From 8c25766800bb2bdc563fea0a89497e88c7961566 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 12 Oct 2004 05:25:51 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'EVOLUTION_2_0_2'. svn path=/tags/EVOLUTION_2_0_2/; revision=27548 --- ChangeLog | 66 +- NEWS | 272 +- README | 126 +- a11y/e-table/.cvsignore | 4 - a11y/e-table/gal-a11y-e-cell-popup.c | 144 - a11y/e-table/gal-a11y-e-cell-popup.h | 64 - a11y/e-table/gal-a11y-e-cell-registry.c | 132 - a11y/e-table/gal-a11y-e-cell-registry.h | 58 - a11y/e-table/gal-a11y-e-cell-text.c | 570 - a11y/e-table/gal-a11y-e-cell-text.h | 48 - a11y/e-table/gal-a11y-e-cell-toggle.c | 162 - a11y/e-table/gal-a11y-e-cell-toggle.h | 47 - a11y/e-table/gal-a11y-e-cell-tree.c | 209 - a11y/e-table/gal-a11y-e-cell-tree.h | 50 - a11y/e-table/gal-a11y-e-cell.c | 555 - a11y/e-table/gal-a11y-e-cell.h | 99 - .../gal-a11y-e-table-click-to-add-factory.c | 88 - .../gal-a11y-e-table-click-to-add-factory.h | 34 - a11y/e-table/gal-a11y-e-table-click-to-add.c | 269 - a11y/e-table/gal-a11y-e-table-click-to-add.h | 35 - a11y/e-table/gal-a11y-e-table-factory.c | 83 - a11y/e-table/gal-a11y-e-table-factory.h | 36 - a11y/e-table/gal-a11y-e-table-item-factory.c | 87 - a11y/e-table/gal-a11y-e-table-item-factory.h | 34 - a11y/e-table/gal-a11y-e-table-item.c | 1433 - a11y/e-table/gal-a11y-e-table-item.h | 44 - a11y/e-table/gal-a11y-e-table.c | 185 - a11y/e-table/gal-a11y-e-table.h | 43 - a11y/e-table/gal-a11y-e-tree-factory.c | 81 - a11y/e-table/gal-a11y-e-tree-factory.h | 34 - a11y/e-table/gal-a11y-e-tree.c | 162 - a11y/e-table/gal-a11y-e-tree.h | 41 - a11y/e-text/.cvsignore | 4 - a11y/e-text/gal-a11y-e-text-factory.c | 87 - a11y/e-text/gal-a11y-e-text-factory.h | 36 - a11y/e-text/gal-a11y-e-text.c | 1121 - a11y/e-text/gal-a11y-e-text.h | 40 - a11y/gal-a11y-factory.h | 94 - a11y/gal-a11y-util.c | 31 - a11y/gal-a11y-util.h | 21 - addressbook/ChangeLog | 133 +- addressbook/gui/component/addressbook-view.c | 133 +- .../apps_evolution_addressbook.schemas.in.in | 12 +- addressbook/gui/contact-editor/e-contact-editor.c | 1 + addressbook/gui/widgets/e-addressbook-view.c | 424 +- addressbook/tools/evolution-addressbook-export.c | 2 +- calendar/ChangeLog | 189 +- calendar/gui/alarm-notify/alarm-queue.c | 75 +- calendar/gui/calendar-component.c | 160 +- calendar/gui/e-week-view.c | 2 +- calendar/gui/gnome-cal.c | 125 +- calendar/gui/itip-utils.c | 3 + calendar/gui/migration.c | 1 + calendar/gui/tasks-component.c | 168 +- camel/ChangeLog | 96 +- camel/camel-filter-driver.c | 2 +- camel/camel-folder-search.c | 1 - camel/camel-movemail.c | 3 +- camel/camel-sasl-digest-md5.c | 1 - camel/camel-sasl-gssapi.c | 1 + camel/camel-service.c | 6 +- camel/camel-tcp-stream-ssl.c | 1 - camel/camel-vee-folder.c | 1 - camel/camel-vee-store.c | 1 - camel/providers/imap/camel-imap-store.c | 171 +- camel/providers/imapp/camel-imapp-store.c | 1 - camel/providers/local/camel-local-folder.c | 2 +- camel/providers/local/camel-maildir-folder.c | 1 - camel/providers/local/camel-mbox-folder.c | 1 - camel/providers/local/camel-mbox-store.c | 1 - camel/providers/local/camel-mh-folder.c | 1 - camel/providers/local/camel-spool-folder.c | 2 +- camel/providers/local/camel-spool-store.c | 1 - camel/providers/nntp/camel-nntp-folder.c | 1 - camel/providers/nntp/camel-nntp-store.c | 131 +- camel/providers/pop3/camel-pop3-store.c | 162 +- camel/providers/smtp/camel-smtp-transport.c | 167 +- camel/providers/smtp/camel-smtp-transport.h | 8 +- camel/tests/data/messages/.cvsignore | 1 - composer/ChangeLog | 38 +- composer/e-msg-composer.c | 178 +- composer/mail-composer-errors.xml | 2 +- composer/mail-composer-errors.xml.h | 2 +- configure.in | 119 +- .../executive-summary/evolution-services.hierarchy | 7 - .../importer/evolution-shell-importer.hierarchy | 7 - e-util/ChangeLog | 224 - e-util/e-bit-array.c | 429 - e-util/e-bit-array.h | 104 - e-util/e-i18n.h | 74 - e-util/e-iconv.c | 614 - e-util/e-iconv.h | 49 - e-util/e-marshal.list | 51 - e-util/e-sorter-array.c | 259 - e-util/e-sorter-array.h | 77 - e-util/e-sorter.c | 153 - e-util/e-sorter.h | 82 - e-util/e-text-event-processor-emacs-like.c | 495 - e-util/e-text-event-processor-emacs-like.h | 70 - e-util/e-text-event-processor-types.h | 132 - e-util/e-text-event-processor.c | 148 - e-util/e-text-event-processor.h | 77 - e-util/e-util.c | 1230 - e-util/e-util.h | 231 - e-util/e-xml-utils.c | 502 - e-util/e-xml-utils.h | 101 - help/C/figures/evo_email_a.png | Bin 87620 -> 99857 bytes help/C/figures/evo_identity_a.png | Bin 46427 -> 29371 bytes help/C/figures/evo_mail_callout_a.png | Bin 90552 -> 90095 bytes help/C/figures/evo_receive_setup_a.png | Bin 60130 -> 38207 bytes help/C/figures/evo_send_setup_a.png | Bin 62908 -> 40068 bytes .../executive-summary/evolution-services.hierarchy | 7 - .../importer/evolution-shell-importer.hierarchy | 7 - mail/ChangeLog | 302 +- mail/em-composer-utils.c | 1 - mail/em-folder-tree-model.c | 2 +- mail/em-folder-tree.c | 185 +- mail/em-folder-view.c | 372 +- mail/em-format-html-display.c | 47 +- mail/em-format-html.c | 4 +- mail/em-format.c | 49 +- mail/em-message-browser.c | 3 - mail/em-popup.c | 800 +- mail/em-subscribe-editor.c | 1 - mail/em-utils.c | 24 +- mail/mail-account-gui.c | 3 +- mail/mail-component.c | 15 +- mail/mail-config.glade | 578 +- mail/mail-errors.xml | 7 - mail/mail-errors.xml.h | 6 - mail/mail-ops.c | 1 - mail/message-list.c | 46 +- po/be.po | 47808 +++++++++++-------- shell/ChangeLog | 28 +- shell/e-shell.c | 2 - shell/main.c | 25 +- widgets/menus/gal-define-views-dialog.c | 379 - widgets/menus/gal-define-views-dialog.h | 78 - widgets/menus/gal-define-views-model.c | 322 - widgets/menus/gal-define-views-model.h | 72 - widgets/menus/gal-define-views.glade | 192 - widgets/menus/gal-view-collection.c | 823 - widgets/menus/gal-view-collection.h | 151 - widgets/menus/gal-view-etable.c | 305 - widgets/menus/gal-view-etable.h | 78 - widgets/menus/gal-view-factory-etable.c | 120 - widgets/menus/gal-view-factory-etable.h | 62 - widgets/menus/gal-view-factory.c | 107 - widgets/menus/gal-view-factory.h | 79 - widgets/menus/gal-view-instance-save-as-dialog.c | 307 - .../menus/gal-view-instance-save-as-dialog.glade | 260 - widgets/menus/gal-view-instance-save-as-dialog.h | 89 - widgets/menus/gal-view-instance.c | 599 - widgets/menus/gal-view-instance.h | 116 - widgets/menus/gal-view-new-dialog.c | 285 - widgets/menus/gal-view-new-dialog.glade | 175 - widgets/menus/gal-view-new-dialog.h | 86 - widgets/menus/gal-view.c | 206 - widgets/menus/gal-view.h | 98 - widgets/misc/ChangeLog | 23 +- widgets/misc/e-canvas-background.c | 496 - widgets/misc/e-canvas-background.h | 71 - widgets/misc/e-canvas-utils.c | 171 - widgets/misc/e-canvas-utils.h | 55 - widgets/misc/e-canvas-vbox.c | 381 - widgets/misc/e-canvas-vbox.h | 93 - widgets/misc/e-canvas.c | 1096 - widgets/misc/e-canvas.h | 157 - widgets/misc/e-colors.c | 103 - widgets/misc/e-colors.h | 44 - widgets/misc/e-cursors.c | 156 - widgets/misc/e-cursors.h | 68 - widgets/misc/e-gui-utils.c | 238 - widgets/misc/e-gui-utils.h | 58 - widgets/misc/e-hsv-utils.c | 178 - widgets/misc/e-hsv-utils.h | 52 - widgets/misc/e-popup-menu.c | 240 - widgets/misc/e-popup-menu.h | 142 - widgets/misc/e-printable.c | 209 - widgets/misc/e-printable.h | 90 - widgets/misc/e-reflow-model.c | 355 - widgets/misc/e-reflow-model.h | 112 - widgets/misc/e-reflow.c | 1507 - widgets/misc/e-reflow.h | 146 - widgets/misc/e-selection-model-array.c | 557 - widgets/misc/e-selection-model-array.h | 96 - widgets/misc/e-selection-model-simple.c | 115 - widgets/misc/e-selection-model-simple.h | 70 - widgets/misc/e-selection-model.c | 689 - widgets/misc/e-selection-model.h | 170 - widgets/misc/e-unicode.c | 2055 - widgets/misc/e-unicode.h | 115 - widgets/misc/gal-categories.glade | 173 - widgets/misc/gal-combo-box.c | 834 - widgets/misc/gal-combo-box.h | 91 - widgets/misc/gal-combo-text.c | 433 - widgets/misc/gal-combo-text.h | 76 - widgets/misc/pixmaps/.cvsignore | 2 - widgets/misc/pixmaps/cursor_cross.xpm | 38 - widgets/misc/pixmaps/cursor_hand_closed.xpm | 38 - widgets/misc/pixmaps/cursor_hand_open.xpm | 38 - widgets/misc/pixmaps/cursor_zoom_in.xpm | 37 - widgets/misc/pixmaps/cursor_zoom_out.xpm | 37 - widgets/misc/test-color.c | 76 - widgets/table/.cvsignore | 13 - widgets/table/add-col.xpm | 22 - widgets/table/arrow-down.xpm | 21 - widgets/table/arrow-up.xpm | 21 - widgets/table/check-empty.xpm | 21 - widgets/table/check-filled.xpm | 21 - widgets/table/clip.png | Bin 192 -> 0 bytes widgets/table/e-cell-checkbox.c | 67 - widgets/table/e-cell-checkbox.h | 50 - widgets/table/e-cell-combo.c | 699 - widgets/table/e-cell-combo.h | 63 - widgets/table/e-cell-date.c | 166 - widgets/table/e-cell-date.h | 49 - widgets/table/e-cell-float.c | 93 - widgets/table/e-cell-float.h | 53 - widgets/table/e-cell-number.c | 85 - widgets/table/e-cell-number.h | 49 - widgets/table/e-cell-pixbuf.c | 417 - widgets/table/e-cell-pixbuf.h | 53 - widgets/table/e-cell-popup.c | 519 - widgets/table/e-cell-popup.h | 101 - widgets/table/e-cell-progress.c | 456 - widgets/table/e-cell-progress.h | 74 - widgets/table/e-cell-size.c | 110 - widgets/table/e-cell-size.h | 49 - widgets/table/e-cell-spin-button.c | 670 - widgets/table/e-cell-spin-button.h | 103 - widgets/table/e-cell-text.c | 2780 -- widgets/table/e-cell-text.h | 123 - widgets/table/e-cell-toggle.c | 489 - widgets/table/e-cell-toggle.h | 62 - widgets/table/e-cell-tree.c | 911 - widgets/table/e-cell-tree.h | 77 - widgets/table/e-cell-vbox.c | 489 - widgets/table/e-cell-vbox.h | 65 - widgets/table/e-cell.c | 499 - widgets/table/e-cell.h | 224 - widgets/table/e-table-click-to-add.c | 573 - widgets/table/e-table-click-to-add.h | 77 - widgets/table/e-table-col-dnd.h | 39 - widgets/table/e-table-col.c | 236 - widgets/table/e-table-col.h | 101 - widgets/table/e-table-column-specification.c | 150 - widgets/table/e-table-column-specification.h | 73 - widgets/table/e-table-column.c | 291 - widgets/table/e-table-config-field.c | 300 - widgets/table/e-table-config-field.h | 69 - widgets/table/e-table-config-no-group.glade | 2112 - widgets/table/e-table-config.c | 1215 - widgets/table/e-table-config.glade | 2181 - widgets/table/e-table-config.h | 115 - widgets/table/e-table-defines.h | 45 - widgets/table/e-table-example-1.c | 308 - widgets/table/e-table-example-2.c | 349 - widgets/table/e-table-extras.c | 292 - widgets/table/e-table-extras.h | 82 - widgets/table/e-table-field-chooser-dialog.c | 224 - widgets/table/e-table-field-chooser-dialog.h | 79 - widgets/table/e-table-field-chooser-item.c | 711 - widgets/table/e-table-field-chooser-item.h | 75 - widgets/table/e-table-field-chooser.c | 302 - widgets/table/e-table-field-chooser.glade | 123 - widgets/table/e-table-field-chooser.h | 79 - widgets/table/e-table-group-container.c | 1512 - widgets/table/e-table-group-container.h | 98 - widgets/table/e-table-group-leaf.c | 686 - widgets/table/e-table-group-leaf.h | 90 - widgets/table/e-table-group.c | 712 - widgets/table/e-table-group.h | 178 - widgets/table/e-table-header-item.c | 1896 - widgets/table/e-table-header-item.h | 118 - widgets/table/e-table-header-utils.c | 480 - widgets/table/e-table-header-utils.h | 55 - widgets/table/e-table-header.c | 952 - widgets/table/e-table-header.h | 120 - widgets/table/e-table-item.c | 3734 -- widgets/table/e-table-item.h | 231 - widgets/table/e-table-memory-callbacks.c | 208 - widgets/table/e-table-memory-callbacks.h | 91 - widgets/table/e-table-memory-store.c | 583 - widgets/table/e-table-memory-store.h | 138 - widgets/table/e-table-memory.c | 277 - widgets/table/e-table-memory.h | 76 - widgets/table/e-table-model.c | 616 - widgets/table/e-table-model.h | 173 - widgets/table/e-table-one.c | 241 - widgets/table/e-table-one.h | 57 - widgets/table/e-table-scrolled.c | 229 - widgets/table/e-table-scrolled.h | 76 - widgets/table/e-table-search.c | 223 - widgets/table/e-table-search.h | 71 - widgets/table/e-table-selection-model.c | 347 - widgets/table/e-table-selection-model.h | 76 - widgets/table/e-table-simple.c | 289 - widgets/table/e-table-simple.h | 122 - widgets/table/e-table-size-test.c | 307 - widgets/table/e-table-sort-info.c | 481 - widgets/table/e-table-sort-info.h | 107 - widgets/table/e-table-sorted-variable.c | 230 - widgets/table/e-table-sorted-variable.h | 65 - widgets/table/e-table-sorted.c | 310 - widgets/table/e-table-sorted.h | 65 - widgets/table/e-table-sorter.c | 462 - widgets/table/e-table-sorter.h | 74 - widgets/table/e-table-sorting-utils.c | 349 - widgets/table/e-table-sorting-utils.h | 83 - widgets/table/e-table-specification.c | 432 - widgets/table/e-table-specification.h | 89 - widgets/table/e-table-state.c | 299 - widgets/table/e-table-state.h | 74 - widgets/table/e-table-subset-variable.c | 250 - widgets/table/e-table-subset-variable.h | 82 - widgets/table/e-table-subset.c | 482 - widgets/table/e-table-subset.h | 89 - widgets/table/e-table-tooltip.h | 44 - widgets/table/e-table-tree.h | 48 - widgets/table/e-table-utils.c | 191 - widgets/table/e-table-utils.h | 49 - widgets/table/e-table-without.c | 392 - widgets/table/e-table-without.h | 91 - widgets/table/e-table.c | 3338 -- widgets/table/e-table.dia | Bin 4514 -> 0 bytes widgets/table/e-table.h | 358 - widgets/table/e-tree-memory-callbacks.c | 275 - widgets/table/e-tree-memory-callbacks.h | 119 - widgets/table/e-tree-memory.c | 717 - widgets/table/e-tree-memory.h | 101 - widgets/table/e-tree-model.c | 1098 - widgets/table/e-tree-model.h | 227 - widgets/table/e-tree-scrolled.c | 228 - widgets/table/e-tree-scrolled.h | 75 - widgets/table/e-tree-selection-model.c | 816 - widgets/table/e-tree-selection-model.h | 79 - widgets/table/e-tree-simple.c | 208 - widgets/table/e-tree-simple.h | 85 - widgets/table/e-tree-sorted-variable.c | 477 - widgets/table/e-tree-sorted-variable.h | 85 - widgets/table/e-tree-sorted.c | 1390 - widgets/table/e-tree-sorted.h | 86 - widgets/table/e-tree-table-adapter.c | 1174 - widgets/table/e-tree-table-adapter.h | 95 - widgets/table/e-tree.c | 3327 -- widgets/table/e-tree.h | 312 - widgets/table/image1.png | Bin 1858 -> 0 bytes widgets/table/image2.png | Bin 1987 -> 0 bytes widgets/table/image3.png | Bin 2051 -> 0 bytes widgets/table/remove-col.xpm | 22 - widgets/table/sample.table | 45 - widgets/table/spec.xml | 21 - widgets/table/table-test.c | 62 - widgets/table/table-test.h | 27 - widgets/table/test-check.c | 221 - widgets/table/test-cols.c | 265 - widgets/table/test-table.c | 478 - widgets/table/tree-expanded.xpm | 23 - widgets/table/tree-unexpanded.xpm | 23 - widgets/text/.cvsignore | 11 - widgets/text/e-completion-callbacks.c | 98 - widgets/text/e-completion-callbacks.h | 68 - widgets/text/e-completion-match.c | 184 - widgets/text/e-completion-match.h | 67 - widgets/text/e-completion-view.c | 859 - widgets/text/e-completion-view.h | 98 - widgets/text/e-completion.c | 343 - widgets/text/e-completion.h | 91 - widgets/text/e-entry-test.c | 83 - widgets/text/e-entry.c | 1392 - widgets/text/e-entry.h | 87 - widgets/text/e-table-text-model.c | 234 - widgets/text/e-table-text-model.h | 64 - widgets/text/e-text-model-repos.c | 87 - widgets/text/e-text-model-repos.h | 69 - widgets/text/e-text-model-test.c | 91 - widgets/text/e-text-model-uri.c | 344 - widgets/text/e-text-model-uri.h | 56 - widgets/text/e-text-model.c | 600 - widgets/text/e-text-model.h | 113 - widgets/text/e-text-test.c | 168 - widgets/text/e-text.c | 3871 -- widgets/text/e-text.h | 244 - 384 files changed, 31249 insertions(+), 115464 deletions(-) delete mode 100644 a11y/e-table/.cvsignore delete mode 100644 a11y/e-table/gal-a11y-e-cell-popup.c delete mode 100644 a11y/e-table/gal-a11y-e-cell-popup.h delete mode 100644 a11y/e-table/gal-a11y-e-cell-registry.c delete mode 100644 a11y/e-table/gal-a11y-e-cell-registry.h delete mode 100644 a11y/e-table/gal-a11y-e-cell-text.c delete mode 100644 a11y/e-table/gal-a11y-e-cell-text.h delete mode 100644 a11y/e-table/gal-a11y-e-cell-toggle.c delete mode 100644 a11y/e-table/gal-a11y-e-cell-toggle.h delete mode 100644 a11y/e-table/gal-a11y-e-cell-tree.c delete mode 100644 a11y/e-table/gal-a11y-e-cell-tree.h delete mode 100644 a11y/e-table/gal-a11y-e-cell.c delete mode 100644 a11y/e-table/gal-a11y-e-cell.h delete mode 100644 a11y/e-table/gal-a11y-e-table-click-to-add-factory.c delete mode 100644 a11y/e-table/gal-a11y-e-table-click-to-add-factory.h delete mode 100644 a11y/e-table/gal-a11y-e-table-click-to-add.c delete mode 100644 a11y/e-table/gal-a11y-e-table-click-to-add.h delete mode 100644 a11y/e-table/gal-a11y-e-table-factory.c delete mode 100644 a11y/e-table/gal-a11y-e-table-factory.h delete mode 100644 a11y/e-table/gal-a11y-e-table-item-factory.c delete mode 100644 a11y/e-table/gal-a11y-e-table-item-factory.h delete mode 100644 a11y/e-table/gal-a11y-e-table-item.c delete mode 100644 a11y/e-table/gal-a11y-e-table-item.h delete mode 100644 a11y/e-table/gal-a11y-e-table.c delete mode 100644 a11y/e-table/gal-a11y-e-table.h delete mode 100644 a11y/e-table/gal-a11y-e-tree-factory.c delete mode 100644 a11y/e-table/gal-a11y-e-tree-factory.h delete mode 100644 a11y/e-table/gal-a11y-e-tree.c delete mode 100644 a11y/e-table/gal-a11y-e-tree.h delete mode 100644 a11y/e-text/.cvsignore delete mode 100644 a11y/e-text/gal-a11y-e-text-factory.c delete mode 100644 a11y/e-text/gal-a11y-e-text-factory.h delete mode 100644 a11y/e-text/gal-a11y-e-text.c delete mode 100644 a11y/e-text/gal-a11y-e-text.h delete mode 100644 a11y/gal-a11y-factory.h delete mode 100644 a11y/gal-a11y-util.c delete mode 100644 a11y/gal-a11y-util.h delete mode 100644 camel/tests/data/messages/.cvsignore delete mode 100644 doc/devel/executive-summary/evolution-services.hierarchy delete mode 100644 doc/devel/importer/evolution-shell-importer.hierarchy delete mode 100644 e-util/e-bit-array.c delete mode 100644 e-util/e-bit-array.h delete mode 100644 e-util/e-i18n.h delete mode 100644 e-util/e-iconv.c delete mode 100644 e-util/e-iconv.h delete mode 100644 e-util/e-marshal.list delete mode 100644 e-util/e-sorter-array.c delete mode 100644 e-util/e-sorter-array.h delete mode 100644 e-util/e-sorter.c delete mode 100644 e-util/e-sorter.h delete mode 100644 e-util/e-text-event-processor-emacs-like.c delete mode 100644 e-util/e-text-event-processor-emacs-like.h delete mode 100644 e-util/e-text-event-processor-types.h delete mode 100644 e-util/e-text-event-processor.c delete mode 100644 e-util/e-text-event-processor.h delete mode 100644 e-util/e-util.c delete mode 100644 e-util/e-util.h delete mode 100644 e-util/e-xml-utils.c delete mode 100644 e-util/e-xml-utils.h delete mode 100644 help/devel/executive-summary/evolution-services.hierarchy delete mode 100644 help/devel/importer/evolution-shell-importer.hierarchy delete mode 100644 widgets/menus/gal-define-views-dialog.c delete mode 100644 widgets/menus/gal-define-views-dialog.h delete mode 100644 widgets/menus/gal-define-views-model.c delete mode 100644 widgets/menus/gal-define-views-model.h delete mode 100644 widgets/menus/gal-define-views.glade delete mode 100644 widgets/menus/gal-view-collection.c delete mode 100644 widgets/menus/gal-view-collection.h delete mode 100644 widgets/menus/gal-view-etable.c delete mode 100644 widgets/menus/gal-view-etable.h delete mode 100644 widgets/menus/gal-view-factory-etable.c delete mode 100644 widgets/menus/gal-view-factory-etable.h delete mode 100644 widgets/menus/gal-view-factory.c delete mode 100644 widgets/menus/gal-view-factory.h delete mode 100644 widgets/menus/gal-view-instance-save-as-dialog.c delete mode 100644 widgets/menus/gal-view-instance-save-as-dialog.glade delete mode 100644 widgets/menus/gal-view-instance-save-as-dialog.h delete mode 100644 widgets/menus/gal-view-instance.c delete mode 100644 widgets/menus/gal-view-instance.h delete mode 100644 widgets/menus/gal-view-new-dialog.c delete mode 100644 widgets/menus/gal-view-new-dialog.glade delete mode 100644 widgets/menus/gal-view-new-dialog.h delete mode 100644 widgets/menus/gal-view.c delete mode 100644 widgets/menus/gal-view.h delete mode 100644 widgets/misc/e-canvas-background.c delete mode 100644 widgets/misc/e-canvas-background.h delete mode 100644 widgets/misc/e-canvas-utils.c delete mode 100644 widgets/misc/e-canvas-utils.h delete mode 100644 widgets/misc/e-canvas-vbox.c delete mode 100644 widgets/misc/e-canvas-vbox.h delete mode 100644 widgets/misc/e-canvas.c delete mode 100644 widgets/misc/e-canvas.h delete mode 100644 widgets/misc/e-colors.c delete mode 100644 widgets/misc/e-colors.h delete mode 100644 widgets/misc/e-cursors.c delete mode 100644 widgets/misc/e-cursors.h delete mode 100644 widgets/misc/e-gui-utils.c delete mode 100644 widgets/misc/e-gui-utils.h delete mode 100644 widgets/misc/e-hsv-utils.c delete mode 100644 widgets/misc/e-hsv-utils.h delete mode 100644 widgets/misc/e-popup-menu.c delete mode 100644 widgets/misc/e-popup-menu.h delete mode 100644 widgets/misc/e-printable.c delete mode 100644 widgets/misc/e-printable.h delete mode 100644 widgets/misc/e-reflow-model.c delete mode 100644 widgets/misc/e-reflow-model.h delete mode 100644 widgets/misc/e-reflow.c delete mode 100644 widgets/misc/e-reflow.h delete mode 100644 widgets/misc/e-selection-model-array.c delete mode 100644 widgets/misc/e-selection-model-array.h delete mode 100644 widgets/misc/e-selection-model-simple.c delete mode 100644 widgets/misc/e-selection-model-simple.h delete mode 100644 widgets/misc/e-selection-model.c delete mode 100644 widgets/misc/e-selection-model.h delete mode 100644 widgets/misc/e-unicode.c delete mode 100644 widgets/misc/e-unicode.h delete mode 100644 widgets/misc/gal-categories.glade delete mode 100644 widgets/misc/gal-combo-box.c delete mode 100644 widgets/misc/gal-combo-box.h delete mode 100644 widgets/misc/gal-combo-text.c delete mode 100644 widgets/misc/gal-combo-text.h delete mode 100644 widgets/misc/pixmaps/.cvsignore delete mode 100644 widgets/misc/pixmaps/cursor_cross.xpm delete mode 100644 widgets/misc/pixmaps/cursor_hand_closed.xpm delete mode 100644 widgets/misc/pixmaps/cursor_hand_open.xpm delete mode 100644 widgets/misc/pixmaps/cursor_zoom_in.xpm delete mode 100644 widgets/misc/pixmaps/cursor_zoom_out.xpm delete mode 100644 widgets/misc/test-color.c delete mode 100644 widgets/table/.cvsignore delete mode 100644 widgets/table/add-col.xpm delete mode 100644 widgets/table/arrow-down.xpm delete mode 100644 widgets/table/arrow-up.xpm delete mode 100644 widgets/table/check-empty.xpm delete mode 100644 widgets/table/check-filled.xpm delete mode 100644 widgets/table/clip.png delete mode 100644 widgets/table/e-cell-checkbox.c delete mode 100644 widgets/table/e-cell-checkbox.h delete mode 100644 widgets/table/e-cell-combo.c delete mode 100644 widgets/table/e-cell-combo.h delete mode 100644 widgets/table/e-cell-date.c delete mode 100644 widgets/table/e-cell-date.h delete mode 100644 widgets/table/e-cell-float.c delete mode 100644 widgets/table/e-cell-float.h delete mode 100644 widgets/table/e-cell-number.c delete mode 100644 widgets/table/e-cell-number.h delete mode 100644 widgets/table/e-cell-pixbuf.c delete mode 100644 widgets/table/e-cell-pixbuf.h delete mode 100644 widgets/table/e-cell-popup.c delete mode 100644 widgets/table/e-cell-popup.h delete mode 100644 widgets/table/e-cell-progress.c delete mode 100644 widgets/table/e-cell-progress.h delete mode 100644 widgets/table/e-cell-size.c delete mode 100644 widgets/table/e-cell-size.h delete mode 100644 widgets/table/e-cell-spin-button.c delete mode 100644 widgets/table/e-cell-spin-button.h delete mode 100644 widgets/table/e-cell-text.c delete mode 100644 widgets/table/e-cell-text.h delete mode 100644 widgets/table/e-cell-toggle.c delete mode 100644 widgets/table/e-cell-toggle.h delete mode 100644 widgets/table/e-cell-tree.c delete mode 100644 widgets/table/e-cell-tree.h delete mode 100644 widgets/table/e-cell-vbox.c delete mode 100644 widgets/table/e-cell-vbox.h delete mode 100644 widgets/table/e-cell.c delete mode 100644 widgets/table/e-cell.h delete mode 100644 widgets/table/e-table-click-to-add.c delete mode 100644 widgets/table/e-table-click-to-add.h delete mode 100644 widgets/table/e-table-col-dnd.h delete mode 100644 widgets/table/e-table-col.c delete mode 100644 widgets/table/e-table-col.h delete mode 100644 widgets/table/e-table-column-specification.c delete mode 100644 widgets/table/e-table-column-specification.h delete mode 100644 widgets/table/e-table-column.c delete mode 100644 widgets/table/e-table-config-field.c delete mode 100644 widgets/table/e-table-config-field.h delete mode 100644 widgets/table/e-table-config-no-group.glade delete mode 100644 widgets/table/e-table-config.c delete mode 100644 widgets/table/e-table-config.glade delete mode 100644 widgets/table/e-table-config.h delete mode 100644 widgets/table/e-table-defines.h delete mode 100644 widgets/table/e-table-example-1.c delete mode 100644 widgets/table/e-table-example-2.c delete mode 100644 widgets/table/e-table-extras.c delete mode 100644 widgets/table/e-table-extras.h delete mode 100644 widgets/table/e-table-field-chooser-dialog.c delete mode 100644 widgets/table/e-table-field-chooser-dialog.h delete mode 100644 widgets/table/e-table-field-chooser-item.c delete mode 100644 widgets/table/e-table-field-chooser-item.h delete mode 100644 widgets/table/e-table-field-chooser.c delete mode 100644 widgets/table/e-table-field-chooser.glade delete mode 100644 widgets/table/e-table-field-chooser.h delete mode 100644 widgets/table/e-table-group-container.c delete mode 100644 widgets/table/e-table-group-container.h delete mode 100644 widgets/table/e-table-group-leaf.c delete mode 100644 widgets/table/e-table-group-leaf.h delete mode 100644 widgets/table/e-table-group.c delete mode 100644 widgets/table/e-table-group.h delete mode 100644 widgets/table/e-table-header-item.c delete mode 100644 widgets/table/e-table-header-item.h delete mode 100644 widgets/table/e-table-header-utils.c delete mode 100644 widgets/table/e-table-header-utils.h delete mode 100644 widgets/table/e-table-header.c delete mode 100644 widgets/table/e-table-header.h delete mode 100644 widgets/table/e-table-item.c delete mode 100644 widgets/table/e-table-item.h delete mode 100644 widgets/table/e-table-memory-callbacks.c delete mode 100644 widgets/table/e-table-memory-callbacks.h delete mode 100644 widgets/table/e-table-memory-store.c delete mode 100644 widgets/table/e-table-memory-store.h delete mode 100644 widgets/table/e-table-memory.c delete mode 100644 widgets/table/e-table-memory.h delete mode 100644 widgets/table/e-table-model.c delete mode 100644 widgets/table/e-table-model.h delete mode 100644 widgets/table/e-table-one.c delete mode 100644 widgets/table/e-table-one.h delete mode 100644 widgets/table/e-table-scrolled.c delete mode 100644 widgets/table/e-table-scrolled.h delete mode 100644 widgets/table/e-table-search.c delete mode 100644 widgets/table/e-table-search.h delete mode 100644 widgets/table/e-table-selection-model.c delete mode 100644 widgets/table/e-table-selection-model.h delete mode 100644 widgets/table/e-table-simple.c delete mode 100644 widgets/table/e-table-simple.h delete mode 100644 widgets/table/e-table-size-test.c delete mode 100644 widgets/table/e-table-sort-info.c delete mode 100644 widgets/table/e-table-sort-info.h delete mode 100644 widgets/table/e-table-sorted-variable.c delete mode 100644 widgets/table/e-table-sorted-variable.h delete mode 100644 widgets/table/e-table-sorted.c delete mode 100644 widgets/table/e-table-sorted.h delete mode 100644 widgets/table/e-table-sorter.c delete mode 100644 widgets/table/e-table-sorter.h delete mode 100644 widgets/table/e-table-sorting-utils.c delete mode 100644 widgets/table/e-table-sorting-utils.h delete mode 100644 widgets/table/e-table-specification.c delete mode 100644 widgets/table/e-table-specification.h delete mode 100644 widgets/table/e-table-state.c delete mode 100644 widgets/table/e-table-state.h delete mode 100644 widgets/table/e-table-subset-variable.c delete mode 100644 widgets/table/e-table-subset-variable.h delete mode 100644 widgets/table/e-table-subset.c delete mode 100644 widgets/table/e-table-subset.h delete mode 100644 widgets/table/e-table-tooltip.h delete mode 100644 widgets/table/e-table-tree.h delete mode 100644 widgets/table/e-table-utils.c delete mode 100644 widgets/table/e-table-utils.h delete mode 100644 widgets/table/e-table-without.c delete mode 100644 widgets/table/e-table-without.h delete mode 100644 widgets/table/e-table.c delete mode 100644 widgets/table/e-table.dia delete mode 100644 widgets/table/e-table.h delete mode 100644 widgets/table/e-tree-memory-callbacks.c delete mode 100644 widgets/table/e-tree-memory-callbacks.h delete mode 100644 widgets/table/e-tree-memory.c delete mode 100644 widgets/table/e-tree-memory.h delete mode 100644 widgets/table/e-tree-model.c delete mode 100644 widgets/table/e-tree-model.h delete mode 100644 widgets/table/e-tree-scrolled.c delete mode 100644 widgets/table/e-tree-scrolled.h delete mode 100644 widgets/table/e-tree-selection-model.c delete mode 100644 widgets/table/e-tree-selection-model.h delete mode 100644 widgets/table/e-tree-simple.c delete mode 100644 widgets/table/e-tree-simple.h delete mode 100644 widgets/table/e-tree-sorted-variable.c delete mode 100644 widgets/table/e-tree-sorted-variable.h delete mode 100644 widgets/table/e-tree-sorted.c delete mode 100644 widgets/table/e-tree-sorted.h delete mode 100644 widgets/table/e-tree-table-adapter.c delete mode 100644 widgets/table/e-tree-table-adapter.h delete mode 100644 widgets/table/e-tree.c delete mode 100644 widgets/table/e-tree.h delete mode 100644 widgets/table/image1.png delete mode 100644 widgets/table/image2.png delete mode 100644 widgets/table/image3.png delete mode 100644 widgets/table/remove-col.xpm delete mode 100644 widgets/table/sample.table delete mode 100644 widgets/table/spec.xml delete mode 100644 widgets/table/table-test.c delete mode 100644 widgets/table/table-test.h delete mode 100644 widgets/table/test-check.c delete mode 100644 widgets/table/test-cols.c delete mode 100644 widgets/table/test-table.c delete mode 100644 widgets/table/tree-expanded.xpm delete mode 100644 widgets/table/tree-unexpanded.xpm delete mode 100644 widgets/text/.cvsignore delete mode 100644 widgets/text/e-completion-callbacks.c delete mode 100644 widgets/text/e-completion-callbacks.h delete mode 100644 widgets/text/e-completion-match.c delete mode 100644 widgets/text/e-completion-match.h delete mode 100644 widgets/text/e-completion-view.c delete mode 100644 widgets/text/e-completion-view.h delete mode 100644 widgets/text/e-completion.c delete mode 100644 widgets/text/e-completion.h delete mode 100644 widgets/text/e-entry-test.c delete mode 100644 widgets/text/e-entry.c delete mode 100644 widgets/text/e-entry.h delete mode 100644 widgets/text/e-table-text-model.c delete mode 100644 widgets/text/e-table-text-model.h delete mode 100644 widgets/text/e-text-model-repos.c delete mode 100644 widgets/text/e-text-model-repos.h delete mode 100644 widgets/text/e-text-model-test.c delete mode 100644 widgets/text/e-text-model-uri.c delete mode 100644 widgets/text/e-text-model-uri.h delete mode 100644 widgets/text/e-text-model.c delete mode 100644 widgets/text/e-text-model.h delete mode 100644 widgets/text/e-text-test.c delete mode 100644 widgets/text/e-text.c delete mode 100644 widgets/text/e-text.h diff --git a/ChangeLog b/ChangeLog index 6a8803bd03..7c8427f6fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,14 @@ -2004-10-01 Jeffrey Stedfast +2004-10-11 JP Rosevear - * configure.in (localedir): Enable imap4 plugin by default. We - need to get people building this and testing it. + * NEWS: update -2004-10-01 JP Rosevear + * configure.in: bump version - * configure.in: set the GETTEXT_PACKAGE to evolution-2.2 - -2004-10-01 JP Rosevear +2004-09-24 JP Rosevear - * configure.in: set a GTKHTML_API_VERSION variable + * NEWS: update + + * configure.in: bump version, requirements 2004-09-13 Not Zed @@ -17,23 +16,41 @@ setting from getaddrinfo call check, and default to on if the interfaces are available. -2004-09-17 William Jon McCann +2004-09-14 Danilo Šegan + + * configure.in: Added "bs" to ALL_LINGUAS. - * configure.in: Fix typos in gal dependency. +2004-09-13 JP Rosevear -2004-09-16 JP Rosevear + * configure.in: bump version, requires - * configure.in: use AC_DEFINE properly +2004-09-13 JP Rosevear -2004-09-16 JP Rosevear + Fixes #63369 + + * README: Update + +2004-09-12 Abel Cheung + + * configure.in: Added "hi" "mk" "ml" "ta" to ALL_LINGUAS. + +2004-09-10 Mohammad DAMT - * configure.in: bump EDS and gal requirements + * configure.in: Added Indonesian "id" to ALL_LINGUAS + * po/id.po: Added Indonesian translation -2004-09-16 JP Rosevear +2004-09-09 Runa Bhattacharjee + * configure.in: Added Bengali "bn" to ALL_LINGUAS. - * configure.in: bump version to 2.1.0 and set base version to 2.2; - define DEVELOPMENT here so we don't have to alter code to change - in future +2004-09-04 Telsa Gwynne + + * configure.in: Added "cy" (Welsh) to ALL_LINGUAS. + +2004-08-30 JP Rosevear + + * configure.in: hard code BASE_VERSION to 2.0; reset + UPGRADE_VERSION to 0 because BASE_VERSION changed; base + GETTEXT_PACKAGE on BASE_VERSION 2004-09-13 Tomasz Kłoczko @@ -134,19 +151,6 @@ * configure.in: bump version, requirements -2004-08-24 JP Rosevear - - * configure.in (plugindir): set a plugin dir so we can easily - install to the same place everywhere - -2004-08-24 JP Rosevear - - * configure.in: Check for mono support properly - -2004-07-05 Not Zed - - * configure.in: add some mono checks. - 2004-06-24 Pablo Saratxaga * configure.in: Added Walloon (wa) to ALL_LINGUAS. diff --git a/NEWS b/NEWS index e2a3d81a35..13752d3523 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,260 @@ +Evolution 2.0.2, 2004-10-11 +---------------------------- + +Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi): + + * Addressbook + + #66520 - Crash deleting addressbooks (Michael) + #66369 - VCard import requires blank lines between contacts (Hans) + #65537 - Updating Contacts Causes Crash (Hans) + + * Calendar + + #65932 - Crash when accessing the details of an appointment notification (Rodrigo) + #64683 - meeting invite expands to larger than workspace (Rodrigo and JP) + #66736 - crash clicking Search Clear button twice (Michael) + #61766 - select personal calendar/tasks by default when migrating (JP) + #65599 - 'Evolution 1.5' crash in 'Free/Busy' editor (Rodrigo) + #62053 - select GroupWise calendar by default (Siva) + #66164 - popup date edit drop down in correct place (JP) + #45951 - Scroll properly in task description (Rodrigo) + + * Mail + + #67170 - Unable to subscribe to the alt hierarchy (Michael) + #67028 - 2.0.1 compilation fails on camel-service.c: In function `camel_getaddrinfo' (Jeff) + #67257 - evolution busy waits looking up hostname if network down (Michael) + #66509 - Evolution Crashes when deleteing a news group (Michael) + #65828 - Fix typo in error message (Jeff) + #63881 - "Cannot copy or move messages into a Virtual Folder" when + dragging from UNMATCHED vfolder into real folder (Ed Catmur) + #63521 - stale / bogus pop cache file (Michael) + #66991 - crash creating folders (Michael) + #66706 - Evolution Crashes while refreshing Folder Subscriptions (Michael) + #67408 - Seg Fault on exit (Michael) + #67211 - Evolution crashes when getting summary from folder (Michael) + #66703 - S/MIME signing fails randomly (Jeff) + + * Shell + + #61285 - use better query for config pages (Michael) + #66216 - don't show translator-credits directly in about box (Malcolm Treddinnick) + +Other bugs + + * Address Book + + - Crash when exiting (Hans) + + * Mail + + - Provide error dialogs if host/name lookups fail (Jeff) + - Improve NNTP locking (Michael) + - Work with complete MBox hierarchy (Michael) + - Forward as inline sends attachments (Michael) + - Fix possible migration bug from 1.2 (Dave Malcolm) + + * Other + + - Updated documentation (Rodney and Novell Doc Team) + - Don't dereference NULL nickname or emailAddr on certificate (Michael) + +Updated translations: + + - el (ta panta rei, Nikos Charonitakis) + - ja (Takeshi AIHANA) + - hu (Laszlo Dvornik) + - pt (Duarte Loreto) + - sq (Laurent Dhima) + - es (Francisco Javier F. Serrador) + - nl (Vincent van Adrighem, Michel Klijmij) + - en_CA (Adam Weinberger) + - zh_CN (Funda Wang) + - cs (Miloslav Trmac) + - pl (GNOME PL Team) + - pt_BR (Raphael Higino) + - sr (Danilo Segan) + - sr@Latn (Danilo Segan) + - en_GB (David Lodge) + - ca (Xavier Conde Rueda) + - ko (Changwoo Ryu) + - ro (Mugurel Tudor) + - fr (Christophe Merlet) + - nb (Kjartan Maraas) + - no (Kjartan Maraas) + - da (Martin Willemoes Hansen) + - ru (Leonid Kanter) + - fa (Meelad Zakaria) + +Evolution 2.0.1, 2004-09-24 +---------------------------- + +Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi): + + * Addressbook + + #61070 - Fix improper grammar (hannah rebekah & fazlu huq) + #59725 - Conduit syncing to wrong desktop record (JP) + #63191 - Fix contact list editor title (JP) + #64080 - addressbook gui component needs to be linked with libcamel (Michael) + #64024 - Lower pane doesn't go away when you uncheck "Preview Pane" in Contacts (Siva) + #64011 - Remove C99-ism (Vicent Noel) + #62856 - in --offline mode, still get prompted for gw addressbook password, work around (Michael) + + * Calendar + + #66344 - Evolution crashes added start time column to tasks (JP) + #63513 - G/W appointment acceptance fails ('invalid object') (Chen) + #60904 - Show all appointments when work week longer than 5 days (JP) + #66158 - Completion status is not displayed immediately (JP) + #59194 - Crash editing location field in event list (JP) + #65682 - get error deleting appointments (Chen) + #55172 - sync montly recurrences properly (JP) + #62374 - alarms no function if run over night (Rodrigo) + #62728 - week day heading in month view does not update after changing week start day in settings (JP) + #62392 - Crash on close alarm notification (Rodrigo) + + * Mail + + #65329 - translate standar folder names (Michael) + #65058 - Specific mails don't display picture but picture data (Michael) + #64972 - signature auto-selection in composer with Maildir account is broken (Michael) + #65448 - Opening a mail does not mark it read (Jeff) + #64974 - Allow selecting of file or folder for maildir and mh accounts (Jeff) + #65703 - Display reply to all icon (JP) + #59717 - crash checking supported authentication types (Michael) + #47821 - try all host names available when connecting (Michael) + #66199 - Image loading fails with authenticated proxy (Michael) + #64023 - Forget NNTP password if it was wrong (Michael) + #64092 - Ambiguity in nomenclature of GW Tasks in Evolution (Siva) + + * Shell + + #61285 - use better query for config pages (Michael) + #66216 - don't show translator-credits directly in about box (Malcolm Treddinnick) + +Other bugs + + * Addressbook + + - point to correct documentation file (Rodney) + - check for LABEL supported (Siva) + + * Calendar + + - Don't allow deletion of system calendar or tasks (JP) + - Don't allow a task to be changed to an assigned task if the backend doesn't support it (Chen) + + * Mail + + - Fix typo setting the root node in folder tree (Dave Malcolm) + - Handle 0 length token read for summary (Michael) + - Make SSL connections async and cancellable (Michael) + +Updated translations: + - fr (Christophe Merlet, Craig Jeffares) + - pl (Artur Flinta) + - sq (Laurent Dhima) + - cs (Miloslav Trmac) + - es (Francisco Javier F. Serrador) + - nl (Vincent van Adrighem) + - zh_CN (Funda Wang) + - en_CA (Adam Weinberger) + - it (Craig Jeffares) + - zh_TW (Craig Jeffares) + - en_GB (Gareth Owen) + - fa (Roozbeh Pournader) + - el (Nikos Charonitakis) + - ja (Takeshi AIHANA) + - pt_BR (Raphael Higino) + - da (Martin Willemoes Hansen) + - ko (Changwoo Ryu) + - nn (Åsmund Skjæveland) + - sr (Danilo Segan) + - hu (Laszlo Dvornik) + - bs Danilo Segan + - id (Mohammad DAMT) + - nb (Sigurd Gartmann) + - no (Sigurd Gartmann) + - ar (Arafat Medini)) + +Evolution 2.0.0, 2004-09-13 +---------------------------- + +Bugzilla bugs fixed (see http://bugzilla.ximian.com/show_bug.cgi): + + * Addressbook + + #59582 - Contact incompletely updated to LDAP store, address information lost/not editable (Siva) + #64084 - addressbook gui component needs to be linked with libcamel (Michael) + + * Calendar + + #65454 - Evolution crashes while opening newly received e-mail (JP) + #62392 - Crash on close alarm notification (Rodrigo) + #64800 - broken timezone selector (Rodney) + + * Mail + + #60515 - signature setting is not preserved changing "Autogenerated" to "None" (Michael) + #63377 - Crash when replying to a (specific) message (Jeff) + #62665 - Wrong Folder is deleted (Jeff) + #64377 - crash creating new folder (Michael) + #63456 - crash replying to E-mail (Michael) + +Other bugs + + * Addressbook + + - Confirmation dialog was showing up on contact-editor close, + even if there were no changes (Hans Petter) + + * Calendar + + - 64 bit build fix (Rodrigo) + + * Misc + + - new documentation (Rodney) + +Updated translations: + + - ar (Arafat Medini) + - bn (Runa Bhattacharjee) + - cs (Miloslav Trmac) + - cy (Dafydd Harries, Telsa Gwynne) + - da (Martin Willemoes Hansen) + - de (Hendrik Richter) + - el (Nikos Charonitakis) + - en_CA (Adam Weinberger) + - en_GB (David Lodge) + - es (Francisco Javier F. Serrador) + - et (Priit Laes) + - fi (Ilkka Tuohela) + - hi (Rajesh Ranjan) + - hu (Laszlo Dvornik) + - id (Mohammad DAMT) + - ja (Takeshi AIHANA) + - ko (Changwoo Ryu) + - ms (Hasbullah Bin Pit) + - nb (Sigurd Gartmann) + - nl (Vincent van Adrighem) + - nn (Åsmund Skjæveland) + - no (Kjartan Maraas) + - pl (Artur Flinta) + - pt (Duarte Loreto) + - pt_BR (Raphael Higino) + - ro (Mugurel Tudor) + - ru (Leonid Kanter) + - sq (Laurent Dhima) + - sr (Danilo Segan) + - sv (Christian Rose) + - tr (Baris Cicek) + - uk (Maxim Dziumanenko) + - zh_CN (Funda Wang) + - zh_TW (Abel Cheung) + Evolution 1.5.94, 2004-08-27 ---------------------------- @@ -810,21 +1067,6 @@ Other bugs: (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 diff --git a/README b/README index 56b4e1820f..4ec10e3c1b 100644 --- a/README +++ b/README @@ -1,14 +1,14 @@ Evolution is the integrated mail, calendar and address book suite from -Ximian, Inc. +the Evolution Team. -See http://www.ximian.com/products/evolution for more information. +See http://www.gnome.org/projects/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 + http://lists.ximian.com to subscribe or view archives of the Ximian mailing lists. @@ -20,8 +20,8 @@ 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 +the menu after running the application), at the Novell knowledge base +(http://support.novell.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). @@ -31,15 +31,12 @@ 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. +In order to build Evolution you need to have the full set of GNOME 2.2 +(or greater) 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 +GNOME 2.2 or greater 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. Please make sure you have the most recent versions of the libraries installed, since bugs in the libraries can cause bugs in Evolution. @@ -47,16 +44,6 @@ 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 @@ -65,28 +52,33 @@ dependencies should be compiled in the order they are listed here): 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. + * [If compiling against GNOME 2.2] libbonobo and libbonoboui 2.4 - * gtkhtml 3.0.1 or later + * gnome-icon-theme 1.2.0 or later - ftp://ftp.gnome.org/pub/gnome/sources/gtkhtml + * ORBit 2.9.8 or later - * gal 1.99.8 or later + ftp://ftp.gnome.org/pub/gnome/sources/libsoup + + * libsoup 2.2.0 or later - ftp://ftp.gnome.org/pub/gnome/sources/gal + ftp://ftp.gnome.org/pub/gnome/sources/libsoup - * Berkeley's libdb 3.1.17 + * evolution-data-server 1.0.0 or later - 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.gnome.org/pub/gnome/sources/evolution-data-server - ftp://ftp.ximian.com/pub/source/evolution + * gtkhtml 3.2.0 or later + + ftp://ftp.gnome.org/pub/gnome/sources/gtkhtml + + * gal 2.2.0 or later + + ftp://ftp.gnome.org/pub/gnome/sources/gal * [Optional] Mozilla NSPR/NSS libraries - These are needed if you want to compile Evolution with SSL + These are needed if you want to compile Evolution with SSL and S/MIME support. http://www.mozilla.org/ @@ -109,70 +101,6 @@ dependencies should be compiled in the order they are listed here): 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 --------------------- 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 a3de45afb3..0000000000 --- a/a11y/e-table/gal-a11y-e-cell-popup.c +++ /dev/null @@ -1,144 +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 Sun Microsystem Inc., 2003 - * - */ - -#include -#include -#include "gal-a11y-e-cell-popup.h" -#include "gal-a11y-e-cell-registry.h" -#include "gal-a11y-util.h" -#include -#include -#include - -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) -{ - 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 */ - "Down", /* action keybinding */ - popup_cell_action); - - a11y->role = ATK_ROLE_TABLE_CELL; - return a11y; -} - -static void -popup_cell_action (GalA11yECell *cell) -{ - 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 Sun Microsystem Inc., 2003 - * - */ - -#ifndef __GAL_A11Y_E_CELL_POPUP_H__ -#define __GAL_A11Y_E_CELL_POPUP_H__ - -#include -#include -#include -#include - -#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 - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_CELL_REGISTRY_H__ -#define __GAL_A11Y_E_CELL_REGISTRY_H__ - -#include -#include -#include -#include - -#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 d94a3640a3..0000000000 --- a/a11y/e-table/gal-a11y-e-cell-text.c +++ /dev/null @@ -1,570 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Christopher James Lahey - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include -#include "gal-a11y-e-cell-text.h" -#include "gal-a11y-util.h" -#include -#include -#include -#include -#include - -#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 = NULL; - gint start, end; - - g_return_val_if_fail (gaec && gaec->cell_view && gaec->cell_view->ecell && E_IS_CELL_TEXT (gaec->cell_view->ecell), -1); - ect = E_CELL_TEXT (gaec->cell_view->ecell); - - 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); - 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 (ATK_TEXT (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 (ATK_TEXT (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 (ATK_TEXT (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 (GAL_A11Y_E_CELL (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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_CELL_TEXT_H__ -#define __GAL_A11Y_E_CELL_TEXT_H__ - -#include -#include -#include -#include - -#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 0d01028cc9..0000000000 --- a/a11y/e-table/gal-a11y-e-cell-toggle.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include "gal-a11y-e-cell-toggle.h" -#include -#include - -#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) -{ - 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 -#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 ae833d9150..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 , Sun Microsystem Inc. 2003. - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include -#include "gal-a11y-e-cell-tree.h" -#include "gal-a11y-e-cell-registry.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; - - 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 (GAL_A11Y_E_CELL (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 (GAL_A11Y_E_CELL (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 (GAL_A11Y_E_CELL (subcell_a11y), ATK_STATE_EXPANDABLE, FALSE); - if (e_tree_table_adapter_node_is_expanded (tree_table_adapter, node)) - gal_a11y_e_cell_add_state (GAL_A11Y_E_CELL (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 (ATK_OBJECT (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 (G_OBJECT (subcell_a11y), (GWeakNotify) 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 , Sun Microsystem Inc. 2003. - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#ifndef __GAL_A11Y_E_CELL_TREE_H__ -#define __GAL_A11Y_E_CELL_TREE_H__ - -#include -#include -#include -#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 9df3568e6c..0000000000 --- a/a11y/e-table/gal-a11y-e-cell.c +++ /dev/null @@ -1,555 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Christopher James Lahey - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include "gal/e-table/e-table.h" -#include "gal-a11y-e-cell.h" -#include "gal-a11y-util.h" -#include -#include -#include -#include -#include - -#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 (GTK_WIDGET (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 (GTK_WINDOW (toplevel)); - - return TRUE; -} - -/* 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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_CELL_H__ -#define __GAL_A11Y_E_CELL_H__ - -#include -#include -#include - -#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-click-to-add-factory.c b/a11y/e-table/gal-a11y-e-table-click-to-add-factory.c deleted file mode 100644 index 9c46b2badc..0000000000 --- a/a11y/e-table/gal-a11y-e-table-click-to-add-factory.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Authors: Yuedong Du - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#include -#include "gal-a11y-e-table-click-to-add-factory.h" -#include "gal-a11y-e-table-click-to-add.h" -#include "gal-a11y-e-table.h" -#include -#include -#include - - -#define CS_CLASS(factory) (G_TYPE_INSTANCE_GET_CLASS ((factory), C_TYPE_STREAM, GalA11yETableClickToAddFactoryClass)) -static AtkObjectFactoryClass *parent_class; -#define PARENT_TYPE (ATK_TYPE_OBJECT_FACTORY) - -/* Static functions */ - -static GType -gal_a11y_e_table_click_to_add_factory_get_accessible_type (void) -{ - return GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD; -} - -static AtkObject* -gal_a11y_e_table_click_to_add_factory_create_accessible (GObject *obj) -{ - AtkObject * atk_object; - - g_return_val_if_fail (E_IS_TABLE_CLICK_TO_ADD(obj), NULL); - - atk_object = gal_a11y_e_table_click_to_add_new (obj); - - return atk_object; -} - -static void -gal_a11y_e_table_click_to_add_factory_class_init (GalA11yETableClickToAddFactoryClass *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_click_to_add_factory_create_accessible; - factory_class->get_accessible_type = gal_a11y_e_table_click_to_add_factory_get_accessible_type; -} - -static void -gal_a11y_e_table_click_to_add_factory_init (GalA11yETableClickToAddFactory *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_click_to_add_factory_get_type (void) -{ - static GType type = 0; - - if (!type) { - GTypeInfo info = { - sizeof (GalA11yETableClickToAddFactoryClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gal_a11y_e_table_click_to_add_factory_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (GalA11yETableClickToAddFactory), - 0, - (GInstanceInitFunc) gal_a11y_e_table_click_to_add_factory_init, - NULL /* value_table */ - }; - - type = g_type_register_static (PARENT_TYPE, "GalA11yETableClickToAddFactory", &info, 0); - } - - return type; -} diff --git a/a11y/e-table/gal-a11y-e-table-click-to-add-factory.h b/a11y/e-table/gal-a11y-e-table-click-to-add-factory.h deleted file mode 100644 index d75453a780..0000000000 --- a/a11y/e-table/gal-a11y-e-table-click-to-add-factory.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Authors: * Yuedong Du - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#ifndef __GAL_A11Y_E_TABLE_CLICK_TO_ADD_FACTORY_H__ -#define __GAL_A11Y_E_TABLE_CLICK_TO_ADD_FACTORY_H__ - -#include -#include - -#define GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD_FACTORY (gal_a11y_e_table_item_factory_get_type ()) -#define GAL_A11Y_E_TABLE_CLICK_TO_ADD_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD_FACTORY, GalA11yETableClickToAddFactory)) -#define GAL_A11Y_E_TABLE_CLICK_TO_ADD_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD_FACTORY, GalA11yETableClickToAddFactoryClass)) -#define GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD_FACTORY)) -#define GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD_FACTORY)) - -typedef struct _GalA11yETableClickToAddFactory GalA11yETableClickToAddFactory; -typedef struct _GalA11yETableClickToAddFactoryClass GalA11yETableClickToAddFactoryClass; - -struct _GalA11yETableClickToAddFactory { - AtkObject object; -}; - -struct _GalA11yETableClickToAddFactoryClass { - AtkObjectClass parent_class; -}; - - -/* Standard Glib function */ -GType gal_a11y_e_table_click_to_add_factory_get_type (void); - -#endif diff --git a/a11y/e-table/gal-a11y-e-table-click-to-add.c b/a11y/e-table/gal-a11y-e-table-click-to-add.c deleted file mode 100644 index 13214a7ddd..0000000000 --- a/a11y/e-table/gal-a11y-e-table-click-to-add.c +++ /dev/null @@ -1,269 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Yuedong Du - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include "gal-a11y-util.h" -#include "gal-a11y-e-table-click-to-add.h" -#include -#include -#include -#include -#include - -static AtkObjectClass *parent_class; -static GType parent_type; -static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETableClickToAddPrivate *) (((char *) object) + priv_offset)) -#define PARENT_TYPE (parent_type) - -struct _GalA11yETableClickToAddPrivate { - gpointer rect; - gpointer row; -}; - - -static gint -etcta_get_n_actions (AtkAction *action) -{ - return 1; -} - -static G_CONST_RETURN gchar* -etcta_get_description (AtkAction *action, - gint i) -{ - if (i == 0) - return "click to add"; - - return NULL; -} - -static G_CONST_RETURN gchar* -etcta_action_get_name (AtkAction *action, gint i) -{ - if (i == 0) - return "click"; - - return NULL; -} - - -static gboolean -idle_do_action (gpointer data) -{ - GdkEventButton event; - ETableClickToAdd * etcta; - gint finished; - - g_return_val_if_fail ( data!= NULL, FALSE); - - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (data))); - g_return_val_if_fail (etcta, FALSE); - - event.x = 0; - event.y = 0; - - event.type = GDK_BUTTON_PRESS; - event.window = GTK_LAYOUT(GNOME_CANVAS_ITEM(etcta)->canvas)->bin_window; - event.button = 1; - event.send_event = TRUE; - event.time = GDK_CURRENT_TIME; - event.axes = NULL; - - g_signal_emit_by_name (etcta, "event", &event, &finished); - - return FALSE; -} - -static gboolean -etcta_do_action (AtkAction * action, gint i) -{ - g_return_val_if_fail (i == 0, FALSE); - - g_idle_add (idle_do_action, action); - - return TRUE; -} - -static void -atk_action_interface_init (AtkActionIface *iface) -{ - g_return_if_fail (iface != NULL); - - iface->do_action = etcta_do_action; - iface->get_n_actions = etcta_get_n_actions; - iface->get_description = etcta_get_description; - iface->get_name = etcta_action_get_name; -} - - -static G_CONST_RETURN gchar * -etcta_get_name (AtkObject *obj) -{ - g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (obj), NULL); - - return "click to add"; -} - -static gint -etcta_get_n_children (AtkObject *accessible) -{ - return 1; -} - -static AtkObject* -etcta_ref_child (AtkObject *accessible, - gint i) -{ - AtkObject * atk_obj = NULL; - ETableClickToAdd * etcta; - - if ( i != 0 ) - return NULL; - - etcta = E_TABLE_CLICK_TO_ADD(atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible))); - - g_return_val_if_fail (etcta, NULL); - - if (etcta->rect) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT(etcta->rect)); - } else if (etcta->row) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT(etcta->row)); - } - - g_object_ref (atk_obj); - - return atk_obj; -} - -static void -etcta_class_init (GalA11yETableClickToAddClass *klass) -{ - AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (PARENT_TYPE); - - atk_object_class->get_name = etcta_get_name; - atk_object_class->get_n_children = etcta_get_n_children; - atk_object_class->ref_child = etcta_ref_child; -} - -static void -etcta_init (GalA11yETableClickToAdd *a11y) -{ -} - -/** - * gal_a11y_e_table_click_to_add_get_type: - * @void: - * - * Registers the &GalA11yETableClickToAdd class if necessary, and returns the type ID - * associated to it. - * - * Return value: The type ID of the &GalA11yETableClickToAdd class. - **/ -GType -gal_a11y_e_table_click_to_add_get_type (void) -{ - static GType type = 0; - - if (!type) { - AtkObjectFactory *factory; - - GTypeInfo info = { - sizeof (GalA11yETableClickToAddClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) etcta_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (GalA11yETableClickToAdd), - 0, - (GInstanceInitFunc) etcta_init, - NULL /* value_table */ - }; - - static const GInterfaceInfo atk_action_info = { - (GInterfaceInitFunc) atk_action_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, - "GalA11yETableClickToAdd", &info, 0, - sizeof(GalA11yETableClickToAddPrivate), &priv_offset); - - g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info); - - } - - return type; -} - -static gboolean -etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) -{ - ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); - GalA11yETableClickToAdd *a11y; - GalA11yETableClickToAddPrivate *priv; - - g_return_val_if_fail (item, TRUE); - - g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD(data), FALSE); - a11y = GAL_A11Y_E_TABLE_CLICK_TO_ADD (data); - - priv = GET_PRIVATE (a11y); - - /* rect replaced by row. */ - if (etcta->rect == NULL && priv->rect != NULL) { - g_signal_emit_by_name (a11y, "children_changed::remove", 0, NULL, NULL); - - } - /* row inserted, and/or replaced by a new row. */ - if (etcta->row != NULL && priv->row == NULL) { - g_signal_emit_by_name (a11y, "children_changed::add", 0, NULL, NULL); - } else if (etcta->row != NULL && priv->row != NULL && etcta->row != priv->row) { - g_signal_emit_by_name (a11y, "children_changed::remove", 0, NULL, NULL); - g_signal_emit_by_name (a11y, "children_changed::add", 0, NULL, NULL); - } - - - priv->rect = etcta->rect; - priv->row = etcta->row; - - return TRUE; -} - -AtkObject * -gal_a11y_e_table_click_to_add_new (GObject *widget) -{ - GalA11yETableClickToAdd *a11y; - ETableClickToAdd * etcta; - GalA11yETableClickToAddPrivate *priv; - - g_return_val_if_fail (widget != NULL, NULL); - - a11y = g_object_new (gal_a11y_e_table_click_to_add_get_type (), NULL); - priv = GET_PRIVATE (a11y); - - etcta = E_TABLE_CLICK_TO_ADD(widget); - - - atk_object_initialize (ATK_OBJECT (a11y), etcta); - - priv->rect = etcta->rect; - priv->row = etcta->row; - - - g_signal_connect_after (G_OBJECT(widget), "event", - G_CALLBACK (etcta_event), a11y); - - return ATK_OBJECT (a11y); -} diff --git a/a11y/e-table/gal-a11y-e-table-click-to-add.h b/a11y/e-table/gal-a11y-e-table-click-to-add.h deleted file mode 100644 index 98e3aa9b80..0000000000 --- a/a11y/e-table/gal-a11y-e-table-click-to-add.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -#ifndef __GAL_A11Y_E_TABLE_CLICK_TO_ADD_H__ -#define __GAL_A11Y_E_TABLE_CLICK_TO_ADD_H__ - -#include -#include -#include - -#define GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD (gal_a11y_e_table_click_to_add_get_type ()) -#define GAL_A11Y_E_TABLE_CLICK_TO_ADD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD, GalA11yETableClickToAdd)) -#define GAL_A11Y_E_TABLE_CLICK_TO_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD, GalA11yETableClickToAddClass)) -#define GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD)) -#define GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD)) - -typedef struct _GalA11yETableClickToAdd GalA11yETableClickToAdd; -typedef struct _GalA11yETableClickToAddClass GalA11yETableClickToAddClass; -typedef struct _GalA11yETableClickToAddPrivate GalA11yETableClickToAddPrivate; - -/* This struct should actually be larger as this isn't what we derive from. - * The GalA11yETableClickToAddPrivate comes right after the parent class structure. - **/ -struct _GalA11yETableClickToAdd { - AtkGObjectAccessible parent; -}; - -struct _GalA11yETableClickToAddClass { - AtkGObjectAccessibleClass parent_class; -}; - -/* Standard Glib function */ -GType gal_a11y_e_table_click_to_add_get_type (void); -AtkObject *gal_a11y_e_table_click_to_add_new (GObject *widget); - -#endif /* ! __GAL_A11Y_E_TABLE_CLICK_TO_ADD_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 - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_TABLE_FACTORY_H__ -#define __GAL_A11Y_E_TABLE_FACTORY_H__ - -#include -#include - -#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 12cb978fde..0000000000 --- a/a11y/e-table/gal-a11y-e-table-item-factory.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Authors: Yuedong Du - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#include -#include "gal-a11y-e-table-item-factory.h" -#include "gal-a11y-e-table-item.h" -#include "gal-a11y-e-table.h" -#include -#include -#include - - -#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; - - g_return_val_if_fail (E_IS_TABLE_ITEM(obj), NULL); - accessible = gal_a11y_e_table_item_new(NULL, E_TABLE_ITEM (obj), 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 - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#ifndef __GAL_A11Y_E_TABLE_ITEM_FACTORY_H__ -#define __GAL_A11Y_E_TABLE_ITEM_FACTORY_H__ - -#include -#include - -#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 627735ba04..0000000000 --- a/a11y/e-table/gal-a11y-e-table-item.c +++ /dev/null @@ -1,1433 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Christopher James Lahey - * Bolian Yin - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include -#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 -#include -#include - -#include -#include -#include -#include -#include -#include - -#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; - GtkWidget *widget; -}; - -static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, - ESelectionModel *selection); -static gboolean gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y); - -static gpointer *eti_reinit_data (AtkTable *table, ETableItem *item); - -#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 gint -model_to_view_row(ETableItem *eti, int row) -{ - int i; - if (row == -1) - return -1; - if (eti->uses_source_model) { - ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); - if (eti->row_guess >= 0 && eti->row_guess < etss->n_map) { - if (etss->map_table[eti->row_guess] == row) { - return eti->row_guess; - } - } - for (i = 0; i < etss->n_map; i++) { - if (etss->map_table[i] == row) - return i; - } - return -1; - } else - return row; -} - -inline static gint -model_to_view_col(ETableItem *eti, int col) -{ - int i; - if (col == -1) - return -1; - for (i = 0; i < eti->cols; i++) { - ETableCol *ecol = e_table_header_get_column (eti->header, i); - if (ecol->col_idx == col) - return i; - } - return -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) -{ - 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) -{ - 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) -{ - 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) -{ - 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) -{ - 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 NULL; - - 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) -{ - gint index; - GalA11yETableItem * item; - GalA11yECell * cell; - - g_return_if_fail (GAL_A11Y_IS_E_CELL (data)); - cell = GAL_A11Y_E_CELL (data); - - item = GAL_A11Y_E_TABLE_ITEM (atk_gobject_accessible_for_object (G_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 = eti_reinit_data (table, item); - if (cell_data == NULL) - return NULL; - - 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)) { - gal_a11y_e_cell_add_state(ret, ATK_STATE_SHOWING, FALSE); - gal_a11y_e_cell_add_state(ret, ATK_STATE_VISIBLE, FALSE); - 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; - - 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; - gpointer *cell_data; - 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"); -} - -/* - * reinit the eti's private data - * make sure it is synchronized with the gal-e-table-item - */ -static gpointer * -eti_reinit_data (AtkTable *table, ETableItem *item) -{ - gpointer * cell_data; - - int oldsize, newsize; - cell_data = GET_PRIVATE (table)->cell_data; - if (GET_PRIVATE (table)->rows != item->rows - || GET_PRIVATE (table)->cols != item->cols ) { /* reinit cell_data */ - oldsize = GET_PRIVATE (table)->cols * GET_PRIVATE (table)->rows; - newsize = item->cols*item->rows; - GET_PRIVATE (table)->cols = item->cols; - GET_PRIVATE (table)->rows = item->rows; - - cell_data = g_realloc(cell_data, newsize*sizeof(gpointer)); - if (newsize > oldsize) - memset(&cell_data[oldsize], 0, (newsize-oldsize)*sizeof(gpointer)); - - GET_PRIVATE (table)->cell_data = cell_data; - } - return cell_data; -} - -/* - * clear all the AtkObjects stored in the cell_data - * doesn't free the cell_data or resize it. - */ -static void -eti_clear_rows (ETableModel * model, AtkObject * table_item, int row, int count) -{ - gint i,j, n_rows, n_cols; - gpointer *cell_data; - - g_return_if_fail (model && table_item); - - cell_data = GET_PRIVATE (table_item)->cell_data; - g_return_if_fail (cell_data); - - n_rows = GET_PRIVATE (table_item)->rows; - n_cols = GET_PRIVATE (table_item)->cols; - - g_return_if_fail( row >= 0 && count > 0 && row+count <= 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; - } - } - } - - 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"); -} - -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; - - 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"); -} - -static void -eti_tree_model_node_changed_cb (ETreeModel *model, ETreePath node, ETableItem *eti) -{ - AtkObject *atk_obj; - GalA11yETableItem *a11y; - - g_return_if_fail (E_IS_TABLE_ITEM (eti)); - - atk_obj = atk_gobject_accessible_for_object (G_OBJECT (eti)); - a11y = GAL_A11Y_E_TABLE_ITEM (atk_obj); - - /* we can't figure out which rows are changed, so just clear all of them ... */ - if (GET_PRIVATE (a11y)->rows > 0) - eti_clear_rows (eti->table_model, atk_obj, 0, GET_PRIVATE (a11y)->rows); -} - -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 ) { - 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; - AtkObject *accessible; - int n; - - g_return_val_if_fail (item && item->cols >= 0 && item->rows >= 0, NULL); - 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; - - accessible = ATK_OBJECT(a11y); - accessible->role = ATK_ROLE_TREE_TABLE; - - /* 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); - - /* find the TableItem's parent: table or tree */ - GET_PRIVATE (a11y)->widget = gtk_widget_get_parent (GTK_WIDGET (item->parent.canvas)); - if (E_IS_TREE (GET_PRIVATE (a11y)->widget)) { - ETreeModel *model; - model = e_tree_get_model (E_TREE (GET_PRIVATE (a11y)->widget)); - g_signal_connect (G_OBJECT(model), "node_changed", - G_CALLBACK (eti_tree_model_node_changed_cb), item); - } - } - 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; - int view_row, view_col; - ETableItem *item; - - g_return_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (a11y)); - - g_signal_emit_by_name (a11y, "selection_changed"); - - item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (a11y))); - - g_return_if_fail (item); - - view_row = model_to_view_row (item, row); - view_col = model_to_view_col (item, col); - - cell = atk_table_ref_at (ATK_TABLE (a11y), view_row, view_col); - if (cell != NULL) { - gal_a11y_e_cell_add_state (GAL_A11Y_E_CELL (cell), ATK_STATE_FOCUSED, FALSE); - - if (ATK_IS_OBJECT (cell)) - g_signal_emit_by_name (a11y, - "active-descendant-changed", - cell); - atk_focus_tracker_notify (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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_TABLE_ITEM_H__ -#define __GAL_A11Y_E_TABLE_ITEM_H__ - -#include -#include -#include - -#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 8f4f246e70..0000000000 --- a/a11y/e-table/gal-a11y-e-table.c +++ /dev/null @@ -1,185 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: - * Christopher James Lahey - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include "gal-a11y-e-table.h" -#include "gal-a11y-e-table-item.h" -#include "gal-a11y-util.h" -#include -#include -#include -#include - -#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 = atk_gobject_accessible_for_object (G_OBJECT(E_TABLE_GROUP_LEAF (table->group)->item)); - 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) -{ - GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible); - ETable * et; - - et = E_TABLE(GTK_ACCESSIBLE (a11y)->widget); - if (et && et->use_click_to_add) { - return 2; - } - - return 1; -} - -static AtkObject* -et_ref_child (AtkObject *accessible, - gint i) -{ - GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible); - ETable * et; - - et = E_TABLE(GTK_ACCESSIBLE (a11y)->widget); - - if (i == 0) { - init_child_item (a11y); - g_object_ref (GET_PRIVATE (a11y)->child_item); - return GET_PRIVATE (a11y)->child_item; - } else if (i == 1) { - AtkObject * accessible; - ETableClickToAdd * etcta; - - if (et && et->use_click_to_add && et->click_to_add) { - etcta = E_TABLE_CLICK_TO_ADD(et->click_to_add); - if (etcta->rect) { - accessible = atk_gobject_accessible_for_object (G_OBJECT(etcta)); - } else { - accessible = atk_gobject_accessible_for_object (G_OBJECT(etcta->row)); - } - return accessible; - } - } - - return NULL; -} - -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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_TABLE_H__ -#define __GAL_A11Y_E_TABLE_H__ - -#include -#include -#include -#include - -#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 - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#include -#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 - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#ifndef __GAL_A11Y_E_TREE_FACTORY_H__ -#define __GAL_A11Y_E_TREE_FACTORY_H__ - -#include -#include - -#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 9bb49496d4..0000000000 --- a/a11y/e-table/gal-a11y-e-tree.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Authors: Yuedong Du - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#include -#include "gal-a11y-e-tree.h" -#include "gal-a11y-util.h" -#include "gal-a11y-e-table-item.h" -#include -#include - -#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 = atk_gobject_accessible_for_object (G_OBJECT (eti)); - if (!priv->child_item) - 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; - - 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 - * - * Copyright (C) 2003 Ximian, Inc. - */ - -#ifndef __GAL_A11Y_E_TREE_H__ -#define __GAL_A11Y_E_TREE_H__ - -#include -#include -#include -#include - -#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 - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_TEXT_FACTORY_H__ -#define __GAL_A11Y_E_TEXT_FACTORY_H__ - -#include -#include - -#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 db066edd6e..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 - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#include -#include "gal-a11y-e-text.h" -#include "gal-a11y-util.h" -#include -#include -#include -#include -#include -#include -#include "gal/e-text/e-text.h" -#include "gal/e-text/e-text-model-repos.h" -#include - -#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 NULL; - 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 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; - 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 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; - 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 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; - 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; - - 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; - default: - 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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_E_TEXT_H__ -#define __GAL_A11Y_E_TEXT_H__ - -#include -#include - -#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/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 , 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 -#include -#include - -#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 - * - * Copyright (C) 2002 Ximian, Inc. - */ - -#include -#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 - * - * Copyright (C) 2001 Chris Lahey - */ - -#ifndef __GAL_A11Y_UTIL_H__ -#define __GAL_A11Y_UTIL_H__ - -#include - -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/addressbook/ChangeLog b/addressbook/ChangeLog index 25830df7b8..0251e7bc72 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -6,67 +6,12 @@ (addressbook_view_init): Unref views when removed from the hash table. -2004-10-06 Not Zed +2004-10-01 William Jon McCann - * gui/component/addressbook-view.c (popup_event_callback): - * gui/component/select-names/e-select-names.c (section_right_click_cb): - * gui/widgets/e-addressbook-view.c (do_popup_menu): fix for - e-popup api changes. Moved all mask specifiers to visible rather - than enable in the menu table. - -2004-10-06 Not Zed - - * gui/contact-editor/e-contact-editor.c: removed - gnome-popup-menu.h (unused). - - * gui/widgets/e-addressbook-reflow-adapter.c: - * gui/widgets/eab-popup-control.c: remove e-popup-menu.h (unused). + * gui/component/component-factory.c (factory): Quiet debug messages. - * gui/component/select-names/e-select-names.c - (section_right_click_cb): use e-popup. Somewhat overengineered - for this use ... - (remove_cb): api changes. - - * gui/widgets/eab-popup.c (eab_popup_target_new_select_names): - added pretty useless wrapper for the select names popup. Added to - hook maps. - -2004-10-01 Not Zed - - * gui/widgets/e-addressbook-view.c (do_popup_menu): convert to - using EABPopup. - (sources): remove dead code. - (has_email_address_1, get_has_email_address): removed now - redundant code. - (save_as, send_as, send_to, print, copy, paste, cut, delete) - (copy_to_folder, move_to_folder, new_card, new_list): new api. - (free_popup_info): dead. - (print_envelope): not pining. - (get_contact_list): take a popup target instead, don't ref. - (get_contact_list_1): not required no more. - (contact_and_book_free): same. - (delete): call eab_view_delete_selection. - (eab_view_delete_selection): do the actual delete here. - - * gui/widgets/eab-popup.c (eab_popup_target_new_select): implement. - -2004-10-01 Not Zed - - * gui/widgets/eab-popup.[ch]: addressbook popup driver. - - * gui/component/addressbook-view.c (delete_addressbook_cb): use - e-error for the message prompt. don't bother keeping it around, - it can never be re-sensitised anyway. - (book_removed): no longer destroy the original dialogue. - - * addressbook-errors.xml: add ask-delete for deleting - addressbooks. - - * gui/component/addressbook-view.c (addressbook_view_init): - connect to popup_event rather than fill_popup_menu now. - (fill_popup_menu_callback): renamed to popup_event_callback, - changed to use epopup. - (add_popup_menu_item): remove, no longer needed. + * gui/component/apps_evolution_addressbook.schemas.in.in: Add + missing show_preview schema. Add missing long descriptions. 2004-09-29 Not Zed @@ -90,52 +35,45 @@ * gui/merging/eab-contact-compare.c (query_cb): Protect against NULL UIDs, and make fewer calls to e_contact_get_const () as a bonus. -2004-09-24 Hao Sheng - - Fix for #66523 +2004-09-23 Fazlu & Hannah - * gui/contact-list-editor/e-contact-list-model.c: - (e_contact_list_model_add_email): estimate the same mail address - and popup a warning dialog. - * addressbook-errors.xml: add the question message for the warning - dialog. + Fixes bug #61070 -2004-09-23 Pamplona Hackers + * addressbook/tools/evolution-addressbook-export.c (main): + Changed the string into proper grammar 'In normal mode, + there should not need size option.' to 'In normal mode, there + is no need for the size option.' - Fixes #61978 +2004-09-23 JP Rosevear - * tools/evolution-addressbook-export.c (main): use more - meaningful error message. + * conduit/address-conduit.c (ecard_from_remote_record): only set + the file as address to the company if no full name exists + (delete_record): don't bail out if the record simply isn't found -2004-09-23 Fazlu & Hannah + Fixes #59725 + + * conduit/address-conduit.c (local_record_from_uid): remove + extraneous semicolon - * tools/evolution-addressbook-export.c (main): - Changed the string into proper grammar 'In normal mode, there - should not need size option.' to 'In normal mode, there is no need - for the size option.' +2004-09-13 Rodney Dawes -2004-09-23 JP Rosevear - - * conduit/address-conduit.c (ecard_from_remote_record): only set - the file as address to the company if no full name exists - (delete_record): don't bail out if the record simply isn't found - - Fixes #59725 - - * conduit/address-conduit.c (local_record_from_uid): remove - extraneous semicolon - -2004-09-21 William Jon McCann + * gui/contact-editor/e-contact-editor.c (show_help_cb): + Point at the correct XML file for documentation - * gui/component/component-factory.c (factory): Quiet debug messages. +2004-09-09 Sivaiah Nallagatla - * gui/widgets/e-addressbook-view.c (eab_view_new): Remove - unnecessary label widget placeholder. Make vertical scrollbar - policy automatic. Use gtk_paned_add2 instead of - gtk_container_add. + Part of fix for #59582. - * gui/component/apps_evolution_addressbook.schemas.in.in: Add - missing show_preview schema. Add missing long descriptions. + * gui/contact-editor/e-contact-editor.c + (sensitize_address): check for _LABEL type address fields also in + supported fileds while sensitizing the address fields. + +2004-09-08 Not Zed + + ** See bug #64080. + + * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD): + link addressbook to camel. 2004-09-13 Rodney Dawes @@ -553,11 +491,6 @@ Don't set empty default value on an int, this causes gconf warning. (bug #60859) -2004-09-04 Not Zed - - * util/e-destination.c: include gnome-i18n.h since camel-object no - longer does(!). - 2004-07-02 Hans Petter Jansson * gui/contact-list-editor/e-contact-list-editor.c diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c index 0a51af0c43..368c0c4540 100644 --- a/addressbook/gui/component/addressbook-view.c +++ b/addressbook/gui/component/addressbook-view.c @@ -60,7 +60,6 @@ #include "addressbook/gui/merging/eab-contact-merging.h" #include "addressbook/printing/e-contact-print.h" #include "addressbook/util/eab-book-util.h" -#include "addressbook/gui/widgets/eab-popup.h" #define PARENT_TYPE G_TYPE_OBJECT static GObjectClass *parent_class = NULL; @@ -614,10 +613,45 @@ load_primary_selection (AddressbookView *view) } /* Folder popup menu 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 */ + if (g_file_test (pixmap, G_FILE_TEST_EXISTS)) + image = gtk_image_new_from_file (pixmap); + else + image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU); + + 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); +} + typedef struct { AddressbookView *view; ESource *selected_source; GtkWidget *toplevel; + GtkWidget *dialog; } BookRemovedClosure; static void @@ -627,6 +661,7 @@ book_removed (EBook *book, EBookStatus status, gpointer data) AddressbookView *view = closure->view; AddressbookViewPrivate *priv = view->priv; ESource *source = closure->selected_source; + GtkWidget *dialog = closure->dialog; GtkWidget *toplevel = closure->toplevel; g_free (closure); @@ -649,54 +684,73 @@ book_removed (EBook *book, EBookStatus status, gpointer data) "addressbook:remove-addressbook", NULL); } + + gtk_widget_destroy (dialog); } static void -delete_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +delete_addressbook_cb (GtkWidget *widget, AddressbookView *view) { - AddressbookView *view = data; AddressbookViewPrivate *priv = view->priv; ESource *selected_source; + GtkWidget *dialog; EBook *book; GError *error = NULL; - GtkWindow *toplevel; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->selector)); if (!selected_source) return; - toplevel = (GtkWindow *)gtk_widget_get_toplevel(ep->target->widget); - - if (e_error_run(toplevel, "addressbook:ask-delete-addressbook", e_source_peek_name(selected_source)) != GTK_RESPONSE_YES) + /* 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, + _("Address book '%s' will be removed. Are you sure you want to continue?"), + e_source_peek_name (selected_source)); +#if !GTK_CHECK_VERSION (2,4,0) + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); +#endif + + if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_YES) { + gtk_widget_destroy (dialog); return; + } /* Remove local data */ book = e_book_new (selected_source, &error); if (book) { BookRemovedClosure *closure = g_new (BookRemovedClosure, 1); - closure->toplevel = (GtkWidget *)toplevel; + closure->toplevel = gtk_widget_get_toplevel (widget); closure->view = view; closure->selected_source = selected_source; + closure->dialog = dialog; if (e_book_async_remove (book, book_removed, closure)) { - e_error_run (toplevel, "addressbook:remove-addressbook", NULL); + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (widget)), + "addressbook:remove-addressbook", + NULL); + g_free (closure); + g_object_unref (book); } } + + gtk_widget_set_sensitive (dialog, FALSE); } static void -new_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +new_addressbook_cb (GtkWidget *widget, AddressbookView *view) { - addressbook_config_create_new_source (gtk_widget_get_toplevel(ep->target->widget)); + addressbook_config_create_new_source (gtk_widget_get_toplevel (widget)); } static void -edit_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) +edit_addressbook_cb (GtkWidget *widget, AddressbookView *view) { - AddressbookView *view = data; AddressbookViewPrivate *priv = view->priv; ESource *selected_source; const char *uid; @@ -714,7 +768,7 @@ edit_addressbook_cb(EPopup *ep, EPopupItem *pitem, void *data) char *uid_copy = g_strdup (uid); closure = g_new (EditorUidClosure, 1); - closure->editor = addressbook_config_edit_source (gtk_widget_get_toplevel(ep->target->widget), selected_source); + closure->editor = addressbook_config_edit_source (gtk_widget_get_toplevel (widget), selected_source); closure->uid = uid_copy; closure->view = view; @@ -739,40 +793,25 @@ primary_source_selection_changed_callback (ESourceSelector *selector, save_primary_selection (view); } -static EPopupItem abv_source_popups[] = { - { E_POPUP_ITEM, "10.new", N_("New Address Book"), new_addressbook_cb, NULL, NULL, 0, 0 }, - { E_POPUP_ITEM, "20.delete", N_("Delete"), delete_addressbook_cb, NULL, "stock_delete", 0, EAB_POPUP_SOURCE_USER|EAB_POPUP_SOURCE_PRIMARY }, - { E_POPUP_ITEM, "30.properties", N_("Properties..."), edit_addressbook_cb, NULL, NULL, 0, EAB_POPUP_SOURCE_PRIMARY }, -}; static void -abv_source_popup_free(EPopup *ep, GSList *list, void *data) -{ - g_slist_free(list); -} - -static gboolean -popup_event_callback(ESourceSelector *selector, ESource *source, GdkEventButton *event, AddressbookView *view) +fill_popup_menu_callback (ESourceSelector *selector, GtkMenu *menu, AddressbookView *view) { - EABPopup *ep; - EABPopupTargetSource *t; - GSList *menus = NULL; - int i; - GtkMenu *menu; - - ep = eab_popup_new("com.novell.evolution.addressbook.source.popup"); - t = eab_popup_target_new_source(ep, selector); - t->target.widget = (GtkWidget *)view->priv->notebook; - - for (i=0;ipriv; + gboolean sensitive; + gboolean local_addressbook; + ESource *selected_source; + char *uri; - menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0); - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event?event->button:0, event?event->time:gtk_get_current_event_time()); + selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (priv->selector)); + sensitive = selected_source ? TRUE : FALSE; - return TRUE; + uri = e_source_peek_relative_uri (selected_source); + local_addressbook = (uri && !strcmp ("system", uri)); + + add_popup_menu_item (menu, _("New Address Book"), NULL, G_CALLBACK (new_addressbook_cb), view, TRUE); + add_popup_menu_item (menu, _("Delete"), GTK_STOCK_DELETE, G_CALLBACK (delete_addressbook_cb), view, sensitive && !local_addressbook); + add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_addressbook_cb), view, sensitive); } static gboolean @@ -938,13 +977,15 @@ selector_tree_drag_data_received (GtkWidget *widget, { GtkTreePath *path = NULL; GtkTreeViewDropPosition pos; - gpointer target = NULL; + gpointer source, target = NULL; GtkTreeModel *model; GtkTreeIter iter; gboolean success = FALSE; + EBook *source_book, *target_book; MergeContext *merge_context; GList *contactlist; + GList *l; if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) @@ -1128,8 +1169,8 @@ addressbook_view_init (AddressbookView *view) g_signal_connect_object (priv->selector, "primary_selection_changed", G_CALLBACK (primary_source_selection_changed_callback), G_OBJECT (view), 0); - g_signal_connect_object (priv->selector, "popup_event", - G_CALLBACK (popup_event_callback), + g_signal_connect_object (priv->selector, "fill_popup_menu", + G_CALLBACK (fill_popup_menu_callback), G_OBJECT (view), 0); load_primary_selection (view); diff --git a/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in b/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in index 1f835d9414..0de9b142f7 100644 --- a/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in +++ b/addressbook/gui/component/apps_evolution_addressbook.schemas.in.in @@ -10,8 +10,8 @@ string - EFolderList XML for the list of completion URIs - EFolderList XML for the list of completion URIs. + EFolderList xml for the list of completion uris + EFolderList xml for the list of completion uris @@ -23,7 +23,7 @@ 3 The number of characters that must be typed before evolution will attempt to autocomplete - The number of characters that must be typed before evolution will attempt to autocomplete. + The number of characters that must be typed before evolution will attempt to autocomplete @@ -37,7 +37,7 @@ URI for the folder last used in the select names dialog - URI for the folder last used in the select names dialog. + URI for the folder last used in the select names dialog @@ -50,7 +50,7 @@ int Position of the vertical pane in main view - Position of the vertical pane in main view. + Position of the vertical pane in main view @@ -62,7 +62,7 @@ true Show the "Preview" pane - Show the "Preview" pane. + Show the "Preview" pane diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index e3731cfbc6..5b447b7b99 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index ed55f42a89..b9f6b123e6 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,6 @@ #include "addressbook/printing/e-contact-print.h" #include "addressbook/printing/e-contact-print-envelope.h" #include "addressbook/gui/search/e-addressbook-search-dialog.h" -#include "addressbook/gui/widgets/eab-popup.h" #include "e-util/e-categories-master-list-wombat.h" #include "e-util/e-sexp.h" @@ -475,12 +475,16 @@ eab_view_new (void) g_signal_connect_swapped (eav->paned, "button_release_event", G_CALLBACK (get_paned_position), eav); + eav->widget = gtk_label_new ("empty label here"); + gtk_container_add (GTK_CONTAINER (eav->paned), eav->widget); + gtk_widget_show (eav->widget); + eav->contact_display = eab_contact_display_new (); eav->contact_display_window = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (eav->contact_display_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (eav->contact_display_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (eav->contact_display_window), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (eav->contact_display_window), eav->contact_display); - gtk_paned_add2 (GTK_PANED (eav->paned), eav->contact_display_window); + gtk_container_add (GTK_CONTAINER (eav->paned), eav->contact_display_window); gtk_widget_show (eav->contact_display); gtk_widget_show (eav->contact_display_window); gtk_widget_show (eav->paned); @@ -771,6 +775,7 @@ get_selection_model (EABView *view) /* Popup menu stuff */ typedef struct { EABView *view; + EPopupMenu *submenu; gpointer closure; } ContactAndBook; @@ -780,219 +785,371 @@ 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 (EABPopupTargetSelect *t) +get_contact_list (ContactAndBook *contact_and_book) { GList *list = NULL; - int i; + ESelectionModel *selection; - for (i=0;icards->len;i++) - list = g_list_prepend(list, t->cards->pdata[i]); + 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 -save_as (EPopup *ep, EPopupItem *pitem, void *data) +has_email_address_1(gint model_row, + gpointer closure) { - /*ContactAndBook *contact_and_book = data;*/ - GList *contacts = get_contact_list ((EABPopupTargetSelect *)ep->target); + 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); - g_list_free(contacts); + e_free_object_list(contacts); } } static void -send_as (EPopup *ep, EPopupItem *pitem, void *data) +send_as (GtkWidget *widget, ContactAndBook *contact_and_book) { - /*ContactAndBook *contact_and_book = data;*/ - GList *contacts = get_contact_list ((EABPopupTargetSelect *)ep->target); - + GList *contacts = get_contact_list (contact_and_book); if (contacts) { eab_send_contact_list(contacts, EAB_DISPOSITION_AS_ATTACHMENT); - g_list_free(contacts); + e_free_object_list(contacts); } } static void -send_to (EPopup *ep, EPopupItem *pitem, void *data) +send_to (GtkWidget *widget, ContactAndBook *contact_and_book) + { - /*ContactAndBook *contact_and_book = data;*/ - GList *contacts = get_contact_list ((EABPopupTargetSelect *)ep->target); + GList *contacts = get_contact_list (contact_and_book); if (contacts) { eab_send_contact_list(contacts, EAB_DISPOSITION_AS_TO); - g_list_free(contacts); + e_free_object_list(contacts); } } static void -print (EPopup *ep, EPopupItem *pitem, void *data) +print (GtkWidget *widget, ContactAndBook *contact_and_book) { - /*ContactAndBook *contact_and_book = data;*/ - EABPopupTargetSelect *t = (EABPopupTargetSelect *)ep->target; - - if (t->cards->len == 1) { - gtk_widget_show(e_contact_print_contact_dialog_new(t->cards->pdata[0])); - } else { - GList *contacts = get_contact_list(t); - - gtk_widget_show(e_contact_print_contact_list_dialog_new(contacts)); - g_list_free(contacts); + 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 -copy (EPopup *ep, EPopupItem *pitem, void *data) +print_envelope (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; + 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 (EPopup *ep, EPopupItem *pitem, void *data) +paste (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; - eab_view_paste (contact_and_book->view); } static void -cut (EPopup *ep, EPopupItem *pitem, void *data) +cut (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; - eab_view_cut (contact_and_book->view); } static void -delete (EPopup *ep, EPopupItem *pitem, void *data) +delete (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; + if (eab_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)); + } - eab_view_delete_selection(contact_and_book->view); + /* 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, + contact, + NULL, + NULL); + } + } + e_free_object_list(list); + g_object_unref(book); + } } static void -copy_to_folder (EPopup *ep, EPopupItem *pitem, void *data) +copy_to_folder (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; - eab_view_copy_to_folder (contact_and_book->view); } static void -move_to_folder (EPopup *ep, EPopupItem *pitem, void *data) +move_to_folder (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; - eab_view_move_to_folder (contact_and_book->view); } static void -new_card (EPopup *ep, EPopupItem *pitem, void *data) +free_popup_info (GtkWidget *w, ContactAndBook *contact_and_book) { - /*ContactAndBook *contact_and_book = data;*/ + contact_and_book_free (contact_and_book); +} + +static void +new_card (GtkWidget *widget, ContactAndBook *contact_and_book) +{ + EBook *book; EContact *contact = e_contact_new(); - eab_show_contact_editor (((EABPopupTargetSelect *)ep->target)->book, contact, TRUE, TRUE); + 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 (EPopup *ep, EPopupItem *pitem, void *data) +new_list (GtkWidget *widget, ContactAndBook *contact_and_book) { - /*ContactAndBook *contact_and_book = data;*/ + EBook *book; EContact *contact = e_contact_new (); - eab_show_contact_list_editor (((EABPopupTargetSelect *)ep->target)->book, contact, TRUE, TRUE); + 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); } -static EPopupItem eabv_popup_items[] = { - { E_POPUP_ITEM, "10.new", N_("New Contact..."), new_card, NULL, "stock_contact", 0, EAB_POPUP_SELECT_EDITABLE}, - { E_POPUP_ITEM, "15.newlist", N_("New Contact List..."), new_list, NULL, "stock_contact-list", 0, EAB_POPUP_SELECT_EDITABLE }, - - { E_POPUP_BAR, "20.bar" }, - { E_POPUP_ITEM, "30.saveas", N_("Save as VCard..."), save_as, NULL, "stock_save-as", 0, EAB_POPUP_SELECT_MANY }, - { E_POPUP_ITEM, "40.forward", N_("Forward Contact"), send_as, NULL, "stock_mail-forward", 0, EAB_POPUP_SELECT_MANY }, - { E_POPUP_ITEM, "50.mailto", N_("Send Message to Contact"), send_to, NULL, "stock_mail-send", 0, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EMAIL }, - { E_POPUP_ITEM, "60.print", N_("Print"), print, NULL, "stock_print", 0, EAB_POPUP_SELECT_MANY }, - - { E_POPUP_BAR, "70.bar" }, - { E_POPUP_ITEM, "80.copyto", N_("Copy to Address Book..."), copy_to_folder, NULL, NULL, 0, EAB_POPUP_SELECT_MANY }, - { E_POPUP_ITEM, "90.moveto", N_("Move to Address Book..."), move_to_folder, NULL, NULL, 0, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EDITABLE }, - - { E_POPUP_BAR, "a0.bar" }, - { E_POPUP_BAR, "b0.cut", N_("Cut"), cut, NULL, "stock_cut", 0, EAB_POPUP_SELECT_MANY|EAB_POPUP_SELECT_EDITABLE }, - { E_POPUP_ITEM, "c0.copy", N_("Copy"), copy, NULL, "stock_copy", 0, EAB_POPUP_SELECT_MANY }, - { E_POPUP_ITEM, "d0.paste", N_("Paste"), paste, NULL, "stock_paste", 0, EAB_POPUP_SELECT_EDITABLE }, - { E_POPUP_ITEM, "e0.delete", N_("Delete"), delete, NULL, "stock_delete", 0, EAB_POPUP_SELECT_EDITABLE|EAB_POPUP_SELECT_MANY }, -}; - +#if 0 static void -get_card_1(gint model_row, void *data) +sources (GtkWidget *widget, ContactAndBook *contact_and_book) { - ContactAndBook *contact_and_book = data; - EContact *contact; + BonoboControl *control; + GNOME_Evolution_ShellView shell_view; + CORBA_Environment ev; - contact = eab_model_get_contact(contact_and_book->view->model, model_row); - if (contact) - g_ptr_array_add((GPtrArray *)contact_and_book->closure, contact); -} + control = g_object_get_data (G_OBJECT (gcal), "control"); + if (control == NULL) + return; -static void -eabv_popup_free(EPopup *ep, GSList *list, void *data) -{ - ContactAndBook *cab = data; - ESelectionModel *selection; + shell_view = get_shell_view_interface (control); + if (shell_view == CORBA_OBJECT_NIL) + return; - /* NB: this looks strange to me */ - selection = contact_and_book_get_selection_model(cab); - if (selection) - e_selection_model_right_click_up(selection); + 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"); - g_slist_free(list); - g_object_unref(cab->view); - g_free(cab); + 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) { - EABPopup *ep; - EABPopupTargetSelect *t; - GSList *menus = NULL; - int i; - GtkMenu *menu; - GPtrArray *cards = g_ptr_array_new(); 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_("Address Book 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 Address Book..."), G_CALLBACK(copy_to_folder), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Move to Address Book..."), 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; - g_object_ref(contact_and_book->view); + contact_and_book->submenu = submenu; - selection_model = contact_and_book_get_selection_model(contact_and_book); - if (selection_model) { - contact_and_book->closure = cards; - e_selection_model_foreach(selection_model, get_card_1, contact_and_book); - } + g_object_ref (contact_and_book->view); - ep = eab_popup_new("com.novell.evolution.addressbook.view.popup"); - t = eab_popup_target_new_select(ep, view->book, !eab_model_editable(view->model), cards); - t->target.widget = (GtkWidget *)view; + selection_model = contact_and_book_get_selection_model (contact_and_book); + if (selection_model) + selection = e_selection_model_selected_count (selection_model) > 0; - for (i=0;imodel) ? 0 : POPUP_READONLY_MASK) + + (selection ? 0 : POPUP_NOSELECTION_MASK) + + (get_has_email_address (contact_and_book) ? 0 : POPUP_NOEMAIL_MASK), + contact_and_book); - e_popup_add_items((EPopup *)ep, menus, eabv_popup_free, contact_and_book); + g_signal_connect (popup, "selection-done", + G_CALLBACK (free_popup_info), contact_and_book); + e_popup_menu (popup, event); - menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0); - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event?event->button.button:0, event?event->button.time:gtk_get_current_event_time()); } static void @@ -1832,43 +1989,12 @@ eab_view_print_preview(EABView *view) void eab_view_delete_selection(EABView *view) { - GList *list, *l; - - if (!eab_editor_confirm_delete(GTK_WINDOW(gtk_widget_get_toplevel(view->widget)))) - return; - - list = get_selected_contacts(view); - if (e_book_check_static_capability (view->book, "bulk-remove")) { - GList *ids = NULL; - - for (l=list;l;l=g_list_next(l)) { - EContact *contact = l->data; - - ids = g_list_prepend (ids, (char*)e_contact_get_const (contact, E_CONTACT_UID)); - } + ContactAndBook contact_and_book; - /* Remove the cards all at once. */ - /* XXX no callback specified... ugh */ - e_book_async_remove_contacts (view->book, - ids, - NULL, - NULL); - - g_list_free (ids); - } - else { - for (l=list;l;l=g_list_next(l)) { - EContact *contact = l->data; - /* Remove the card. */ - /* XXX no callback specified... ugh */ - e_book_async_remove_contact (view->book, - contact, - NULL, - NULL); - } - } + memset (&contact_and_book, 0, sizeof (contact_and_book)); + contact_and_book.view = view; - e_free_object_list(list); + delete (GTK_WIDGET (view), &contact_and_book); } static void diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c index 0fc31587a1..0793db7aad 100644 --- a/addressbook/tools/evolution-addressbook-export.c +++ b/addressbook/tools/evolution-addressbook-export.c @@ -150,7 +150,7 @@ main (int argc, char **argv) action_list_cards_init (&actctx); } else { - g_warning (_("Unhandled error")); + g_warning (_("Impossible internal error.")); exit (-1); } diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 58363a96b9..208e1d1efb 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,9 +1,3 @@ -2004-10-11 Not Zed - - * gui/alarm-notify/alarm-queue.c (tray_icon_clicked_cb): convert - to epopup. - (add_popup_menu_item): removed, now redundant. - 2004-10-08 Rodrigo Moya Fixes #45951 @@ -16,33 +10,6 @@ * gui/dialogs/comp-editor.c (setup_widgets): no need to create an extra GtkVBox, just use the GtkDialog's one. -2004-10-07 JP Rosevear - - * gui/dialogs/cal-prefs-dialog.c: remove useless include - - * gui/dialogs/url-editor-dialog.c: ditto - -2004-10-07 JP Rosevear - - * gui/print.c: guard config.h - - * gui/tasks-control.c: guard config.h, remove useless include - - * gui/migration.c: remove useless include - - * gui/main.c: remove useless include - - * gui/e-calendar-view.h: #define the type - - * gui/calendar-offline-handler.c: remove useless include - - * gui/calendar-config.c: tidy header - -2004-10-07 JP Rosevear - - * gui/calendar-commands.c: guard config.h include, kill warning - and remove useless include - 2004-10-06 Rodrigo Moya Fixes #65932 @@ -55,86 +22,10 @@ * gui/comp-editor-factory.c (cal_opened_cb): don't assert on error cases, just display an error dialog. -2004-10-06 Not Zed - - * gui/gnome-cal.c (gnome_calendar_setup_view_popup): rename to - view_popup_factory. Make it build an epopup item list directly. - Can't re-use the galview cruft :-/ - (gnome_calendar_discard_view_popup): no longer needed. - (gc_set_view, gc_save_custom_view, gc_define_views_response) - (gc_define_views): implement the gal-view popup menu items. - - * gui/gnome-cal.h: - * gui/e-week-view.h: - * gui/e-day-view.h: - * gui/e-cal-list-view.h: removed old e-popup-menu header. - - * gui/e-calendar-view.c (setup_popup_icons): removed. - (e_calendar_view_create_popup_menu): converted to use e-popup. - (on_paste, on_copy, on_cut, on_delete_occurrence) - (on_unrecur_appointment, on_delete_appointment, on_publish) - (on_forward, on_meeting, on_move_to, on_copy_to, on_print_event) - (on_save_as, on_print, on_edit_appointment, on_goto_today) - (on_goto_date, on_new_task, on_new_meeting, on_new_event) - (on_new_appointment): convert to use e-popup stuff. - - * gui/tasks-component.c (popup_event_cb): e-popup api changes. +2004-10-06 JP Rosevear - * gui/e-cal-popup.c (e_cal_popup_target_new_select): implement the - selection target. - (ecalp_target_free): and free it. - - * gui/e-cal-model.h: Make the ECalModel struct non-anonymous so it - can be forward-declared. - - * gui/calendar-component.c (popup_event_cb): e-popup api changes. - -2004-10-06 Rodrigo Moya - - Revert fix for #60551 - - * gui/dialogs/task-page.c (task_page_fill_component): start date - can be after the due date, no need to compare. - -2004-10-02 Ivn Frade - - Fixes #48116 - - * gui/dialogs/task-details.page.c (task_details_page_fill_component): - Validation: completed date is not a future date. - -2004-10-01 Not Zed - - * gui/tasks-component.c (create_component_view): cast warning - away. - (create_component_view): connect to popup_event rather than - fill_popup_menu. - - * gui/calendar-component.c (create_component_view): cast a warning - away. - - * calendar-errors.xml: add prompt-delete-task-list. - - * gui/tasks-component.c (fill_popup_menu_cb): renamed to - popup_event_cb, make use e-cal-popup. - (edit_task_list_cb, new_task_list_cb, delete_task_list_cb) - (copy_task_list_cb): deja-vu. update for api. - (add_popup_menu_item): killed. murdered. drawn and quatered. - (delete_task_list_cb): use e-error for the delete prompt. - - * gui/calendar-component.c (create_component_view): hook onto - popup event instead of fill_popup_menu. - - * calendar-errors.xml: added prompt-delete-calendar. - - * gui/calendar-component.c (fill_popup_menu_cb): rename to - popup_event_cb, make use e-cal-popup. - (edit_calendar_cb, new_calendar_cb, delete_calendar_cb) - (copy_calendar_cb): fix for api changes. - (add_popup_menu_item): removed. - (delete_calendar_cb): use e-error for the delete thing. - - * gui/e-cal-popup.[ch]: calendar popup driver. + * gui/itip-utils.c (comp_server_send): pass the variable in + correctly 2004-09-29 Rodrigo Moya @@ -152,15 +43,15 @@ destroyed (priv == null). 2004-09-28 JP Rosevear - - Fixes #61766 - - * gui/migration.c (create_calendar_contact_source): set a color - for the contacts - (create_calendar_sources): set a color for the personal source and - make in primary and default if nothing else is either - (create_task_sources): ditto for tasks personal source + + Fixes #61766 + * gui/migration.c (create_calendar_contact_source): set a color + for the contacts + (create_calendar_sources): set a color for the personal source and + make in primary and default if nothing else is either + (create_task_sources): ditto for tasks personal source + 2004-09-24 Rodrigo Moya Fixes #65599 @@ -170,12 +61,6 @@ * gui/e-pub-utils.c (e_pub_publish): use auth_new_cal_from_source() instead of auth_new_cal_from_uri(). -2004-09-24 JP Rosevear - - Fixes #64955, Vincent Noel - - * libecal/e-cal.c (e_cal_get_alarms_in_range): fix c99-ism - 2004-09-24 JP Rosevear Fixes #66344 @@ -220,14 +105,14 @@ * gui/e-cal-model-tasks.c (e_cal_model_tasks_mark_task_complete): notify of change so completion status updates immediately - -2004-09-21 JP Rosevear +2004-09-21 JP Rosevear + Fixes #59194 - - * gui/e-cal-model-calendar.c (get_location): return "" instead of - NULL + * gui/e-cal-model-calendar.c (get_location): return "" instead of + NULL + 2004-09-21 Chenthill Palanisamy Fixes #65682 @@ -235,27 +120,20 @@ (itip_send_comp): check the static capability before booking the deletion. -2004-09-15 JP Rosevear - +2004-09-20 JP Rosevear + Fixes #55172 * conduits/calendar/calendar-conduit.c (local_record_from_comp): handle -1 (last) for monthly recurrences and check both by_set_pos and by_day since either can indicate this type of recurrence - + 2004-09-20 Tony Tsui Fixes #66174 * gui/dialogs/meeting-page.c (existing_attendee): fixed memory leak. -2004-09-10 Hannah & Fazlu - - Fixes bug #65051 - - * calendar/gui/dialogs/task-page.c (task_page_fill_component): - Compared the dates and time - 2004-09-10 Rodrigo Moya Fixes #62374 @@ -270,6 +148,31 @@ (load_alarms): unref the previous query, this function should now only be called once per time range. +2004-09-09 JP Rosevear + + Fixes #65454 + + * gui/e-itip-control.c (class_init): only use a destroy function, + no finalize + (cleanup_ecal): util function + (init): use above for hash table and killed destroyed flag + (weren't using it anywhere) + (destroy): collapse finalize work into here and guard against + multiple destroy calls + +2004-08-31 Rodrigo Moya + + Fixes #62392 + + * gui/alarm-notify/alarm-queue.c (display_notification): ref the + client's query object so that it doesn't disappear on us. + (tray_icon_destroyed_cb): unref the query previously ref'ed. + +2004-08-31 Rodrigo Moya + + * gui/e-cal-model-tasks.c: include missing string.h, to avoid + problems in 64 bit builds. + 2004-09-09 JP Rosevear Fixes #65454 @@ -281,7 +184,7 @@ (weren't using it anywhere) (destroy): collapse finalize work into here and guard against multiple destroy calls - + 2004-09-08 JP Rosevear Fixes #62728 @@ -998,7 +901,7 @@ Partially fixes #56171 -2004-07-11 JÃrg Billeter +2004-07-11 Jürg Billeter * gui/dialogs/event-page.c (event_page_fill_component): busy should be opaque, not transparent diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index e9b4e6f8e0..223fd6fa9f 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -51,7 +51,6 @@ #include "alarm-queue.h" #include "config-data.h" #include "util.h" -#include "e-util/e-popup.h" @@ -801,6 +800,36 @@ tray_icon_destroyed_cb (GtkWidget *tray, gpointer user_data) } /* Callbacks. */ +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 */ + if (g_file_test (pixmap, G_FILE_TEST_EXISTS)) + image = gtk_image_new_from_file (pixmap); + else + image = gtk_image_new_from_stock (pixmap, GTK_ICON_SIZE_MENU); + + 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); + + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + gtk_widget_show (item); +} + static gboolean open_alarm_dialog (TrayIconData *tray_data) { @@ -825,15 +854,13 @@ open_alarm_dialog (TrayIconData *tray_data) } static void -popup_dismiss_cb (EPopup *ep, EPopupItem *pitem, void *data) +popup_dismiss_cb (GtkWidget *widget, TrayIconData *tray_data) { - TrayIconData *tray_data = data; - gtk_widget_destroy (tray_data->tray_icon); } static void -popup_dismiss_all_cb (EPopup *ep, EPopupItem *pitem, void *data) +popup_dismiss_all_cb (GtkWidget *widget, TrayIconData *tray_data) { while (tray_icons_list != NULL) { TrayIconData *tray_data = tray_icons_list->data; @@ -845,25 +872,11 @@ popup_dismiss_all_cb (EPopup *ep, EPopupItem *pitem, void *data) } static void -popup_open_cb (EPopup *ep, EPopupItem *pitem, void *data) +popup_open_cb (GtkWidget *widget, TrayIconData *tray_data) { - TrayIconData *tray_data = data; - open_alarm_dialog (tray_data); } -static EPopupItem tray_items[] = { - { E_POPUP_ITEM, "00.open", N_("Open"), popup_open_cb, NULL, GTK_STOCK_OPEN }, - { E_POPUP_ITEM, "10.dismiss", N_("Dismiss"), popup_dismiss_cb, NULL, NULL }, - { E_POPUP_ITEM, "20.dismissall", N_("Dismiss All"), popup_dismiss_all_cb, NULL, NULL }, -}; - -static void -tray_popup_free(EPopup *ep, GSList *items, void *data) -{ - g_slist_free(items); -} - static gint tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data) { @@ -873,17 +886,17 @@ tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_da if (event->button == 1) { return open_alarm_dialog (tray_data); } else if (event->button == 3) { - GtkMenu *menu; - GSList *menus = NULL; - EPopup *ep; - int i; - - ep = e_popup_new("com.novell.evolution.alarmNotify.popup"); - for (i=0;ibutton, event->time); + GtkWidget *menu; + + /* display popup menu */ + menu = gtk_menu_new (); + add_popup_menu_item (GTK_MENU (menu), _("Open"), GTK_STOCK_OPEN, + G_CALLBACK (popup_open_cb), tray_data); + add_popup_menu_item (GTK_MENU (menu), _("Dismiss"), NULL, + G_CALLBACK (popup_dismiss_cb), tray_data); + add_popup_menu_item (GTK_MENU (menu), _("Dismiss All"), NULL, + G_CALLBACK (popup_dismiss_all_cb), tray_data); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time); return TRUE; } diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index b1d63987bd..41d5a0c8ab 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -51,9 +51,7 @@ #include "dialogs/event-editor.h" #include "widgets/misc/e-source-selector.h" #include "widgets/misc/e-info-label.h" -#include "widgets/misc/e-error.h" #include "e-util/e-icon-factory.h" -#include "e-cal-popup.h" /* IDs for user creatable items */ #define CREATE_EVENT_ID "event" @@ -310,109 +308,133 @@ update_primary_task_selection (CalendarComponentView *component_view) /* Callbacks. */ static void -copy_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) +add_popup_menu_item (GtkMenu *menu, const char *label, const char *icon_name, + GCallback callback, gpointer user_data, gboolean sensitive) +{ + GtkWidget *item, *image; + GdkPixbuf *pixbuf; + + if (icon_name) { + item = gtk_image_menu_item_new_with_label (label); + + /* load the image */ + pixbuf = e_icon_factory_get_icon (icon_name, E_ICON_SIZE_MENU); + image = gtk_image_new_from_pixbuf (pixbuf); + + 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, CalendarComponentView *component_view) { - CalendarComponentView *component_view = data; ESource *selected_source; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; - copy_source_dialog (GTK_WINDOW (gtk_widget_get_toplevel (ep->target->widget)), selected_source, E_CAL_SOURCE_TYPE_EVENT); + copy_source_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget)), selected_source, E_CAL_SOURCE_TYPE_EVENT); } static void -delete_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) +delete_calendar_cb (GtkWidget *widget, CalendarComponentView *component_view) { - CalendarComponentView *component_view = data; ESource *selected_source; - ECal *cal; - char *uri; + GtkWidget *dialog; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; - if (e_error_run((GtkWindow *)gtk_widget_get_toplevel(ep->target->widget), - "calendar:prompt-delete-calendar", e_source_peek_name(selected_source)) != GTK_RESPONSE_YES) - return; - - /* first, ask the backend to remove the calendar */ - uri = e_source_get_uri (selected_source); - cal = e_cal_model_get_client_for_uri (gnome_calendar_get_calendar_model (component_view->calendar), uri); - if (!cal) - cal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_EVENT); - g_free (uri); - if (cal) { - if (e_cal_remove (cal, NULL)) { - if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (component_view->source_selector), - selected_source)) { - gnome_calendar_remove_source (component_view->calendar, E_CAL_SOURCE_TYPE_EVENT, selected_source); - e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), - selected_source); + /* 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) { + ECal *cal; + char *uri; + + /* first, ask the backend to remove the calendar */ + uri = e_source_get_uri (selected_source); + cal = e_cal_model_get_client_for_uri (gnome_calendar_get_calendar_model (component_view->calendar), uri); + if (!cal) + cal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_EVENT); + g_free (uri); + if (cal) { + if (e_cal_remove (cal, NULL)) { + if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (component_view->source_selector), + selected_source)) { + gnome_calendar_remove_source (component_view->calendar, E_CAL_SOURCE_TYPE_EVENT, selected_source); + e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), + selected_source); + } + + e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); + e_source_list_sync (component_view->source_list, NULL); } - - e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); - e_source_list_sync (component_view->source_list, NULL); } } + + gtk_widget_destroy (dialog); } static void -new_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) +new_calendar_cb (GtkWidget *widget, CalendarComponentView *component_view) { - calendar_setup_new_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget))); + calendar_setup_new_calendar (GTK_WINDOW (gtk_widget_get_toplevel (widget))); } static void -edit_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) +edit_calendar_cb (GtkWidget *widget, CalendarComponentView *component_view) { - CalendarComponentView *component_view = data; ESource *selected_source; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; - calendar_setup_edit_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source); + calendar_setup_edit_calendar (GTK_WINDOW (gtk_widget_get_toplevel (widget)), selected_source); } -static EPopupItem ecc_source_popups[] = { - { E_POPUP_ITEM, "10.new", N_("New Calendar"), new_calendar_cb, NULL, "stock_calendar", 0, 0 }, - { E_POPUP_ITEM, "15.copy", N_("Copy"), copy_calendar_cb, NULL, "stock_folder-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY }, - { E_POPUP_ITEM, "20.delete", N_("Delete"), delete_calendar_cb, NULL, "stock_delete", 0, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY }, - { E_POPUP_ITEM, "30.properties", N_("Properties..."), edit_calendar_cb, NULL, NULL, 0, E_CAL_POPUP_SOURCE_PRIMARY }, -}; - static void -ecc_source_popup_free(EPopup *ep, GSList *list, void *data) -{ - g_slist_free(list); -} - -static gboolean -popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *event, CalendarComponentView *component_view) +fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, CalendarComponentView *component_view) { - ECalPopup *ep; - ECalPopupTargetSource *t; - GSList *menus = NULL; - int i; - GtkMenu *menu; - - ep = e_cal_popup_new("com.novell.evolution.calendar.source.popup"); - t = e_cal_popup_target_new_source(ep, selector); - t->target.widget = (GtkWidget *)component_view->calendar; - - for (i=0;ibutton:0, event?event->time:gtk_get_current_event_time()); + ESource *source; + gboolean sensitive, system; + const char *source_uri; + + source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); + sensitive = source ? TRUE : FALSE; - return TRUE; + /* FIXME Gross hack, should have a property or something */ + source_uri = e_source_peek_relative_uri (source); + system = source_uri && !strcmp ("system", source_uri); + + add_popup_menu_item (menu, _("New Calendar"), "stock_calendar", + G_CALLBACK (new_calendar_cb), component_view, TRUE); + add_popup_menu_item (menu, _("Copy"), "stock_folder-copy", + G_CALLBACK (copy_calendar_cb), component_view, sensitive); + add_popup_menu_item (menu, _("Delete"), "stock_delete", G_CALLBACK (delete_calendar_cb), component_view, sensitive && !system); + add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_calendar_cb), component_view, sensitive); } static void @@ -1035,7 +1057,7 @@ create_component_view (CalendarComponent *calendar_component) /* Create sidebar selector */ component_view->source_selector = e_source_selector_new (calendar_component->priv->source_list); - e_source_selector_set_select_new ((ESourceSelector *)component_view->source_selector, TRUE); + e_source_selector_set_select_new (component_view->source_selector, TRUE); g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), calendar_component); @@ -1102,8 +1124,8 @@ create_component_view (CalendarComponent *calendar_component) G_CALLBACK (source_selection_changed_cb), component_view); g_signal_connect (component_view->source_selector, "primary_selection_changed", G_CALLBACK (primary_source_selection_changed_cb), component_view); - g_signal_connect (component_view->source_selector, "popup_event", - G_CALLBACK (popup_event_cb), component_view); + g_signal_connect (component_view->source_selector, "fill_popup_menu", + G_CALLBACK (fill_popup_menu_cb), component_view); /* Set up the "new" item handler */ component_view->creatable_items_handler = e_user_creatable_items_handler_new ("calendar", create_local_item_cb, calendar_component); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 7802fa5da1..cfb0f208f1 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -3935,7 +3935,7 @@ e_week_view_show_popup_menu (EWeekView *week_view, popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (week_view)); g_object_weak_ref (G_OBJECT (popup), popup_destroyed_cb, week_view); - gtk_menu_popup (popup, NULL, NULL, NULL, NULL, bevent?bevent->button:0, bevent?bevent->time:gtk_get_current_event_time()); + e_popup_menu (popup, (GdkEvent *) bevent); } static gboolean diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index f5ac1895d7..b8c97d5040 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -47,7 +47,6 @@ #include #include #include -#include #include "widgets/menus/gal-view-menus.h" #include "widgets/misc/e-error.h" #include "e-comp-editor-registry.h" @@ -78,7 +77,6 @@ #include "misc.h" #include "ea-calendar.h" #include "common/authentication.h" -#include "e-cal-popup.h" /* FIXME glib 2.4 and above has this */ #ifndef G_MAXINT32 @@ -1984,137 +1982,36 @@ gnome_calendar_discard_view_menus (GnomeCalendar *gcal) priv->view_menus = NULL; } -/* This is copied/moved from gal-view-instance, only the calendar uses this for a popup menu */ -static void -gc_set_view(EPopup *ep, EPopupItem *pitem, void *data) -{ - GnomeCalendar *gcal = data; - - if (pitem->type & E_POPUP_ACTIVE) - gal_view_instance_set_current_view_id(gcal->priv->view_instance, (char *)pitem->user_data); -} - -static void -gc_save_custom_view(EPopup *ep, EPopupItem *pitem, void *data) -{ - GnomeCalendar *gcal = data; - - gal_view_instance_save_as(gcal->priv->view_instance); -} - -static void -gc_define_views_response(GtkWidget *d, int id, GnomeCalendar *gcal) +EPopupMenu * +gnome_calendar_setup_view_popup (GnomeCalendar *gcal) { - if (id == GTK_RESPONSE_OK) - gal_view_collection_save(gcal->priv->view_instance->collection); - - gtk_widget_destroy(d); -} - -static void -gc_define_views(EPopup *ep, EPopupItem *pitem, void *data) -{ - GnomeCalendar *gcal = data; - GtkWidget *dialog = gal_define_views_dialog_new(gcal->priv->view_instance->collection); - - g_signal_connect(dialog, "response", G_CALLBACK(gc_define_views_response), data); - gtk_widget_show(dialog); -} + GnomeCalendarPrivate *priv; -static EPopupItem gc_popups[] = { - /* Code generates the path to fit */ - { E_POPUP_BAR, NULL }, - { E_POPUP_RADIO|E_POPUP_ACTIVE, NULL, N_("Custom View"), }, - { E_POPUP_ITEM, NULL, N_("Save Custom View"), gc_save_custom_view }, + g_return_val_if_fail (gcal != NULL, NULL); + g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - /* index == 3, when we have non-custom view */ + priv = gcal->priv; - { E_POPUP_BAR, NULL }, - { E_POPUP_ITEM, NULL, N_("Define Views..."), gc_define_views }, -}; + g_return_val_if_fail (priv->view_instance != NULL, NULL); -static void -gc_popup_free (EPopup *ep, GSList *list, void *data) -{ - while (list) { - GSList *n = list->next; - EPopupItem *pitem = list->data; - - g_free(pitem->path); - g_free(pitem->label); - g_free(pitem->user_data); - g_free(pitem); - g_slist_free_1(list); - list = n; - } + return gal_view_instance_get_popup_menu (priv->view_instance); } -static void -gc_popup_free_static (EPopup *ep, GSList *list, void *data) +void +gnome_calendar_discard_view_popup (GnomeCalendar *gcal, EPopupMenu *popup) { - while (list) { - GSList *n = list->next; - EPopupItem *pitem = list->data; - g_free(pitem->path); - g_free(pitem); - g_slist_free_1(list); - list = n; - } -} -void -gnome_calendar_view_popup_factory (GnomeCalendar *gcal, EPopup *ep, const char *prefix) -{ GnomeCalendarPrivate *priv; - int length; - int i; - gboolean found = FALSE; - char *id; - GSList *menus = NULL; - EPopupItem *pitem; g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - g_return_if_fail (prefix != NULL); priv = gcal->priv; g_return_if_fail (priv->view_instance != NULL); - length = gal_view_collection_get_count(priv->view_instance->collection); - id = gal_view_instance_get_current_view_id (priv->view_instance); - - for (i = 0; i < length; i++) { - GalViewCollectionItem *item = gal_view_collection_get_view_item(priv->view_instance->collection, i); - - pitem = g_malloc0(sizeof(*pitem)); - pitem->type = E_POPUP_RADIO; - pitem->path = g_strdup_printf("%s/%02d.item", prefix, i); - pitem->label = g_strdup(item->title); - pitem->activate = gc_set_view; - pitem->user_data = g_strdup(item->id); - - if (!found && id && !strcmp (id, item->id)) { - found = TRUE; - pitem->type |= E_POPUP_ACTIVE; - } - - menus = g_slist_prepend(menus, pitem); - } - - if (menus) - e_popup_add_items(ep, menus, gc_popup_free, gcal); - - menus = NULL; - for (i = found?3:0; ipath = g_strdup_printf("%s/%02d.item", prefix, i+length); - menus = g_slist_prepend(menus, pitem); - } - - e_popup_add_items(ep, menus, gc_popup_free_static, gcal); + gal_view_instance_free_popup_menu (priv->view_instance, popup); } static void diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 9679cdcb45..b7309a21e8 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -1137,6 +1138,8 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, SoupMessage *msg; SoupUri *real_uri; char *ical_string; + char *prompt; + gboolean remember = FALSE; toplevel = e_cal_util_new_top_level (); icalcomponent_set_method (toplevel, ICAL_METHOD_PUBLISH); diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c index de43d4bb5f..fa1b4bdeeb 100644 --- a/calendar/gui/migration.c +++ b/calendar/gui/migration.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index d5455468eb..a817ca8546 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -40,7 +40,6 @@ #include "migration.h" #include "comp-util.h" #include "calendar-config.h" -#include "e-cal-popup.h" #include "common/authentication.h" #include "dialogs/calendar-setup.h" #include "dialogs/comp-editor.h" @@ -48,7 +47,6 @@ #include "dialogs/task-editor.h" #include "widgets/misc/e-source-selector.h" #include "widgets/misc/e-info-label.h" -#include "widgets/misc/e-error.h" #include "e-util/e-icon-factory.h" #define CREATE_TASK_ID "task" @@ -254,111 +252,137 @@ update_primary_selection (TasksComponentView *component_view) /* Callbacks. */ static void -copy_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data) +add_popup_menu_item (GtkMenu *menu, const char *label, const char *icon_name, + GCallback callback, gpointer user_data, gboolean sensitive) +{ + GtkWidget *item, *image; + GdkPixbuf *pixbuf; + + if (icon_name) { + item = gtk_image_menu_item_new_with_label (label); + + /* load the image */ + pixbuf = e_icon_factory_get_icon (icon_name, E_ICON_SIZE_MENU); + image = gtk_image_new_from_pixbuf (pixbuf); + + 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, TasksComponentView *component_view) { - TasksComponentView *component_view = data; ESource *selected_source; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; - copy_source_dialog (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source, E_CAL_SOURCE_TYPE_TODO); + copy_source_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget)), selected_source, E_CAL_SOURCE_TYPE_TODO); } static void -delete_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data) +delete_task_list_cb (GtkWidget *widget, TasksComponentView *component_view) { - TasksComponentView *component_view = data; ESource *selected_source; - ECal *cal; - char *uri; + GtkWidget *dialog; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; - if (e_error_run((GtkWindow *)gtk_widget_get_toplevel(ep->target->widget), - "calendar:prompt-delete-task-list", e_source_peek_name(selected_source)) != GTK_RESPONSE_YES) - return; - - /* first, ask the backend to remove the task list */ - uri = e_source_get_uri (selected_source); - cal = e_cal_model_get_client_for_uri ( - e_calendar_table_get_model (E_CALENDAR_TABLE (e_tasks_get_calendar_table (component_view->tasks))), - uri); - if (!cal) - cal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_TODO); - g_free (uri); - if (cal) { - if (e_cal_remove (cal, NULL)) { - if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (component_view->source_selector), - selected_source)) { - e_tasks_remove_todo_source (component_view->tasks, selected_source); - e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), - selected_source); + /* 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) { + ECal *cal; + char *uri; + + /* first, ask the backend to remove the task list */ + uri = e_source_get_uri (selected_source); + cal = e_cal_model_get_client_for_uri ( + e_calendar_table_get_model (E_CALENDAR_TABLE (e_tasks_get_calendar_table (component_view->tasks))), + uri); + if (!cal) + cal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_TODO); + g_free (uri); + if (cal) { + if (e_cal_remove (cal, NULL)) { + if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (component_view->source_selector), + selected_source)) { + e_tasks_remove_todo_source (component_view->tasks, selected_source); + e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), + selected_source); + } + + e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); + e_source_list_sync (component_view->source_list, NULL); } - - e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); - e_source_list_sync (component_view->source_list, NULL); } } + + gtk_widget_destroy (dialog); } static void -new_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data) +new_task_list_cb (GtkWidget *widget, TasksComponentView *component_view) { - calendar_setup_new_task_list (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget))); + calendar_setup_new_task_list (GTK_WINDOW (gtk_widget_get_toplevel (widget))); } static void -edit_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data) +edit_task_list_cb (GtkWidget *widget, TasksComponentView *component_view) { - TasksComponentView *component_view = data; ESource *selected_source; selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; - calendar_setup_edit_task_list (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source); + calendar_setup_edit_task_list (GTK_WINDOW (gtk_widget_get_toplevel (widget)), selected_source); } -static EPopupItem etc_source_popups[] = { - { E_POPUP_ITEM, "10.new", N_("New Task List"), new_task_list_cb, NULL, "stock_todo", 0, 0 }, - { E_POPUP_ITEM, "15.copy", N_("Copy"), copy_task_list_cb, NULL, "stock_folder-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY }, - { E_POPUP_ITEM, "20.delete", N_("Delete"), delete_task_list_cb, NULL, "stock_delete", 0, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY }, - { E_POPUP_ITEM, "30.properties", N_("Properties..."), edit_task_list_cb, NULL, NULL, 0, E_CAL_POPUP_SOURCE_PRIMARY }, -}; - static void -etc_source_popup_free(EPopup *ep, GSList *list, void *data) +fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, TasksComponentView *component_view) { - g_slist_free(list); -} - -static gboolean -popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *event, TasksComponentView *component_view) -{ - ECalPopup *ep; - ECalPopupTargetSource *t; - GSList *menus = NULL; - int i; - GtkMenu *menu; - - ep = e_cal_popup_new("com.novell.evolution.tasks.source.popup"); - t = e_cal_popup_target_new_source(ep, selector); - t->target.widget = (GtkWidget *)component_view->tasks; - - for (i=0;ibutton:0, event?event->time:gtk_get_current_event_time()); - - return TRUE; + ESource *source; + gboolean sensitive, system; + const char *source_uri; + + source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); + sensitive = source ? TRUE : FALSE; + + /* FIXME Gross hack, should have a property or something */ + source_uri = e_source_peek_relative_uri (source); + system = source_uri && !strcmp ("system", source_uri); + + add_popup_menu_item (menu, _("New Task List"), "stock_todo", + G_CALLBACK (new_task_list_cb), component_view, TRUE); + add_popup_menu_item (menu, _("Copy"), "stock_folder-copy", + G_CALLBACK (copy_task_list_cb), component_view, sensitive); + add_popup_menu_item (menu, _("Delete"), "stock_delete", G_CALLBACK (delete_task_list_cb), + component_view, sensitive && !system); + add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_task_list_cb), + component_view, sensitive); } static void @@ -843,7 +867,7 @@ create_component_view (TasksComponent *tasks_component) /* Create sidebar selector */ component_view->source_selector = e_source_selector_new (tasks_component->priv->source_list); - e_source_selector_set_select_new ((ESourceSelector *)component_view->source_selector, TRUE); + e_source_selector_set_select_new (component_view->source_selector, TRUE); g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), tasks_component); @@ -912,8 +936,8 @@ create_component_view (TasksComponent *tasks_component) G_CALLBACK (source_selection_changed_cb), component_view); g_signal_connect (component_view->source_selector, "primary_selection_changed", G_CALLBACK (primary_source_selection_changed_cb), component_view); - g_signal_connect (component_view->source_selector, "popup_event", - G_CALLBACK (popup_event_cb), component_view); + g_signal_connect (component_view->source_selector, "fill_popup_menu", + G_CALLBACK (fill_popup_menu_cb), component_view); /* Set up the "new" item handler */ component_view->creatable_items_handler = e_user_creatable_items_handler_new ("tasks", create_local_item_cb, tasks_component); diff --git a/camel/ChangeLog b/camel/ChangeLog index 3f75ad95c9..e677210378 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -42,22 +42,6 @@ EAI_AGAIN, it doesn't appear to mean the same as EAGAIN does with system calls (i guess 'no shit sherlock' really). -2004-10-04 JP Rosevear - - * providers/imap4/camel-imap4-provider.c: include camel-i18n.h - -2004-10-01 Jeffrey Stedfast - - * providers/imap4/camel-imap4-folder.c (imap4_sync): If we aren't - online, we're done. nothing to do. - (imap4_refresh_info): Same. - (imap4_append_message): Same but set an exception. - (imap4_transfer_messages_to): Same. - - * camel-service.c (camel_getaddrinfo): Avoid assigning a value to - the member of a const struct (which newer gcc's apparently break - over) by casting to non-const. - 2004-09-28 Not Zed ** See bug #66509. @@ -101,7 +85,7 @@ * camel-vee-store.c: * camel-vee-folder.c: move the unmatched folder onto the camel-vee-store object. Removede the global - unmatched folder and associated locks/etc, fixed all the code up + unmatched folder and associated locks/etc, fixed all the code up to work with the new unmatched folder, if present. 2004-09-27 Not Zed @@ -127,24 +111,6 @@ (spool_get_meta_path): implement, this needs to work differnetly to the parent classes implementations :-/. -2004-09-22 Jeffrey Stedfast - - * providers/imap/camel-imap-store.c (connect_to_server): Instead - of doing a host-lookup ourselves, get it passed in to us as an - argument. Also simplified a bit (try_starttls is no longer an - option). - (connect_to_server_wrapper): Simplified (we no longer have - fallback cases for SSL stuff). Also, perform host lookup here. - - * providers/imap4/camel-imap4-store.c: Same changes as above. - - * providers/pop3/camel-pop3-store.c: Same. - - * providers/smtp/camel-smtp-transport.c: Same. Other changes - include making the code consistant with the other providers. - - * providers/nntp/camel-nntp-store.c: Same as pop/imap. - 2004-09-21 Not Zed ** See bug #63521. @@ -229,12 +195,6 @@ * camel-http-stream.c: turn off debug. -2004-09-08 Hannah & Fazlu - - Fixes Bug#61088 - - * camel/camel-smime-context.c: Change of strings. - 2004-09-15 Not Zed ** See bug #0xffff. @@ -555,60 +515,6 @@ CAMEL_GROUPWISE_CFLAGS. (libcamelgroupwise_la_LIBADD): use CAMEL_GROUPWISE_LIBS. -2004-09-07 Not Zed - - * providers/groupwise/camel-groupwise-provider.c: put the options - in their own section. - -2004-09-06 Not Zed - - * camel-search-private.c (utf8_get): remove this, and make the - code use camel_utf8_getc instead. Quite a bit faster esp if - optimising with inlines. - - * camel-object.c (check_magic_fail): change the check_magic code - to mostly run from a macro, its worth it. - -2004-09-04 Not Zed - - * providers/local/camel-mbox-summary.c (message_info_new): fix - cast issue. - - * providers/pop3/camel-pop3-engine.c (get_capabilities): remove - some unused variables. - - * camel-object.h: remove camel-i18n.h, fixed all c files where - appropriate. - -2004-08-25 Not Zed - - * camel-list-utils.[ch]: Copied e_dlist* stuff to here, part of - removing e-util dependency on camel. - -2004-08-05 Not Zed - - * providers/local/camel-local-provider.c: same. - - * providers/imap/camel-imap-provider.c: put the extra stuff into a - 'general' section. - - * providers/imapp/camel-imapp-provider.c: same. - - * providers/pop3/camel-pop3-provider.c: make sure each section - start has a name. - -2004-08-03 Not Zed - - * camel-url.c (camel_url_set_param): when clearing a param, use - remove_data instead of set_data_full. craptatious glib at it - again. - - * providers/nntp/camel-nntp-provider.c: turn on ssl option. - -2004-07-07 Not Zed - - * camel-folder.c: removed filter-rule.h ugh. - 2004-07-02 Christian Neumair * camel-smime-context.c: s/Can't/Cannot/. diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c index dfb88b84ed..cd26c3c390 100644 --- a/camel/camel-filter-driver.c +++ b/camel/camel-filter-driver.c @@ -44,8 +44,8 @@ #include "camel-stream-fs.h" #include "camel-stream-mem.h" #include "camel-mime-message.h" + #include "camel-debug.h" -#include "camel-i18n.h" #include "e-util/e-sexp.h" #include "e-util/e-memory.h" diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index b7578ba887..9dde9dd848 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -45,7 +45,6 @@ #include "camel-stream-mem.h" #include "e-util/e-memory.h" #include "camel-search-private.h" -#include "camel-i18n.h" #define d(x) #define r(x) diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c index 619d3dc33a..9684bf25e6 100644 --- a/camel/camel-movemail.c +++ b/camel/camel-movemail.c @@ -42,11 +42,12 @@ #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" -#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c index b526ff47e7..91bbcda705 100644 --- a/camel/camel-sasl-digest-md5.c +++ b/camel/camel-sasl-digest-md5.c @@ -37,7 +37,6 @@ #include "camel-charset-map.h" #include "camel-mime-utils.h" #include "camel-sasl-digest-md5.h" -#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c index 29724078b1..1efbefee16 100644 --- a/camel/camel-sasl-gssapi.c +++ b/camel/camel-sasl-gssapi.c @@ -204,6 +204,7 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex) 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; diff --git a/camel/camel-service.c b/camel/camel-service.c index b916d5c05a..a4e27259f2 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -38,6 +38,7 @@ #include #include "e-util/e-msgport.h" + #include "e-util/e-host-utils.h" #include "camel-service.h" @@ -45,7 +46,6 @@ #include "camel-exception.h" #include "camel-operation.h" #include "camel-private.h" -#include "camel-i18n.h" #define d(x) #define w(x) @@ -896,7 +896,7 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo * else memcpy (&myhints, hints, sizeof (myhints)); - myhints.ai_family = AF_INET; + myhints.ai_faimily = AF_INET; hints = &myhints; #endif @@ -917,7 +917,7 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo * cs_freeinfo(msg); } else res = NULL; - + camel_operation_end(NULL); return res; diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c index 19c534beff..39bf89d468 100644 --- a/camel/camel-tcp-stream-ssl.c +++ b/camel/camel-tcp-stream-ssl.c @@ -61,7 +61,6 @@ #include "camel-session.h" #include "camel-certdb.h" #include "camel-operation.h" -#include "camel-i18n.h" /* from md5-utils.h */ void md5_get_digest (const char *buffer, int buffer_size, unsigned char digest[16]); diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c index 34211a48aa..d7c29eefb4 100644 --- a/camel/camel-vee-folder.c +++ b/camel/camel-vee-folder.c @@ -38,7 +38,6 @@ #include "camel-vee-store.h" /* for open flags */ #include "camel-private.h" #include "camel-debug.h" -#include "camel-i18n.h" #include "e-util/md5-utils.h" diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c index 90c6ee1f95..b562ad4a60 100644 --- a/camel/camel-vee-store.c +++ b/camel/camel-vee-store.c @@ -27,7 +27,6 @@ #include "camel-vee-folder.h" #include "camel-private.h" -#include "camel-i18n.h" #include diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index bc89bae55b..c0c0bcc8a2 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -24,6 +24,7 @@ * */ + #ifdef HAVE_CONFIG_H #include #endif @@ -58,10 +59,11 @@ #include "camel-sasl.h" #include "camel-utf8.h" #include "camel-string-utils.h" + #include "camel-imap-private.h" #include "camel-private.h" + #include "camel-debug.h" -#include "camel-i18n.h" #define d(x) @@ -503,52 +505,76 @@ imap_get_capability (CamelService *service, CamelException *ex) } enum { - MODE_CLEAR, - MODE_SSL, - MODE_TLS, + 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, struct addrinfo *ai, int ssl_mode, CamelException *ex) +connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex) { CamelImapStore *store = (CamelImapStore *) service; CamelImapResponse *response; CamelStream *tcp_stream; CamelSockOptData sockopt; gboolean force_imap4 = FALSE; - int clean_quit, ret; + int clean_quit; + int ret; char *buf; + struct addrinfo *ai, hints = { 0 }; + char *serv; + + /* FIXME: this connect stuff is duplicated everywhere */ + + if (service->url->port) { + serv = g_alloca(16); + sprintf(serv, "%d", service->url->port); + } else + serv = "imap"; - if (ssl_mode != MODE_CLEAR) { + if (ssl_mode != USE_SSL_NEVER) { #ifdef HAVE_SSL - if (ssl_mode == MODE_TLS) { - tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, STARTTLS_FLAGS); + if (try_starttls) { + tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS); } else { + if (service->url->port == 0) + serv = "imaps"; tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS); } #else - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not connect to %s: %s"), - service->url->host, _("SSL unavailable")); + if (!try_starttls && service->url->port == 0) + serv = "imaps"; + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, + _("SSL unavailable")); return FALSE; #endif /* HAVE_SSL */ } else { tcp_stream = camel_tcp_stream_raw_new (); } + + hints.ai_socktype = SOCK_STREAM; + ai = camel_getaddrinfo(service->url->host, serv, &hints, ex); + if (ai == NULL) { + camel_object_unref(tcp_stream); + return FALSE; + } - if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) { + ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai); + camel_freeaddrinfo(ai); + 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: %s"), - service->url->host, - g_strerror (errno)); + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, g_strerror (errno)); camel_object_unref (tcp_stream); @@ -643,18 +669,32 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam store->server_level = IMAP_LEVEL_IMAP4; } - if (ssl_mode != MODE_TLS) { - /* we're done */ - return TRUE; +#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 */ - if (!(store->capabilities & IMAP_CAPABILITY_STARTTLS)) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to connect to IMAP server %s in secure mode: %s"), - service->url->host, _("STARTTLS not supported")); - - goto exception; - } + 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; @@ -719,6 +759,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam store->connected = FALSE; return FALSE; +#endif /* HAVE_SSL */ } static gboolean @@ -866,54 +907,60 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio static struct { char *value; - char *serv; int mode; } ssl_options[] = { - { "", "imaps", MODE_SSL }, /* really old (1.x) */ - { "always", "imaps", MODE_SSL }, - { "when-possible", "imap", MODE_TLS }, - { "never", "imap", MODE_CLEAR }, - { NULL, "imap", MODE_CLEAR }, + { "", 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, *ssl_mode; - struct addrinfo hints, *ai; - int mode, ret, i; - char *serv; - - if ((command = camel_url_get_param (service->url, "command"))) + 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); - - if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) { + +#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, ssl_mode)) + if (!strcmp (ssl_options[i].value, use_ssl)) break; - mode = ssl_options[i].mode; - serv = ssl_options[i].serv; + 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 { - mode = MODE_CLEAR; - serv = "imap"; + /* User doesn't care about SSL */ + return connect_to_server (service, ssl_mode, FALSE, ex); } - - if (service->url->port) { - serv = g_alloca (16); - sprintf (serv, "%d", service->url->port); - } - - memset (&hints, 0, sizeof (hints)); - hints.ai_socktype = SOCK_STREAM; - hints.ai_family = PF_UNSPEC; - if (!(ai = camel_getaddrinfo (service->url->host, serv, &hints, ex))) - return FALSE; - - ret = connect_to_server (service, ai, mode, ex); - - camel_freeaddrinfo (ai); - - return ret; +#else + return connect_to_server (service, USE_SSL_NEVER, FALSE, ex); +#endif } extern CamelServiceAuthType camel_imap_password_authtype; diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c index 00ba0d00ce..2176c91cc6 100644 --- a/camel/providers/imapp/camel-imapp-store.c +++ b/camel/providers/imapp/camel-imapp-store.c @@ -48,7 +48,6 @@ #ifdef HAVE_SSL #include "camel/camel-tcp-stream-ssl.h" #endif -#include "camel/camel-i18n.h" #include "camel-imapp-store-summary.h" #include "camel-imapp-store.h" diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c index 70673d9687..b86d23221a 100644 --- a/camel/providers/local/camel-local-folder.c +++ b/camel/providers/local/camel-local-folder.c @@ -20,6 +20,7 @@ * */ + #ifdef HAVE_CONFIG_H #include #endif @@ -47,7 +48,6 @@ #include "camel-stream-filter.h" #include "camel-mime-filter-from.h" #include "camel-exception.h" -#include "camel-i18n.h" #include "camel-local-private.h" diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c index 669e636527..ba42b75f28 100644 --- a/camel/providers/local/camel-maildir-folder.c +++ b/camel/providers/local/camel-maildir-folder.c @@ -39,7 +39,6 @@ #include "camel-data-wrapper.h" #include "camel-mime-message.h" #include "camel-exception.h" -#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c index b4926b9b04..fa8f0b645d 100644 --- a/camel/providers/local/camel-mbox-folder.c +++ b/camel/providers/local/camel-mbox-folder.c @@ -42,7 +42,6 @@ #include "camel-stream-filter.h" #include "camel-mime-filter-from.h" #include "camel-exception.h" -#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c index f98c87a8ea..1277407dbb 100644 --- a/camel/providers/local/camel-mbox-store.c +++ b/camel/providers/local/camel-mbox-store.c @@ -37,7 +37,6 @@ #include "camel-text-index.h" #include "camel-exception.h" #include "camel-url.h" -#include "camel-i18n.h" #define d(x) diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c index fd054933c5..78456b6daf 100644 --- a/camel/providers/local/camel-mh-folder.c +++ b/camel/providers/local/camel-mh-folder.c @@ -39,7 +39,6 @@ #include "camel-data-wrapper.h" #include "camel-mime-message.h" #include "camel-exception.h" -#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c index b9cb643189..6a1bbf798a 100644 --- a/camel/providers/local/camel-spool-folder.c +++ b/camel/providers/local/camel-spool-folder.c @@ -44,8 +44,8 @@ #include "camel-session.h" #include "camel-file-utils.h" #include "camel-lock-client.h" + #include "camel-local-private.h" -#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c index 3dc21886c8..2e3d9ea777 100644 --- a/camel/providers/local/camel-spool-store.c +++ b/camel/providers/local/camel-spool-store.c @@ -41,7 +41,6 @@ #include "camel-exception.h" #include "camel-url.h" #include "camel-private.h" -#include "camel-i18n.h" #define d(x) diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c index 7f06555b43..ffb1b29742 100644 --- a/camel/providers/nntp/camel-nntp-folder.c +++ b/camel/providers/nntp/camel-nntp-folder.c @@ -49,7 +49,6 @@ #include "camel/camel-multipart.h" #include "camel/camel-mime-part.h" #include "camel/camel-stream-buffer.h" -#include "camel/camel-i18n.h" #include "camel/camel-private.h" #include "camel-nntp-summary.h" diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 1d4f43cc52..5813a965ff 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -52,7 +52,6 @@ #include "camel-nntp-folder.h" #include "camel-nntp-private.h" #include "camel-nntp-resp-codes.h" -#include "camel-i18n.h" #define w(x) extern int camel_verbose_debug; @@ -82,6 +81,12 @@ nntp_can_work_offline(CamelDiscoStore *store) return TRUE; } +enum { + USE_SSL_NEVER, + USE_SSL_ALWAYS, + USE_SSL_WHEN_POSSIBLE +}; + static struct { const char *name; int type; @@ -148,17 +153,8 @@ xover_setup(CamelNNTPStore *store, CamelException *ex) return ret; } -enum { - MODE_CLEAR, - MODE_SSL, - MODE_TLS, -}; - -#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, struct addrinfo *ai, int ssl_mode, CamelException *ex) +connect_to_server (CamelService *service, int ssl_mode, CamelException *ex) { CamelNNTPStore *store = (CamelNNTPStore *) service; CamelDiscoStore *disco_store = (CamelDiscoStore*) service; @@ -168,6 +164,8 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam unsigned int len; int ret; char *path; + struct addrinfo *ai, hints = { 0 }; + char *serv; CAMEL_SERVICE_LOCK(store, connect_lock); @@ -184,34 +182,42 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam camel_data_cache_set_expire_age (store->cache, 60*60*24*14); camel_data_cache_set_expire_access (store->cache, 60*60*24*5); } + + if (service->url->port) { + serv = g_alloca(16); + sprintf(serv, "%d", service->url->port); + } else + serv = "nntp"; - if (ssl_mode != MODE_CLEAR) { #ifdef HAVE_SSL - if (ssl_mode == MODE_TLS) { - tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, STARTTLS_FLAGS); - } else { - tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS); - } -#else - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not connect to %s: %s"), - service->url->host, _("SSL unavailable")); - - goto fail; -#endif /* HAVE_SSL */ + if (ssl_mode != USE_SSL_NEVER) { + if (service->url->port == 0) + serv = "nntps"; + 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 */ + + hints.ai_socktype = SOCK_STREAM; + ai = camel_getaddrinfo(service->url->host, serv, &hints, ex); + if (ai == NULL) { + camel_object_unref(tcp_stream); + goto fail; + } - if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) { + ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai); + camel_freeaddrinfo(ai); + 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: %s"), - service->url->host, - g_strerror (errno)); + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, g_strerror (errno)); camel_object_unref (tcp_stream); @@ -273,51 +279,54 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam static struct { char *value; - char *serv; int mode; } ssl_options[] = { - { "", "nntps", MODE_SSL }, /* really old (1.x) */ - { "always", "nntps", MODE_SSL }, - { "when-possible", "nntp", MODE_TLS }, - { "never", "nntp", MODE_CLEAR }, - { NULL, "nntp", MODE_CLEAR }, + { "", 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_online (CamelService *service, CamelException *ex) { - struct addrinfo hints, *ai; - const char *ssl_mode; - int mode, ret, i; - char *serv; +#ifdef HAVE_SSL + const char *use_ssl; + int i, ssl_mode; - if ((ssl_mode = camel_url_get_param (service->url, "use_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, ssl_mode)) + if (!strcmp (ssl_options[i].value, use_ssl)) break; - mode = ssl_options[i].mode; - serv = ssl_options[i].serv; + 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 { - mode = MODE_CLEAR; - serv = "nntp"; - } - - if (service->url->port) { - serv = g_alloca (16); - sprintf (serv, "%d", service->url->port); + /* User doesn't care about SSL */ + return connect_to_server (service, ssl_mode, ex); } - - memset (&hints, 0, sizeof (hints)); - hints.ai_socktype = SOCK_STREAM; - hints.ai_family = PF_UNSPEC; - if (!(ai = camel_getaddrinfo (service->url->host, serv, &hints, ex))) - return FALSE; - - ret = connect_to_server (service, ai, mode, ex); - - camel_freeaddrinfo (ai); - - return ret; +#else + return connect_to_server (service, USE_SSL_NEVER, ex); +#endif } static gboolean diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 1c7b9d025d..52d3d1a831 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -54,7 +54,6 @@ #ifdef HAVE_SSL #include "camel-tcp-stream-ssl.h" #endif -#include "camel-i18n.h" /* Specified in RFC 1939 */ #define POP3_PORT 110 @@ -135,16 +134,16 @@ finalize (CamelObject *object) } enum { - MODE_CLEAR, - MODE_SSL, - MODE_TLS, + 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, struct addrinfo *ai, int ssl_mode, CamelException *ex) +connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex) { CamelPOP3Store *store = CAMEL_POP3_STORE (service); CamelStream *tcp_stream; @@ -152,34 +151,56 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam guint32 flags = 0; int clean_quit; int ret; - - if (ssl_mode != MODE_CLEAR) { + struct addrinfo *ai, hints = { 0 }; + char *serv; + + if (service->url->port) { + serv = g_alloca(16); + sprintf(serv, "%d", service->url->port); + } else + serv = "pop3"; + + if (ssl_mode != USE_SSL_NEVER) { #ifdef HAVE_SSL - if (ssl_mode == MODE_TLS) { - tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, STARTTLS_FLAGS); + if (try_starttls) { + tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS); } else { + if (service->url->port == 0) + serv = "pop3s"; tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS); } #else + if (!try_starttls && service->url->port == 0) + serv = "pop3s"; + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not connect to %s: %s"), - service->url->host, _("SSL unavailable")); + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, + _("SSL unavailable")); return FALSE; #endif /* HAVE_SSL */ } else { tcp_stream = camel_tcp_stream_raw_new (); } + + hints.ai_socktype = SOCK_STREAM; + ai = camel_getaddrinfo(service->url->host, serv, &hints, ex); + if (ai == NULL) { + camel_object_unref(tcp_stream); + return FALSE; + } - if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) { + ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai); + camel_freeaddrinfo(ai); + 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: %s"), - service->url->host, - g_strerror (errno)); + _("Could not connect to POP server %s (port %s): %s"), + service->url->host, serv, g_strerror (errno)); camel_object_unref (tcp_stream); @@ -197,24 +218,41 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam if (!(store->engine = camel_pop3_engine_new (tcp_stream, flags))) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to read a valid greeting from POP server %s"), - service->url->host); - + _("Failed to read a valid greeting from POP server %s (port %s)"), + service->url->host, serv); return FALSE; } - if (ssl_mode != MODE_TLS) { - camel_object_unref (tcp_stream); - return TRUE; +#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 */ - if (!(store->engine->capa & CAMEL_POP3_CAP_STLS)) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to connect to POP server %s in secure mode: %s"), - service->url->host, _("STLS not supported")); - goto stls_exception; - } + camel_object_unref (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; @@ -264,55 +302,59 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam store->engine = NULL; return FALSE; +#endif /* HAVE_SSL */ } static struct { char *value; - char *serv; int mode; } ssl_options[] = { - { "", "pop3s", MODE_SSL }, /* really old (1.x) */ - { "always", "pop3s", MODE_SSL }, - { "when-possible", "pop3", MODE_TLS }, - { "never", "pop3", MODE_CLEAR }, - { NULL, "pop3", MODE_CLEAR }, + { "", 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) { - struct addrinfo hints, *ai; - const char *ssl_mode; - int mode, ret, i; - char *serv; +#ifdef HAVE_SSL + const char *use_ssl; + int i, ssl_mode; - if ((ssl_mode = camel_url_get_param (service->url, "use_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, ssl_mode)) + if (!strcmp (ssl_options[i].value, use_ssl)) break; - mode = ssl_options[i].mode; - serv = ssl_options[i].serv; + 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 { - mode = MODE_CLEAR; - serv = "pop3"; + /* User doesn't care about SSL */ + return connect_to_server (service, ssl_mode, FALSE, ex); } - - if (service->url->port) { - serv = g_alloca (16); - sprintf (serv, "%d", service->url->port); - } - - memset (&hints, 0, sizeof (hints)); - hints.ai_socktype = SOCK_STREAM; - hints.ai_family = PF_UNSPEC; - if (!(ai = camel_getaddrinfo (service->url->host, serv, &hints, ex))) - return FALSE; - - ret = connect_to_server (service, ai, mode, ex); - - camel_freeaddrinfo (ai); - - return ret; +#else + return connect_to_server (service, USE_SSL_NEVER, FALSE, ex); +#endif } extern CamelServiceAuthType camel_pop3_password_authtype; diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index a6e555badf..fc313ed4d2 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -55,7 +55,7 @@ #include "camel-session.h" #include "camel-exception.h" #include "camel-sasl.h" -#include "camel-i18n.h" + extern int camel_verbose_debug; #define d(x) (camel_verbose_debug ? (x) : 0) @@ -145,7 +145,18 @@ 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 * @@ -217,56 +228,70 @@ smtp_error_string (int error) } } -enum { - MODE_CLEAR, - MODE_SSL, - MODE_TLS, -}; - #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, struct addrinfo *ai, int ssl_mode, CamelException *ex) +connect_to_server (CamelService *service, int try_starttls, CamelException *ex) { CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service); CamelStream *tcp_stream; char *respbuf = NULL; int ret; + struct addrinfo *ai, hints = { 0 }; + char *serv; if (!CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex)) return FALSE; /* set some smtp transport defaults */ - transport->flags = 0; + transport->flags &= CAMEL_SMTP_TRANSPORT_USE_SSL; /* reset all but ssl flags */ transport->authtypes = NULL; + + if (service->url->port) { + serv = g_alloca(16); + sprintf(serv, "%d", service->url->port); + } else + serv = "smtp"; - if (ssl_mode != MODE_CLEAR) { + if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL) { #ifdef HAVE_SSL - if (ssl_mode == MODE_TLS) { - tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, STARTTLS_FLAGS); + if (try_starttls) { + tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS); } else { + if (service->url->port == 0) + serv = "smtps"; tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS); } #else - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not connect to %s: %s"), - service->url->host, _("SSL unavailable")); + if (!try_starttls && service->url->port == 0) + serv = "smtps"; + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, + _("SSL unavailable")); + return FALSE; #endif /* HAVE_SSL */ } else { tcp_stream = camel_tcp_stream_raw_new (); } + + hints.ai_socktype = SOCK_STREAM; + ai = camel_getaddrinfo(service->url->host, serv, &hints, ex); + if (ai == NULL) { + camel_object_unref(tcp_stream); + return FALSE; + } - if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -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: %s"), - service->url->host, g_strerror (errno)); + ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai); + camel_freeaddrinfo(ai); + if (ret == -1) { + camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, + g_strerror (errno)); camel_object_unref (tcp_stream); @@ -310,19 +335,30 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam /* clear any EHLO/HELO exception and assume that any SMTP errors encountered were non-fatal */ camel_exception_clear (ex); - if (ssl_mode != MODE_TLS) { - /* we're done */ - return TRUE; +#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 */ - if (!(transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS)) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to connect to SMTP server %s in secure mode: %s"), - service->url->host, _("STARTTLS not supported")); - - goto exception_cleanup; - } + 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, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM, @@ -372,55 +408,38 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam transport->connected = FALSE; return FALSE; +#endif /* HAVE_SSL */ } -static struct { - char *value; - char *serv; - int mode; -} ssl_options[] = { - { "", "smtps", MODE_SSL }, /* really old (1.x) */ - { "always", "smtps", MODE_SSL }, - { "when-possible", "smtp", MODE_TLS }, - { "never", "smtp", MODE_CLEAR }, - { NULL, "smtp", MODE_CLEAR }, -}; - static gboolean connect_to_server_wrapper (CamelService *service, CamelException *ex) { - struct addrinfo hints, *ai; - const char *ssl_mode; - int mode, ret, i; - char *serv; +#ifdef HAVE_SSL + CamelSmtpTransport *transport = (CamelSmtpTransport *) service; - if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) { - for (i = 0; ssl_options[i].value; i++) - if (!strcmp (ssl_options[i].value, ssl_mode)) - break; - mode = ssl_options[i].mode; - serv = ssl_options[i].serv; + 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 { - mode = MODE_CLEAR; - serv = "smtp"; + /* User doesn't care about SSL */ + return connect_to_server (service, FALSE, ex); } - - if (service->url->port) { - serv = g_alloca (16); - sprintf (serv, "%d", service->url->port); - } - - memset (&hints, 0, sizeof (hints)); - hints.ai_socktype = SOCK_STREAM; - hints.ai_family = PF_UNSPEC; - if (!(ai = camel_getaddrinfo (service->url->host, serv, &hints, ex))) - return FALSE; - - ret = connect_to_server (service, ai, mode, ex); - - camel_freeaddrinfo (ai); - - return ret; +#else + return connect_to_server (service, FALSE, ex); +#endif } static gboolean diff --git a/camel/providers/smtp/camel-smtp-transport.h b/camel/providers/smtp/camel-smtp-transport.h index 7b5ad88f12..87fcafb58b 100644 --- a/camel/providers/smtp/camel-smtp-transport.h +++ b/camel/providers/smtp/camel-smtp-transport.h @@ -43,7 +43,13 @@ extern "C" { #define CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES (1 << 2) #define CAMEL_SMTP_TRANSPORT_STARTTLS (1 << 3) -#define CAMEL_SMTP_TRANSPORT_AUTH_EQUAL (1 << 4) /* set if we are using authtypes from a broken AUTH= */ +#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; 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/composer/ChangeLog b/composer/ChangeLog index a09bbbb640..8f45bf86a8 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -4,31 +4,10 @@ into the recipients list or else we end up free'ing them later when we shouldn't. Fixes bug #66703 -2004-10-06 Not Zed +2004-10-08 JP Rosevear - * e-msg-composer.c (drag_data_received): - * e-msg-composer-attachment-bar.c (emcab_popup): e-popup api changes. - -2004-10-01 JP Rosevear - - * e-msg-composer.c: uses GTKHTML_API_VERSION for the bonobo server - look up - -2004-10-01 Not Zed - - * e-msg-composer.c (create_composer): enable ask drop action and - hook onto drag motion. - (drag_motion): implement. - (drop_action): do the work here now. - (drag_data_received): popup a menu if the action is ask. - (drop_popup_copy, drop_popup_move, drop_popup_cancel): - (drop_popup_free): Popup callbacks. - -2004-09-30 Kjartan Maraas - - * e-msg-composer.c: (autosave_manager_start), - (autosave_manager_stop), (create_composer): Use non-deprecated - functions. + * mail-composer-errors.xml: remove acceleratoer from _Save Message + to not break string freeze 2004-08-17 Michael Meeks @@ -83,17 +62,6 @@ * e-msg-composer-attachment.c: include config.h. See #61395. -2004-09-04 Not Zed - - * e-msg-composer-*.c: include gnome-i18n.h if required. - -2004-08-30 Not Zed - - * e-msg-composer-attachment-bar.c (emcab_popup): em-popup based - popup menu to replace the gnome one. - (popup_menu_event): use new func above. - (button_press_event): ", some cleanup. - 2004-06-18 Not Zed ** Fix for #60387. diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 9d1dc1c347..5012637c67 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -70,7 +70,6 @@ #include #include -#include #include #include @@ -117,7 +116,6 @@ #include "mail/mail-ops.h" #include "mail/mail-mt.h" #include "mail/mail-session.h" -#include "mail/em-popup.h" #include "e-msg-composer.h" #include "e-msg-composer-attachment-bar.h" @@ -130,7 +128,7 @@ #include "Editor.h" #include "listener.h" -#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor:" GTKHTML_API_VERSION +#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor:3.1" #define d(x) x @@ -162,19 +160,6 @@ static GtkTargetEntry drop_types[] = { #define num_drop_types (sizeof (drop_types) / sizeof (drop_types[0])) -static struct { - char *target; - GdkAtom atom; - guint32 actions; -} drag_info[] = { - { "message/rfc822", 0, GDK_ACTION_COPY }, - { "x-uid-list", 0, GDK_ACTION_ASK|GDK_ACTION_MOVE|GDK_ACTION_COPY }, - { "text/uri-list", 0, GDK_ACTION_COPY }, - { "_NETSCAPE_URL", 0, GDK_ACTION_COPY }, - { "text/x-vcard", 0, GDK_ACTION_COPY }, - { "text/calendar", 0, GDK_ACTION_COPY }, -}; - static const char *emc_draft_format_names[] = { "pgp-sign", "pgp-encrypt", "smime-sign", "smime-encrypt" }; @@ -1458,14 +1443,14 @@ static void autosave_manager_start (AutosaveManager *am) { if (am->id == 0) - am->id = g_timeout_add (AUTOSAVE_INTERVAL, autosave_run, am); + am->id = gtk_timeout_add (AUTOSAVE_INTERVAL, autosave_run, am); } static void autosave_manager_stop (AutosaveManager *am) { if (am->id) { - g_source_remove (am->id); + gtk_timeout_remove (am->id); am->id = 0; } } @@ -2659,24 +2644,10 @@ attach_message(EMsgComposer *composer, CamelMimeMessage *msg) camel_object_unref(mime_part); } -struct _drop_data { - EMsgComposer *composer; - - GdkDragContext *context; - /* Only selection->data and selection->length are valid */ - GtkSelectionData *selection; - - guint32 action; - guint info; - guint time; - - unsigned int move:1; - unsigned int moved:1; - unsigned int aborted:1; -}; - static void -drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, GtkSelectionData *selection, guint info, guint time) +drag_data_received (EMsgComposer *composer, GdkDragContext *context, + int x, int y, GtkSelectionData *selection, + guint info, guint time) { char *tmp, *str, **urls; CamelMimePart *mime_part; @@ -2684,8 +2655,8 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk CamelURL *url; CamelMimeMessage *msg; char *content_type; - int i, success=FALSE, delete=FALSE; - + int i; + switch (info) { case DND_TYPE_MESSAGE_RFC822: d(printf ("dropping a message/rfc822\n")); @@ -2695,11 +2666,8 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_stream_reset (stream); msg = camel_mime_message_new (); - if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) { + if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) attach_message(composer, msg); - success = TRUE; - delete = action == GDK_ACTION_MOVE; - } camel_object_unref(msg); camel_object_unref(stream); @@ -2738,7 +2706,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk } g_free (urls); - success = TRUE; break; case DND_TYPE_TEXT_VCARD: case DND_TYPE_TEXT_CALENDAR: @@ -2756,7 +2723,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_object_unref (mime_part); g_free (content_type); - success = TRUE; break; case DND_TYPE_X_UID_LIST: { GPtrArray *uids; @@ -2821,8 +2787,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_object_unref(mime_part); camel_object_unref(mp); } - success = TRUE; - delete = action == GDK_ACTION_MOVE; fail: if (camel_exception_is_set(&ex)) { char *name; @@ -2848,117 +2812,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk d(printf ("dropping an unknown\n")); break; } - - printf("Drag finished, success %d delete %d\n", success, delete); - - gtk_drag_finish(context, success, delete, time); -} - -static void -drop_popup_copy(EPopup *ep, EPopupItem *item, void *data) -{ - struct _drop_data *m = data; - drop_action(m->composer, m->context, GDK_ACTION_COPY, m->selection, m->info, m->time); -} - -static void -drop_popup_move(EPopup *ep, EPopupItem *item, void *data) -{ - struct _drop_data *m = data; - drop_action(m->composer, m->context, GDK_ACTION_MOVE, m->selection, m->info, m->time); -} - -static void -drop_popup_cancel(EPopup *ep, EPopupItem *item, void *data) -{ - struct _drop_data *m = data; - gtk_drag_finish(m->context, FALSE, FALSE, m->time); -} - -static EPopupItem drop_popup_menu[] = { - { E_POPUP_ITEM, "00.emc.02", N_("_Copy"), drop_popup_copy, NULL, "stock_mail-copy", 0 }, - { E_POPUP_ITEM, "00.emc.03", N_("_Move"), drop_popup_move, NULL, "stock_mail-move", 0 }, - { E_POPUP_BAR, "10.emc" }, - { E_POPUP_ITEM, "99.emc.00", N_("Cancel _Drag"), drop_popup_cancel, NULL, NULL, 0 }, -}; - -static void -drop_popup_free(EPopup *ep, GSList *items, void *data) -{ - struct _drop_data *m = data; - - g_slist_free(items); - - g_object_unref(m->context); - g_object_unref(m->composer); - g_free(m->selection->data); - g_free(m->selection); - g_free(m); -} - -static void -drag_data_received (EMsgComposer *composer, GdkDragContext *context, - int x, int y, GtkSelectionData *selection, - guint info, guint time) -{ - if (selection->data == NULL || selection->length == -1) - return; - - if (context->action == GDK_ACTION_ASK) { - EMPopup *emp; - GSList *menus = NULL; - GtkMenu *menu; - int i; - struct _drop_data *m; - - m = g_malloc0(sizeof(*m)); - m->context = context; - g_object_ref(context); - m->composer = composer; - g_object_ref(composer); - m->action = context->action; - m->info = info; - m->time = time; - m->selection = g_malloc0(sizeof(*m->selection)); - m->selection->data = g_malloc(selection->length); - memcpy(m->selection->data, selection->data, selection->length); - m->selection->length = selection->length; - - emp = em_popup_new("com.ximian.mail.composer.popup.drop"); - for (i=0;iaction, selection, info, time); - } -} - -static gboolean -drag_motion(GObject *o, GdkDragContext *context, gint x, gint y, guint time, EMsgComposer *composer) -{ - GList *targets; - GdkDragAction action, actions = 0; - - for (targets = context->targets; targets; targets = targets->next) { - int i; - - for (i=0;idata == (void *)drag_info[i].atom) - actions |= drag_info[i].actions; - } - - actions &= context->actions; - action = context->suggested_action; - /* we default to copy */ - if (action == GDK_ACTION_ASK && (actions & (GDK_ACTION_MOVE|GDK_ACTION_COPY)) != (GDK_ACTION_MOVE|GDK_ACTION_COPY)) - action = GDK_ACTION_COPY; - - gdk_drag_status(context, action, time); - - return action != 0; } static void @@ -2967,10 +2820,6 @@ class_init (EMsgComposerClass *klass) GtkObjectClass *object_class; GtkWidgetClass *widget_class; GObjectClass *gobject_class; - int i; - - for (i=0;iattachment_expander_icon = gtk_image_new_from_pixbuf (attachment_pixbuf); gtk_misc_set_alignment (GTK_MISC (composer->attachment_expander_icon), 1, 0.5); gtk_widget_set_size_request (composer->attachment_expander_icon, 100, -1); - g_object_unref (attachment_pixbuf); + gdk_pixbuf_unref (attachment_pixbuf); gtk_box_pack_start (GTK_BOX (expander_hbox), composer->attachment_expander_label, TRUE, TRUE, 0); diff --git a/composer/mail-composer-errors.xml b/composer/mail-composer-errors.xml index 1a52225ca3..dc696a5f02 100644 --- a/composer/mail-composer-errors.xml +++ b/composer/mail-composer-errors.xml @@ -39,7 +39,7 @@ Closing this composer window will discard the message permanently, unless you choose to save the message in your Drafts folder. This will allow you to continue the message at a later date.