From 63ca694c5e258d4f90112697d58004e1496d4b21 Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 24 Sep 2004 18:16:46 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'EVOLUTION_2_0_1'. svn path=/tags/EVOLUTION_2_0_1/; revision=27371 --- ChangeLog | 51 +- NEWS | 168 + 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 | 70 +- addressbook/gui/widgets/e-addressbook-view.c | 8 +- addressbook/tools/evolution-addressbook-export.c | 2 +- calendar/ChangeLog | 48 +- camel/ChangeLog | 60 - camel/camel-sasl-digest-md5.c | 1 - camel/camel-service.c | 2 +- camel/camel-tcp-stream-ssl.c | 1 - camel/providers/imap/camel-imap-store.c | 4 +- camel/providers/imapp/camel-imapp-store.c | 37 +- camel/providers/local/camel-local-folder.c | 1 - camel/providers/nntp/camel-nntp-store.c | 2 +- camel/providers/pop3/camel-pop3-store.c | 1 - camel/providers/smtp/camel-smtp-transport.c | 2 +- camel/tests/data/messages/.cvsignore | 1 - composer/ChangeLog | 11 - composer/e-msg-composer.c | 1 - configure.in | 111 +- .../executive-summary/evolution-services.hierarchy | 7 - .../importer/evolution-shell-importer.hierarchy | 7 - e-util/ChangeLog | 179 - 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 - .../executive-summary/evolution-services.hierarchy | 7 - .../importer/evolution-shell-importer.hierarchy | 7 - mail/ChangeLog | 269 +- mail/em-composer-utils.c | 1 - mail/em-folder-tree-model.c | 2 +- mail/em-folder-tree.c | 108 +- 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-utils.c | 24 +- mail/mail-account-gui.c | 3 +- mail/mail-component.c | 22 +- mail/mail-config.glade | 574 +- mail/mail-errors.xml | 7 - mail/mail-errors.xml.h | 6 - mail/message-list.c | 46 +- po/be.po | 47808 +++++++++++-------- shell/ChangeLog | 16 +- shell/e-shell.c | 2 - shell/main.c | 2 +- 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/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 - 349 files changed, 29942 insertions(+), 113900 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 3c7f502153..fe0aca170e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,23 +4,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: Fix typos in gal dependency. + * configure.in: Added "bs" to ALL_LINGUAS. -2004-09-16 JP Rosevear +2004-09-13 JP Rosevear - * configure.in: use AC_DEFINE properly + * configure.in: bump version, requires + +2004-09-13 JP Rosevear + + Fixes #63369 -2004-09-16 JP Rosevear + * README: Update + +2004-09-12 Abel Cheung + + * configure.in: Added "hi" "mk" "ml" "ta" to ALL_LINGUAS. + +2004-09-10 Mohammad DAMT + + * configure.in: Added Indonesian "id" to ALL_LINGUAS + * po/id.po: Added Indonesian translation + +2004-09-09 Runa Bhattacharjee + * configure.in: Added Bengali "bn" to ALL_LINGUAS. - * configure.in: bump EDS and gal requirements +2004-09-04 Telsa Gwynne -2004-09-16 JP Rosevear + * configure.in: Added "cy" (Welsh) 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-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 @@ -121,19 +139,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..4c7ef1cf9a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,171 @@ +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 ---------------------------- 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 eb3e556e49..2ede669766 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,49 +1,42 @@ -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 + +2004-09-09 Sivaiah Nallagatla - * gui/component/component-factory.c (factory): Quiet debug messages. + Part of fix for #59582. - * 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. + * gui/contact-editor/e-contact-editor.c + (sensitize_address): check for _LABEL type address fields also in + supported fileds while sensitizing the address fields. - * gui/component/apps_evolution_addressbook.schemas.in.in: Add - missing show_preview schema. Add missing long descriptions. +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 @@ -461,11 +454,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/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 518daefd10..236b53f16f 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -480,12 +480,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); 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 5816c90ad4..858f032b13 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -42,14 +42,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 @@ -57,8 +57,8 @@ (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): @@ -71,13 +71,6 @@ * 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 @@ -92,6 +85,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 @@ -103,7 +121,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 diff --git a/camel/ChangeLog b/camel/ChangeLog index f68d97d54f..668fea1d9f 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -46,12 +46,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. @@ -372,60 +366,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-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-service.c b/camel/camel-service.c index 171bfe6061..31c39614ff 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -37,6 +37,7 @@ #include #include "e-util/e-msgport.h" + #include "e-util/e-host-utils.h" #include "camel-service.h" @@ -44,7 +45,6 @@ #include "camel-exception.h" #include "camel-operation.h" #include "camel-private.h" -#include "camel-i18n.h" #define d(x) #define w(x) 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/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 54340ca783..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) diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c index 3c0dac5456..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" @@ -190,29 +189,32 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls) CamelIMAPPStore *store = CAMEL_IMAPP_STORE (service); CamelStream * volatile tcp_stream = NULL; CamelIMAPPStream * volatile imap_stream = NULL; - struct hostent *h = NULL; - int ret, port; + int ret; CamelException *ex; ex = camel_exception_new(); CAMEL_TRY { + char *serv; + struct addrinfo *ai, hints = { 0 }; + /* parent class connect initialization */ CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex); if (ex->id) camel_exception_throw_ex(ex); - h = camel_service_gethost(service, ex); - if (ex->id) - camel_exception_throw_ex(ex); - - port = service->url->port ? service->url->port : IMAP_PORT; - + if (service->url->port) { + serv = g_alloca(16); + sprintf(serv, "%d", service->url->port); + } else + serv = "imap"; + #ifdef HAVE_SSL if (camel_url_get_param (service->url, "use_ssl")) { if (try_starttls) tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS); else { - port = service->url->port ? service->url->port : 995; + if (service->url->port == 0) + serv = "imaps"; tcp_stream = camel_tcp_stream_ssl_new (service->session, service->url->host, SSL_PORT_FLAGS); } } else { @@ -221,16 +223,21 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls) #else tcp_stream = camel_tcp_stream_raw_new (); #endif /* HAVE_SSL */ - - ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port); - camel_free_host (h); + + hints.ai_socktype = SOCK_STREAM; + ai = camel_getaddrinfo(service->url->host, serv, &hints, ex); + if (ex->id) + camel_exception_throw_ex(ex); + + ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai); + camel_freeaddrinfo(ai); if (ret == -1) { if (errno == EINTR) camel_exception_throw(CAMEL_EXCEPTION_USER_CANCEL, _("Connection cancelled")); else camel_exception_throw(CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not connect to %s (port %d): %s"), - service->url->host, port, strerror(errno)); + _("Could not connect to %s (port %s): %s"), + service->url->host, serv, strerror(errno)); } imap_stream = (CamelIMAPPStream *)camel_imapp_stream_new(tcp_stream); diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c index 4f15336785..8d87b2b4ee 100644 --- a/camel/providers/local/camel-local-folder.c +++ b/camel/providers/local/camel-local-folder.c @@ -48,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/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index e1473f1de1..c03fe4a7de 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -21,6 +21,7 @@ * USA */ + #ifdef HAVE_CONFIG_H #include #endif @@ -51,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; diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 4e5c2baace..f2d903b1c8 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 diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index c3a9e9ed15..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) 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 edd6395386..8aaa25aced 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -51,17 +51,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 e72df878f8..4e67778100 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -70,7 +70,6 @@ #include #include -#include #include #include diff --git a/configure.in b/configure.in index 938ccd9d73..93e758da1e 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT(evolution, 2.1.0, http://bugzilla.ximian.com/enter_bug.cgi?product=Evolution) +AC_INIT(evolution, 2.0.1, http://bugzilla.ximian.com/enter_bug.cgi?product=Evolution) AC_CONFIG_SRCDIR(README) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) @@ -16,38 +16,6 @@ ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" dnl Initialize maintainer mode AM_MAINTAINER_MODE -dnl ************************************************************************************************* -dnl Base Version -dnl -dnl This is for api/versioning tracking for things like bonobo .server files -dnl -dnl This should always be the major/minor of the stable version or stable version to be -dnl ************************************************************************************************* -BASE_VERSION=2.2 -AC_SUBST(BASE_VERSION) -AC_DEFINE_UNQUOTED(BASE_VERSION, "$BASE_VERSION", [Base version (Major.Minor)]) - -dnl ************************************************************************************************* -dnl Updgrade Revision -dnl -dnl This is for triggering migration calls between varying versions. -dnl -dnl This should be reset to 0 whenever BASE_VERSION changes -dnl ************************************************************************************************* -UPGRADE_REVISION=0 -AC_SUBST(UPGRADE_REVISION) -AC_DEFINE_UNQUOTED(UPGRADE_REVISION, "$UPGRADE_REVISION", [The number of times we've upgraded since the BASE_VERSION release]) - -dnl ************************************************************************************************* -dnl Development mode -dnl -dnl The controls whether things like the development warning in shell/main.c are displayed. -dnl -dnl This should be set to 0 for stable releases and 1 for unstable releases -dnl ************************************************************************************************* -AC_SUBST(UPGRADE_REVISION) -AC_DEFINE(DEVELOPMENT, 1, [If we are in development mode or not]) - AC_ISC_POSIX AC_PROG_CC AC_PROG_CPP @@ -78,10 +46,20 @@ AC_SUBST(HAVE_JW) dnl I18N stuff AC_PROG_INTLTOOL([0.30]) -ALL_LINGUAS="am ar az be bg bs ca cs da de el en_AU en_CA en_GB es et eu fa fi fr ga gl gu he hr hu is it ja ko lt lv mn ms nb nl nn no pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr uk vi wa zh_CN zh_TW" +ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_AU en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu id is it ja ko lt lv mk ml mn ms nb nl nn no pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi wa zh_CN zh_TW" AM_GLIB_GNU_GETTEXT -GETTEXT_PACKAGE=evolution-1.5 +dnl The base version for OAFIIDs, install dirs, binary names +BASE_VERSION=2.0 +AC_SUBST(BASE_VERSION) +AC_DEFINE_UNQUOTED(BASE_VERSION, "$BASE_VERSION", [Base version (Major.Minor)]) + +dnl Update/migration version +UPGRADE_REVISION=0 +AC_SUBST(UPGRADE_REVISION) +AC_DEFINE_UNQUOTED(UPGRADE_REVISION, "$UPGRADE_REVISION", [The number of times we've upgraded since the BASE_VERSION release]) + +GETTEXT_PACKAGE=evolution-$BASE_VERSION AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) @@ -511,10 +489,10 @@ dnl ********* dnl Libraries dnl ********* -PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.6) +PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.1) AC_SUBST(GTKHTML_CFLAGS) AC_SUBST(GTKHTML_LIBS) -GTKHTML_DATADIR=`$PKG_CONFIG --variable gtkhtml_datadir libgtkhtml-3.6` +GTKHTML_DATADIR=`$PKG_CONFIG --variable gtkhtml_datadir libgtkhtml-3.1` AC_SUBST(GTKHTML_DATADIR) @@ -683,16 +661,6 @@ AC_SUBST(KRB5_LDFLAGS) AC_SUBST(KRB4_CFLAGS) AC_SUBST(KRB4_LDFLAGS) -dnl Mono hooks - -AC_ARG_ENABLE(mono, [ --enable-mono=[yes,no] Add Mono embedded hooks.], - enable_mono="$enableval", enable_mono="no") - -if test "x${enable_mono}" = "xyes"; then - AC_DEFINE(ENABLE_MONO,1,[Define if Mono embedding should be enabled]) - mono_package="mono" -fi -AM_CONDITIONAL(ENABLE_MONO, test x$enable_mono = xyes) dnl ******************************************************************************** dnl security extension support (SSL and S/MIME) @@ -1070,7 +1038,7 @@ esac AM_PATH_ORBIT2(2.9.8) AC_MSG_CHECKING(for CORBA include paths) -IDL_INCLUDES="-I "`pkg-config --variable=idldir libbonobo-2.0`" -I "`pkg-config --variable=idldir bonobo-activation-2.0`" -I "`pkg-config --variable=idldir evolution-data-server-1.2` +IDL_INCLUDES="-I "`pkg-config --variable=idldir libbonobo-2.0`" -I "`pkg-config --variable=idldir bonobo-activation-2.0`" -I "`pkg-config --variable=idldir evolution-data-server-1.0` AC_MSG_RESULT($IDL_INCLUDES) AC_SUBST(IDL_INCLUDES) @@ -1094,25 +1062,19 @@ fi dnl --- Required version numbers -GAL_REQUIRED=2.3.0 -GAL_PACKAGE=2.4 -GTKHTML_REQUIRED=3.5.0 -GTKHTML_PACKAGE=3.6 -EDS_REQUIRED=1.1.0 -EDS_PACKAGE=1.2 +GAL_REQUIRED=2.2.2 +GTKHTML_REQUIRED=3.2.2 +EDS_REQUIRED=1.0.1 BONOBOUI_REQUIRED=2.4.2 AC_SUBST(GAL_REQUIRED) -AC_SUBST(GAL_PACKAGE) AC_SUBST(GTKHTML_REQUIRED) -AC_SUBST(GTKHTML_PACKAGE) AC_SUBST(EDS_REQUIRED) -AC_SUBST(EDS_PACKAGE) AC_SUBST(BONOBOUI_REQUIRED) dnl --- Flags to get all the GNOME stuff -FULL_GNOME_DEPS="glib-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gnome-vfs-2.0 libgnomeui-2.0 libglade-2.0 libgnomecanvas-2.0 libxml-2.0 gconf-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED" +FULL_GNOME_DEPS="glib-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gnome-vfs-2.0 libgnomeui-2.0 libglade-2.0 libgnomecanvas-2.0 libxml-2.0 gconf-2.0 gal-2.2 >= $GAL_REQUIRED" EVO_SET_COMPILE_FLAGS(GNOME_FULL, $FULL_GNOME_DEPS) AC_SUBST(GNOME_FULL_CFLAGS) @@ -1126,13 +1088,13 @@ CPPFLAGS="$CPPFLAGS_save" dnl --- Flags for the various libraries we build -EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.4 >= $GAL_REQUIRED $mozilla_nss, +EVO_SET_COMPILE_FLAGS(CAMEL, glib-2.0 gthread-2.0 gal-2.2 >= $GAL_REQUIRED $mozilla_nss, $THREADS_CFLAGS $KRB4_CFLAGS $KRB5_CFLAGS $MANUAL_NSS_CFLAGS $OPENSSL_CFLAGS, $THREADS_LIBS $KRB4_LDFLAGS $KRB5_LDFLAGS $MANUAL_NSS_LIBS $OPENSSL_LDFLAGS) AC_SUBST(CAMEL_CFLAGS) AC_SUBST(CAMEL_LIBS) -EVO_SET_COMPILE_FLAGS(CAMEL_GROUPWISE, libegroupwise-$EDS_PACKAGE >= $EDS_REQUIRED, +EVO_SET_COMPILE_FLAGS(CAMEL_GROUPWISE, libegroupwise-1.0 >= $EDS_REQUIRED, $CAMEL_CFLAGS, $CAMEL_LIBS) AC_SUBST(CAMEL_GROUPWISE_CFLAGS) @@ -1153,19 +1115,19 @@ EVO_SET_COMPILE_FLAGS(CERT_UI, glib-2.0 gobject-2.0 gthread-2.0, AC_SUBST(CERT_UI_CFLAGS) AC_SUBST(CERT_UI_LIBS) -EVO_SET_COMPILE_FLAGS(E_NAME, libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED) +EVO_SET_COMPILE_FLAGS(E_NAME, libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-2.2 >= $GAL_REQUIRED) AC_SUBST(E_NAME_CFLAGS) AC_SUBST(E_NAME_LIBS) -EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED $mozilla_nspr $mono_package, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS) +EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-2.2 >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 libedataserver-1.0 >= $EDS_REQUIRED $mozilla_nspr, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS) AC_SUBST(E_UTIL_CFLAGS) AC_SUBST(E_UTIL_LIBS) -EVO_SET_COMPILE_FLAGS(TZDIALOG, libecal-$EDS_PACKAGE >= $EDS_REQUIRED, $GNOME_FULL_CFLAGS, $GNOME_FULL_LIBS) +EVO_SET_COMPILE_FLAGS(TZDIALOG, libecal-1.0 >= $EDS_REQUIRED, $GNOME_FULL_CFLAGS, $GNOME_FULL_LIBS) AC_SUBST(TZDIALOG_CFLAGS) AC_SUBST(TZDIALOG_LIBS) -EVO_SET_COMPILE_FLAGS(SOURCE_SEL, libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED, $GNOME_FULL_CFLAGS, $GNOME_FULL_LIBS) +EVO_SET_COMPILE_FLAGS(SOURCE_SEL, libedataserver-1.0 >= $EDS_REQUIRED, $GNOME_FULL_CFLAGS, $GNOME_FULL_LIBS) AC_SUBST(SOURCE_SEL_CFLAGS) AC_SUBST(SOURCE_SEL_LIBS) @@ -1175,23 +1137,23 @@ dnl EVO_SET_COMPILE_FLAGS(E_WIDGETS, bonobo_conf bonobox_print gdk_pixbuf gnomec dnl AC_SUBST(E_WIDGETS_CFLAGS) dnl AC_SUBST(E_WIDGETS_LIBS) dnl -EVO_SET_COMPILE_FLAGS(IMPORTERS, gconf-2.0 libglade-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libgnomeui-2.0 libebook-$EDS_PACKAGE >= $EDS_REQUIRED) +EVO_SET_COMPILE_FLAGS(IMPORTERS, gconf-2.0 libglade-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libgnomeui-2.0 libebook-1.0 >= $EDS_REQUIRED) AC_SUBST(IMPORTERS_CFLAGS) AC_SUBST(IMPORTERS_LIBS) -EVO_SET_COMPILE_FLAGS(LIBFILTER, libgnome-2.0 libgnomeui-2.0 libglade-2.0 libxml-2.0 gconf-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED) +EVO_SET_COMPILE_FLAGS(LIBFILTER, libgnome-2.0 libgnomeui-2.0 libglade-2.0 libxml-2.0 gconf-2.0 gal-2.2 >= $GAL_REQUIRED) AC_SUBST(LIBFILTER_CFLAGS) AC_SUBST(LIBFILTER_LIBS) dnl --- evolution (shell) flags -EVO_SET_COMPILE_FLAGS(SHELL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-2.0 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED) +EVO_SET_COMPILE_FLAGS(SHELL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-2.2 >= $GAL_REQUIRED libglade-2.0 gnome-vfs-2.0 libgtkhtml-3.1 >= $GTKHTML_REQUIRED) AC_SUBST(SHELL_CFLAGS) AC_SUBST(SHELL_LIBS) dnl --- evolution-addressbook flags -EVOLUTION_ADDRESSBOOK_DEPS="gconf-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 gnome-vfs-2.0 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED" +EVOLUTION_ADDRESSBOOK_DEPS="gconf-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gal-2.2 >= $GAL_REQUIRED libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 gnome-vfs-2.0 libgnomeprintui-2.2 libgtkhtml-3.1 >= $GTKHTML_REQUIRED libebook-1.0 >= $EDS_REQUIRED" EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS) AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS) @@ -1208,7 +1170,7 @@ EVO_SET_COMPILE_FLAGS(LIBSOUP, libsoup-2.2 >= 2.2.0) AC_SUBST(LIBSOUP_CFLAGS) AC_SUBST(LIBSOUP_LIBS) -EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED libecal-$EDS_PACKAGE >= $EDS_REQUIRED) +EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 gal-2.2 >= $GAL_REQUIRED libglade-2.0 gnome-vfs-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-3.1 >= $GTKHTML_REQUIRED libebook-1.0 >= $EDS_REQUIRED libecal-1.0 >= $EDS_REQUIRED) AC_SUBST(EVOLUTION_CALENDAR_CFLAGS) AC_SUBST(EVOLUTION_CALENDAR_LIBS) @@ -1220,17 +1182,17 @@ fi dnl --- evolution-mail flags -EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-$GAL_PACKAGE >= $GAL_REQUIRED libglade-2.0 gnome-vfs-module-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libxml-2.0 bonobo-activation-2.0 gthread-2.0 gconf-2.0 $mozilla_nss libebook-$EDS_PACKAGE >= $EDS_REQUIRED) +EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gal-2.2 >= $GAL_REQUIRED libglade-2.0 gnome-vfs-module-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-3.1 >= $GTKHTML_REQUIRED libxml-2.0 bonobo-activation-2.0 gthread-2.0 gconf-2.0 $mozilla_nss libebook-1.0 >= $EDS_REQUIRED) AC_SUBST(EVOLUTION_MAIL_CFLAGS) AC_SUBST(EVOLUTION_MAIL_LIBS) dnl -- evolution-data-server IDL and version -AC_DEFINE(DATASERVER_API_VERSION, "1.2", evolution-data-server API version) -AC_DEFINE_UNQUOTED(DATASERVER_VERSION, "`pkg-config --modversion evolution-data-server-1.2`", evolution-data-server version) +AC_DEFINE(DATASERVER_API_VERSION, "1.0", evolution-data-server API version) +AC_DEFINE_UNQUOTED(DATASERVER_VERSION, "`pkg-config --modversion evolution-data-server-1.0`", evolution-data-server version) AC_MSG_CHECKING(for evolution-data-server IDL) -DATASERVER_IDL=`pkg-config --variable=idldir evolution-data-server-1.2`/Evolution-DataServer.idl +DATASERVER_IDL=`pkg-config --variable=idldir evolution-data-server-1.0`/Evolution-DataServer.idl if test -f "$DATASERVER_IDL"; then AC_MSG_RESULT($DATASERVER_IDL) AC_SUBST(DATASERVER_IDL) @@ -1270,9 +1232,6 @@ AC_SUBST(camel_providerdir) componentdir="$privlibdir/components" AC_SUBST(componentdir) -plugindir="$privlibdir/plugins" -AC_SUBST(plugindir) - idldir="$datadir/idl/evolution-$BASE_VERSION" AC_SUBST(idldir) diff --git a/doc/devel/executive-summary/evolution-services.hierarchy b/doc/devel/executive-summary/evolution-services.hierarchy deleted file mode 100644 index 37559d819d..0000000000 --- a/doc/devel/executive-summary/evolution-services.hierarchy +++ /dev/null @@ -1,7 +0,0 @@ -GtkObject - BonoboObject - ExecutiveSummaryComponent - ExecutiveSummaryComponentFactory - Handle to remote Bonobo::Unknown - ExecutiveSummaryComponentFactoryClient - ExecutiveSummaryHtmlView diff --git a/doc/devel/importer/evolution-shell-importer.hierarchy b/doc/devel/importer/evolution-shell-importer.hierarchy deleted file mode 100644 index c46ebdf782..0000000000 --- a/doc/devel/importer/evolution-shell-importer.hierarchy +++ /dev/null @@ -1,7 +0,0 @@ -GtkObject - BonoboObject - BonoboXObject - EvolutionImporter - EvolutionImporterListener - Handle to remote Bonobo::Unknown - EvolutionImporterClient diff --git a/e-util/ChangeLog b/e-util/ChangeLog index e003553d5a..80d2665544 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -79,185 +79,6 @@ (d): turn off debugging (expire_dir_rec): remove debug printfs -2004-08-24 JP Rosevear - - * Makefile.am: define EVOLUTION_PLUGINDIR - - * e-plugin.c (e_plugin_get_type): add both a global and user - specifc eplug path as defaults - (e_plugin_load_plugins): just skip a directory if it can't be - opened - -2004-09-10 Not Zed - - * e-popup.c (emph_construct_menu): duh, setup the hook pointer. - - * e-menu.c (e_menu_add_items): pass pixmaps and ui files to this - function now. - (e_menu_add_pixmap): removed, covered by above. - (e_menu_add_ui): removed, covered by above. - (emph_construct_menu): setup the hook pointer properly. - - * e-menu.h: moved the pixmap and ui file structures to be public, - removed hte hook equivalents. - -2004-09-09 Not Zed - - * e-event.c (e_event_remove_items): implement a remove function. - (e_event_add_items): return a handle to pass to above. - (emph_event_handle): noop if we're disabled. - - * e-popup.c (emph_popup_factory): noop if the - plugin is disabled. - - * e-plugin.c (ep_init): setup an enabled bit for the plugin. - Preliminary work on being able to manage plugins. - (e_plugin_hook_enable): set hook enable state. - (e_plugin_enable): set plugin enable state. - -2004-09-07 Not Zed - - * e-config.c (ec_rebuild): pass the right old widget to the page - factory. - (ec_widget_destroy): unref the config and the target when done. - (e_config_create_widget): force the notebook to page 0, workaround - some other bug i don't understand. - (e_config_create_window): set dialog hint on druid. - -2004-09-06 Not Zed - - * e-account.c (e_account_import): emit a changed event on the dest. - (e_account_set_from_xml): emit a changed event if we were. - - * e-config.c (ec_rebuild): add a table item for some type-safety. - remove/alter the asserts so the code attemps to fail gracefully - rather than just fail. - -2004-09-01 Not Zed - - * e-menu.[ch]: - * e-popup.[ch]: - * e-config.[ch]: - * e-event.[ch]: API syncrhonisation. Item callbacks now get the - root object, the item, and user-supplied data. Removed - now-redundant data and structures. Documentation updates. - -2004-08-30 Not Zed - - * e-popup.c (emph_construct_item): just build a popupitem - directly, use user_data to pass the activate method name. - - * e-popup.h: removed epopuphookitem. - - * e-popup.c (emph_construct_item): dont set hook on hookitem - anymore, dont need to set user_data either. - - * e-popup.h: no longer pass parent pointer in EPopupHookItem, its - handled by add_items's data now. - - * e-popup.c (ep_finalise): re-arrange and call freefunc with the - new args. - (e_popup_create_menu): change the activate data so we can pass the - new api arguments. - (ep_activate): changes for api changes. - (emph_popup_factory): no longer takes target arg, taken from the - popup, pass the popuphook to the add_items call. - (emph_popup_activate): changed for new argument types. - - * e-popup.h: removed popup from epopupitem. - - * e-popup.c (e_popup_add_static_items): make private/rename to - ep_add_static_items. - (ep_add_static_items): dont pass target, it is set on the epopup - structure. - (e_popup_add_items): change the freefunc to be an EPopupItemsFunc - and add a user-data field, and track the parent epopup. - - * e-popup.h: change the activatefunc to pass the target and data - supplied to add_items. - -2004-08-25 Not Zed - - * e-config.c (e_config_new): removed, this shouldn't be here for - an abstract class. - (*): Added doco. - -2004-08-24 Not Zed - - * e-config.c (emph_construct_item): translate the label text. - - * e-popup.c (emph_construct_item): translate the label text. - - * e-plugin.c (e_plugin_xml_prop_domain): helper to get a property - translated. - (ep_construct): translate the name and description based on the - new domain tag. get the description as tag content not property. - (e_plugin_xml_content_domain): similar for xml node content. - -2004-08-24 Not Zed - - * e-account.c (init): setup some defaults for the account. - - * e-config.c (e_config_create_widget): remove target arg actually. - (ec_rebuild): add druid page start/end pages. fixes. - (ec_druid_finish, ec_druid_cancel): handle finishing the druid. - -2004-08-23 Not Zed - - * e-config.c (ec_druid_prepare, ec_druid_prev, ec_druid_next): - handle druid navigation. - -2004-08-20 Not Zed - - * e-config.c (e_config_target_changed): add 'how' changed arg. - (e_config_create_widget): dont take target anymore, set that - separately. - (e_config_set_target): new virtual method to set the target. - (ec_set_target): implementation. - -2004-08-19 Not Zed - - * e-account.c (e_account_set_bool): only emit changed if it did. - -2004-08-17 Not Zed - - * e-config.c (e_config_page_check): fix a past-o. - (e_config_target_changed): treat the returned page for a druid - page factory as a gnomedruidpagestandard, so get_page works, etc. - -2004-08-16 Not Zed - - * e-event.[ch]: Added event hook and dispatch router. - -2004-08-13 Not Zed - - * e-plugin.c (e_plugin_load_plugins): don't take a path, load all - paths set. - (e_plugin_add_load_path): add a load path to the search path. - (e_plugin_get_type): setup the initial load path from environment - or defaults. - (e_plugin_xml_int): helper to get a prop in int format. - -2004-08-11 Not Zed - - * e-config.c (e_config_target_changed): handle DRUID root type. - -2004-08-05 Not Zed - - * e-account.c (class_init): add a changed signal. - (e_account_set_string, e_account_set_int, e_account_set_bool): - emit changed signal if it did. - - * e-config.c (e_config_add_page_check): add a page verification - function. It will be called for the given page, or all pages, to - verify the page contains valid data. - -2004-07-29 Not Zed - - * e-account.c (e_account_get_string, e_account_get_int) - (e_account_get_bool, e_account_set_string, e_account_set_int) - (e_account_set_bool): implement. completely table driven. - 2004-07-02 Chris Toshok [ fixes #60691 ] diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c deleted file mode 100644 index bb98a3f465..0000000000 --- a/e-util/e-bit-array.c +++ /dev/null @@ -1,429 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-bit-array.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#include -#include -#include "e-bit-array.h" -#include "gal/util/e-util.h" - -#define PARENT_TYPE G_TYPE_OBJECT - -#define ONES ((guint32) 0xffffffff) - -#define BOX(n) ((n) / 32) -#define OFFSET(n) (31 - ((n) % 32)) -#define BITMASK(n) ((guint32)(((guint32) 0x1) << OFFSET((n)))) -#define BITMASK_LEFT(n) ((((n) % 32) == 0) ? 0 : (ONES << (32 - ((n) % 32)))) -#define BITMASK_RIGHT(n) ((guint32)(((guint32) ONES) >> ((n) % 32))) - -static GObjectClass *parent_class; - -static void -e_bit_array_insert_real(EBitArray *eba, int row) -{ - int box; - int i; - if(eba->bit_count >= 0) { - /* Add another word if needed. */ - if ((eba->bit_count & 0x1f) == 0) { - eba->data = g_renew(guint32, eba->data, (eba->bit_count >> 5) + 1); - eba->data[eba->bit_count >> 5] = 0; - } - - /* The box is the word that our row is in. */ - box = BOX(row); - /* Shift all words to the right of our box right one bit. */ - for (i = eba->bit_count >> 5; i > box; i--) { - eba->data[i] = (eba->data[i] >> 1) | (eba->data[i - 1] << 31); - } - - /* Shift right half of box one bit to the right. */ - eba->data[box] = (eba->data[box] & BITMASK_LEFT(row)) | ((eba->data[box] & BITMASK_RIGHT(row)) >> 1); - eba->bit_count ++; - } -} - -static void -e_bit_array_delete_real(EBitArray *eba, int row, gboolean move_selection_mode) -{ - int box; - int i; - int last; - int selected = FALSE; - if(eba->bit_count >= 0) { - guint32 bitmask; - box = row >> 5; - last = eba->bit_count >> 5; - - /* Build bitmasks for the left and right half of the box */ - bitmask = BITMASK_RIGHT(row) >> 1; - if (move_selection_mode) - selected = e_bit_array_value_at(eba, row); - /* Shift right half of box one bit to the left. */ - eba->data[box] = (eba->data[box] & BITMASK_LEFT(row))| ((eba->data[box] & bitmask) << 1); - - /* Shift all words to the right of our box left one bit. */ - if (box < last) { - eba->data[box] &= eba->data[box + 1] >> 31; - - for (i = box + 1; i < last; i++) { - eba->data[i] = (eba->data[i] << 1) | (eba->data[i + 1] >> 31); - } - /* this over-runs our memory! */ - /*eba->data[i] = eba->data[i] << 1; */ - } - eba->bit_count --; - /* Remove the last word if not needed. */ - if ((eba->bit_count & 0x1f) == 0) { - eba->data = g_renew(guint32, eba->data, eba->bit_count >> 5); - } - if (move_selection_mode && selected && eba->bit_count > 0) { - e_bit_array_select_single_row (eba, row == eba->bit_count ? row - 1 : row); - } - } -} - -/* FIXME : Improve efficiency here. */ -void -e_bit_array_delete(EBitArray *eba, int row, int count) -{ - int i; - for (i = 0; i < count; i++) - e_bit_array_delete_real(eba, row, FALSE); -} - -/* FIXME : Improve efficiency here. */ -void -e_bit_array_delete_single_mode(EBitArray *eba, int row, int count) -{ - int i; - for (i = 0; i < count; i++) - e_bit_array_delete_real(eba, row, TRUE); -} - -/* FIXME : Improve efficiency here. */ -void -e_bit_array_insert(EBitArray *eba, int row, int count) -{ - int i; - for (i = 0; i < count; i++) - e_bit_array_insert_real(eba, row); -} - -/* FIXME: Implement this more efficiently. */ -void -e_bit_array_move_row(EBitArray *eba, int old_row, int new_row) -{ - e_bit_array_delete_real(eba, old_row, FALSE); - e_bit_array_insert_real(eba, new_row); -} - -static void -eba_dispose (GObject *object) -{ - EBitArray *eba; - - eba = E_BIT_ARRAY (object); - - if (eba->data) - g_free(eba->data); - eba->data = NULL; - - if (G_OBJECT_CLASS (parent_class)->dispose) - (* G_OBJECT_CLASS (parent_class)->dispose) (object); -} - -/** - * e_selection_model_is_row_selected - * @selection: #EBitArray to check - * @n: The row to check - * - * This routine calculates whether the given row is selected. - * - * Returns: %TRUE if the given row is selected - */ -gboolean -e_bit_array_value_at (EBitArray *eba, - gint n) -{ - if (eba->bit_count < n || eba->bit_count == 0) - return 0; - else - return (eba->data[BOX(n)] >> OFFSET(n)) & 0x1; -} - -/** - * e_selection_model_foreach - * @selection: #EBitArray to traverse - * @callback: The callback function to call back. - * @closure: The closure - * - * This routine calls the given callback function once for each - * selected row, passing closure as the closure. - */ -void -e_bit_array_foreach (EBitArray *eba, - EForeachFunc callback, - gpointer closure) -{ - int i; - int last = (eba->bit_count + 31) / 32; - for (i = 0; i < last; i++) { - if (eba->data[i]) { - int j; - guint32 value = eba->data[i]; - for (j = 0; j < 32; j++) { - if (value & 0x80000000) { - callback(i * 32 + j, closure); - } - value <<= 1; - } - } - } -} - -/** - * e_selection_model_clear - * @selection: #EBitArray to clear - * - * This routine clears the selection to no rows selected. - */ -void -e_bit_array_clear(EBitArray *eba) -{ - g_free(eba->data); - eba->data = NULL; - eba->bit_count = 0; -} - -#define PART(x,n) (((x) & (0x01010101 << n)) >> n) -#define SECTION(x, n) (((x) >> (n * 8)) & 0xff) - -/** - * e_selection_model_selected_count - * @selection: #EBitArray to count - * - * This routine calculates the number of rows selected. - * - * Returns: The number of rows selected in the given model. - */ -gint -e_bit_array_selected_count (EBitArray *eba) -{ - gint count; - int i; - int last; - - if (!eba->data) - return 0; - - count = 0; - - last = BOX(eba->bit_count - 1); - - for (i = 0; i <= last; i++) { - int j; - guint32 thiscount = 0; - for (j = 0; j < 8; j++) - thiscount += PART(eba->data[i], j); - for (j = 0; j < 4; j++) - count += SECTION(thiscount, j); - } - - return count; -} - -/** - * e_selection_model_select_all - * @selection: #EBitArray to select all - * - * This routine selects all the rows in the given - * #EBitArray. - */ -void -e_bit_array_select_all (EBitArray *eba) -{ - int i; - - if (!eba->data) - eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32); - - for (i = 0; i < (eba->bit_count + 31) / 32; i ++) { - eba->data[i] = ONES; - } - - /* need to zero out the bits corresponding to the rows not - selected in the last full 32 bit mask */ - if (eba->bit_count % 32) { - int unselected_mask = 0; - int num_unselected_in_last_byte = 32 - eba->bit_count % 32; - - for (i = 0; i < num_unselected_in_last_byte; i ++) - unselected_mask |= 1 << i; - - eba->data[(eba->bit_count + 31) / 32 - 1] &= ~unselected_mask; - } -} - -/** - * e_selection_model_invert_selection - * @selection: #EBitArray to invert - * - * This routine inverts all the rows in the given - * #EBitArray. - */ -void -e_bit_array_invert_selection (EBitArray *eba) -{ - int i; - - if (!eba->data) - eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32); - - for (i = 0; i < (eba->bit_count + 31) / 32; i ++) { - eba->data[i] = ~eba->data[i]; - } -} - -int -e_bit_array_bit_count (EBitArray *eba) -{ - return eba->bit_count; -} - -gboolean -e_bit_array_cross_and (EBitArray *eba) -{ - int i; - for (i = 0; i < eba->bit_count / 32; i++) { - if (eba->data[i] != ONES) - return FALSE; - } - if ((eba->bit_count % 32) && ((eba->data[i] & BITMASK_LEFT(eba->bit_count)) != BITMASK_LEFT(eba->bit_count))) - return FALSE; - return TRUE; -} - -gboolean -e_bit_array_cross_or (EBitArray *eba) -{ - int i; - for (i = 0; i < eba->bit_count / 32; i++) { - if (eba->data[i] != 0) - return TRUE; - } - if ((eba->bit_count % 32) && ((eba->data[i] & BITMASK_LEFT(eba->bit_count)) != 0)) - return TRUE; - return FALSE; -} - -#define OPERATE(object, i,mask,grow) ((grow) ? (((object)->data[(i)]) |= ((guint32) ~(mask))) : (((object)->data[(i)]) &= (mask))) - -void -e_bit_array_change_one_row(EBitArray *eba, int row, gboolean grow) -{ - int i; - i = BOX(row); - - OPERATE(eba, i, ~BITMASK(row), grow); -} - -void -e_bit_array_change_range(EBitArray *eba, int start, int end, gboolean grow) -{ - int i, last; - if (start != end) { - i = BOX(start); - last = BOX(end); - - if (i == last) { - OPERATE(eba, i, BITMASK_LEFT(start) | BITMASK_RIGHT(end), grow); - } else { - OPERATE(eba, i, BITMASK_LEFT(start), grow); - if (grow) - for (i ++; i < last; i++) - eba->data[i] = ONES; - else - for (i ++; i < last; i++) - eba->data[i] = 0; - OPERATE(eba, i, BITMASK_RIGHT(end), grow); - } - } -} - -void -e_bit_array_select_single_row (EBitArray *eba, int row) -{ - int i; - for (i = 0; i < ((eba->bit_count + 31) / 32); i++) { - if (!((i == BOX(row) && eba->data[i] == BITMASK(row)) || - (i != BOX(row) && eba->data[i] == 0))) { - g_free(eba->data); - eba->data = g_new0(guint32, (eba->bit_count + 31) / 32); - eba->data[BOX(row)] = BITMASK(row); - - break; - } - } -} - -void -e_bit_array_toggle_single_row (EBitArray *eba, int row) -{ - if (eba->data[BOX(row)] & BITMASK(row)) - eba->data[BOX(row)] &= ~BITMASK(row); - else - eba->data[BOX(row)] |= BITMASK(row); -} - - -static void -e_bit_array_init (EBitArray *eba) -{ - eba->data = NULL; - eba->bit_count = 0; -} - -static void -e_bit_array_class_init (EBitArrayClass *klass) -{ - GObjectClass *object_class; - - parent_class = g_type_class_ref (PARENT_TYPE); - - object_class = G_OBJECT_CLASS(klass); - - object_class->dispose = eba_dispose; -} - -E_MAKE_TYPE(e_bit_array, "EBitArray", EBitArray, - e_bit_array_class_init, e_bit_array_init, PARENT_TYPE) - -EBitArray * -e_bit_array_new (int count) -{ - EBitArray *eba = g_object_new (E_BIT_ARRAY_TYPE, NULL); - eba->bit_count = count; - eba->data = g_new0(guint32, (eba->bit_count + 31) / 32); - return eba; -} diff --git a/e-util/e-bit-array.h b/e-util/e-bit-array.h deleted file mode 100644 index ebfe644da6..0000000000 --- a/e-util/e-bit-array.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-bit-array.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef _E_BIT_ARRAY_H_ -#define _E_BIT_ARRAY_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define E_BIT_ARRAY_TYPE (e_bit_array_get_type ()) -#define E_BIT_ARRAY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_BIT_ARRAY_TYPE, EBitArray)) -#define E_BIT_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_BIT_ARRAY_TYPE, EBitArrayClass)) -#define E_IS_BIT_ARRAY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_BIT_ARRAY_TYPE)) -#define E_IS_BIT_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_BIT_ARRAY_TYPE)) - -#ifndef _E_FOREACH_FUNC_H_ -#define _E_FOREACH_FUNC_H_ -typedef void (*EForeachFunc) (int model_row, - gpointer closure); -#endif - -typedef struct { - GObject base; - - gint bit_count; - guint32 *data; -} EBitArray; - -typedef struct { - GObjectClass parent_class; -} EBitArrayClass; - - -GType e_bit_array_get_type (void); -EBitArray *e_bit_array_new (int count); - -gboolean e_bit_array_value_at (EBitArray *selection, - gint n); -void e_bit_array_foreach (EBitArray *selection, - EForeachFunc callback, - gpointer closure); -void e_bit_array_clear (EBitArray *selection); -gint e_bit_array_selected_count (EBitArray *selection); -void e_bit_array_select_all (EBitArray *selection); -void e_bit_array_invert_selection (EBitArray *selection); -int e_bit_array_bit_count (EBitArray *selection); -void e_bit_array_change_one_row (EBitArray *selection, - int row, - gboolean grow); -void e_bit_array_change_range (EBitArray *selection, - int start, - int end, - gboolean grow); -void e_bit_array_select_single_row (EBitArray *eba, - int row); -void e_bit_array_toggle_single_row (EBitArray *eba, - int row); - -void e_bit_array_insert (EBitArray *esm, - int row, - int count); -void e_bit_array_delete (EBitArray *esm, - int row, - int count); -void e_bit_array_delete_single_mode (EBitArray *esm, - int row, - int count); -void e_bit_array_move_row (EBitArray *esm, - int old_row, - int new_row); -gint e_bit_array_bit_count (EBitArray *esm); - -gboolean e_bit_array_cross_and (EBitArray *esm); -gboolean e_bit_array_cross_or (EBitArray *esm); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* _E_BIT_ARRAY_H_ */ diff --git a/e-util/e-i18n.h b/e-util/e-i18n.h deleted file mode 100644 index 829b2480aa..0000000000 --- a/e-util/e-i18n.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-i18n.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * Copied from gnome-i18nP.h, because this header is typically not installed - * - * This file has to be included before any file from the GNOME libraries - * to have this override the definitions that are pulled from the gnome-i18n.h - * - * the difference is that gnome-i18n.h is used for applications, and this is - * used by libraries (because libraries have to use dcgettext instead of - * gettext and they need to provide the translation domain, unlike apps). - * - * So you can just put this after you include config.h - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef __E_I18N_H__ -#define __E_I18N_H__ - -#include - -G_BEGIN_DECLS - -#ifdef ENABLE_NLS - /* this function is defined in e-util.c */ - extern char *e_gettext (const char *msgid); -# undef _ -# ifdef GNOME_EXPLICIT_TRANSLATION_DOMAIN -/* No parentheses allowed here since that breaks string concatenation. */ -# define E_I18N_DOMAIN GNOME_EXPLICIT_TRANSLATION_DOMAIN -# else -/* No parentheses allowed here since that breaks string concatenation. */ -# define E_I18N_DOMAIN PACKAGE -# endif -# define _(String) e_gettext (String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -/* Stubs that do something close enough. */ -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -/* No parentheses allowed here since that breaks string concatenation. */ -# define E_I18N_DOMAIN "" -#endif - -G_END_DECLS - -#endif /* __E_I18N_H__ */ diff --git a/e-util/e-iconv.c b/e-util/e-iconv.c deleted file mode 100644 index 3236521438..0000000000 --- a/e-util/e-iconv.c +++ /dev/null @@ -1,614 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-iconv.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Michael Zucchi - * Jeffery Stedfast - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include -#include "e-iconv.h" - -#include - -#ifdef HAVE_CODESET -#include -#endif - -#include "iconv-detect.h" - -#define cd(x) - -#ifdef G_THREADS_ENABLED -static GStaticMutex lock = G_STATIC_MUTEX_INIT; -#define LOCK() g_static_mutex_lock(&lock) -#define UNLOCK() g_static_mutex_unlock(&lock) -#else -#define LOCK() -#define UNLOCK() -#endif - -typedef struct _EDListNode { - struct _EDListNode *next; - struct _EDListNode *prev; -} EDListNode; - -typedef struct _EDList { - struct _EDListNode *head; - struct _EDListNode *tail; - struct _EDListNode *tailpred; -} EDList; - -#define E_DLIST_INITIALISER(l) { (EDListNode *)&l.tail, 0, (EDListNode *)&l.head } - -struct _iconv_cache_node { - struct _iconv_cache_node *next; - struct _iconv_cache_node *prev; - - struct _iconv_cache *parent; - - int busy; - iconv_t ip; -}; - -struct _iconv_cache { - struct _iconv_cache *next; - struct _iconv_cache *prev; - - char *conv; - - EDList open; /* stores iconv_cache_nodes, busy ones up front */ -}; - -#define E_ICONV_CACHE_SIZE (16) - -static EDList iconv_cache_list; -static GHashTable *iconv_cache; -static GHashTable *iconv_cache_open; -static unsigned int iconv_cache_size = 0; - -static GHashTable *iconv_charsets = NULL; -static char *locale_charset = NULL; -static char *locale_lang = NULL; - -struct { - char *charset; - char *iconv_name; -} known_iconv_charsets[] = { -#if 0 - /* charset name, iconv-friendly charset name */ - { "iso-8859-1", "iso-8859-1" }, - { "iso8859-1", "iso-8859-1" }, - /* the above mostly serves as an example for iso-style charsets, - but we have code that will populate the iso-*'s if/when they - show up in e_iconv_charset_name() so I'm - not going to bother putting them all in here... */ - { "windows-cp1251", "cp1251" }, - { "windows-1251", "cp1251" }, - { "cp1251", "cp1251" }, - /* the above mostly serves as an example for windows-style - charsets, but we have code that will parse and convert them - to their cp#### equivalents if/when they show up in - e_iconv_charset_name() so I'm not going to bother - putting them all in here either... */ -#endif - /* charset name (lowercase!), iconv-friendly name (sometimes case sensitive) */ - { "utf-8", "UTF-8" }, - - /* 10646 is a special case, its usually UCS-2 big endian */ - /* This might need some checking but should be ok for solaris/linux */ - { "iso-10646-1", "UCS-2BE" }, - { "iso_10646-1", "UCS-2BE" }, - { "iso10646-1", "UCS-2BE" }, - { "iso-10646", "UCS-2BE" }, - { "iso_10646", "UCS-2BE" }, - { "iso10646", "UCS-2BE" }, - - { "ks_c_5601-1987", "EUC-KR" }, - - /* FIXME: Japanese/Korean/Chinese stuff needs checking */ - { "euckr-0", "EUC-KR" }, - { "5601", "EUC-KR" }, - { "zh_TW-euc", "EUC-TW" }, - { "zh_CN.euc", "gb2312" }, - { "zh_TW-big5", "BIG5" }, - { "euc-cn", "gb2312" }, - { "big5-0", "BIG5" }, - { "big5.eten-0", "BIG5" }, - { "big5hkscs-0", "BIG5HKSCS" }, - { "gb2312-0", "gb2312" }, - { "gb2312.1980-0", "gb2312" }, - { "gb-2312", "gb2312" }, - { "gb18030-0", "gb18030" }, - { "gbk-0", "GBK" }, - - { "eucjp-0", "eucJP" }, - { "ujis-0", "ujis" }, - { "jisx0208.1983-0","SJIS" }, - { "jisx0212.1990-0","SJIS" }, - { "pck", "SJIS" }, - { NULL, NULL } -}; - - - -/* Another copy of this trivial list implementation - Why? This stuff gets called a lot (potentially), should run fast, - and g_list's are f@@#$ed up to make this a hassle */ -static void e_dlist_init(EDList *v) -{ - v->head = (EDListNode *)&v->tail; - v->tail = 0; - v->tailpred = (EDListNode *)&v->head; -} - -static EDListNode *e_dlist_addhead(EDList *l, EDListNode *n) -{ - n->next = l->head; - n->prev = (EDListNode *)&l->head; - l->head->prev = n; - l->head = n; - return n; -} - -static EDListNode *e_dlist_addtail(EDList *l, EDListNode *n) -{ - n->next = (EDListNode *)&l->tail; - n->prev = l->tailpred; - l->tailpred->next = n; - l->tailpred = n; - return n; -} - -static EDListNode *e_dlist_remove(EDListNode *n) -{ - n->next->prev = n->prev; - n->prev->next = n->next; - return n; -} - - -/* fucking glib... */ -static const char * -e_strdown (char *str) -{ - register char *s = str; - - while (*s) { - if (*s >= 'A' && *s <= 'Z') - *s += 0x20; - s++; - } - - return str; -} - -static const char * -e_strup (char *str) -{ - register char *s = str; - - while (*s) { - if (*s >= 'a' && *s <= 'z') - *s -= 0x20; - s++; - } - - return str; -} - - -static void -locale_parse_lang (const char *locale) -{ - char *codeset, *lang; - - if ((codeset = strchr (locale, '.'))) - lang = g_strndup (locale, codeset - locale); - else - lang = g_strdup (locale); - - /* validate the language */ - if (strlen (lang) >= 2) { - if (lang[2] == '-' || lang[2] == '_') { - /* canonicalise the lang */ - e_strdown (lang); - - /* validate the country code */ - if (strlen (lang + 3) > 2) { - /* invalid country code */ - lang[2] = '\0'; - } else { - lang[2] = '-'; - e_strup (lang + 3); - } - } else if (lang[2] != '\0') { - /* invalid language */ - g_free (lang); - lang = NULL; - } - - locale_lang = lang; - } else { - /* invalid language */ - locale_lang = NULL; - g_free (lang); - } -} - -/* NOTE: Owns the lock on return if keep is TRUE ! */ -static void -e_iconv_init(int keep) -{ - char *from, *to, *locale; - int i; - - LOCK(); - - if (iconv_charsets != NULL) { - if (!keep) - UNLOCK(); - return; - } - - iconv_charsets = g_hash_table_new(g_str_hash, g_str_equal); - - for (i = 0; known_iconv_charsets[i].charset != NULL; i++) { - from = g_strdup(known_iconv_charsets[i].charset); - to = g_strdup(known_iconv_charsets[i].iconv_name); - e_strdown (from); - g_hash_table_insert(iconv_charsets, from, to); - } - - e_dlist_init(&iconv_cache_list); - iconv_cache = g_hash_table_new(g_str_hash, g_str_equal); - iconv_cache_open = g_hash_table_new(NULL, NULL); - - locale = setlocale (LC_ALL, NULL); - - if (!locale || !strcmp (locale, "C") || !strcmp (locale, "POSIX")) { - /* The locale "C" or "POSIX" is a portable locale; its - * LC_CTYPE part corresponds to the 7-bit ASCII character - * set. - */ - - locale_charset = NULL; - locale_lang = NULL; - } else { -#ifdef HAVE_CODESET - locale_charset = g_strdup (nl_langinfo (CODESET)); - e_strdown (locale_charset); -#else - /* A locale name is typically of the form language[_terri- - * tory][.codeset][@modifier], where language is an ISO 639 - * language code, territory is an ISO 3166 country code, and - * codeset is a character set or encoding identifier like - * ISO-8859-1 or UTF-8. - */ - char *codeset, *p; - - codeset = strchr (locale, '.'); - if (codeset) { - codeset++; - - /* ; is a hack for debian systems and / is a hack for Solaris systems */ - for (p = codeset; *p && !strchr ("@;/", *p); p++); - locale_charset = g_strndup (codeset, p - codeset); - e_strdown (locale_charset); - } else { - /* charset unknown */ - locale_charset = NULL; - } -#endif - - /* parse the locale lang */ - locale_parse_lang (locale); - - } - - if (!keep) - UNLOCK(); -} - -const char *e_iconv_charset_name(const char *charset) -{ - char *name, *ret, *tmp; - - if (charset == NULL) - return NULL; - - name = g_alloca (strlen (charset) + 1); - strcpy (name, charset); - e_strdown (name); - - e_iconv_init(TRUE); - ret = g_hash_table_lookup(iconv_charsets, name); - if (ret != NULL) { - UNLOCK(); - return ret; - } - - /* Unknown, try canonicalise some basic charset types to something that should work */ - if (strncmp(name, "iso", 3) == 0) { - /* Convert iso-nnnn-n or isonnnn-n or iso_nnnn-n to iso-nnnn-n or isonnnn-n */ - int iso, codepage; - char *p; - - tmp = name + 3; - if (*tmp == '-' || *tmp == '_') - tmp++; - - iso = strtoul (tmp, &p, 10); - - if (iso == 10646) { - /* they all become ICONV_10646 */ - ret = g_strdup (ICONV_10646); - } else { - tmp = p; - if (*tmp == '-' || *tmp == '_') - tmp++; - - codepage = strtoul (tmp, &p, 10); - - if (p > tmp) { - /* codepage is numeric */ -#ifdef __aix__ - if (codepage == 13) - ret = g_strdup ("IBM-921"); - else -#endif /* __aix__ */ - ret = g_strdup_printf (ICONV_ISO_D_FORMAT, iso, codepage); - } else { - /* codepage is a string - probably iso-2022-jp or something */ - ret = g_strdup_printf (ICONV_ISO_S_FORMAT, iso, p); - } - } - } else if (strncmp(name, "windows-", 8) == 0) { - /* Convert windows-nnnnn or windows-cpnnnnn to cpnnnn */ - tmp = name+8; - if (!strncmp(tmp, "cp", 2)) - tmp+=2; - ret = g_strdup_printf("CP%s", tmp); - } else if (strncmp(name, "microsoft-", 10) == 0) { - /* Convert microsoft-nnnnn or microsoft-cpnnnnn to cpnnnn */ - tmp = name+10; - if (!strncmp(tmp, "cp", 2)) - tmp+=2; - ret = g_strdup_printf("CP%s", tmp); - } else { - /* Just assume its ok enough as is, case and all */ - ret = g_strdup(charset); - } - - g_hash_table_insert(iconv_charsets, g_strdup(name), ret); - UNLOCK(); - - return ret; -} - -static void -flush_entry(struct _iconv_cache *ic) -{ - struct _iconv_cache_node *in, *nn; - - in = (struct _iconv_cache_node *)ic->open.head; - nn = in->next; - while (nn) { - if (in->ip != (iconv_t)-1) { - g_hash_table_remove(iconv_cache_open, in->ip); - iconv_close(in->ip); - } - g_free(in); - in = nn; - nn = in->next; - } - g_free(ic->conv); - g_free(ic); -} - -/* This should run pretty quick, its called a lot */ -iconv_t e_iconv_open(const char *oto, const char *ofrom) -{ - const char *to, *from; - char *tofrom; - struct _iconv_cache *ic; - struct _iconv_cache_node *in; - int errnosav; - iconv_t ip; - - if (oto == NULL || ofrom == NULL) { - errno = EINVAL; - return (iconv_t) -1; - } - - to = e_iconv_charset_name (oto); - from = e_iconv_charset_name (ofrom); - tofrom = g_alloca (strlen (to) + strlen (from) + 2); - sprintf(tofrom, "%s%%%s", to, from); - - LOCK(); - - ic = g_hash_table_lookup(iconv_cache, tofrom); - if (ic) { - e_dlist_remove((EDListNode *)ic); - } else { - struct _iconv_cache *last = (struct _iconv_cache *)iconv_cache_list.tailpred; - struct _iconv_cache *prev; - - prev = last->prev; - while (prev && iconv_cache_size > E_ICONV_CACHE_SIZE) { - in = (struct _iconv_cache_node *)last->open.head; - if (in->next && !in->busy) { - cd(printf("Flushing iconv converter '%s'\n", last->conv)); - e_dlist_remove((EDListNode *)last); - g_hash_table_remove(iconv_cache, last->conv); - flush_entry(last); - iconv_cache_size--; - } - last = prev; - prev = last->prev; - } - - iconv_cache_size++; - - ic = g_malloc(sizeof(*ic)); - e_dlist_init(&ic->open); - ic->conv = g_strdup(tofrom); - g_hash_table_insert(iconv_cache, ic->conv, ic); - - cd(printf("Creating iconv converter '%s'\n", ic->conv)); - } - e_dlist_addhead(&iconv_cache_list, (EDListNode *)ic); - - /* If we have a free iconv, use it */ - in = (struct _iconv_cache_node *)ic->open.tailpred; - if (in->prev && !in->busy) { - cd(printf("using existing iconv converter '%s'\n", ic->conv)); - ip = in->ip; - if (ip != (iconv_t)-1) { - /* work around some broken iconv implementations - * that die if the length arguments are NULL - */ - size_t buggy_iconv_len = 0; - char *buggy_iconv_buf = NULL; - - /* resets the converter */ - iconv(ip, &buggy_iconv_buf, &buggy_iconv_len, &buggy_iconv_buf, &buggy_iconv_len); - in->busy = TRUE; - e_dlist_remove((EDListNode *)in); - e_dlist_addhead(&ic->open, (EDListNode *)in); - } - } else { - cd(printf("creating new iconv converter '%s'\n", ic->conv)); - ip = iconv_open(to, from); - in = g_malloc(sizeof(*in)); - in->ip = ip; - in->parent = ic; - e_dlist_addhead(&ic->open, (EDListNode *)in); - if (ip != (iconv_t)-1) { - g_hash_table_insert(iconv_cache_open, ip, in); - in->busy = TRUE; - } else { - errnosav = errno; - g_warning("Could not open converter for '%s' to '%s' charset", from, to); - in->busy = FALSE; - errno = errnosav; - } - } - - UNLOCK(); - - return ip; -} - -size_t e_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char ** outbuf, size_t *outbytesleft) -{ - return iconv(cd, (char **) inbuf, inbytesleft, outbuf, outbytesleft); -} - -void -e_iconv_close(iconv_t ip) -{ - struct _iconv_cache_node *in; - - if (ip == (iconv_t)-1) - return; - - LOCK(); - in = g_hash_table_lookup(iconv_cache_open, ip); - if (in) { - cd(printf("closing iconv converter '%s'\n", in->parent->conv)); - e_dlist_remove((EDListNode *)in); - in->busy = FALSE; - e_dlist_addtail(&in->parent->open, (EDListNode *)in); - } else { - g_warning("trying to close iconv i dont know about: %p", ip); - iconv_close(ip); - } - UNLOCK(); - -} - -const char *e_iconv_locale_charset(void) -{ - e_iconv_init(FALSE); - - return locale_charset; -} - - -const char * -e_iconv_locale_language (void) -{ - e_iconv_init (FALSE); - - return locale_lang; -} - -/* map CJKR charsets to their language code */ -/* NOTE: only support charset names that will be returned by - * e_iconv_charset_name() so that we don't have to keep track of all - * the aliases too. */ -static struct { - char *charset; - char *lang; -} cjkr_lang_map[] = { - { "Big5", "zh" }, - { "BIG5HKSCS", "zh" }, - { "gb2312", "zh" }, - { "gb18030", "zh" }, - { "gbk", "zh" }, - { "euc-tw", "zh" }, - { "iso-2022-jp", "ja" }, - { "sjis", "ja" }, - { "ujis", "ja" }, - { "eucJP", "ja" }, - { "euc-jp", "ja" }, - { "euc-kr", "ko" }, - { "koi8-r", "ru" }, - { "koi8-u", "uk" } -}; - -#define NUM_CJKR_LANGS (sizeof (cjkr_lang_map) / sizeof (cjkr_lang_map[0])) - -const char * -e_iconv_charset_language (const char *charset) -{ - int i; - - if (!charset) - return NULL; - - charset = e_iconv_charset_name (charset); - for (i = 0; i < NUM_CJKR_LANGS; i++) { - if (!strcasecmp (cjkr_lang_map[i].charset, charset)) - return cjkr_lang_map[i].lang; - } - - return NULL; -} diff --git a/e-util/e-iconv.h b/e-util/e-iconv.h deleted file mode 100644 index 14b93853d5..0000000000 --- a/e-util/e-iconv.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-iconv.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Michael Zucchi - * Jeffrey Stedfast - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef _E_ICONV_H_ -#define _E_ICONV_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -const char *e_iconv_charset_name(const char *charset); -iconv_t e_iconv_open(const char *oto, const char *ofrom); -size_t e_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char ** outbuf, size_t *outbytesleft); -void e_iconv_close(iconv_t ip); -const char *e_iconv_locale_charset(void); - -/* languages */ -const char *e_iconv_locale_language (void); -const char *e_iconv_charset_language (const char *charset); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* !_E_ICONV_H_ */ diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list deleted file mode 100644 index 92496dbd7b..0000000000 --- a/e-util/e-marshal.list +++ /dev/null @@ -1,51 +0,0 @@ -BOOLEAN:INT,INT,OBJECT,INT,INT,UINT -BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT -BOOLEAN:NONE -BOOLEAN:OBJECT -BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN -BOOLEAN:POINTER,POINTER,INT,INT,INT -BOOLEAN:POINTER,POINTER,POINTER,INT,INT,INT -BOOLEAN:STRING,INT -DOUBLE:OBJECT,DOUBLE,DOUBLE,BOOLEAN -INT:BOXED -INT:INT -INT:INT,INT,BOXED -INT:INT,POINTER,INT,BOXED -INT:OBJECT,BOXED -INT:POINTER -NONE:BOXED -NONE:BOXED,INT -NONE:BOXED,INT,INT -NONE:DOUBLE -NONE:INT -NONE:INT,INT -NONE:INT,INT,BOXED -NONE:INT,INT,OBJECT -NONE:INT,INT,OBJECT,BOXED,UINT,UINT -NONE:INT,INT,OBJECT,INT,INT,BOXED,UINT,UINT -NONE:INT,INT,OBJECT,POINTER,UINT,UINT -NONE:INT,INT,OBJECT,UINT -NONE:INT,INT,STRING,STRING -NONE:INT,INT,STRING,STRING,POINTER -NONE:INT,POINTER -NONE:INT,POINTER,INT,BOXED -NONE:INT,POINTER,INT,OBJECT -NONE:INT,POINTER,INT,OBJECT,BOXED,UINT,UINT -NONE:INT,POINTER,INT,OBJECT,INT,INT,BOXED,UINT,UINT -NONE:INT,POINTER,INT,OBJECT,UINT -NONE:INT,STRING -NONE:NONE -NONE:OBJECT -NONE:OBJECT,OBJECT -NONE:OBJECT,DOUBLE,DOUBLE,BOOLEAN -NONE:POINTER -NONE:POINTER,BOOLEAN -NONE:POINTER,BOOLEAN,BOOLEAN,BOOLEAN -NONE:POINTER,INT -NONE:POINTER,INT,INT -NONE:POINTER,INT,INT,INT -NONE:POINTER,INT,OBJECT -NONE:POINTER,POINTER -NONE:POINTER,POINTER,INT -OBJECT:OBJECT,DOUBLE,DOUBLE,BOOLEAN -POINTER:NONE diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c deleted file mode 100644 index ab1e748d9a..0000000000 --- a/e-util/e-sorter-array.c +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-sorter-array.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#include -#include -#include -#include "gal/util/e-util.h" -#include "e-sorter-array.h" - -#define d(x) - -#define PARENT_TYPE E_SORTER_TYPE - -#define INCREMENT_AMOUNT 100 - -static ESorterClass *parent_class; - -static void esa_sort (ESorterArray *esa); -static void esa_backsort (ESorterArray *esa); - -static gint esa_model_to_sorted (ESorter *sorter, int row); -static gint esa_sorted_to_model (ESorter *sorter, int row); -static void esa_get_model_to_sorted_array (ESorter *sorter, int **array, int *count); -static void esa_get_sorted_to_model_array (ESorter *sorter, int **array, int *count); -static gboolean esa_needs_sorting (ESorter *esa); - -#define ESA_NEEDS_SORTING(esa) (((ESorterArray *) (esa))->compare != NULL) - -static int -esort_callback(const void *data1, const void *data2, gpointer user_data) -{ - ESorterArray *esa = user_data; - int ret_val; - int int1, int2; - - int1 = *(int *)data1; - int2 = *(int *)data2; - - ret_val = esa->compare (int1, int2, esa->closure); - if (ret_val != 0) - return ret_val; - - if (int1 < int2) - return -1; - if (int1 > int2) - return 1; - return 0; -} - -static void -esa_sort(ESorterArray *esa) -{ - int rows; - int i; - - if (esa->sorted) - return; - - rows = esa->rows; - - esa->sorted = g_new(int, rows); - for (i = 0; i < rows; i++) - esa->sorted[i] = i; - - if (esa->compare) - e_sort (esa->sorted, rows, sizeof(int), esort_callback, esa); -} - -static void -esa_backsort(ESorterArray *esa) -{ - int i, rows; - - if (esa->backsorted) - return; - - esa_sort(esa); - - rows = esa->rows; - - esa->backsorted = g_new0(int, rows); - - for (i = 0; i < rows; i++) { - esa->backsorted[esa->sorted[i]] = i; - } -} - - -static gint -esa_model_to_sorted (ESorter *es, int row) -{ - ESorterArray *esa = E_SORTER_ARRAY(es); - - g_return_val_if_fail(row >= 0, -1); - g_return_val_if_fail(row < esa->rows, -1); - - if (ESA_NEEDS_SORTING(es)) - esa_backsort(esa); - - if (esa->backsorted) - return esa->backsorted[row]; - else - return row; -} - -static gint -esa_sorted_to_model (ESorter *es, int row) -{ - ESorterArray *esa = (ESorterArray *) es; - - g_return_val_if_fail(row >= 0, -1); - g_return_val_if_fail(row < esa->rows, -1); - - if (ESA_NEEDS_SORTING(es)) - esa_sort(esa); - - if (esa->sorted) - return esa->sorted[row]; - else - return row; -} - -static void -esa_get_model_to_sorted_array (ESorter *es, int **array, int *count) -{ - ESorterArray *esa = E_SORTER_ARRAY(es); - if (array || count) { - esa_backsort(esa); - - if (array) - *array = esa->backsorted; - if (count) - *count = esa->rows; - } -} - -static void -esa_get_sorted_to_model_array (ESorter *es, int **array, int *count) -{ - ESorterArray *esa = E_SORTER_ARRAY(es); - if (array || count) { - esa_sort(esa); - - if (array) - *array = esa->sorted; - if (count) - *count = esa->rows; - } -} - -static gboolean -esa_needs_sorting(ESorter *es) -{ - ESorterArray *esa = E_SORTER_ARRAY(es); - return esa->compare != NULL; -} - -void -e_sorter_array_clean(ESorterArray *esa) -{ - g_free(esa->sorted); - esa->sorted = NULL; - - g_free(esa->backsorted); - esa->backsorted = NULL; -} - -void -e_sorter_array_set_count (ESorterArray *esa, int count) -{ - e_sorter_array_clean (esa); - esa->rows = count; -} - -void -e_sorter_array_append (ESorterArray *esa, int count) -{ - int i; - g_free(esa->backsorted); - esa->backsorted = NULL; - - if (esa->sorted) { - esa->sorted = g_renew(int, esa->sorted, esa->rows + count); - for (i = 0; i < count; i++) { - int value = esa->rows; - size_t pos; - e_bsearch (&value, esa->sorted, esa->rows, sizeof (int), esort_callback, esa, &pos, NULL); - memmove (esa->sorted + pos + 1, esa->sorted + pos, sizeof (int) * (esa->rows - pos)); - esa->sorted[pos] = value; - esa->rows ++; - } - } else { - esa->rows += count; - } -} - -ESorterArray * -e_sorter_array_construct (ESorterArray *esa, - ECompareRowsFunc compare, - gpointer closure) -{ - esa->compare = compare; - esa->closure = closure; - return esa; -} - -ESorterArray * -e_sorter_array_new (ECompareRowsFunc compare, gpointer closure) -{ - ESorterArray *esa = g_object_new (E_SORTER_ARRAY_TYPE, NULL); - - return e_sorter_array_construct (esa, compare, closure); -} - -static void -esa_class_init (ESorterArrayClass *klass) -{ - ESorterClass *sorter_class = E_SORTER_CLASS(klass); - - parent_class = g_type_class_ref (PARENT_TYPE); - - sorter_class->model_to_sorted = esa_model_to_sorted ; - sorter_class->sorted_to_model = esa_sorted_to_model ; - sorter_class->get_model_to_sorted_array = esa_get_model_to_sorted_array ; - sorter_class->get_sorted_to_model_array = esa_get_sorted_to_model_array ; - sorter_class->needs_sorting = esa_needs_sorting ; -} - -static void -esa_init (ESorterArray *esa) -{ - esa->rows = 0; - esa->compare = NULL; - esa->closure = NULL; - esa->sorted = NULL; - esa->backsorted = NULL; -} - -E_MAKE_TYPE(e_sorter_array, "ESorterArray", ESorterArray, esa_class_init, esa_init, PARENT_TYPE) diff --git a/e-util/e-sorter-array.h b/e-util/e-sorter-array.h deleted file mode 100644 index 227e437443..0000000000 --- a/e-util/e-sorter-array.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-sorter-array.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef _E_SORTER_ARRAY_H_ -#define _E_SORTER_ARRAY_H_ - -#include -#include -#include - -G_BEGIN_DECLS - -#define E_SORTER_ARRAY_TYPE (e_sorter_array_get_type ()) -#define E_SORTER_ARRAY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SORTER_ARRAY_TYPE, ESorterArray)) -#define E_SORTER_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SORTER_ARRAY_TYPE, ESorterArrayClass)) -#define E_IS_SORTER_ARRAY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SORTER_ARRAY_TYPE)) -#define E_IS_SORTER_ARRAY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SORTER_ARRAY_TYPE)) - -#ifndef _E_COMPARE_ROWS_FUNC_H_ -#define _E_COMPARE_ROWS_FUNC_H_ -typedef int (*ECompareRowsFunc) (int row1, - int row2, - gpointer closure); -#endif - -typedef struct { - ESorter base; - - ECompareRowsFunc compare; - gpointer closure; - - /* If needs_sorting is 0, then model_to_sorted and sorted_to_model are no-ops. */ - int *sorted; - int *backsorted; - - int rows; -} ESorterArray; - -typedef struct { - ESorterClass parent_class; -} ESorterArrayClass; - -GType e_sorter_array_get_type (void); -ESorterArray *e_sorter_array_construct (ESorterArray *sorter, - ECompareRowsFunc compare, - gpointer closure); -ESorterArray *e_sorter_array_new (ECompareRowsFunc compare, - gpointer closure); -void e_sorter_array_clean (ESorterArray *esa); -void e_sorter_array_set_count (ESorterArray *esa, - int count); -void e_sorter_array_append (ESorterArray *esa, - int count); - -G_END_DECLS - -#endif /* _E_SORTER_ARRAY_H_ */ diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c deleted file mode 100644 index adee6d0d98..0000000000 --- a/e-util/e-sorter.c +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-sorter.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#include -#include -#include -#include "gal/util/e-util.h" -#include "e-sorter.h" - -#define d(x) - -#define PARENT_TYPE G_TYPE_OBJECT - -static GObjectClass *parent_class; - -static gint es_model_to_sorted (ESorter *es, int row); -static gint es_sorted_to_model (ESorter *es, int row); -static void es_get_model_to_sorted_array (ESorter *es, int **array, int *count); -static void es_get_sorted_to_model_array (ESorter *es, int **array, int *count); -static gboolean es_needs_sorting(ESorter *es); - -static void -es_class_init (ESorterClass *klass) -{ - parent_class = g_type_class_ref (PARENT_TYPE); - - klass->model_to_sorted = es_model_to_sorted; - klass->sorted_to_model = es_sorted_to_model; - klass->get_model_to_sorted_array = es_get_model_to_sorted_array; - klass->get_sorted_to_model_array = es_get_sorted_to_model_array; - klass->needs_sorting = es_needs_sorting; -} - -static void -es_init (ESorter *es) -{ -} - -E_MAKE_TYPE(e_sorter, "ESorter", ESorter, es_class_init, es_init, PARENT_TYPE) - -ESorter * -e_sorter_new (void) -{ - ESorter *es = g_object_new (E_SORTER_TYPE, NULL); - - return es; -} - - -static gint -es_model_to_sorted (ESorter *es, int row) -{ - return row; -} - -static gint -es_sorted_to_model (ESorter *es, int row) -{ - return row; -} - - -static void -es_get_model_to_sorted_array (ESorter *es, int **array, int *count) -{ -} - -static void -es_get_sorted_to_model_array (ESorter *es, int **array, int *count) -{ -} - - -static gboolean -es_needs_sorting(ESorter *es) -{ - return FALSE; -} - -gint -e_sorter_model_to_sorted (ESorter *es, int row) -{ - g_return_val_if_fail(es != NULL, -1); - g_return_val_if_fail(row >= 0, -1); - - if (E_SORTER_GET_CLASS(es)->model_to_sorted) - return E_SORTER_GET_CLASS(es)->model_to_sorted (es, row); - else - return -1; -} - -gint -e_sorter_sorted_to_model (ESorter *es, int row) -{ - g_return_val_if_fail(es != NULL, -1); - g_return_val_if_fail(row >= 0, -1); - - if (E_SORTER_GET_CLASS(es)->sorted_to_model) - return E_SORTER_GET_CLASS(es)->sorted_to_model (es, row); - else - return -1; -} - - -void -e_sorter_get_model_to_sorted_array (ESorter *es, int **array, int *count) -{ - g_return_if_fail(es != NULL); - - if (E_SORTER_GET_CLASS(es)->get_model_to_sorted_array) - E_SORTER_GET_CLASS(es)->get_model_to_sorted_array (es, array, count); -} - -void -e_sorter_get_sorted_to_model_array (ESorter *es, int **array, int *count) -{ - g_return_if_fail(es != NULL); - - if (E_SORTER_GET_CLASS(es)->get_sorted_to_model_array) - E_SORTER_GET_CLASS(es)->get_sorted_to_model_array (es, array, count); -} - - -gboolean -e_sorter_needs_sorting(ESorter *es) -{ - g_return_val_if_fail (es != NULL, FALSE); - - if (E_SORTER_GET_CLASS(es)->needs_sorting) - return E_SORTER_GET_CLASS(es)->needs_sorting (es); - else - return FALSE; -} diff --git a/e-util/e-sorter.h b/e-util/e-sorter.h deleted file mode 100644 index a70c2bd2d7..0000000000 --- a/e-util/e-sorter.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-sorter.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef _E_SORTER_H_ -#define _E_SORTER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define E_SORTER_TYPE (e_sorter_get_type ()) -#define E_SORTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_SORTER_TYPE, ESorter)) -#define E_SORTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_SORTER_TYPE, ESorterClass)) -#define E_IS_SORTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_SORTER_TYPE)) -#define E_IS_SORTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_SORTER_TYPE)) -#define E_SORTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_SORTER_TYPE, ESorterClass)) - -typedef struct { - GObject base; -} ESorter; - -typedef struct { - GObjectClass parent_class; - gint (*model_to_sorted) (ESorter *sorter, - int row); - gint (*sorted_to_model) (ESorter *sorter, - int row); - - void (*get_model_to_sorted_array) (ESorter *sorter, - int **array, - int *count); - void (*get_sorted_to_model_array) (ESorter *sorter, - int **array, - int *count); - - gboolean (*needs_sorting) (ESorter *sorter); -} ESorterClass; - -GType e_sorter_get_type (void); -ESorter *e_sorter_new (void); - -gint e_sorter_model_to_sorted (ESorter *sorter, - int row); -gint e_sorter_sorted_to_model (ESorter *sorter, - int row); - -void e_sorter_get_model_to_sorted_array (ESorter *sorter, - int **array, - int *count); -void e_sorter_get_sorted_to_model_array (ESorter *sorter, - int **array, - int *count); - -gboolean e_sorter_needs_sorting (ESorter *sorter); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _E_SORTER_H_ */ diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c deleted file mode 100644 index 478dc2d68b..0000000000 --- a/e-util/e-text-event-processor-emacs-like.c +++ /dev/null @@ -1,495 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-text-event-processor-emacs-like.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#include -#include -#include -#include "e-text-event-processor-emacs-like.h" - -static void e_text_event_processor_emacs_like_init (ETextEventProcessorEmacsLike *card); -static void e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass); -static gint e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event); - -#define PARENT_TYPE E_TEXT_EVENT_PROCESSOR_TYPE -static ETextEventProcessorClass *parent_class = NULL; - -/* The arguments we take */ -enum { - ARG_0 -}; - -static const ETextEventProcessorCommand control_keys[26] = -{ - { E_TEP_START_OF_LINE, E_TEP_MOVE, 0, "" }, /* a */ - { E_TEP_BACKWARD_CHARACTER, E_TEP_MOVE, 0, "" }, /* b */ - { E_TEP_SELECTION, E_TEP_COPY, 0, "" }, /* c */ - { E_TEP_FORWARD_CHARACTER, E_TEP_DELETE, 0, "" }, /* d */ - { E_TEP_END_OF_LINE, E_TEP_MOVE, 0, "" }, /* e */ - { E_TEP_FORWARD_CHARACTER, E_TEP_MOVE, 0, "" }, /* f */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* g */ - { E_TEP_BACKWARD_CHARACTER, E_TEP_DELETE, 0, "" }, /* h */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* i */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* j */ - { E_TEP_END_OF_LINE, E_TEP_DELETE, 0, "" }, /* k */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* l */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* m */ - { E_TEP_FORWARD_LINE, E_TEP_MOVE, 0, "" }, /* n */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* o */ - { E_TEP_BACKWARD_LINE, E_TEP_MOVE, 0, "" }, /* p */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* q */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* r */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* s */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* t */ - { E_TEP_START_OF_LINE, E_TEP_DELETE, 0, "" }, /* u */ - { E_TEP_SELECTION, E_TEP_PASTE, 0, "" }, /* v */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* w */ - { E_TEP_SELECTION, E_TEP_DELETE, 0, "" }, /* x */ - { E_TEP_SELECTION, E_TEP_PASTE, 0, "" }, /* y */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" } /* z */ -}; - -static const ETextEventProcessorCommand alt_keys[26] = -{ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* a */ - { E_TEP_BACKWARD_WORD, E_TEP_MOVE, 0, "" }, /* b */ - { E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_TITLE, "" },/* c */ - { E_TEP_FORWARD_WORD, E_TEP_DELETE, 0, "" }, /* d */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* e */ - { E_TEP_FORWARD_WORD, E_TEP_MOVE, 0, "" }, /* f */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* g */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* h */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* i */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* j */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* k */ - { E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_LOWER, "" }, /* l */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* m */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* n */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* o */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* p */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* q */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* r */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* s */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* t */ - { E_TEP_SELECTION, E_TEP_CAPS, E_TEP_CAPS_UPPER, "" }, /* u */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* v */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* w */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* x */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" }, /* y */ - { E_TEP_SELECTION, E_TEP_NOP, 0, "" } /* z */ - -}; - -E_MAKE_TYPE (e_text_event_processor_emacs_like, - "ETextEventProcessorEmacsLike", - ETextEventProcessorEmacsLike, - e_text_event_processor_emacs_like_class_init, - e_text_event_processor_emacs_like_init, - PARENT_TYPE) - -static void -e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass) -{ - ETextEventProcessorClass *processor_class; - - processor_class = (ETextEventProcessorClass*) klass; - - parent_class = g_type_class_ref (PARENT_TYPE); - - processor_class->event = e_text_event_processor_emacs_like_event; -} - -static void -e_text_event_processor_emacs_like_init (ETextEventProcessorEmacsLike *tep) -{ -} - -static gint -e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event) -{ - ETextEventProcessorCommand command; - ETextEventProcessorEmacsLike *tep_el = E_TEXT_EVENT_PROCESSOR_EMACS_LIKE(tep); - command.action = E_TEP_NOP; - switch (event->type) { - case GDK_BUTTON_PRESS: - if (event->button.button == 1) { - command.action = E_TEP_GRAB; - command.time = event->button.time; - g_signal_emit_by_name (tep, "command", &command); - if (event->button.state & GDK_SHIFT_MASK) - command.action = E_TEP_SELECT; - else - command.action = E_TEP_MOVE; - command.position = E_TEP_VALUE; - command.value = event->button.position; - command.time = event->button.time; - tep_el->mouse_down = TRUE; - } - break; - case GDK_2BUTTON_PRESS: - if (event->button.button == 1) { - command.action = E_TEP_SELECT; - command.position = E_TEP_SELECT_WORD; - command.time = event->button.time; - } - break; - case GDK_3BUTTON_PRESS: - if (event->button.button == 1) { - command.action = E_TEP_SELECT; - command.position = E_TEP_SELECT_ALL; - command.time = event->button.time; - } - break; - case GDK_BUTTON_RELEASE: - if (event->button.button == 1) { - command.action = E_TEP_UNGRAB; - command.time = event->button.time; - tep_el->mouse_down = FALSE; - } else if (event->button.button == 2) { - command.action = E_TEP_MOVE; - command.position = E_TEP_VALUE; - command.value = event->button.position; - command.time = event->button.time; - g_signal_emit_by_name (tep, "command", &command); - - command.action = E_TEP_GET_SELECTION; - command.position = E_TEP_SELECTION; - command.value = 0; - command.time = event->button.time; - } - break; - case GDK_MOTION_NOTIFY: - if (tep_el->mouse_down) { - command.action = E_TEP_SELECT; - command.position = E_TEP_VALUE; - command.time = event->motion.time; - command.value = event->motion.position; - } - break; - case GDK_KEY_PRESS: - { - ETextEventProcessorEventKey key = event->key; - command.time = event->key.time; - if (key.state & GDK_SHIFT_MASK) - command.action = E_TEP_SELECT; - else if (key.state & GDK_MOD1_MASK) - command.action = E_TEP_NOP; - else - command.action = E_TEP_MOVE; - switch(key.keyval) { - case GDK_Home: - case GDK_KP_Home: - if (key.state & GDK_CONTROL_MASK) - command.position = E_TEP_START_OF_BUFFER; - else - command.position = E_TEP_START_OF_LINE; - break; - case GDK_End: - case GDK_KP_End: - if (key.state & GDK_CONTROL_MASK) - command.position = E_TEP_END_OF_BUFFER; - else - command.position = E_TEP_END_OF_LINE; - break; - case GDK_Page_Up: - case GDK_KP_Page_Up: command.position = E_TEP_BACKWARD_PAGE; break; - - case GDK_Page_Down: - case GDK_KP_Page_Down: command.position = E_TEP_FORWARD_PAGE; break; - /* CUA has Ctrl-Up/Ctrl-Down as paragraph up down */ - case GDK_Up: - case GDK_KP_Up: command.position = E_TEP_BACKWARD_LINE; break; - - case GDK_Down: - case GDK_KP_Down: command.position = E_TEP_FORWARD_LINE; break; - - case GDK_Left: - case GDK_KP_Left: - if (key.state & GDK_CONTROL_MASK) - command.position = E_TEP_BACKWARD_WORD; - else - command.position = E_TEP_BACKWARD_CHARACTER; - break; - case GDK_Right: - case GDK_KP_Right: - if (key.state & GDK_CONTROL_MASK) - command.position = E_TEP_FORWARD_WORD; - else - command.position = E_TEP_FORWARD_CHARACTER; - break; - - case GDK_BackSpace: - command.action = E_TEP_DELETE; - if (key.state & GDK_CONTROL_MASK) - command.position = E_TEP_BACKWARD_WORD; - else - command.position = E_TEP_BACKWARD_CHARACTER; - break; - case GDK_Clear: - command.action = E_TEP_DELETE; - command.position = E_TEP_END_OF_LINE; - break; - case GDK_Insert: - case GDK_KP_Insert: - if (key.state & GDK_SHIFT_MASK) { - command.action = E_TEP_PASTE; - command.position = E_TEP_SELECTION; - } else if (key.state & GDK_CONTROL_MASK) { - command.action = E_TEP_COPY; - command.position = E_TEP_SELECTION; - } else { - /* gtk_toggle_insert(text) -- IMPLEMENT -- FIXME */ - } - break; - case GDK_Delete: - case GDK_KP_Delete: - if (key.state & GDK_CONTROL_MASK){ - command.action = E_TEP_DELETE; - command.position = E_TEP_FORWARD_WORD; - } else if (key.state & GDK_SHIFT_MASK) { - command.action = E_TEP_COPY; - command.position = E_TEP_SELECTION; - g_signal_emit_by_name (tep, "command", &command); - - command.action = E_TEP_DELETE; - command.position = E_TEP_SELECTION; - } else { - command.action = E_TEP_DELETE; - command.position = E_TEP_FORWARD_CHARACTER; - } - break; - case GDK_Tab: - case GDK_KP_Tab: - case GDK_ISO_Left_Tab: - case GDK_3270_BackTab: - /* Don't insert literally */ - command.action = E_TEP_NOP; - command.position = E_TEP_SELECTION; - break; - case GDK_Return: - case GDK_KP_Enter: - if (tep->allow_newlines) { - if (key.state & GDK_CONTROL_MASK) { - command.action = E_TEP_ACTIVATE; - command.position = E_TEP_SELECTION; - } else { - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "\n"; - } - } else { - if (key.state & GDK_CONTROL_MASK) { - command.action = E_TEP_NOP; - command.position = E_TEP_SELECTION; - } else { - command.action = E_TEP_ACTIVATE; - command.position = E_TEP_SELECTION; - } - } - break; - case GDK_Escape: - /* Don't insert literally */ - command.action = E_TEP_NOP; - command.position = E_TEP_SELECTION; - break; - - case GDK_KP_Space: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = " "; - break; - case GDK_KP_Equal: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "="; - break; - case GDK_KP_Multiply: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "*"; - break; - case GDK_KP_Add: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "+"; - break; - case GDK_KP_Subtract: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "-"; - break; - case GDK_KP_Decimal: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "."; - break; - case GDK_KP_Divide: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "/"; - break; - case GDK_KP_0: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "0"; - break; - case GDK_KP_1: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "1"; - break; - case GDK_KP_2: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "2"; - break; - case GDK_KP_3: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "3"; - break; - case GDK_KP_4: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "4"; - break; - case GDK_KP_5: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "5"; - break; - case GDK_KP_6: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "6"; - break; - case GDK_KP_7: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "7"; - break; - case GDK_KP_8: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "8"; - break; - case GDK_KP_9: - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = 1; - command.string = "9"; - break; - - default: - if ((key.state & GDK_CONTROL_MASK) && !(key.state & GDK_MOD1_MASK)) { - if ((key.keyval >= 'A') && (key.keyval <= 'Z')) - key.keyval -= 'A' - 'a'; - - if ((key.keyval >= 'a') && (key.keyval <= 'z')) { - command.position = control_keys[(int) (key.keyval - 'a')].position; - if (control_keys[(int) (key.keyval - 'a')].action != E_TEP_MOVE) - command.action = control_keys[(int) (key.keyval - 'a')].action; - command.value = control_keys[(int) (key.keyval - 'a')].value; - command.string = control_keys[(int) (key.keyval - 'a')].string; - } - - if (key.keyval == ' ') { - command.action = E_TEP_NOP; - } - - if (key.keyval == 'x') { - command.action = E_TEP_COPY; - command.position = E_TEP_SELECTION; - g_signal_emit_by_name (tep, "command", &command); - - command.action = E_TEP_DELETE; - command.position = E_TEP_SELECTION; - } - - break; - } else if ((key.state & GDK_MOD1_MASK) && !(key.state & GDK_CONTROL_MASK)) { - if ((key.keyval >= 'A') && (key.keyval <= 'Z')) - key.keyval -= 'A' - 'a'; - - if ((key.keyval >= 'a') && (key.keyval <= 'z')) { - command.position = alt_keys[(int) (key.keyval - 'a')].position; - if (alt_keys[(int) (key.keyval - 'a')].action != E_TEP_MOVE) - command.action = alt_keys[(int) (key.keyval - 'a')].action; - command.value = alt_keys[(int) (key.keyval - 'a')].value; - command.string = alt_keys[(int) (key.keyval - 'a')].string; - } - } else if (!(key.state & GDK_MOD1_MASK) && !(key.state & GDK_CONTROL_MASK) && key.length > 0) { - if (key.keyval >= GDK_KP_0 && key.keyval <= GDK_KP_9) { - key.keyval = '0'; - key.string = "0"; - } - command.action = E_TEP_INSERT; - command.position = E_TEP_SELECTION; - command.value = strlen(key.string); - command.string = key.string; - - } else { - command.action = E_TEP_NOP; - } - } - break; - case GDK_KEY_RELEASE: - command.time = event->key.time; - command.action = E_TEP_NOP; - break; - default: - command.action = E_TEP_NOP; - break; - } - } - if (command.action != E_TEP_NOP) { - g_signal_emit_by_name (tep, "command", &command); - return 1; - } - else - return 0; -} - -ETextEventProcessor * -e_text_event_processor_emacs_like_new (void) -{ - ETextEventProcessorEmacsLike *retval = g_object_new (E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE, NULL); - return E_TEXT_EVENT_PROCESSOR (retval); -} - diff --git a/e-util/e-text-event-processor-emacs-like.h b/e-util/e-text-event-processor-emacs-like.h deleted file mode 100644 index 1fd74dacfe..0000000000 --- a/e-util/e-text-event-processor-emacs-like.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-text-event-processor-emacs-like.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__ -#define __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -/* ETextEventProcessorEmacsLike - Turns events on a text widget into commands. Uses an emacs-ish interface. - * - */ - -#define E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE (e_text_event_processor_emacs_like_get_type ()) -#define E_TEXT_EVENT_PROCESSOR_EMACS_LIKE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE, ETextEventProcessorEmacsLike)) -#define E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE, ETextEventProcessorEmacsLikeClass)) -#define E_IS_TEXT_EVENT_PROCESSOR_EMACS_LIKE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE)) -#define E_IS_TEXT_EVENT_PROCESSOR_EMACS_LIKE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_TYPE)) - - -typedef struct _ETextEventProcessorEmacsLike ETextEventProcessorEmacsLike; -typedef struct _ETextEventProcessorEmacsLikeClass ETextEventProcessorEmacsLikeClass; - -struct _ETextEventProcessorEmacsLike -{ - ETextEventProcessor parent; - - /* object specific fields */ - guint mouse_down : 1; -}; - -struct _ETextEventProcessorEmacsLikeClass -{ - ETextEventProcessorClass parent_class; -}; - - -GType e_text_event_processor_emacs_like_get_type (void); -ETextEventProcessor *e_text_event_processor_emacs_like_new (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __E_TEXT_EVENT_PROCESSOR_EMACS_LIKE_H__ */ diff --git a/e-util/e-text-event-processor-types.h b/e-util/e-text-event-processor-types.h deleted file mode 100644 index 5cb3f198d7..0000000000 --- a/e-util/e-text-event-processor-types.h +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-text-event-processor-types.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef __E_TEXT_EVENT_PROCESSOR_TYPES_H__ -#define __E_TEXT_EVENT_PROCESSOR_TYPES_H__ - -#include - -G_BEGIN_DECLS - -#include - -typedef union _ETextEventProcessorEvent ETextEventProcessorEvent; - -typedef enum { - E_TEP_VALUE, - E_TEP_SELECTION, - - E_TEP_START_OF_BUFFER, - E_TEP_END_OF_BUFFER, - - E_TEP_START_OF_LINE, - E_TEP_END_OF_LINE, - - E_TEP_FORWARD_CHARACTER, - E_TEP_BACKWARD_CHARACTER, - - E_TEP_FORWARD_WORD, - E_TEP_BACKWARD_WORD, - - E_TEP_FORWARD_LINE, - E_TEP_BACKWARD_LINE, - - E_TEP_FORWARD_PARAGRAPH, - E_TEP_BACKWARD_PARAGRAPH, - - E_TEP_FORWARD_PAGE, - E_TEP_BACKWARD_PAGE, - - E_TEP_SELECT_WORD, - E_TEP_SELECT_ALL - -} ETextEventProcessorCommandPosition; - -typedef enum { - E_TEP_MOVE, - E_TEP_SELECT, - E_TEP_DELETE, - E_TEP_INSERT, - - E_TEP_CAPS, - - E_TEP_COPY, - E_TEP_PASTE, - E_TEP_GET_SELECTION, - E_TEP_SET_SELECT_BY_WORD, - E_TEP_ACTIVATE, - - E_TEP_GRAB, - E_TEP_UNGRAB, - - E_TEP_NOP -} ETextEventProcessorCommandAction; - -typedef struct { - ETextEventProcessorCommandPosition position; - ETextEventProcessorCommandAction action; - int value; - char *string; - guint32 time; -} ETextEventProcessorCommand; - -typedef struct { - GdkEventType type; - guint32 time; - guint state; - guint button; - gint position; -} ETextEventProcessorEventButton; - -typedef struct { - GdkEventType type; - guint32 time; - guint state; - guint keyval; - gint length; - gchar *string; -} ETextEventProcessorEventKey; - -typedef struct { - GdkEventType type; - guint32 time; - guint state; - gint position; -} ETextEventProcessorEventMotion; - -union _ETextEventProcessorEvent { - GdkEventType type; - ETextEventProcessorEventButton button; - ETextEventProcessorEventKey key; - ETextEventProcessorEventMotion motion; -}; - -typedef enum _ETextEventProcessorCaps { - E_TEP_CAPS_UPPER, - E_TEP_CAPS_LOWER, - E_TEP_CAPS_TITLE -} ETextEventProcessorCaps; - -G_END_DECLS - -#endif /* __E_TEXT_EVENT_PROCESSOR_TYPES_H__ */ diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c deleted file mode 100644 index 6b974d894e..0000000000 --- a/e-util/e-text-event-processor.c +++ /dev/null @@ -1,148 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-text-event-processor.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#include "e-text-event-processor.h" -#include -#include -#include "gal/util/e-marshal.h" - -static void e_text_event_processor_init (ETextEventProcessor *card); -static void e_text_event_processor_class_init (ETextEventProcessorClass *klass); - -static void e_text_event_processor_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void e_text_event_processor_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); - -#define PARENT_TYPE G_TYPE_OBJECT -static GObjectClass *parent_class = NULL; - -/* The arguments we take */ -enum { - PROP_0, - PROP_ALLOW_NEWLINES -}; - -enum { - E_TEP_EVENT, - E_TEP_LAST_SIGNAL -}; - -static guint e_tep_signals[E_TEP_LAST_SIGNAL] = { 0 }; - -E_MAKE_TYPE (e_text_event_processor, - "ETextEventProcessor", - ETextEventProcessor, - e_text_event_processor_class_init, - e_text_event_processor_init, - PARENT_TYPE) - -static void -e_text_event_processor_class_init (ETextEventProcessorClass *klass) -{ - GObjectClass *object_class; - - object_class = (GObjectClass*) klass; - - parent_class = g_type_class_ref (PARENT_TYPE); - - object_class->set_property = e_text_event_processor_set_property; - object_class->get_property = e_text_event_processor_get_property; - - e_tep_signals[E_TEP_EVENT] = - g_signal_new ("command", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextEventProcessorClass, command), - NULL, NULL, - e_marshal_NONE__POINTER, - G_TYPE_NONE, 1, - G_TYPE_POINTER); - - g_object_class_install_property (object_class, PROP_ALLOW_NEWLINES, - g_param_spec_boolean ("allow_newlines", - _( "Allow newlines" ), - _( "Allow newlines" ), - FALSE, - G_PARAM_READWRITE)); - - klass->event = NULL; - klass->command = NULL; - -} - -static void -e_text_event_processor_init (ETextEventProcessor *tep) -{ - tep->allow_newlines = TRUE; -} - -gint -e_text_event_processor_handle_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event) -{ - if (E_TEXT_EVENT_PROCESSOR_GET_CLASS(tep)->event) - return E_TEXT_EVENT_PROCESSOR_GET_CLASS(tep)->event(tep, event); - else - return 0; -} - -/* Set_arg handler for the text item */ -static void -e_text_event_processor_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object); - - switch (prop_id) { - case PROP_ALLOW_NEWLINES: - tep->allow_newlines = g_value_get_boolean (value); - break; - default: - return; - } -} - -/* Get_arg handler for the text item */ -static void -e_text_event_processor_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - ETextEventProcessor *tep = E_TEXT_EVENT_PROCESSOR (object); - - switch (prop_id) { - case PROP_ALLOW_NEWLINES: - g_value_set_boolean (value, tep->allow_newlines); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} diff --git a/e-util/e-text-event-processor.h b/e-util/e-text-event-processor.h deleted file mode 100644 index 21f2550fde..0000000000 --- a/e-util/e-text-event-processor.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-text-event-processor.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef __E_TEXT_EVENT_PROCESSOR_H__ -#define __E_TEXT_EVENT_PROCESSOR_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -/* ETextEventProcessor - Turns events on a text widget into commands. - * - */ - -#define E_TEXT_EVENT_PROCESSOR_TYPE (e_text_event_processor_get_type ()) -#define E_TEXT_EVENT_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TEXT_EVENT_PROCESSOR_TYPE, ETextEventProcessor)) -#define E_TEXT_EVENT_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TEXT_EVENT_PROCESSOR_TYPE, ETextEventProcessorClass)) -#define E_IS_TEXT_EVENT_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_TYPE)) -#define E_IS_TEXT_EVENT_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TEXT_EVENT_PROCESSOR_TYPE)) -#define E_TEXT_EVENT_PROCESSOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), E_TEXT_EVENT_PROCESSOR_TYPE, ETextEventProcessorClass)) -typedef struct _ETextEventProcessor ETextEventProcessor; -typedef struct _ETextEventProcessorClass ETextEventProcessorClass; - -struct _ETextEventProcessor -{ - GObject parent; - - /* object specific fields */ - guint allow_newlines : 1; -}; - -struct _ETextEventProcessorClass -{ - GtkObjectClass parent_class; - - /* signals */ - void (* command) (ETextEventProcessor *tep, ETextEventProcessorCommand *command); - - /* virtual functions */ - gint (* event) (ETextEventProcessor *tep, ETextEventProcessorEvent *event); -}; - - -GType e_text_event_processor_get_type (void); -gint e_text_event_processor_handle_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __E_TEXT_EVENT_PROCESSOR_H__ */ diff --git a/e-util/e-util.c b/e-util/e-util.c deleted file mode 100644 index 2514cfc931..0000000000 --- a/e-util/e-util.c +++ /dev/null @@ -1,1230 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-util.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#include -#include "e-util.h" -#include "e-i18n.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if 0 -#include -#endif - -int -g_str_compare (const void *x, const void *y) -{ - if (x == NULL || y == NULL) { - if (x == y) - return 0; - else - return x ? -1 : 1; - } - - return strcmp (x, y); -} - -int -g_collate_compare (const void *x, const void *y) -{ - if (x == NULL || y == NULL) { - if (x == y) - return 0; - else - return x ? -1 : 1; - } - - return g_utf8_collate (x, y); -} - -int -g_int_compare (const void *x, const void *y) -{ - if (GPOINTER_TO_INT (x) < GPOINTER_TO_INT (y)) - return -1; - else if (GPOINTER_TO_INT (x) == GPOINTER_TO_INT (y)) - return 0; - else - return 1; -} - -char * -e_strdup_strip(const char *string) -{ - int i; - int length = 0; - int initial = 0; - for ( i = 0; string[i]; i++ ) { - if (initial == i && isspace((unsigned char) string[i])) { - initial ++; - } - if (!isspace((unsigned char) string[i])) { - length = i - initial + 1; - } - } - return g_strndup(string + initial, length); -} - -void -e_free_object_list (GList *list) -{ - GList *p; - - for (p = list; p != NULL; p = p->next) - g_object_unref (p->data); - - g_list_free (list); -} - -void -e_free_object_slist (GSList *list) -{ - GSList *p; - - for (p = list; p != NULL; p = p->next) - g_object_unref (p->data); - - g_slist_free (list); -} - -void -e_free_string_list (GList *list) -{ - GList *p; - - for (p = list; p != NULL; p = p->next) - g_free (p->data); - - g_list_free (list); -} - -void -e_free_string_slist (GSList *list) -{ - GSList *p; - - for (p = list; p != NULL; p = p->next) - g_free (p->data); - g_slist_free (list); -} - -#define BUFF_SIZE 1024 - -char * -e_read_file(const char *filename) -{ - int fd; - char buffer[BUFF_SIZE]; - GList *list = NULL, *list_iterator; - GList *lengths = NULL, *lengths_iterator; - int length = 0; - int bytes; - char *ret_val; - - fd = open(filename, O_RDONLY); - if (fd == -1) - return NULL; - bytes = read(fd, buffer, BUFF_SIZE); - while (bytes) { - if (bytes > 0) { - char *temp = g_malloc(bytes); - memcpy (temp, buffer, bytes); - list = g_list_prepend(list, temp); - lengths = g_list_prepend(lengths, GINT_TO_POINTER(bytes)); - length += bytes; - } else { - if (errno != EINTR) { - close(fd); - g_list_foreach(list, (GFunc) g_free, NULL); - g_list_free(list); - g_list_free(lengths); - return NULL; - } - } - bytes = read(fd, buffer, BUFF_SIZE); - } - ret_val = g_new(char, length + 1); - ret_val[length] = 0; - lengths_iterator = lengths; - list_iterator = list; - for ( ; list_iterator; list_iterator = list_iterator->next, lengths_iterator = lengths_iterator->next) { - int this_length = GPOINTER_TO_INT(lengths_iterator->data); - length -= this_length; - memcpy(ret_val + length, list_iterator->data, this_length); - } - close(fd); - g_list_foreach(list, (GFunc) g_free, NULL); - g_list_free(list); - g_list_free(lengths); - return ret_val; -} - -gint -e_write_file(const char *filename, const char *data, int flags) -{ - int fd; - int length = strlen(data); - int bytes; - fd = open(filename, flags | O_WRONLY, 0666); - if (fd == -1) - return errno; - while (length > 0) { - bytes = write(fd, data, length); - if (bytes > 0) { - length -= bytes; - data += bytes; - } else { - if (errno != EINTR && errno != EAGAIN) { - int save_errno = errno; - close(fd); - return save_errno; - } - } - } - if (close(fd) != 0) { - return errno; - } - return 0; -} - -gint -e_write_file_mkstemp(char *filename, const char *data) -{ - int fd; - int length = strlen(data); - int bytes; - fd = mkstemp (filename); - if (fd == -1) - return errno; - while (length > 0) { - bytes = write(fd, data, length); - if (bytes > 0) { - length -= bytes; - data += bytes; - } else { - if (errno != EINTR && errno != EAGAIN) { - int save_errno = errno; - close(fd); - return save_errno; - } - } - } - if (close(fd) != 0) { - return errno; - } - return 0; -} - -/** - * e_mkdir_hier: - * @path: a directory path - * @mode: a mode, as for mkdir(2) - * - * This creates the named directory with the given @mode, creating - * any necessary intermediate directories (with the same @mode). - * - * Return value: 0 on success, -1 on error, in which case errno will - * be set as for mkdir(2). - **/ -int -e_mkdir_hier(const char *path, mode_t mode) -{ - char *copy, *p; - - if (path[0] == '/') { - p = copy = g_strdup (path); - } else { - gchar *current_dir = g_get_current_dir(); - p = copy = g_concat_dir_and_file (current_dir, path); - } - - do { - p = strchr (p + 1, '/'); - if (p) - *p = '\0'; - if (access (copy, F_OK) == -1) { - if (mkdir (copy, mode) == -1) { - g_free (copy); - return -1; - } - } - if (p) - *p = '/'; - } while (p); - - g_free (copy); - return 0; -} - -#if 0 -char * -e_read_uri(const char *uri) -{ - GnomeVFSHandle *handle; - GList *list = NULL, *list_iterator; - GList *lengths = NULL, *lengths_iterator; - gchar buffer[1025]; - gchar *ret_val; - int length = 0; - GnomeVFSFileSize bytes; - - gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ); - - gnome_vfs_read(handle, buffer, 1024, &bytes); - while (bytes) { - if (bytes) { - char *temp = g_malloc(bytes); - memcpy (temp, buffer, bytes); - list = g_list_prepend(list, temp); - lengths = g_list_prepend(lengths, GINT_TO_POINTER((gint) bytes)); - length += bytes; - } - gnome_vfs_read(handle, buffer, 1024, &bytes); - } - - ret_val = g_new(char, length + 1); - ret_val[length] = 0; - lengths_iterator = lengths; - list_iterator = list; - for ( ; list_iterator; list_iterator = list_iterator->next, lengths_iterator = lengths_iterator->next) { - int this_length = GPOINTER_TO_INT(lengths_iterator->data); - length -= this_length; - memcpy(ret_val + length, list_iterator->data, this_length); - } - gnome_vfs_close(handle); - g_list_foreach(list, (GFunc) g_free, NULL); - g_list_free(list); - g_list_free(lengths); - return ret_val; -} -#endif - -/* Include build marshalers */ - -#include "e-marshal.h" -#include "e-marshal.c" - -gchar** -e_strsplit (const gchar *string, - const gchar *delimiter, - gint max_tokens) -{ - GSList *string_list = NULL, *slist; - gchar **str_array, *s; - guint i, n = 1; - - g_return_val_if_fail (string != NULL, NULL); - g_return_val_if_fail (delimiter != NULL, NULL); - - if (max_tokens < 1) - max_tokens = G_MAXINT; - - s = strstr (string, delimiter); - if (s) - { - guint delimiter_len = strlen (delimiter); - - do - { - guint len; - gchar *new_string; - - len = s - string; - new_string = g_new (gchar, len + 1); - strncpy (new_string, string, len); - new_string[len] = 0; - string_list = g_slist_prepend (string_list, new_string); - n++; - string = s + delimiter_len; - s = strstr (string, delimiter); - } - while (--max_tokens && s); - } - - n++; - string_list = g_slist_prepend (string_list, g_strdup (string)); - - str_array = g_new (gchar*, n); - - i = n - 1; - - str_array[i--] = NULL; - for (slist = string_list; slist; slist = slist->next) - str_array[i--] = slist->data; - - g_slist_free (string_list); - - return str_array; -} - -gchar * -e_strstrcase (const gchar *haystack, const gchar *needle) -{ - /* find the needle in the haystack neglecting case */ - const gchar *ptr; - guint len; - - g_return_val_if_fail (haystack != NULL, NULL); - g_return_val_if_fail (needle != NULL, NULL); - - len = strlen(needle); - if (len > strlen(haystack)) - return NULL; - - if (len == 0) - return (gchar *) haystack; - - for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++) - if (!g_strncasecmp (ptr, needle, len)) - return (gchar *) ptr; - - return NULL; -} - -/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */ -void -e_filename_make_safe (gchar *string) -{ - gchar *p, *ts; - gunichar c; - - g_return_if_fail (string != NULL); - p = string; - - while(p && *p) { - c = g_utf8_get_char (p); - ts = p; - p = g_utf8_next_char (p); - if (!g_unichar_isprint(c) || ( c < 0xff && strchr (" /'\"`&();|<>$%{}!", c&0xff ))) { - while (ts 0; number --) { - value *= 10; - } - return value; -} - -gchar * -e_format_number (gint number) -{ - GList *iterator, *list = NULL; - struct lconv *locality; - gint char_length = 0; - gint group_count = 0; - guchar *grouping; - int last_count = 3; - int divider; - char *value; - char *value_iterator; - - locality = localeconv(); - grouping = locality->grouping; - while (number) { - char *group; - switch (*grouping) { - default: - last_count = *grouping; - grouping++; - case 0: - divider = epow10(last_count); - if (number >= divider) { - group = g_strdup_printf("%0*d", last_count, number % divider); - } else { - group = g_strdup_printf("%d", number % divider); - } - number /= divider; - break; - case CHAR_MAX: - group = g_strdup_printf("%d", number); - number = 0; - break; - } - char_length += strlen(group); - list = g_list_prepend(list, group); - group_count ++; - } - - if (list) { - value = g_new(char, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep)); - - iterator = list; - value_iterator = value; - - strcpy(value_iterator, iterator->data); - value_iterator += strlen(iterator->data); - for (iterator = iterator->next; iterator; iterator = iterator->next) { - strcpy(value_iterator, locality->thousands_sep); - value_iterator += strlen(locality->thousands_sep); - - strcpy(value_iterator, iterator->data); - value_iterator += strlen(iterator->data); - } - e_free_string_list (list); - return value; - } else { - return g_strdup("0"); - } -} - -static gchar * -do_format_number_as_float (double number) -{ - GList *iterator, *list = NULL; - struct lconv *locality; - gint char_length = 0; - gint group_count = 0; - guchar *grouping; - int last_count = 3; - int divider; - char *value; - char *value_iterator; - double fractional; - - locality = localeconv(); - grouping = locality->grouping; - while (number >= 1.0) { - char *group; - switch (*grouping) { - default: - last_count = *grouping; - grouping++; - /* Fall through */ - case 0: - divider = epow10(last_count); - number /= divider; - fractional = modf (number, &number); - fractional *= divider; - fractional = floor (fractional); - - if (number >= 1.0) { - group = g_strdup_printf("%0*d", last_count, (int) fractional); - } else { - group = g_strdup_printf("%d", (int) fractional); - } - break; - case CHAR_MAX: - divider = epow10(last_count); - number /= divider; - fractional = modf (number, &number); - fractional *= divider; - fractional = floor (fractional); - - while (number >= 1.0) { - group = g_strdup_printf("%0*d", last_count, (int) fractional); - - char_length += strlen(group); - list = g_list_prepend(list, group); - group_count ++; - - divider = epow10(last_count); - number /= divider; - fractional = modf (number, &number); - fractional *= divider; - fractional = floor (fractional); - } - - group = g_strdup_printf("%d", (int) fractional); - break; - } - char_length += strlen(group); - list = g_list_prepend(list, group); - group_count ++; - } - - if (list) { - value = g_new(char, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep)); - - iterator = list; - value_iterator = value; - - strcpy(value_iterator, iterator->data); - value_iterator += strlen(iterator->data); - for (iterator = iterator->next; iterator; iterator = iterator->next) { - strcpy(value_iterator, locality->thousands_sep); - value_iterator += strlen(locality->thousands_sep); - - strcpy(value_iterator, iterator->data); - value_iterator += strlen(iterator->data); - } - e_free_string_list (list); - return value; - } else { - return g_strdup("0"); - } -} - -gchar * -e_format_number_float (gfloat number) -{ - gfloat int_part; - gint fraction; - struct lconv *locality; - gchar *str_intpart; - gchar *decimal_point; - gchar *str_fraction; - gchar *value; - - locality = localeconv(); - - int_part = floor (number); - str_intpart = do_format_number_as_float ((double) int_part); - - if (!strcmp(locality->mon_decimal_point, "")) { - decimal_point = "."; - } - else { - decimal_point = locality->mon_decimal_point; - } - - fraction = (int) ((number - int_part) * 100); - - if (fraction == 0) { - str_fraction = g_strdup ("00"); - } else { - str_fraction = g_strdup_printf ("%02d", fraction); - } - - value = g_strconcat (str_intpart, decimal_point, str_fraction, NULL); - - g_free (str_intpart); - g_free (str_fraction); - - return value; -} - -gboolean -e_create_directory (gchar *directory) -{ - gint ret_val = e_mkdir_hier (directory, 0777); - if (ret_val == -1) - return FALSE; - else - return TRUE; -} - - -/* Perform a binary search for key in base which has nmemb elements - of size bytes each. The comparisons are done by (*compare)(). */ -void e_bsearch (const void *key, - const void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure, - size_t *start, - size_t *end) -{ - size_t l, u, idx; - const void *p; - int comparison; - if (!(start || end)) - return; - - l = 0; - u = nmemb; - while (l < u) { - idx = (l + u) / 2; - p = (void *) (((const char *) base) + (idx * size)); - comparison = (*compare) (key, p, closure); - if (comparison < 0) - u = idx; - else if (comparison > 0) - l = idx + 1; - else { - size_t lsave, usave; - lsave = l; - usave = u; - if (start) { - while (l < u) { - idx = (l + u) / 2; - p = (void *) (((const char *) base) + (idx * size)); - comparison = (*compare) (key, p, closure); - if (comparison <= 0) - u = idx; - else - l = idx + 1; - } - *start = l; - - l = lsave; - u = usave; - } - if (end) { - while (l < u) { - idx = (l + u) / 2; - p = (void *) (((const char *) base) + (idx * size)); - comparison = (*compare) (key, p, closure); - if (comparison < 0) - u = idx; - else - l = idx + 1; - } - *end = l; - } - return; - } - } - - if (start) - *start = l; - if (end) - *end = l; -} - -static gpointer closure_closure; -static ESortCompareFunc compare_closure; - -static int -qsort_callback(const void *data1, const void *data2) -{ - return (*compare_closure) (data1, data2, closure_closure); -} - -/* Forget it. We're just going to use qsort. I lost the need for a stable sort. */ -void -e_sort (void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure) -{ - closure_closure = closure; - compare_closure = compare; - qsort(base, nmemb, size, qsort_callback); -#if 0 - void *base_copy; - int i; - base_copy = g_malloc(nmemb * size); - - for (i = 0; i < nmemb; i++) { - int position; - e_bsearch(base + (i * size), base_copy, i, size, compare, closure, NULL, &position); - memmove(base_copy + (position + 1) * size, base_copy + position * size, (i - position) * size); - memcpy(base_copy + position * size, base + i * size, size); - } - memcpy(base, base_copy, nmemb * size); - g_free(base_copy); -#endif -} - -size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm) -{ -#ifdef HAVE_LKSTRFTIME - return strftime(s, max, fmt, tm); -#else - char *c, *ffmt, *ff; - size_t ret; - - ffmt = g_strdup(fmt); - ff = ffmt; - while ((c = strstr(ff, "%l")) != NULL) { - c[1] = 'I'; - ff = c; - } - - ff = fmt; - while ((c = strstr(ff, "%k")) != NULL) { - c[1] = 'H'; - ff = c; - } - - ret = strftime(s, max, ffmt, tm); - g_free(ffmt); - return ret; -#endif -} - -size_t -e_utf8_strftime(char *s, size_t max, const char *fmt, const struct tm *tm) -{ - size_t sz, ret; - char *locale_fmt, *buf; - - locale_fmt = g_locale_from_utf8(fmt, -1, NULL, &sz, NULL); - if (!locale_fmt) - return 0; - - ret = e_strftime(s, max, locale_fmt, tm); - if (!ret) { - g_free (locale_fmt); - return 0; - } - - buf = g_locale_to_utf8(s, ret, NULL, &sz, NULL); - if (!buf) { - g_free (locale_fmt); - return 0; - } - - if (sz >= max) { - char *tmp = buf + max - 1; - tmp = g_utf8_find_prev_char(buf, tmp); - if (tmp) - sz = tmp - buf; - else - sz = 0; - } - memcpy(s, buf, sz); - s[sz] = '\0'; - g_free(locale_fmt); - g_free(buf); - return sz; -} - -/** - * Function to do a last minute fixup of the AM/PM stuff if the locale - * and gettext haven't done it right. Most English speaking countries - * except the USA use the 24 hour clock (UK, Australia etc). However - * since they are English nobody bothers to write a language - * translation (gettext) file. So the locale turns off the AM/PM, but - * gettext does not turn on the 24 hour clock. Leaving a mess. - * - * This routine checks if AM/PM are defined in the locale, if not it - * forces the use of the 24 hour clock. - * - * The function itself is a front end on strftime and takes exactly - * the same arguments. - * - * TODO: Actually remove the '%p' from the fixed up string so that - * there isn't a stray space. - **/ - -size_t e_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct tm *tm) -{ - char buf[10]; - char *sp; - char *ffmt; - size_t ret; - - if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) { - /* No AM/PM involved - can use the fmt string directly */ - ret=e_strftime(s, max, fmt, tm); - } else { - /* Get the AM/PM symbol from the locale */ - e_strftime (buf, 10, "%p", tm); - - if (buf[0]) { - /** - * AM/PM have been defined in the locale - * so we can use the fmt string directly - **/ - ret=e_strftime(s, max, fmt, tm); - } else { - /** - * No AM/PM defined by locale - * must change to 24 hour clock - **/ - ffmt=g_strdup(fmt); - for (sp=ffmt; (sp=strstr(sp, "%l")); sp++) { - /** - * Maybe this should be 'k', but I have never - * seen a 24 clock actually use that format - **/ - sp[1]='H'; - } - for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) { - sp[1]='H'; - } - ret=e_strftime(s, max, ffmt, tm); - g_free(ffmt); - } - } - return(ret); -} - -size_t -e_utf8_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct tm *tm) -{ - size_t sz, ret; - char *locale_fmt, *buf; - - locale_fmt = g_locale_from_utf8(fmt, -1, NULL, &sz, NULL); - if (!locale_fmt) - return 0; - - ret = e_strftime_fix_am_pm(s, max, locale_fmt, tm); - if (!ret) { - g_free (locale_fmt); - return 0; - } - - buf = g_locale_to_utf8(s, ret, NULL, &sz, NULL); - if (!buf) { - g_free (locale_fmt); - return 0; - } - - if (sz >= max) { - char *tmp = buf + max - 1; - tmp = g_utf8_find_prev_char(buf, tmp); - if (tmp) - sz = tmp - buf; - else - sz = 0; - } - memcpy(s, buf, sz); - s[sz] = '\0'; - g_free(locale_fmt); - g_free(buf); - return sz; -} - -/** - * e_flexible_strtod: - * @nptr: the string to convert to a numeric value. - * @endptr: if non-NULL, it returns the character after - * the last character used in the conversion. - * - * Converts a string to a gdouble value. This function detects - * strings either in the standard C locale or in the current locale. - * - * This function is typically used when reading configuration files or - * other non-user input that should not be locale dependent, but may - * have been in the past. To handle input from the user you should - * normally use the locale-sensitive system strtod function. - * - * To convert from a double to a string in a locale-insensitive way, use - * @g_ascii_dtostr. - * - * Return value: the gdouble value. - **/ -gdouble -e_flexible_strtod (const gchar *nptr, - gchar **endptr) -{ - gchar *fail_pos; - gdouble val; - struct lconv *locale_data; - const char *decimal_point; - int decimal_point_len; - const char *p, *decimal_point_pos; - const char *end = NULL; /* Silence gcc */ - char *copy, *c; - - g_return_val_if_fail (nptr != NULL, 0); - - fail_pos = NULL; - - locale_data = localeconv (); - decimal_point = locale_data->decimal_point; - decimal_point_len = strlen (decimal_point); - - g_assert (decimal_point_len != 0); - - decimal_point_pos = NULL; - if (!strcmp (decimal_point, ".")) - return strtod (nptr, endptr); - - p = nptr; - - /* Skip leading space */ - while (isspace ((guchar)*p)) - p++; - - /* Skip leading optional sign */ - if (*p == '+' || *p == '-') - p++; - - if (p[0] == '0' && - (p[1] == 'x' || p[1] == 'X')) { - p += 2; - /* HEX - find the (optional) decimal point */ - - while (isxdigit ((guchar)*p)) - p++; - - if (*p == '.') { - decimal_point_pos = p++; - - while (isxdigit ((guchar)*p)) - p++; - - if (*p == 'p' || *p == 'P') - p++; - if (*p == '+' || *p == '-') - p++; - while (isdigit ((guchar)*p)) - p++; - end = p; - } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { - return strtod (nptr, endptr); - } - } else { - while (isdigit ((guchar)*p)) - p++; - - if (*p == '.') { - decimal_point_pos = p++; - - while (isdigit ((guchar)*p)) - p++; - - if (*p == 'e' || *p == 'E') - p++; - if (*p == '+' || *p == '-') - p++; - while (isdigit ((guchar)*p)) - p++; - end = p; - } else if (strncmp (p, decimal_point, decimal_point_len) == 0) { - return strtod (nptr, endptr); - } - } - /* For the other cases, we need not convert the decimal point */ - - if (!decimal_point_pos) - return strtod (nptr, endptr); - - /* We need to convert the '.' to the locale specific decimal point */ - copy = g_malloc (end - nptr + 1 + decimal_point_len); - - c = copy; - memcpy (c, nptr, decimal_point_pos - nptr); - c += decimal_point_pos - nptr; - memcpy (c, decimal_point, decimal_point_len); - c += decimal_point_len; - memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1)); - c += end - (decimal_point_pos + 1); - *c = 0; - - val = strtod (copy, &fail_pos); - - if (fail_pos) { - if (fail_pos > decimal_point_pos) - fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1); - else - fail_pos = (char *)nptr + (fail_pos - copy); - } - - g_free (copy); - - if (endptr) - *endptr = fail_pos; - - return val; -} - -/** - * e_ascii_dtostr: - * @buffer: A buffer to place the resulting string in - * @buf_len: The length of the buffer. - * @format: The printf-style format to use for the - * code to use for converting. - * @d: The double to convert - * - * Converts a double to a string, using the '.' as - * decimal_point. To format the number you pass in - * a printf-style formating string. Allowed conversion - * specifiers are eEfFgG. - * - * If you want to generates enough precision that converting - * the string back using @g_strtod gives the same machine-number - * (on machines with IEEE compatible 64bit doubles) use the format - * string "%.17g". If you do this it is guaranteed that the size - * of the resulting string will never be larger than - * @G_ASCII_DTOSTR_BUF_SIZE bytes. - * - * Return value: The pointer to the buffer with the converted string. - **/ -gchar * -e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d) -{ - struct lconv *locale_data; - const char *decimal_point; - int decimal_point_len; - gchar *p; - int rest_len; - gchar format_char; - - g_return_val_if_fail (buffer != NULL, NULL); - g_return_val_if_fail (format[0] == '%', NULL); - g_return_val_if_fail (strpbrk (format + 1, "'l%") == NULL, NULL); - - format_char = format[strlen (format) - 1]; - - g_return_val_if_fail (format_char == 'e' || format_char == 'E' || - format_char == 'f' || format_char == 'F' || - format_char == 'g' || format_char == 'G', - NULL); - - if (format[0] != '%') - return NULL; - - if (strpbrk (format + 1, "'l%")) - return NULL; - - if (!(format_char == 'e' || format_char == 'E' || - format_char == 'f' || format_char == 'F' || - format_char == 'g' || format_char == 'G')) - return NULL; - - - g_snprintf (buffer, buf_len, format, d); - - locale_data = localeconv (); - decimal_point = locale_data->decimal_point; - decimal_point_len = strlen (decimal_point); - - g_assert (decimal_point_len != 0); - - if (strcmp (decimal_point, ".")) { - p = buffer; - - if (*p == '+' || *p == '-') - p++; - - while (isdigit ((guchar)*p)) - p++; - - if (strncmp (p, decimal_point, decimal_point_len) == 0) { - *p = '.'; - p++; - if (decimal_point_len > 1) { - rest_len = strlen (p + (decimal_point_len-1)); - memmove (p, p + (decimal_point_len-1), - rest_len); - p[rest_len] = 0; - } - } - } - - return buffer; -} - -gchar * -e_strdup_append_strings (gchar *first_string, ...) -{ - gchar *buffer; - gchar *current; - gint length; - va_list args1; - va_list args2; - char *v_string; - int v_int; - - va_start (args1, first_string); - G_VA_COPY (args2, args1); - - length = 0; - - v_string = first_string; - while (v_string) { - v_int = va_arg (args1, int); - if (v_int >= 0) - length += v_int; - else - length += strlen (v_string); - v_string = va_arg (args1, char *); - } - - buffer = g_new (char, length + 1); - current = buffer; - - v_string = first_string; - while (v_string) { - v_int = va_arg (args2, int); - if (v_int < 0) { - int i; - for (i = 0; v_string[i]; i++) { - *(current++) = v_string[i]; - } - } else { - int i; - for (i = 0; v_string[i] && i < v_int; i++) { - *(current++) = v_string[i]; - } - } - v_string = va_arg (args2, char *); - } - *(current++) = 0; - - va_end (args1); - va_end (args2); - - return buffer; -} - -gchar ** -e_strdupv (const gchar **str_array) -{ - if (str_array) { - gint i; - gchar **retval; - - i = 0; - while (str_array[i]) - i++; - - retval = g_new (gchar*, i + 1); - - i = 0; - while (str_array[i]) { - retval[i] = g_strdup (str_array[i]); - i++; - } - retval[i] = NULL; - - return retval; - } else { - return NULL; - } -} - -char * -e_gettext (const char *msgid) -{ - static gboolean initialized = FALSE; - - if (!initialized) { - bindtextdomain (E_I18N_DOMAIN, GNOMELOCALEDIR); - bind_textdomain_codeset (E_I18N_DOMAIN, "UTF-8"); - initialized = TRUE; - } - - return dgettext (E_I18N_DOMAIN, msgid); -} - diff --git a/e-util/e-util.h b/e-util/e-util.h deleted file mode 100644 index d9d51967d1..0000000000 --- a/e-util/e-util.h +++ /dev/null @@ -1,231 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-util.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef _E_UTIL_H_ -#define _E_UTIL_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include - -#define E_MAKE_TYPE(l,str,t,ci,i,parent) \ -GType l##_get_type(void)\ -{\ - static GType type = 0; \ - if (!type){ \ - static GTypeInfo const object_info = { \ - sizeof (t##Class), \ - \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - \ - (GClassInitFunc) ci, \ - (GClassFinalizeFunc) NULL, \ - NULL, /* class_data */ \ - \ - sizeof (t), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) i, \ - }; \ - type = g_type_register_static (parent, str, &object_info, 0); \ - } \ - return type; \ -} - - -#define E_MAKE_X_TYPE(l,str,t,ci,i,parent,poa_init,offset) \ -GtkType l##_get_type(void) \ -{ \ - static GtkType type = 0; \ - if (!type){ \ - GTypeInfo info = { \ - sizeof (t##Class), \ - \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - \ - (GClassInitFunc) ci, \ - (GClassFinalizeFunc) NULL, \ - \ - NULL, /* class_data */ \ - \ - sizeof (t), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) i, \ - }; \ - type = bonobo_x_type_unique ( \ - parent, poa_init, NULL, \ - offset, &info, str); \ - } \ - return type; \ -} - -#define GET_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ - { \ - va_list args; \ - int i; \ - char *s; \ - \ - va_start (args, (first_string)); \ - \ - i = 0; \ - for (s = (first_string); s; s = va_arg (args, char *)) \ - i++; \ - va_end (args); \ - \ - (labels) = g_new (char *, i + 1); \ - \ - va_start (args, (first_string)); \ - i = 0; \ - for (s = (first_string); s; s = va_arg (args, char *)) \ - (labels)[i++] = s; \ - \ - va_end (args); \ - (labels)[i] = NULL; \ - } - - -#define GET_DUPLICATED_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ - { \ - int i; \ - GET_STRING_ARRAY_FROM_ELLIPSIS ((labels), (first_string)); \ - for (i = 0; labels[i]; i++) \ - labels[i] = g_strdup (labels[i]); \ - } - - -#if 0 -# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) \ - gtk_object_class_add_signals (oc, sigs, last) -# define E_OBJECT_CLASS_TYPE(oc) (oc)->type -#else -# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) -# define E_OBJECT_CLASS_TYPE(oc) G_TYPE_FROM_CLASS (oc) -#endif - - -typedef enum { - E_FOCUS_NONE, - E_FOCUS_CURRENT, - E_FOCUS_START, - E_FOCUS_END -} EFocus; -int g_str_compare (const void *x, - const void *y); -int g_collate_compare (const void *x, - const void *y); -int g_int_compare (const void *x, - const void *y); -char *e_strdup_strip (const char *string); -void e_free_object_list (GList *list); -void e_free_object_slist (GSList *list); -void e_free_string_list (GList *list); -void e_free_string_slist (GSList *list); -char *e_read_file (const char *filename); -int e_write_file (const char *filename, - const char *data, - int flags); -int e_write_file_mkstemp (char *filename, - const char *data); -int e_mkdir_hier (const char *path, - mode_t mode); - -gchar **e_strsplit (const gchar *string, - const gchar *delimiter, - gint max_tokens); -gchar *e_strstrcase (const gchar *haystack, - const gchar *needle); -/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */ -void e_filename_make_safe (gchar *string); -gchar *e_format_number (gint number); -gchar *e_format_number_float (gfloat number); -gboolean e_create_directory (gchar *directory); -gchar **e_strdupv (const gchar **str_array); - - -typedef int (*ESortCompareFunc) (const void *first, - const void *second, - gpointer closure); -void e_sort (void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure); -void e_bsearch (const void *key, - const void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure, - size_t *start, - size_t *end); -size_t e_strftime_fix_am_pm (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_strftime (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_utf8_strftime_fix_am_pm (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_utf8_strftime (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -/* String to/from double conversion functions */ -gdouble e_flexible_strtod (const gchar *nptr, - gchar **endptr); - -/* 29 bytes should enough for all possible values that - * g_ascii_dtostr can produce with the %.17g format. - * Then add 10 for good measure */ -#define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10) -gchar *e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d); - -/* Alternating char * and int arguments with a NULL char * to end. - Less than 0 for the int means copy the whole string. */ -gchar *e_strdup_append_strings (gchar *first_string, - ...); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _E_UTIL_H_ */ diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c deleted file mode 100644 index 437934be65..0000000000 --- a/e-util/e-xml-utils.c +++ /dev/null @@ -1,502 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-xml-utils.c - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "e-xml-utils.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gal/util/e-i18n.h" -#include "gal/util/e-util.h" - -xmlNode * -e_xml_get_child_by_name (const xmlNode *parent, const xmlChar *child_name) -{ - xmlNode *child; - - g_return_val_if_fail (parent != NULL, NULL); - g_return_val_if_fail (child_name != NULL, NULL); - - for (child = parent->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrcmp (child->name, child_name) == 0) { - return child; - } - } - return NULL; -} - -/* Returns the first child with the name child_name and the "lang" - * attribute that matches the current LC_MESSAGES, or else, the first - * child with the name child_name and no "lang" attribute. - */ -xmlNode * -e_xml_get_child_by_name_by_lang (const xmlNode *parent, - const xmlChar *child_name, - const gchar *lang) -{ - xmlNode *child; - /* This is the default version of the string. */ - xmlNode *C = NULL; - - g_return_val_if_fail (parent != NULL, NULL); - g_return_val_if_fail (child_name != NULL, NULL); - - if (lang == NULL) { -#ifdef HAVE_LC_MESSAGES - lang = setlocale (LC_MESSAGES, NULL); -#else - lang = setlocale (LC_CTYPE, NULL); -#endif - } - for (child = parent->xmlChildrenNode; child != NULL; child = child->next) { - if (xmlStrcmp (child->name, child_name) == 0) { - xmlChar *this_lang = xmlGetProp (child, "lang"); - if (this_lang == NULL) { - C = child; - } else if (xmlStrcmp(this_lang, "lang") == 0) { - return child; - } - } - } - return C; -} - -static xmlNode * -e_xml_get_child_by_name_by_lang_list_with_score (const xmlNode *parent, - const gchar *name, - const GList *lang_list, - gint *best_lang_score) -{ - xmlNodePtr best_node = NULL, node; - - for (node = parent->xmlChildrenNode; node != NULL; node = node->next) { - xmlChar *lang; - - if (node->name == NULL || strcmp (node->name, name) != 0) { - continue; - } - lang = xmlGetProp (node, "xml:lang"); - if (lang != NULL) { - const GList *l; - gint i; - - for (l = lang_list, i = 0; - l != NULL && i < *best_lang_score; - l = l->next, i++) { - if (strcmp ((gchar *) l->data, lang) == 0) { - best_node = node; - *best_lang_score = i; - } - } - } else { - if (best_node == NULL) { - best_node = node; - } - } - xmlFree (lang); - if (*best_lang_score == 0) { - return best_node; - } - } - - return best_node; -} - -/* - * e_xml_get_child_by_name_by_lang_list: - * - */ -xmlNode * -e_xml_get_child_by_name_by_lang_list (const xmlNode *parent, - const gchar *name, - const GList *lang_list) -{ - gint best_lang_score = INT_MAX; - - g_return_val_if_fail (parent != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - - if (lang_list == NULL) { - lang_list = gnome_i18n_get_language_list ("LC_MESSAGES"); - } - return e_xml_get_child_by_name_by_lang_list_with_score - (parent,name, - lang_list, - &best_lang_score); -} - -/* - * e_xml_get_child_by_name_no_lang - * - */ -xmlNode * -e_xml_get_child_by_name_no_lang (const xmlNode *parent, const gchar *name) -{ - xmlNodePtr node; - - g_return_val_if_fail (parent != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - - for (node = parent->xmlChildrenNode; node != NULL; node = node->next) { - xmlChar *lang; - - if (node->name == NULL || strcmp (node->name, name) != 0) { - continue; - } - lang = xmlGetProp (node, "xml:lang"); - if (lang == NULL) { - return node; - } - xmlFree (lang); - } - - return NULL; -} - -gint -e_xml_get_integer_prop_by_name (const xmlNode *parent, const xmlChar *prop_name) -{ - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - return e_xml_get_integer_prop_by_name_with_default (parent, prop_name, 0); -} - -gint -e_xml_get_integer_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - gint def) -{ - xmlChar *prop; - gint ret_val = def; - - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - prop = xmlGetProp ((xmlNode *) parent, prop_name); - if (prop != NULL) { - (void) sscanf (prop, "%d", &ret_val); - xmlFree (prop); - } - return ret_val; -} - -void -e_xml_set_integer_prop_by_name (xmlNode *parent, - const xmlChar *prop_name, - gint value) -{ - gchar *valuestr; - - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); - - valuestr = g_strdup_printf ("%d", value); - xmlSetProp (parent, prop_name, valuestr); - g_free (valuestr); -} - -guint -e_xml_get_uint_prop_by_name (const xmlNode *parent, const xmlChar *prop_name) -{ - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - return e_xml_get_uint_prop_by_name_with_default (parent, prop_name, 0); -} - -guint -e_xml_get_uint_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - guint def) -{ - xmlChar *prop; - guint ret_val = def; - - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - prop = xmlGetProp ((xmlNode *) parent, prop_name); - if (prop != NULL) { - (void) sscanf (prop, "%u", &ret_val); - xmlFree (prop); - } - return ret_val; -} - -void -e_xml_set_uint_prop_by_name (xmlNode *parent, - const xmlChar *prop_name, - guint value) -{ - gchar *valuestr; - - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); - - valuestr = g_strdup_printf ("%u", value); - xmlSetProp (parent, prop_name, valuestr); - g_free (valuestr); -} - -gboolean -e_xml_get_bool_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name) -{ - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - return e_xml_get_bool_prop_by_name_with_default (parent, - prop_name, - FALSE); -} - -gboolean -e_xml_get_bool_prop_by_name_with_default(const xmlNode *parent, - const xmlChar *prop_name, - gboolean def) -{ - xmlChar *prop; - gboolean ret_val = def; - - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - prop = xmlGetProp ((xmlNode *) parent, prop_name); - if (prop != NULL) { - if (g_strcasecmp (prop, "true") == 0) { - ret_val = TRUE; - } else if (g_strcasecmp (prop, "false") == 0) { - ret_val = FALSE; - } - xmlFree(prop); - } - return ret_val; -} - -void -e_xml_set_bool_prop_by_name (xmlNode *parent, const xmlChar *prop_name, gboolean value) -{ - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); - - if (value) { - xmlSetProp (parent, prop_name, "true"); - } else { - xmlSetProp (parent, prop_name, "false"); - } -} - -gdouble -e_xml_get_double_prop_by_name (const xmlNode *parent, const xmlChar *prop_name) -{ - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - return e_xml_get_double_prop_by_name_with_default (parent, prop_name, 0.0); -} - -gdouble -e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, const xmlChar *prop_name, gdouble def) -{ - xmlChar *prop; - gdouble ret_val = def; - - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - prop = xmlGetProp ((xmlNode *) parent, prop_name); - if (prop != NULL) { - ret_val = e_flexible_strtod (prop, NULL); - xmlFree (prop); - } - return ret_val; -} - -void -e_xml_set_double_prop_by_name(xmlNode *parent, const xmlChar *prop_name, gdouble value) -{ - char buffer[E_ASCII_DTOSTR_BUF_SIZE]; - char *format; - - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); - - if (fabs (value) < 1e9 && fabs (value) > 1e-5) { - format = g_strdup_printf ("%%.%df", DBL_DIG); - } else { - format = g_strdup_printf ("%%.%dg", DBL_DIG); - } - e_ascii_dtostr (buffer, sizeof (buffer), format, value); - g_free (format); - - xmlSetProp (parent, prop_name, buffer); -} - -gchar * -e_xml_get_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name) -{ - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - return e_xml_get_string_prop_by_name_with_default (parent, prop_name, NULL); -} - -gchar * -e_xml_get_string_prop_by_name_with_default (const xmlNode *parent, const xmlChar *prop_name, const gchar *def) -{ - xmlChar *prop; - gchar *ret_val; - - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - prop = xmlGetProp ((xmlNode *) parent, prop_name); - if (prop != NULL) { - ret_val = g_strdup (prop); - xmlFree (prop); - } else { - ret_val = g_strdup (def); - } - return ret_val; -} - -void -e_xml_set_string_prop_by_name (xmlNode *parent, const xmlChar *prop_name, const gchar *value) -{ - g_return_if_fail (parent != NULL); - g_return_if_fail (prop_name != NULL); - - if (value != NULL) { - xmlSetProp (parent, prop_name, value); - } -} - -gchar * -e_xml_get_translated_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name) -{ - xmlChar *prop; - gchar *ret_val = NULL; - gchar *combined_name; - - g_return_val_if_fail (parent != NULL, 0); - g_return_val_if_fail (prop_name != NULL, 0); - - prop = xmlGetProp ((xmlNode *) parent, prop_name); - if (prop != NULL) { - ret_val = g_strdup (prop); - xmlFree (prop); - return ret_val; - } - - combined_name = g_strdup_printf("_%s", prop_name); - prop = xmlGetProp ((xmlNode *) parent, combined_name); - if (prop != NULL) { - ret_val = g_strdup (gettext(prop)); - xmlFree (prop); - } - g_free(combined_name); - - return ret_val; -} - - -int -e_xml_save_file (const char *filename, xmlDocPtr doc) -{ - char *filesave, *slash, *xmlbuf; - size_t n, written = 0; - int ret, fd, size; - int errnosave; - ssize_t w; - - filesave = alloca (strlen (filename) + 5); - slash = strrchr (filename, '/'); - if (slash) - sprintf (filesave, "%.*s.#%s", slash - filename + 1, filename, slash + 1); - else - sprintf (filesave, ".#%s", filename); - - fd = open (filesave, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (fd == -1) - return -1; - - xmlDocDumpFormatMemory (doc, (xmlChar **) &xmlbuf, &size, TRUE); - if (size <= 0) { - close (fd); - unlink (filesave); - errno = ENOMEM; - return -1; - } - - n = (size_t) size; - do { - do { - w = write (fd, xmlbuf + written, n - written); - } while (w == -1 && errno == EINTR); - - if (w > 0) - written += w; - } while (w != -1 && written < n); - - xmlFree (xmlbuf); - - if (written < n || fsync (fd) == -1) { - errnosave = errno; - close (fd); - unlink (filesave); - errno = errnosave; - return -1; - } - - while ((ret = close (fd)) == -1 && errno == EINTR) - ; - - if (ret == -1) - return -1; - - if (rename (filesave, filename) == -1) { - errnosave = errno; - unlink (filesave); - errno = errnosave; - return -1; - } - - return 0; -} diff --git a/e-util/e-xml-utils.h b/e-util/e-xml-utils.h deleted file mode 100644 index 6c39ee6f79..0000000000 --- a/e-util/e-xml-utils.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-xml-utils.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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. - */ - -#ifndef __E_XML_UTILS__ -#define __E_XML_UTILS__ - -#include -#include - -G_BEGIN_DECLS - -xmlNode *e_xml_get_child_by_name (const xmlNode *parent, - const xmlChar *child_name); -/* lang set to NULL means use the current locale. */ -xmlNode *e_xml_get_child_by_name_by_lang (const xmlNode *parent, - const xmlChar *child_name, - const gchar *lang); -/* lang_list set to NULL means use the current locale. */ -xmlNode *e_xml_get_child_by_name_by_lang_list (const xmlNode *parent, - const gchar *name, - const GList *lang_list); -xmlNode *e_xml_get_child_by_name_no_lang (const xmlNode *parent, - const gchar *name); - - -gint e_xml_get_integer_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name); -gint e_xml_get_integer_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - gint def); -void e_xml_set_integer_prop_by_name (xmlNode *parent, - const xmlChar *prop_name, - gint value); - - -guint e_xml_get_uint_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name); -guint e_xml_get_uint_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - guint def); -void e_xml_set_uint_prop_by_name (xmlNode *parent, - const xmlChar *prop_name, - guint value); - - -gboolean e_xml_get_bool_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name); -gboolean e_xml_get_bool_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - gboolean def); -void e_xml_set_bool_prop_by_name (xmlNode *parent, - const xmlChar *prop_name, - gboolean value); - -gdouble e_xml_get_double_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name); -gdouble e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - gdouble def); -void e_xml_set_double_prop_by_name ( xmlNode *parent, - const xmlChar *prop_name, - gdouble value); - - -gchar *e_xml_get_string_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name); -gchar *e_xml_get_string_prop_by_name_with_default (const xmlNode *parent, - const xmlChar *prop_name, - const gchar *def); -void e_xml_set_string_prop_by_name (xmlNode *parent, - const xmlChar *prop_name, - const gchar *value); - -gchar *e_xml_get_translated_string_prop_by_name (const xmlNode *parent, - const xmlChar *prop_name); - -int e_xml_save_file (const char *filename, xmlDocPtr doc); - -G_END_DECLS - -#endif /* __E_XML_UTILS__ */ diff --git a/help/devel/executive-summary/evolution-services.hierarchy b/help/devel/executive-summary/evolution-services.hierarchy deleted file mode 100644 index 37559d819d..0000000000 --- a/help/devel/executive-summary/evolution-services.hierarchy +++ /dev/null @@ -1,7 +0,0 @@ -GtkObject - BonoboObject - ExecutiveSummaryComponent - ExecutiveSummaryComponentFactory - Handle to remote Bonobo::Unknown - ExecutiveSummaryComponentFactoryClient - ExecutiveSummaryHtmlView diff --git a/help/devel/importer/evolution-shell-importer.hierarchy b/help/devel/importer/evolution-shell-importer.hierarchy deleted file mode 100644 index c46ebdf782..0000000000 --- a/help/devel/importer/evolution-shell-importer.hierarchy +++ /dev/null @@ -1,7 +0,0 @@ -GtkObject - BonoboObject - BonoboXObject - EvolutionImporter - EvolutionImporterListener - Handle to remote Bonobo::Unknown - EvolutionImporterClient diff --git a/mail/ChangeLog b/mail/ChangeLog index 1d1bc0f896..aad693723e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -48,6 +48,65 @@ emfv->mark_seen for deciding whether or not to mark the message as seen. Fixes bug #65448. +2004-09-08 Not Zed + + ** See bug #60515. + + * mail-account-gui.c (sig_fill_menu): connect to the activate + signal for the none item. + +2004-09-01 Jeffrey Stedfast + + Fix for bug #63377 and prevention of similar cases. + + * em-format.c (emf_finalise): Free the default_charset. + (emf_format_clone): Clone the default_charset - this prevents the + particular crash described in bug #63377. + + * em-utils.c (em_utils_message_to_html): If source is NULL, set + our own default charset (from the user's gconf key) on the + formatter to make sure there's always a source charset for + conversion to UTF-8. + +2004-08-30 Jeffrey Stedfast + + * em-folder-tree.c (emft_popup_delete_folder): Set the store and + full_name info on the dialog. + (emft_popup_delete_response): Use the requisite data stored on the + dialog object rather than examining the selection again. Fixes bug + #62665. + +2004-08-30 Not Zed + + ** See bug #64377. + + * em-folder-selector.c (emfs_response): only set the uri if we + have one to set. + + * em-folder-tree.c (em_folder_tree_finalize): Removed + cose using selected_path and selected_uri strings. + (emft_popup_new_folder): " + (emft_popup_copy_folder_selected): " + (emft_tree_selection_changed): + (emft_tree_row_activated): ", free paths after use. + + * em-folder-selector.c (emfs_create_name_changed): free + get_selected_uri return. + (emfs_create_name_activate): " + (em_folder_selector_get_selected_path): handle api change, store + the selected_path too. + + * em-folder-tree.c (em_folder_tree_get_selected_uri): + de-constify,and get the selection directly from the tree. + (em_folder_tree_get_selected_path): same. + +2004-08-27 Not Zed + + ** See bug #63456. + + * message-list.c (main_folder_changed): noop if the async_event + pointer is NULL which can happen during destroy. + 2004-09-09 Jeffrey Stedfast * mail-account-gui.c (mail_account_gui_new): If built with @@ -455,216 +514,6 @@ * Makefile.am (SUBDIRS): Revert previous error change -2004-09-10 Not Zed - - * em-*: various doco updates. - - * em-format-quote.c (emfq_builtin_init): instead of removing the - type, just add an override noop. Changed api's. - -2004-09-09 Not Zed - - * em-format.c (em_format_class_remove_handler): Change this to use - the original structure only, not by type. - - * em-format-hook.c (emfh_enable): implement hook enablation. - -2004-09-07 Not Zed - - * em-account-editor.c (emae_setup_providers): set the provider - shown selected on the store as well. - - * mail-config.glade: moved the druid 'help text' directly into the - glade file. - - * em-account-editor.c (emae_check_complete): add pre-load for - management page options. - - * em-utils.c (em_utils_configure_account): remove use of - mail-config-druid. - - * em-account-editor.c (emae_remove_childen): removed. - (*): removed service->url, always get it from/set it to the - e-account so it doesn't have side-effects with plugins. - - * mail-dialogs.glade: fix up the names of the various license - dialog fields. - -2004-09-06 Not Zed - - * em-account-editor.c (emae_receive_options_extra_item): store the - config widgets in the item entry itself. - (emae_auto_detect): wasted a whole lot of time on this crap. - - * em-account-prefs.c (account_able_clicked): removed some redundant logic. - - * mail-send-recv.c (mail_autoreceive_setup): renamed to - mail_autoreceive_init and rewrote all the callbacks. now it - listens to events on the accountlist directly and doesn't need - invoking manually. It also runs relative to the account always, - rather than copying the uri. Removed all callers except the mail - component one. - - * em-account-editor.c (em_account_editor_provider_selector_new): - removed becaus eof below. - (em_account_editor_construct): copy the account to a working - object if supplied, else create a new one. - - * mail-config.glade: make the provider selectors just use - em_account_editor_dropdown new for the dropdown menu. - - * em-account-editor.c (prepare_signatures): removed, merged into - the identity page code. - (sig_fill_menu): removed. - (emae_setup_signatures): new function to setup signatures on a - gtkcombobox. - (clear_menu): removed. - (signature_changed): removed. - (emae_signature_changed): new function for changed. - (signature_removed): removed. - (emae_signature_removed): new function for removed. - (emae_signature_get_iter): helper for finding the right row for - this signature. - (signature_added): removed. - (emae_signature_added): new function for added. - (sig_activate): removed. - (emae_signaturetype_changed): new function to update the account - info immediately. - (sig_add_new_signature): renamed to emae_signature_new. - (select_account_signature): no longer needed, this happens in the - setup. - - * mail-config.glade: changed the signature thing to a custom - widget (gtkcombobox). - - * em-account-editor.c (em_account_editor_construct): updates for - api change, table sections require table items. - (emae_setup_service): handle host:port hostname syntax. - (emae_hostname_changed): and here too. - (emae_commit): fill this out, and implement it. - -2004-09-04 Not Zed - - * *.c: include gnome i18.h if needed since camel-object.h was - fixed. - - * em-format.c (em_format_class_add_handler): if a handler is - already set for type, link it in. - - * em-format.h: added a link pointer to EMFormatHanlder, so that - overrides can also fallback. remove applications member - not - used anymore. - -2004-09-01 Not Zed - - * em-popup.h: added some docs. - - * em-popup.c (emp_standard_menu_factory): - * em-folder-tree.c (tree_drag_data_received): popup api changes. - -2004-08-31 Not Zed - - * em-format-html-display.c (efhd_attachment_button_show): use a - wrapper for the button event since the popup event has changed - signature. - -2004-08-30 Not Zed - - * em-popup.c (emp_standard_menu_factory): changed args. - (struct _open_in_item): removed, use user data instead. - (*): fix callbacks for new apis. - (emp_popup_open): Removed some dead popup callbacks never invoked. - (em_popup_target_new_attachments): new target type for attachment - bar in composer. - - * em-folder-tree.c (emft_popup*): convert to new e-popup apis. - - * em-folder-view.c: emfv_popup_*: convert to new e-poup callback - signatures. - (EMFV_MAP_CALLBACK): fix for e-popup callback change. - (EMFV_POPUP_AUTO_TYPE): same. - (emfv_popup): dont bother setting item callback data. - (emfv_popup_labels_free): api changes. - (emfv_popup_items_free): new free method. - (EMFVPopupItem): No longer needed. - (emfv_uri_popup_free): api changes. - (emfv_format_popup_event): new api's == simpler code. - - * em-account-editor.c (emae_receive_options_extra_item): add a - hack for the label item, which is only used by connector to - override the hostname and username labels. - -2004-08-24 Not Zed - - * em-account-editor.c (em_account_editor_construct): create the - window rather than the widget here. - - * mail-config.glade: remove the extra_page from the druid, it is - autogenerated now. renamed the "Receiving options" notebook page - to "Receiving Email" since it isn't hte options page. - - * em-account-editor.c (emae_receive_options_page): no longer - needed, autogenerated. - (emae_receive_options_item): setup the auto-receive time values. - (emae_receive_page): don't setup the auto check time values here. - - * mail-config.glade: Remove the Receiving Mail tab, it is now - completely auto-generated. - -2004-08-17 Not Zed - - * em-event.[ch]: mail event dispatcher. - - * mail-component.c (mc_startup): hook into events. - - * mail-folder-cache.c (update_1folder): always set the uri field. - (real_flush_updates): emit a folder.changed:new event if we have new - mail. - -2004-08-13 Not Zed - - * mail-config.glade: replaced ssl selector with custom widget - (gtkcombobox). Giv the preferences, composer toplevel unique - names. - -2004-07-29 Not Zed - - * mail-config.glade: replaced source and transport selector with - custom widget (gtkcombobox). - - * em-account-editor.[ch]: copy over mail-account-gui.[ch] and - rename stuff. Make a gobject. Move most internals, internal. - -2004-07-28 Not Zed - - * em-composer-prefs.c (em_composer_prefs_construct): get the - toplevel tab as the root. - (em_composer_prefs_construct): setup plugin metadata for composer - prefs. - - * em-mailer-prefs.c (em_mailer_prefs_construct): setup plugin - metadata for mail preferences. - - * em-config.c (em_config_target_new_prefs): new target for 'prefs' - mode, everything global via gconf. - - * em-mailer-prefs.c (em_mailer_prefs_construct): get the gui from - the preferences_toplevel not the preferences_tab window which we - don't need. - - * mail-config.glade: rename the preferences 'toplevel' to - preferences_toplevel so we can get it unparented. And the - composer toplevel to composer_toplevel. - - * em-folder-properties.c (em_folder_properties_show): remove test - code. - - * em-format.h (struct _EMFormatPURI): add a free function - callback. - - * em-format.c (emf_clear_puri_node): if the free function is set, - call it. - 2004-07-01 Rodney Dawes * Makefile.am (BUILT_SOURCES): Remove $(error_i18n) diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 20df960507..524c188351 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -28,7 +28,6 @@ #include #include -#include #include "mail-mt.h" #include "mail-ops.h" diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index da31fd4c12..33c3c97843 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -20,6 +20,7 @@ * */ + #ifdef HAVE_CONFIG_H #include #endif @@ -37,7 +38,6 @@ #include #include -#include #include diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index c516a53735..4ba92154e5 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -37,7 +37,6 @@ #include #include -#include #include #include @@ -988,47 +987,35 @@ tree_drag_data_action(struct _DragDataReceivedAsync *m) } static void -emft_drop_popup_copy(EPopup *ep, EPopupItem *item, void *data) +emft_drop_popup_copy(GtkWidget *item, struct _DragDataReceivedAsync *m) { - struct _DragDataReceivedAsync *m = data; - m->action = GDK_ACTION_COPY; tree_drag_data_action(m); } static void -emft_drop_popup_move(EPopup *ep, EPopupItem *item, void *data) +emft_drop_popup_move(GtkWidget *item, struct _DragDataReceivedAsync *m) { - struct _DragDataReceivedAsync *m = data; - m->action = GDK_ACTION_MOVE; tree_drag_data_action(m); } static void -emft_drop_popup_cancel(EPopup *ep, EPopupItem *item, void *data) +emft_drop_popup_cancel(GtkWidget *item, struct _DragDataReceivedAsync *m) { - struct _DragDataReceivedAsync *m = data; - m->aborted = TRUE; mail_msg_free(&m->msg); } -static EPopupItem emft_drop_popup_menu[] = { - { E_POPUP_ITEM, "00.emc.00", N_("_Copy to Folder"), emft_drop_popup_copy, NULL, NULL, 1 }, - { E_POPUP_ITEM, "00.emc.01", N_("_Move to Folder"), emft_drop_popup_move, NULL, NULL, 1 }, - { E_POPUP_ITEM, "00.emc.02", N_("_Copy"), emft_drop_popup_copy, NULL, "stock_folder-copy", 2 }, - { E_POPUP_ITEM, "00.emc.03", N_("_Move"), emft_drop_popup_move, NULL, "stock_folder-move", 2 }, - { E_POPUP_BAR, "10.emc" }, - { E_POPUP_ITEM, "99.emc.00", N_("Cancel _Drag"), emft_drop_popup_cancel, NULL, "stock_cancel", 0 }, +static EMPopupItem emft_drop_popup_menu[] = { + { EM_POPUP_ITEM, "00.emc.00", N_("_Copy to Folder"), G_CALLBACK (emft_drop_popup_copy), NULL, NULL, 1 }, + { EM_POPUP_ITEM, "00.emc.01", N_("_Move to Folder"), G_CALLBACK (emft_drop_popup_move), NULL, NULL, 1 }, + { EM_POPUP_ITEM, "00.emc.02", N_("_Copy"), G_CALLBACK (emft_drop_popup_copy), NULL, "stock_folder-copy", 2 }, + { EM_POPUP_ITEM, "00.emc.03", N_("_Move"), G_CALLBACK (emft_drop_popup_move), NULL, "stock_folder-move", 2 }, + { EM_POPUP_BAR, "10.emc" }, + { EM_POPUP_ITEM, "99.emc.00", N_("Cancel _Drag"), G_CALLBACK (emft_drop_popup_cancel), NULL, "stock_cancel", 0 }, }; -static void -emft_drop_popup_free(EPopup *ep, GSList *items, void *data) -{ - g_slist_free(items); -} - static void tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, int x, int y, GtkSelectionData *selection, guint info, guint time, EMFolderTree *emft) { @@ -1095,13 +1082,15 @@ tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, int x, int y mask = ~2; for (i=0;ivisible & mask) == 0) + if ((item->mask & mask) == 0) { + item->activate_data = m; menus = g_slist_append(menus, item); + } } - e_popup_add_items((EPopup *)emp, menus, emft_drop_popup_free, m); - menu = e_popup_create_menu_once((EPopup *)emp, NULL, mask, mask); + em_popup_add_items(emp, menus, (GDestroyNotify)g_slist_free); + menu = em_popup_create_menu_once(emp, NULL, mask, mask); gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); } else { tree_drag_data_action(m); @@ -2215,9 +2204,8 @@ fail: } static void -emft_popup_copy(EPopup *ep, EPopupItem *item, void *data) +emft_popup_copy (GtkWidget *item, EMFolderTree *emft) { - EMFolderTree *emft = data; struct _copy_folder_data *cfd; cfd = g_malloc (sizeof (*cfd)); @@ -2229,9 +2217,8 @@ emft_popup_copy(EPopup *ep, EPopupItem *item, void *data) } static void -emft_popup_move(EPopup *ep, EPopupItem *item, void *data) +emft_popup_move (GtkWidget *item, EMFolderTree *emft) { - EMFolderTree *emft = data; struct _copy_folder_data *cfd; cfd = g_malloc (sizeof (*cfd)); @@ -2444,10 +2431,8 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr } static void -emft_popup_new_folder (EPopup *ep, EPopupItem *pitem, void *data) +emft_popup_new_folder (GtkWidget *item, EMFolderTree *emft) { - EMFolderTree *emft = data; - EMFolderTree *folder_tree; GtkWidget *dialog; char *uri; @@ -2572,9 +2557,8 @@ emft_popup_delete_response (GtkWidget *dialog, int response, EMFolderTree *emft) } static void -emft_popup_delete_folder (EPopup *ep, EPopupItem *pitem, void *data) +emft_popup_delete_folder (GtkWidget *item, EMFolderTree *emft) { - EMFolderTree *emft = data; struct _EMFolderTreePrivate *priv = emft->priv; GtkTreeSelection *selection; CamelStore *local, *store; @@ -2608,9 +2592,8 @@ emft_popup_delete_folder (EPopup *ep, EPopupItem *pitem, void *data) } static void -emft_popup_rename_folder (EPopup *ep, EPopupItem *pitem, void *data) +emft_popup_rename_folder (GtkWidget *item, EMFolderTree *emft) { - EMFolderTree *emft = data; struct _EMFolderTreePrivate *priv = emft->priv; char *prompt, *full_name, *name, *new_name, *uri; GtkTreeSelection *selection; @@ -2705,9 +2688,8 @@ emft_popup_rename_folder (EPopup *ep, EPopupItem *pitem, void *data) static void -emft_popup_properties (EPopup *ep, EPopupItem *pitem, void *data) +emft_popup_properties (GtkWidget *item, EMFolderTree *emft) { - EMFolderTree *emft = data; struct _EMFolderTreePrivate *priv = emft->priv; GtkTreeSelection *selection; GtkTreeModel *model; @@ -2723,39 +2705,33 @@ emft_popup_properties (EPopup *ep, EPopupItem *pitem, void *data) g_free (uri); } -static EPopupItem emft_popup_menu[] = { +static EMPopupItem emft_popup_menu[] = { #if 0 - { E_POPUP_ITEM, "00.emc.00", N_("_View"), emft_popup_view, NULL, NULL, EM_POPUP_FOLDER_SELECT }, - { E_POPUP_ITEM, "00.emc.01", N_("Open in _New Window"), emft_popup_open_new, NULL, NULL, EM_POPUP_FOLDER_SELECT }, + { EM_POPUP_ITEM, "00.emc.00", N_("_View"), G_CALLBACK (emft_popup_view), NULL, NULL, EM_POPUP_FOLDER_SELECT }, + { EM_POPUP_ITEM, "00.emc.01", N_("Open in _New Window"), G_CALLBACK (emft_popup_open_new), NULL, NULL, EM_POPUP_FOLDER_SELECT }, - { E_POPUP_BAR, "10.emc" }, + { EM_POPUP_BAR, "10.emc" }, #endif - { E_POPUP_ITEM, "10.emc.00", N_("_Copy..."), emft_popup_copy, NULL, "stock_folder-copy", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT }, - { E_POPUP_ITEM, "10.emc.01", N_("_Move..."), emft_popup_move, NULL, "stock_folder-move", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE }, + { EM_POPUP_ITEM, "10.emc.00", N_("_Copy..."), G_CALLBACK (emft_popup_copy), NULL, "stock_folder-copy", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT }, + { EM_POPUP_ITEM, "10.emc.01", N_("_Move..."), G_CALLBACK (emft_popup_move), NULL, "stock_folder-move", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE }, - { E_POPUP_BAR, "20.emc" }, + { EM_POPUP_BAR, "20.emc" }, /* FIXME: need to disable for nochildren folders */ - { E_POPUP_ITEM, "20.emc.00", N_("_New Folder..."), emft_popup_new_folder, NULL, "stock_folder", EM_POPUP_FOLDER_INFERIORS }, + { EM_POPUP_ITEM, "20.emc.00", N_("_New Folder..."), G_CALLBACK (emft_popup_new_folder), NULL, "stock_folder", EM_POPUP_FOLDER_INFERIORS }, /* FIXME: need to disable for undeletable folders */ - { E_POPUP_ITEM, "20.emc.01", N_("_Delete"), emft_popup_delete_folder, NULL, "stock_delete", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE }, - { E_POPUP_ITEM, "20.emc.01", N_("_Rename..."), emft_popup_rename_folder, NULL, NULL, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE }, + { EM_POPUP_ITEM, "20.emc.01", N_("_Delete"), G_CALLBACK (emft_popup_delete_folder), NULL, "stock_delete", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE }, + { EM_POPUP_ITEM, "20.emc.01", N_("_Rename..."), G_CALLBACK (emft_popup_rename_folder), NULL, NULL, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE }, - { E_POPUP_BAR, "80.emc" }, - { E_POPUP_ITEM, "80.emc.00", N_("_Properties"), emft_popup_properties, NULL, "stock_folder-properties", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT } + { EM_POPUP_BAR, "80.emc" }, + { EM_POPUP_ITEM, "80.emc.00", N_("_Properties"), G_CALLBACK (emft_popup_properties), NULL, "stock_folder-properties", EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT } }; -static void -emft_popup_free(EPopup *ep, GSList *items, void *data) -{ - g_slist_free(items); -} - static gboolean emft_tree_button_press (GtkTreeView *treeview, GdkEventButton *event, EMFolderTree *emft) { GtkTreeSelection *selection; CamelStore *local, *store; - EMPopupTargetFolder *target; + EMPopupTarget *target; GtkTreePath *tree_path; GtkTreeModel *model; GtkTreeIter iter; @@ -2825,14 +2801,18 @@ emft_tree_button_press (GtkTreeView *treeview, GdkEventButton *event, EMFolderTr emp = em_popup_new ("com.ximian.mail.storageset.popup.select"); /* FIXME: pass valid fi->flags here */ - target = em_popup_target_new_folder (emp, uri, info_flags, flags); + target = em_popup_target_new_folder (uri, info_flags, flags); - for (i = 0; i < sizeof (emft_popup_menu) / sizeof (emft_popup_menu[0]); i++) - menus = g_slist_prepend (menus, &emft_popup_menu[i]); + for (i = 0; i < sizeof (emft_popup_menu) / sizeof (emft_popup_menu[0]); i++) { + EMPopupItem *item = &emft_popup_menu[i]; + + item->activate_data = emft; + menus = g_slist_prepend (menus, item); + } - e_popup_add_items ((EPopup *)emp, menus, emft_popup_free, emft); + em_popup_add_items (emp, menus, (GDestroyNotify) g_slist_free); - menu = e_popup_create_menu_once ((EPopup *)emp, (EPopupTarget *)target, 0, target->target.mask); + menu = em_popup_create_menu_once (emp, target, 0, target->mask); if (event == NULL || event->type == GDK_KEY_PRESS) { /* FIXME: menu pos function */ diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 58037057a4..41f38c3a0b 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -52,7 +52,12 @@ #include #include -#include + +#if 0 +#include +#include +#include +#endif #include #include @@ -1038,34 +1043,20 @@ static void efhd_format_source(EMFormat *emf, CamelStream *stream, CamelMimePart /* if it hasn't been processed yet, format the attachment */ static void -efhd_attachment_show(EPopup *ep, EPopupItem *item, void *data) +efhd_attachment_show(GtkWidget *w, struct _attach_puri *info) { - struct _attach_puri *info = data; - d(printf("show attachment button called\n")); info->shown = ~info->shown; em_format_set_inline(info->puri.format, info->puri.part_id, info->shown); } -static void -efhd_attachment_button_show(GtkWidget *w, void *data) -{ - efhd_attachment_show(NULL, NULL, data); -} - -static EPopupItem efhd_menu_items[] = { - { E_POPUP_BAR, "05.display", }, - { E_POPUP_ITEM, "05.display.00", N_("_View Inline"), efhd_attachment_show }, - { E_POPUP_ITEM, "05.display.00", N_("_Hide"), efhd_attachment_show }, +static EMPopupItem efhd_menu_items[] = { + { EM_POPUP_BAR, "05.display", }, + { EM_POPUP_ITEM, "05.display.00", N_("_View Inline"), G_CALLBACK(efhd_attachment_show) }, + { EM_POPUP_ITEM, "05.display.00", N_("_Hide"), G_CALLBACK(efhd_attachment_show) }, }; -static void -efhd_menu_items_free(EPopup *ep, GSList *items, void *data) -{ - g_slist_free(items); -} - static void efhd_popup_place_widget(GtkMenu *menu, int *x, int *y, gboolean *push_in, gpointer user_data) { @@ -1082,8 +1073,8 @@ efhd_attachment_popup(GtkWidget *w, GdkEventButton *event, struct _attach_puri * GtkMenu *menu; GSList *menus = NULL; EMPopup *emp; - EMPopupTargetPart *target; - EPopupItem *item; + EMPopupTarget *target; + EMPopupItem *item; d(printf("attachment popup, button %d\n", event->button)); @@ -1093,20 +1084,22 @@ efhd_attachment_popup(GtkWidget *w, GdkEventButton *event, struct _attach_puri * } emp = em_popup_new("com.ximian.mail.formathtmldisplay.popup.part"); - target = em_popup_target_new_part(emp, info->puri.part, info->handle?info->handle->mime_type:NULL); - target->target.widget = w; + target = em_popup_target_new_part(info->puri.part, info->handle?info->handle->mime_type:NULL); + target->widget = w; /* add our local menus */ if (info->handle) { /* show/hide menus, only if we have an inline handler */ + efhd_menu_items[0].activate_data = info; menus = g_slist_prepend(menus, &efhd_menu_items[0]); item = &efhd_menu_items[info->shown?2:1]; + item->activate_data = info; menus = g_slist_prepend(menus, item); } - e_popup_add_items((EPopup *)emp, menus, efhd_menu_items_free, info); + em_popup_add_items(emp, menus, (GDestroyNotify)g_slist_free); - menu = e_popup_create_menu_once((EPopup *)emp, (EPopupTarget *)target, target->target.mask, target->target.mask); + menu = em_popup_create_menu_once(emp, target, target->mask, target->mask); if (event) gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, event->time); else @@ -1224,7 +1217,7 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje button = gtk_button_new(); if (info->handle) - g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_button_show), info); + g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_show), info); else { gtk_widget_set_sensitive(button, FALSE); GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 503a3053e2..09d0bc73ff 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -41,7 +41,9 @@ #include #include -#include +#include +#include +#include #include #include diff --git a/mail/em-format.c b/mail/em-format.c index df5ca50e65..737148fa4c 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -202,10 +201,8 @@ em_format_get_type(void) * @emfc: EMFormatClass * @info: Callback information. * - * Add a mime type handler to this class. This is only used by - * implementing classes. The @info.old pointer will automatically be - * setup to point to the old hanlder if one was already set. This can - * be used for overrides a fallback. + * Add a mime type handler to this class. This is only used by implementing + * classes. * * When a mime type described by @info is encountered, the callback will * be invoked. Note that @info may be extended by sub-classes if @@ -216,36 +213,26 @@ em_format_get_type(void) void em_format_class_add_handler(EMFormatClass *emfc, EMFormatHandler *info) { - printf("adding format handler to '%s' '%s'\n", g_type_name_from_class((GTypeClass *)emfc), info->mime_type); - info->old = g_hash_table_lookup(emfc->type_handlers, info->mime_type); g_hash_table_insert(emfc->type_handlers, info->mime_type, info); + /* FIXME: do we care? This is really gui stuff */ + /* + if (info->applications == NULL) + info->applications = gnome_vfs_mime_get_short_list_applications(info->mime_type);*/ } + /** * em_format_class_remove_handler: - * @emfc: - * @info: - * - * Remove a handler. @info must be a value which was previously - * added. + * @emfc: EMFormatClass + * @mime_type: mime-type of handler to remove + * + * Remove a mime type handler from this class. This is only used by + * implementing classes. **/ void -em_format_class_remove_handler(EMFormatClass *emfc, EMFormatHandler *info) +em_format_class_remove_handler (EMFormatClass *emfc, const char *mime_type) { - EMFormatHandler *current; - - /* TODO: thread issues? */ - - current = g_hash_table_lookup(emfc->type_handlers, info->mime_type); - if (current == info) { - current = info->old; - g_hash_table_insert(emfc->type_handlers, current->mime_type, current); - } else { - while (current && current->old != info) - current = current->old; - g_return_if_fail(current != NULL); - current->old = info->old; - } + g_hash_table_remove (emfc->type_handlers, mime_type); } /** @@ -325,8 +312,6 @@ em_format_add_puri(EMFormat *emf, size_t size, const char *cid, CamelMimePart *p EMFormatPURI *puri; const char *tmp; - printf("adding puri for part: %s\n", emf->part_id->str); - g_assert(size >= sizeof(*puri)); puri = g_malloc0(size); @@ -439,13 +424,13 @@ em_format_find_visible_puri(EMFormat *emf, const char *uri) EMFormatPURI *pw; struct _EMFormatPURITree *ptree; - (printf("checking for visible uri '%s'\n", uri)); + d(printf("checking for visible uri '%s'\n", uri)); ptree = emf->pending_uri_level; while (ptree) { pw = (EMFormatPURI *)ptree->uri_list.head; while (pw->next) { - (printf(" pw->uri = '%s' pw->cid = '%s\n", pw->uri?pw->uri:"", pw->cid)); + d(printf(" pw->uri = '%s' pw->cid = '%s\n", pw->uri?pw->uri:"", pw->cid)); if ((pw->uri && !strcmp(pw->uri, uri)) || !strcmp(pw->cid, uri)) return pw; pw = pw->next; @@ -482,8 +467,6 @@ emf_clear_puri_node(struct _EMFormatPURITree *node) pw = (EMFormatPURI *)node->uri_list.head; pn = pw->next; while (pn) { - if (pw->free) - pw->free(pw); g_free(pw->uri); g_free(pw->cid); g_free(pw->part_id); diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c index 98fc1bd319..4f3a2aaa2c 100644 --- a/mail/em-message-browser.c +++ b/mail/em-message-browser.c @@ -41,7 +41,6 @@ #include "em-format-html-display.h" #include "em-message-browser.h" -#include "em-menu.h" #include "evolution-shell-component-utils.h" /* Pixmap stuff, sigh */ @@ -176,8 +175,6 @@ GtkWidget *em_message_browser_new(void) { EMMessageBrowser *emmb = g_object_new(em_message_browser_get_type(), 0); - ((EMFolderView *)emmb)->menu = em_menu_new("com.novell.evolution.mail.messagebrowser"); - return (GtkWidget *)emmb; } diff --git a/mail/em-popup.c b/mail/em-popup.c index 8b580e3147..28e5121c51 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -40,7 +40,6 @@ #include #include -#include #include "em-popup.h" #include "e-util/e-msgport.h" @@ -64,69 +63,71 @@ #include -static void emp_standard_menu_factory(EPopup *emp, void *data); +static void emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data); + +struct _EMPopupFactory { + struct _EMPopupFactory *next, *prev; + + char *menuid; + EMPopupFactoryFunc factory; + void *factory_data; +}; + +struct _menu_node { + struct _menu_node *next, *prev; + + GSList *menu; + GDestroyNotify freefunc; +}; + +struct _EMPopupPrivate { + EDList menus; +}; + +static EDList emp_factories = E_DLIST_INITIALISER(emp_factories); static GObjectClass *emp_parent; static void emp_init(GObject *o) { - /*EMPopup *emp = (EMPopup *)o; */ -} + EMPopup *emp = (EMPopup *)o; + struct _EMPopupPrivate *p; -static void -emp_finalise(GObject *o) -{ - ((GObjectClass *)emp_parent)->finalize(o); + p = emp->priv = g_malloc0(sizeof(struct _EMPopupPrivate)); + + e_dlist_init(&p->menus); } static void -emp_target_free(EPopup *ep, EPopupTarget *t) +emp_finalise(GObject *o) { - switch (t->type) { - case EM_POPUP_TARGET_SELECT: { - EMPopupTargetSelect *s = (EMPopupTargetSelect *)t; - - if (s->folder) - camel_object_unref(s->folder); - g_free(s->uri); - if (s->uids) - em_utils_uids_free(s->uids); - break; } - case EM_POPUP_TARGET_URI: { - EMPopupTargetURI *s = (EMPopupTargetURI *)t; + EMPopup *emp = (EMPopup *)o; + struct _EMPopupPrivate *p = emp->priv; + struct _menu_node *mnode, *nnode; - g_free(s->uri); - break; } - case EM_POPUP_TARGET_PART: { - EMPopupTargetPart *s = (EMPopupTargetPart *)t; + g_free(emp->menuid); - camel_object_unref(s->part); - g_free(s->mime_type); - break; } - case EM_POPUP_TARGET_FOLDER: { - EMPopupTargetFolder *s = (EMPopupTargetFolder *)t; - - g_free(s->uri); - break; } - case EM_POPUP_TARGET_ATTACHMENTS: { - EMPopupTargetAttachments *s = (EMPopupTargetAttachments *)t; + mnode = (struct _menu_node *)p->menus.head; + nnode = mnode->next; + while (nnode) { + if (mnode->freefunc) + mnode->freefunc(mnode->menu); - g_slist_foreach(s->attachments, (GFunc)g_object_unref, NULL); - g_slist_free(s->attachments); - break; } + g_free(mnode); + mnode = nnode; + nnode = nnode->next; } - ((EPopupClass *)emp_parent)->target_free(ep, t); + g_free(p); + + ((GObjectClass *)emp_parent)->finalize(o); } static void emp_class_init(GObjectClass *klass) { klass->finalize = emp_finalise; - ((EPopupClass *)klass)->target_free = emp_target_free; - - e_popup_class_add_factory((EPopupClass *)klass, NULL, emp_standard_menu_factory, NULL); } GType @@ -143,8 +144,11 @@ em_popup_get_type(void) sizeof(EMPopup), 0, (GInstanceInitFunc)emp_init }; - emp_parent = g_type_class_ref(e_popup_get_type()); - type = g_type_register_static(e_popup_get_type(), "EMPopup", &info, 0); + emp_parent = g_type_class_ref(G_TYPE_OBJECT); + type = g_type_register_static(G_TYPE_OBJECT, "EMPopup", &info, 0); + + /* FIXME: this should probably sit somewhere in global setup */ + em_popup_static_add_factory(NULL, (EMPopupFactoryFunc)emp_standard_menu_factory, NULL); } return type; @@ -154,11 +158,290 @@ EMPopup *em_popup_new(const char *menuid) { EMPopup *emp = g_object_new(em_popup_get_type(), 0); - e_popup_construct(&emp->popup, menuid); + emp->menuid = g_strdup(menuid); return emp; } +/** + * em_popup_add_items: + * @emp: + * @items: + * @freefunc: + * + * Add new EMPopupItems to the menu's. Any with the same path + * will override previously defined menu items, at menu building + * time. + **/ +void +em_popup_add_items(EMPopup *emp, GSList *items, GDestroyNotify freefunc) +{ + struct _menu_node *node; + + node = g_malloc(sizeof(*node)); + node->menu = items; + node->freefunc = freefunc; + e_dlist_addtail(&emp->priv->menus, (EDListNode *)node); +} + +/** + * em_popup_add_static_items: + * @emp: + * @target: Target of this menu. + * + * Will load up any matching menu items from an installed + * popup factory. If the menuid of @emp is NULL, then this + * has no effect. + * + **/ +void +em_popup_add_static_items(EMPopup *emp, EMPopupTarget *target) +{ + struct _EMPopupFactory *f; + + if (emp->menuid == NULL || target == NULL) + return; + + /* setup the menu itself */ + f = (struct _EMPopupFactory *)emp_factories.head; + while (f->next) { + if (f->menuid == NULL + || !strcmp(f->menuid, emp->menuid)) { + f->factory(emp, target, f->factory_data); + } + f = f->next; + } +} + +static int +emp_cmp(const void *ap, const void *bp) +{ + struct _EMPopupItem *a = *((void **)ap); + struct _EMPopupItem *b = *((void **)bp); + + return strcmp(a->path, b->path); +} + +/** + * em_popup_create: + * @menuitems: + * @hide_mask: used to hide menu items, not sure of it's utility, + * since you could just 'not add them' in the first place. Saves + * copying logic anyway. + * @disable_mask: used to disable menu items. + * + * TEMPORARY code to create a menu from a list of items. + * + * The menu items are merged based on their path element, and + * built into a menu tree. + * + * Return value: + **/ +GtkMenu * +em_popup_create_menu(EMPopup *emp, guint32 hide_mask, guint32 disable_mask) +{ + struct _EMPopupPrivate *p = emp->priv; + struct _menu_node *mnode, *nnode; + GPtrArray *items = g_ptr_array_new(); + GSList *l; + GString *ppath = g_string_new(""); + GtkMenu *topmenu; + GHashTable *menu_hash = g_hash_table_new(g_str_hash, g_str_equal), + *group_hash = g_hash_table_new(g_str_hash, g_str_equal); + /*char *domain = NULL;*/ + int i; + + /* FIXME: need to override old ones with new names */ + mnode = (struct _menu_node *)p->menus.head; + nnode = mnode->next; + while (nnode) { + for (l=mnode->menu; l; l = l->next) + g_ptr_array_add(items, l->data); + mnode = nnode; + nnode = nnode->next; + } + + qsort(items->pdata, items->len, sizeof(items->pdata[0]), emp_cmp); + + topmenu = (GtkMenu *)gtk_menu_new(); + for (i=0;ilen;i++) { + GtkWidget *label; + struct _EMPopupItem *item = items->pdata[i]; + GtkMenu *thismenu; + GtkMenuItem *menuitem; + char *tmp; + + /* for bar's, the mask is exclusive or */ + if (item->mask) { + if ((item->type & EM_POPUP_TYPE_MASK) == EM_POPUP_BAR) { + if ((item->mask & hide_mask) == item->mask) + continue; + } else if (item->mask & hide_mask) + continue; + } + + g_string_truncate(ppath, 0); + tmp = strrchr(item->path, '/'); + if (tmp) { + g_string_append_len(ppath, item->path, tmp-item->path); + thismenu = g_hash_table_lookup(menu_hash, ppath->str); + g_assert(thismenu != NULL); + } else { + thismenu = topmenu; + } + + switch (item->type & EM_POPUP_TYPE_MASK) { + case EM_POPUP_ITEM: + if (item->image) { + GdkPixbuf *pixbuf; + GtkWidget *image; + + pixbuf = e_icon_factory_get_icon ((char *)item->image, E_ICON_SIZE_MENU); + image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + + gtk_widget_show(image); + menuitem = (GtkMenuItem *)gtk_image_menu_item_new(); + gtk_image_menu_item_set_image((GtkImageMenuItem *)menuitem, image); + } else { + menuitem = (GtkMenuItem *)gtk_menu_item_new(); + } + break; + case EM_POPUP_TOGGLE: + menuitem = (GtkMenuItem *)gtk_check_menu_item_new(); + gtk_check_menu_item_set_active((GtkCheckMenuItem *)menuitem, item->type & EM_POPUP_ACTIVE); + break; + case EM_POPUP_RADIO: + menuitem = (GtkMenuItem *)gtk_radio_menu_item_new(g_hash_table_lookup(group_hash, ppath->str)); + g_hash_table_insert(group_hash, ppath->str, gtk_radio_menu_item_get_group((GtkRadioMenuItem *)menuitem)); + gtk_check_menu_item_set_active((GtkCheckMenuItem *)menuitem, item->type & EM_POPUP_ACTIVE); + break; + case EM_POPUP_IMAGE: + menuitem = (GtkMenuItem *)gtk_image_menu_item_new(); + gtk_image_menu_item_set_image((GtkImageMenuItem *)menuitem, item->image); + break; + case EM_POPUP_SUBMENU: { + GtkMenu *submenu = (GtkMenu *)gtk_menu_new(); + + g_hash_table_insert(menu_hash, item->path, submenu); + menuitem = (GtkMenuItem *)gtk_menu_item_new(); + gtk_menu_item_set_submenu(menuitem, (GtkWidget *)submenu); + break; } + case EM_POPUP_BAR: + /* TODO: double-bar, end-bar stuff? */ + menuitem = (GtkMenuItem *)gtk_separator_menu_item_new(); + break; + default: + continue; + } + + if (item->label) { + label = gtk_label_new_with_mnemonic(_(item->label)); + gtk_misc_set_alignment((GtkMisc *)label, 0.0, 0.5); + gtk_widget_show(label); + gtk_container_add((GtkContainer *)menuitem, label); + } + + if (item->activate) + g_signal_connect(menuitem, "activate", item->activate, item->activate_data); + + gtk_menu_shell_append((GtkMenuShell *)thismenu, (GtkWidget *)menuitem); + + if (item->mask & disable_mask) + gtk_widget_set_sensitive((GtkWidget *)menuitem, FALSE); + + gtk_widget_show((GtkWidget *)menuitem); + } + + g_string_free(ppath, TRUE); + g_ptr_array_free(items, TRUE); + g_hash_table_destroy(menu_hash); + g_hash_table_destroy(group_hash); + + return topmenu; +} + +static void +emp_popup_done(GtkWidget *w, EMPopup *emp) +{ + gtk_widget_destroy(w); + g_object_unref(emp); +} + +/** + * em_popup_create_menu_once: + * @emp: EMPopup, once the menu is shown, this cannot be + * considered a valid pointer. + * @target: If set, the target of the selection. Static menu + * items will be added. The target will be freed once complete. + * @hide_mask: + * @disable_mask: + * + * Like popup_create_menu, but automatically sets up the menu + * so that it is destroyed once a selection takes place, and + * the EMPopup is unreffed. + * + * Return value: A menu, to popup. + **/ +GtkMenu * +em_popup_create_menu_once(EMPopup *emp, EMPopupTarget *target, guint32 hide_mask, guint32 disable_mask) +{ + GtkMenu *menu; + + if (target) + em_popup_add_static_items(emp, target); + + menu = em_popup_create_menu(emp, hide_mask, disable_mask); + + if (target) + g_signal_connect_swapped(menu, "selection_done", G_CALLBACK(em_popup_target_free), target); + g_signal_connect(menu, "selection_done", G_CALLBACK(emp_popup_done), emp); + + return menu; +} + +/* ********************************************************************** */ + +/** + * em_popup_static_add_factory: + * @menuid: + * @func: + * @data: + * + * Add a popup factory which will be called to add_items() any + * extra menu's if wants to do the current PopupTarget. + * + * TODO: Make the menuid a pattern? + * + * Return value: A handle to the factory. + **/ +EMPopupFactory * +em_popup_static_add_factory(const char *menuid, EMPopupFactoryFunc func, void *data) +{ + struct _EMPopupFactory *f = g_malloc0(sizeof(*f)); + + f->menuid = g_strdup(menuid); + f->factory = func; + f->factory_data = data; + e_dlist_addtail(&emp_factories, (EDListNode *)f); + + return f; +} + +/** + * em_popup_static_remove_factory: + * @f: + * + * Remove a popup factory. + **/ +void +em_popup_static_remove_factory(EMPopupFactory *f) +{ + e_dlist_remove((EDListNode *)f); + g_free(f->menuid); + g_free(f); +} + /** * em_popup_target_new_select: * @folder: The selection will ref this for the life of it. @@ -169,20 +452,21 @@ EMPopup *em_popup_new(const char *menuid) * * Return value: **/ -EMPopupTargetSelect * -em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids) +EMPopupTarget * +em_popup_target_new_select(struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids) { - EMPopupTargetSelect *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_SELECT, sizeof(*t)); + EMPopupTarget *t = g_malloc0(sizeof(*t)); guint32 mask = ~0; int i; const char *tmp; - t->uids = uids; - t->folder = folder; - t->uri = g_strdup(folder_uri); + t->type = EM_POPUP_TARGET_SELECT; + t->data.select.uids = uids; + t->data.select.folder = folder; + t->data.select.folder_uri = g_strdup(folder_uri); if (folder == NULL) { - t->target.mask = mask; + t->mask = mask; return t; } @@ -247,18 +531,19 @@ em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char camel_folder_free_message_info(folder, info); } - t->target.mask = mask; + t->mask = mask; return t; } -EMPopupTargetURI * -em_popup_target_new_uri(EMPopup *emp, const char *uri) +EMPopupTarget * +em_popup_target_new_uri(const char *uri) { - EMPopupTargetURI *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_URI, sizeof(*t)); + EMPopupTarget *t = g_malloc0(sizeof(*t)); guint32 mask = ~0; - t->uri = g_strdup(uri); + t->type = EM_POPUP_TARGET_URI; + t->data.uri = g_strdup(uri); if (g_ascii_strncasecmp(uri, "http:", 5) == 0 || g_ascii_strncasecmp(uri, "https:", 6) == 0) @@ -268,46 +553,48 @@ em_popup_target_new_uri(EMPopup *emp, const char *uri) else mask &= ~EM_POPUP_URI_NOT_MAILTO; - t->target.mask = mask; + t->mask = mask; return t; } -EMPopupTargetPart * -em_popup_target_new_part(EMPopup *emp, struct _CamelMimePart *part, const char *mime_type) +EMPopupTarget * +em_popup_target_new_part(struct _CamelMimePart *part, const char *mime_type) { - EMPopupTargetPart *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_PART, sizeof(*t)); + EMPopupTarget *t = g_malloc0(sizeof(*t)); guint32 mask = ~0; - t->part = part; + t->type = EM_POPUP_TARGET_PART; + t->data.part.part = part; camel_object_ref(part); if (mime_type) - t->mime_type = g_strdup(mime_type); + t->data.part.mime_type = g_strdup(mime_type); else - t->mime_type = camel_data_wrapper_get_mime_type((CamelDataWrapper *)part); + t->data.part.mime_type = camel_data_wrapper_get_mime_type((CamelDataWrapper *)part); - camel_strdown(t->mime_type); + camel_strdown(t->data.part.mime_type); if (CAMEL_IS_MIME_MESSAGE(camel_medium_get_content_object((CamelMedium *)part))) mask &= ~EM_POPUP_PART_MESSAGE; - if (strncmp(t->mime_type, "image/", 6) == 0) + if (strncmp(t->data.part.mime_type, "image/", 6) == 0) mask &= ~EM_POPUP_PART_IMAGE; - t->target.mask = mask; + t->mask = mask; return t; } /* TODO: This should be based on the CamelFolderInfo, but ... em-folder-tree doesn't keep it? */ -EMPopupTargetFolder * -em_popup_target_new_folder (EMPopup *emp, const char *uri, guint32 info_flags, guint32 popup_flags) +EMPopupTarget * +em_popup_target_new_folder (const char *uri, guint32 info_flags, guint32 popup_flags) { - EMPopupTargetFolder *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_FOLDER, sizeof(*t)); + EMPopupTarget *t = g_malloc0(sizeof(*t)); guint32 mask = ~0; CamelURL *url; - t->uri = g_strdup(uri); + t->type = EM_POPUP_TARGET_FOLDER; + t->data.folder.folder_uri = g_strdup(uri); if (popup_flags & EM_POPUP_FOLDER_STORE) mask &= ~(EM_POPUP_FOLDER_STORE|EM_POPUP_FOLDER_INFERIORS); @@ -342,63 +629,91 @@ em_popup_target_new_folder (EMPopup *emp, const char *uri, guint32 info_flags, g camel_url_free(url); done: - t->target.mask = mask; + t->mask = mask; return t; } -/** - * em_popup_target_new_attachments: - * @emp: - * @attachments: A list of EMsgComposerAttachment objects, reffed for - * the list. Will be unreff'd once finished with. - * - * Owns the list @attachments and their items after they're passed in. - * - * Return value: - **/ -EMPopupTargetAttachments * -em_popup_target_new_attachments(EMPopup *emp, GSList *attachments) +void +em_popup_target_free(EMPopupTarget *t) { - EMPopupTargetAttachments *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_ATTACHMENTS, sizeof(*t)); - guint32 mask = ~0; - int len = g_slist_length(attachments); - - t->attachments = attachments; - if (len > 0) - mask &= ~ EM_POPUP_ATTACHMENTS_MANY; - if (len == 1) - mask &= ~ EM_POPUP_ATTACHMENTS_ONE; - t->target.mask = mask; + switch (t->type) { + case EM_POPUP_TARGET_SELECT: + if (t->data.select.folder) + camel_object_unref(t->data.select.folder); + g_free(t->data.select.folder_uri); + if (t->data.select.uids) + em_utils_uids_free(t->data.select.uids); + break; + case EM_POPUP_TARGET_URI: + g_free(t->data.uri); + break; + case EM_POPUP_TARGET_PART: + camel_object_unref(t->data.part.part); + g_free(t->data.part.mime_type); + break; + case EM_POPUP_TARGET_FOLDER: + g_free(t->data.folder.folder_uri); + break; + } - return t; + g_free(t); } /* ********************************************************************** */ +#if 0 +/* TODO: flesh these out where possible */ +static void +emp_popup_open(GtkWidget *w, EMFolderView *emfv) +{ + em_folder_view_open_selected(emfv); +} + +static void +emp_popup_edit (GtkWidget *w, EMPopupTarget *t) +{ + if (!em_utils_check_user_can_send_mail(t->widget)) + return; + + em_utils_edit_messages(t->widget, t->data.select.folder, em_utils_uids_copy(t->data.select.uids), FALSE); +} + static void -emp_part_popup_saveas(EPopup *ep, EPopupItem *item, void *data) +emp_popup_saveas(GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetPart *t = (EMPopupTargetPart *)ep->target; + em_utils_save_messages(t->widget, t->data.select.folder, em_utils_uids_copy(t->data.select.uids)); +} - em_utils_save_part(ep->target->widget, _("Save As..."), t->part); +static EMPopupItem emp_standard_select_popups[] = { + /*{ EM_POPUP_ITEM, "00.select.00", N_("_Open"), G_CALLBACK(emp_popup_open), NULL, NULL, 0 },*/ + { EM_POPUP_ITEM, "00.select.01", N_("_Edit as New Message..."), G_CALLBACK(emp_popup_edit), NULL, NULL, EM_POPUP_SELECT_EDIT }, + { EM_POPUP_ITEM, "00.select.02", N_("_Save As..."), G_CALLBACK(emp_popup_saveas), NULL, "stock_save-as", 0 }, +}; +#endif + +/* ********************************************************************** */ + +static void +emp_part_popup_saveas(GtkWidget *w, EMPopupTarget *t) +{ + em_utils_save_part(w, _("Save As..."), t->data.part.part); } static void -emp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) +emp_part_popup_set_background(GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetPart *t = (EMPopupTargetPart *)ep->target; GConfClient *gconf; char *str, *filename, *path, *extension; unsigned int i=1; - filename = g_strdup(camel_mime_part_get_filename(t->part)); + filename = g_strdup(camel_mime_part_get_filename(t->data.part.part)); /* if filename is blank, create a default filename based on MIME type */ if (!filename || !filename[0]) { CamelContentType *ct; - ct = camel_mime_part_get_content_type(t->part); + ct = camel_mime_part_get_content_type(t->data.part.part); g_free (filename); filename = g_strdup_printf (_("untitled_image.%s"), ct->subtype); } @@ -422,7 +737,7 @@ emp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) g_free(filename); - if (em_utils_save_part_to_file(ep->target->widget, path, t->part)) { + if (em_utils_save_part_to_file(w, path, t->data.part.part)) { gconf = gconf_client_get_default(); /* if the filename hasn't changed, blank the filename before @@ -452,68 +767,64 @@ emp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) } static void -emp_part_popup_reply_sender(EPopup *ep, EPopupItem *item, void *data) +emp_part_popup_reply_sender (GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetPart *t = (EMPopupTargetPart *)ep->target; CamelMimeMessage *message; - message = (CamelMimeMessage *)camel_medium_get_content_object((CamelMedium *)t->part); - em_utils_reply_to_message(NULL, NULL, message, REPLY_MODE_SENDER, NULL); + message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); + em_utils_reply_to_message (NULL, NULL, message, REPLY_MODE_SENDER, NULL); } static void -emp_part_popup_reply_list (EPopup *ep, EPopupItem *item, void *data) +emp_part_popup_reply_list (GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetPart *t = (EMPopupTargetPart *)ep->target; CamelMimeMessage *message; - message = (CamelMimeMessage *)camel_medium_get_content_object((CamelMedium *)t->part); - em_utils_reply_to_message(NULL, NULL, message, REPLY_MODE_LIST, NULL); + message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); + em_utils_reply_to_message (NULL, NULL, message, REPLY_MODE_LIST, NULL); } static void -emp_part_popup_reply_all (EPopup *ep, EPopupItem *item, void *data) +emp_part_popup_reply_all (GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetPart *t = (EMPopupTargetPart *)ep->target; CamelMimeMessage *message; - message = (CamelMimeMessage *)camel_medium_get_content_object((CamelMedium *)t->part); - em_utils_reply_to_message(NULL, NULL, message, REPLY_MODE_ALL, NULL); + message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); + em_utils_reply_to_message (NULL, NULL, message, REPLY_MODE_ALL, NULL); } static void -emp_part_popup_forward (EPopup *ep, EPopupItem *item, void *data) +emp_part_popup_forward (GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetPart *t = (EMPopupTargetPart *)ep->target; CamelMimeMessage *message; /* TODO: have a emfv specific override so we can get the parent folder uri */ - message = (CamelMimeMessage *)camel_medium_get_content_object((CamelMedium *) t->part); - em_utils_forward_message(message, NULL); + message = (CamelMimeMessage *) camel_medium_get_content_object ((CamelMedium *) t->data.part.part); + em_utils_forward_message (message, NULL); } static EMPopupItem emp_standard_object_popups[] = { - { E_POPUP_ITEM, "00.part.00", N_("_Save As..."), emp_part_popup_saveas, NULL, "stock_save-as", 0 }, - { E_POPUP_ITEM, "00.part.10", N_("Set as _Background"), emp_part_popup_set_background, NULL, NULL, EM_POPUP_PART_IMAGE }, - { E_POPUP_BAR, "10.part", NULL, NULL, NULL, NULL, EM_POPUP_PART_MESSAGE }, - { E_POPUP_ITEM, "10.part.00", N_("_Reply to sender"), emp_part_popup_reply_sender, NULL, "stock_mail-reply" , EM_POPUP_PART_MESSAGE }, - { E_POPUP_ITEM, "10.part.01", N_("Reply to _List"), emp_part_popup_reply_list, NULL, NULL, EM_POPUP_PART_MESSAGE}, - { E_POPUP_ITEM, "10.part.03", N_("Reply to _All"), emp_part_popup_reply_all, NULL, "stock_mail-reply-to-all", EM_POPUP_PART_MESSAGE}, - { E_POPUP_BAR, "20.part", NULL, NULL, NULL, NULL, EM_POPUP_PART_MESSAGE }, - { E_POPUP_ITEM, "20.part.00", N_("_Forward"), emp_part_popup_forward, NULL, "stock_mail-forward", EM_POPUP_PART_MESSAGE }, + { EM_POPUP_ITEM, "00.part.00", N_("_Save As..."), G_CALLBACK(emp_part_popup_saveas), NULL, "stock_save-as", 0 }, + { EM_POPUP_ITEM, "00.part.10", N_("Set as _Background"), G_CALLBACK(emp_part_popup_set_background), NULL, NULL, EM_POPUP_PART_IMAGE }, + { EM_POPUP_BAR, "10.part", NULL, NULL, NULL, NULL, EM_POPUP_PART_MESSAGE }, + { EM_POPUP_ITEM, "10.part.00", N_("_Reply to sender"), G_CALLBACK(emp_part_popup_reply_sender), NULL, "stock_mail-reply" , EM_POPUP_PART_MESSAGE }, + { EM_POPUP_ITEM, "10.part.01", N_("Reply to _List"), G_CALLBACK(emp_part_popup_reply_list), NULL, NULL, EM_POPUP_PART_MESSAGE}, + { EM_POPUP_ITEM, "10.part.03", N_("Reply to _All"), G_CALLBACK(emp_part_popup_reply_all), NULL, "stock_mail-reply-to-all", EM_POPUP_PART_MESSAGE}, + { EM_POPUP_BAR, "20.part", NULL, NULL, NULL, NULL, EM_POPUP_PART_MESSAGE }, + { EM_POPUP_ITEM, "20.part.00", N_("_Forward"), G_CALLBACK(emp_part_popup_forward), NULL, "stock_mail-forward", EM_POPUP_PART_MESSAGE }, + }; -static const EPopupItem emp_standard_part_apps_bar = { E_POPUP_BAR, "99.object" }; +static const EMPopupItem emp_standard_part_apps_bar = { EM_POPUP_BAR, "99.object" }; /* ********************************************************************** */ static void -emp_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data) +emp_uri_popup_link_open(GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target; GError *err = NULL; - gnome_url_show(t->uri, &err); + gnome_url_show(t->data.uri, &err); if (err) { g_warning("gnome_url_show: %s", err->message); g_error_free(err); @@ -521,36 +832,33 @@ emp_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data) } static void -emp_uri_popup_address_send(EPopup *ep, EPopupItem *item, void *data) +emp_uri_popup_address_send (GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target; - /* TODO: have an emfv specific override to get the from uri */ - em_utils_compose_new_message_with_mailto(t->uri, NULL); + em_utils_compose_new_message_with_mailto (t->data.uri, NULL); } static void -emp_uri_popup_address_add(EPopup *ep, EPopupItem *item, void *data) +emp_uri_popup_address_add(GtkWidget *w, EMPopupTarget *t) { - EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target; CamelURL *url; - url = camel_url_new(t->uri, NULL); + url = camel_url_new(t->data.uri, NULL); if (url == NULL) { - g_warning("cannot parse url '%s'", t->uri); + g_warning("cannot parse url '%s'", t->data.uri); return; } if (url->path && url->path[0]) - em_utils_add_address(ep->target->widget, url->path); + em_utils_add_address(w, url->path); camel_url_free(url); } -static EPopupItem emp_standard_uri_popups[] = { - { E_POPUP_ITEM, "00.uri.00", N_("_Open Link in Browser"), emp_uri_popup_link_open, NULL, NULL, EM_POPUP_URI_NOT_MAILTO }, - { E_POPUP_ITEM, "00.uri.10", N_("Se_nd message to..."), emp_uri_popup_address_send, NULL, NULL, EM_POPUP_URI_MAILTO }, - { E_POPUP_ITEM, "00.uri.20", N_("_Add to Addressbook"), emp_uri_popup_address_add, NULL, NULL, EM_POPUP_URI_MAILTO }, +static EMPopupItem emp_standard_uri_popups[] = { + { EM_POPUP_ITEM, "00.uri.00", N_("_Open Link in Browser"), G_CALLBACK(emp_uri_popup_link_open), NULL, NULL, EM_POPUP_URI_NOT_MAILTO }, + { EM_POPUP_ITEM, "00.uri.10", N_("Se_nd message to..."), G_CALLBACK(emp_uri_popup_address_send), NULL, NULL, EM_POPUP_URI_MAILTO }, + { EM_POPUP_ITEM, "00.uri.20", N_("_Add to Addressbook"), G_CALLBACK(emp_uri_popup_address_add), NULL, NULL, EM_POPUP_URI_MAILTO }, }; /* ********************************************************************** */ @@ -559,21 +867,23 @@ static EPopupItem emp_standard_uri_popups[] = { #include - EMPopupTargetPart *target; +struct _open_in_item { + EMPopupItem item; + EMPopupTarget *target; + GnomeVFSMimeApplication *app; +}; static void -emp_apps_open_in(EPopup *ep, EPopupItem *item, void *data) +emp_apps_open_in(GtkWidget *w, struct _open_in_item *item) { char *path; - EMPopupTargetPart *target = (EMPopupTargetPart *)ep->target; - path = em_utils_temp_save_part(target->target.widget, target->part); + path = em_utils_temp_save_part(item->target->widget, item->target->data.part.part); if (path) { - GnomeVFSMimeApplication *app = item->user_data; - int douri = (app->expects_uris == GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS); + int douri = (item->app->expects_uris == GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS); char *command; - if (app->requires_terminal) { + if (item->app->requires_terminal) { char *term, *args = NULL; GConfClient *gconf; @@ -586,11 +896,11 @@ emp_apps_open_in(EPopup *ep, EPopupItem *item, void *data) return; command = g_strdup_printf ("%s%s%s %s %s%s &", term, args ? " " : "", args ? args : "", - app->command, douri ? "file://" : "", path); + item->app->command, douri ? "file://" : "", path); g_free (term); g_free (args); } else { - command = g_strdup_printf ("%s %s%s &", app->command, douri ? "file://" : "", path); + command = g_strdup_printf ("%s %s%s &", item->app->command, douri ? "file://" : "", path); } /* FIXME: Do not use system here */ @@ -601,14 +911,14 @@ emp_apps_open_in(EPopup *ep, EPopupItem *item, void *data) } static void -emp_apps_popup_free(EPopup *ep, GSList *free_list, void *data) +emp_apps_popup_free(GSList *free_list) { while (free_list) { GSList *n = free_list->next; - EPopupItem *item = free_list->data; + struct _open_in_item *item = free_list->data; - g_free(item->path); - g_free(item->label); + g_free(item->item.path); + g_free(item->item.label); g_free(item); g_slist_free_1(free_list); @@ -617,19 +927,13 @@ emp_apps_popup_free(EPopup *ep, GSList *free_list, void *data) } static void -emp_standard_items_free(EPopup *ep, GSList *items, void *data) -{ - g_slist_free(items); -} - -static void -emp_standard_menu_factory(EPopup *emp, void *data) +emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data) { int i, len; - EPopupItem *items; + EMPopupItem *items; GSList *menus = NULL; - switch (emp->target->type) { + switch (target->type) { #if 0 case EM_POPUP_TARGET_SELECT: return; @@ -637,21 +941,18 @@ emp_standard_menu_factory(EPopup *emp, void *data) len = LEN(emp_standard_select_popups); break; #endif - case EM_POPUP_TARGET_URI: { - /*EMPopupTargetURI *t = (EMPopupTargetURI *)target;*/ - + case EM_POPUP_TARGET_URI: items = emp_standard_uri_popups; len = LEN(emp_standard_uri_popups); - break; } + break; case EM_POPUP_TARGET_PART: { - EMPopupTargetPart *t = (EMPopupTargetPart *)emp->target; - GList *apps = gnome_vfs_mime_get_short_list_applications(t->mime_type); + GList *apps = gnome_vfs_mime_get_short_list_applications(target->data.part.mime_type); /* FIXME: use the snoop_part stuff from em-format.c */ - if (apps == NULL && strcmp(t->mime_type, "application/octet-stream") == 0) { + if (apps == NULL && strcmp(target->data.part.mime_type, "application/octet-stream") == 0) { const char *filename, *name_type; - filename = camel_mime_part_get_filename(t->part); + filename = camel_mime_part_get_filename(target->data.part.part); if (filename) { /* GNOME-VFS will misidentify TNEF attachments as MPEG */ @@ -673,23 +974,25 @@ emp_standard_menu_factory(EPopup *emp, void *data) for (l = apps, i = 0; l; l = l->next, i++) { GnomeVFSMimeApplication *app = l->data; - EPopupItem *item; + struct _open_in_item *item; if (app->requires_terminal) continue; item = g_malloc0(sizeof(*item)); - item->type = E_POPUP_ITEM; - item->path = g_strdup_printf("99.object.%02d", i); - item->label = g_strdup_printf(_("Open in %s..."), app->name); - item->activate = emp_apps_open_in; - item->user_data = app; + item->item.type = EM_POPUP_ITEM; + item->item.path = g_strdup_printf("99.object.%02d", i); + item->item.label = g_strdup_printf(_("Open in %s..."), app->name); + item->item.activate = G_CALLBACK(emp_apps_open_in); + item->item.activate_data = item; + item->target = target; + item->app = app; open_menus = g_slist_prepend(open_menus, item); } if (open_menus) - e_popup_add_items(emp, open_menus, emp_apps_popup_free, NULL); + em_popup_add_items(emp, open_menus, (GDestroyNotify)emp_apps_popup_free); g_string_free(label, TRUE); g_list_free(apps); @@ -704,139 +1007,12 @@ emp_standard_menu_factory(EPopup *emp, void *data) } for (i=0;itarget->mask) == 0) + if ((items[i].mask & target->mask) == 0) { + items[i].activate_data = target; menus = g_slist_prepend(menus, &items[i]); + } } if (menus) - e_popup_add_items(emp, menus, emp_standard_items_free, NULL); -} - -/* ********************************************************************** */ - -/* Popup menu plugin handler */ - -/* - - - - - - - -*/ - -static void *emph_parent_class; -#define emph ((EMPopupHook *)eph) - -static const EPopupHookTargetMask emph_select_masks[] = { - { "one", EM_POPUP_SELECT_ONE }, - { "many", EM_POPUP_SELECT_MANY }, - { "mark_read", EM_POPUP_SELECT_MARK_READ }, - { "mark_unread", EM_POPUP_SELECT_MARK_UNREAD }, - { "delete", EM_POPUP_SELECT_DELETE }, - { "undelete", EM_POPUP_SELECT_UNDELETE }, - { "mailing_list", EM_POPUP_SELECT_MAILING_LIST }, - { "resend", EM_POPUP_SELECT_EDIT }, - { "mark_important", EM_POPUP_SELECT_MARK_IMPORTANT }, - { "mark_unimportant", EM_POPUP_SELECT_MARK_UNIMPORTANT }, - { "flag_followup", EM_POPUP_SELECT_FLAG_FOLLOWUP }, - { "flag_completed", EM_POPUP_SELECT_FLAG_COMPLETED }, - { "flag_clear", EM_POPUP_SELECT_FLAG_CLEAR }, - { "add_sender", EM_POPUP_SELECT_ADD_SENDER }, - { "mark_junk", EM_POPUP_SELECT_MARK_JUNK }, - { "mark_nojunk", EM_POPUP_SELECT_MARK_NOJUNK }, - { "folder", EM_POPUP_SELECT_FOLDER }, - { 0 } -}; - -static const EPopupHookTargetMask emph_uri_masks[] = { - { "http", EM_POPUP_URI_HTTP }, - { "mailto", EM_POPUP_URI_MAILTO }, - { "notmailto", EM_POPUP_URI_NOT_MAILTO }, - { 0 } -}; - -static const EPopupHookTargetMask emph_part_masks[] = { - { "message", EM_POPUP_PART_MESSAGE }, - { "image", EM_POPUP_PART_IMAGE }, - { 0 } -}; - -static const EPopupHookTargetMask emph_folder_masks[] = { - { "folder", EM_POPUP_FOLDER_FOLDER }, - { "store", EM_POPUP_FOLDER_STORE }, - { "inferiors", EM_POPUP_FOLDER_INFERIORS }, - { "delete", EM_POPUP_FOLDER_DELETE }, - { "select", EM_POPUP_FOLDER_SELECT }, - { 0 } -}; - -static const EPopupHookTargetMask emph_attachments_masks[] = { - { "one", EM_POPUP_ATTACHMENTS_ONE }, - { "many", EM_POPUP_ATTACHMENTS_MANY }, - { 0 } -}; - -static const EPopupHookTargetMap emph_targets[] = { - { "select", EM_POPUP_TARGET_SELECT, emph_select_masks }, - { "uri", EM_POPUP_TARGET_URI, emph_uri_masks }, - { "part", EM_POPUP_TARGET_PART, emph_part_masks }, - { "folder", EM_POPUP_TARGET_FOLDER, emph_folder_masks }, - { "attachments", EM_POPUP_TARGET_ATTACHMENTS, emph_attachments_masks }, - { 0 } -}; - -static void -emph_finalise(GObject *o) -{ - /*EPluginHook *eph = (EPluginHook *)o;*/ - - ((GObjectClass *)emph_parent_class)->finalize(o); -} - -static void -emph_class_init(EPluginHookClass *klass) -{ - int i; - - ((GObjectClass *)klass)->finalize = emph_finalise; - ((EPluginHookClass *)klass)->id = "com.ximian.evolution.mail.popup:1.0"; - - for (i=0;emph_targets[i].type;i++) - e_popup_hook_class_add_target_map((EPopupHookClass *)klass, &emph_targets[i]); - - ((EPopupHookClass *)klass)->popup_class = g_type_class_ref(em_popup_get_type()); -} - -GType -em_popup_hook_get_type(void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof(EMPopupHookClass), NULL, NULL, (GClassInitFunc) emph_class_init, NULL, NULL, - sizeof(EMPopupHook), 0, (GInstanceInitFunc) NULL, - }; - - emph_parent_class = g_type_class_ref(e_popup_hook_get_type()); - type = g_type_register_static(e_popup_hook_get_type(), "EMPopupHook", &info, 0); - } - - return type; + em_popup_add_items(emp, menus, (GDestroyNotify)g_slist_free); } diff --git a/mail/em-utils.c b/mail/em-utils.c index 2adf723f67..8c22fe8926 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -44,13 +44,13 @@ #include #include #include -#include #include "mail-component.h" #include "mail-mt.h" #include "mail-ops.h" #include "mail-tools.h" #include "mail-config.h" +#include "mail-config-druid.h" #include "message-tag-followup.h" #include @@ -63,7 +63,6 @@ #include "em-utils.h" #include "em-composer-utils.h" #include "em-format-quote.h" -#include "em-account-editor.h" static void emu_save_part_done (CamelMimePart *part, char *name, int done, void *data); @@ -179,18 +178,19 @@ druid_destroy_cb (gpointer user_data, GObject *deadbeef) gboolean em_utils_configure_account (GtkWidget *parent) { - EMAccountEditor *emae; - - emae = em_account_editor_new(NULL, EMAE_DRUID); + MailConfigDruid *druid; + + druid = mail_config_druid_new (); + if (parent != NULL) - e_dialog_set_transient_for((GtkWindow *)emae->editor, parent); - - g_object_weak_ref((GObject *)emae->editor, (GWeakNotify) druid_destroy_cb, NULL); - gtk_widget_show(emae->editor); - gtk_grab_add(emae->editor); - gtk_main(); + e_dialog_set_transient_for ((GtkWindow *) druid, parent); + + g_object_weak_ref ((GObject *) druid, (GWeakNotify) druid_destroy_cb, NULL); + gtk_widget_show ((GtkWidget *) druid); + gtk_grab_add ((GtkWidget *) druid); + gtk_main (); - return mail_config_is_configured(); + return mail_config_is_configured (); } /** diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c index 6e5328ef87..5de9dc8211 100644 --- a/mail/mail-account-gui.c +++ b/mail/mail-account-gui.c @@ -45,7 +45,6 @@ #include #include #include -#include #ifdef USE_GTKFILECHOOSER #include #include @@ -2443,6 +2442,8 @@ mail_account_gui_save (MailAccountGui *gui) mail_config_save_accounts (); + mail_autoreceive_setup (); + return TRUE; } diff --git a/mail/mail-component.c b/mail/mail-component.c index 6bd8c9d123..f753e37931 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -36,7 +36,6 @@ #include #include "em-popup.h" -#include "em-menu.h" #include "em-utils.h" #include "em-composer-utils.h" #include "em-format.h" @@ -76,7 +75,6 @@ #include #include -#include #include #include @@ -322,24 +320,6 @@ mc_startup(MailComponent *mc) mc_setup_local_store(mc); load_accounts(mc, mail_config_get_accounts()); vfolder_load_storage(); - -#ifdef ENABLE_MONO - if (getenv("EVOLUTION_DISABLE_MONO") == NULL) - e_plugin_register_type(e_plugin_mono_get_type()); -#endif - e_plugin_register_type(e_plugin_lib_get_type()); - e_plugin_hook_register_type(em_popup_hook_get_type()); - e_plugin_hook_register_type(em_menu_hook_get_type()); - e_plugin_hook_register_type(em_config_hook_get_type()); - - e_plugin_hook_register_type(em_format_hook_get_type()); - em_format_hook_register_type(em_format_get_type()); - em_format_hook_register_type(em_format_html_get_type()); - em_format_hook_register_type(em_format_html_display_get_type()); - - e_plugin_hook_register_type(em_event_hook_get_type()); - - e_plugin_load_plugins(); } static void @@ -878,7 +858,7 @@ mail_component_init (MailComponent *component) priv->async_event = mail_async_event_new(); priv->store_hash = g_hash_table_new (NULL, NULL); - mail_autoreceive_init(); + mail_autoreceive_setup(); offline = mail_offline_handler_new(); bonobo_object_add_interface((BonoboObject *)component, (BonoboObject *)offline); diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 625b952991..2103e332e5 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -46,27 +46,6 @@ Click "Forward" to begin. False 0 - - - True - Please enter your name and email address below. The "optional" fields below do not need to be filled in, unless you wish to include this information in email you send. - False - False - GTK_JUSTIFY_FILL - True - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - - - @@ -88,25 +67,24 @@ Click "Forward" to begin. 0 - - True - Please select among the following options - False - False - GTK_JUSTIFY_FILL - True - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - + + + + + + + + + True + Receiving Email + + + + 16 + True + False + 0 @@ -128,27 +106,6 @@ Click "Forward" to begin. False 0 - - - True - Please enter information about the way you will send mail. If you are not sure, ask your system administrator or Internet Service Provider. - False - False - GTK_JUSTIFY_FILL - True - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - - - @@ -169,27 +126,6 @@ Click "Forward" to begin. False 0 - - - True - You are almost done with the mail configuration process. The identity, incoming mail server and outgoing mail transport method which you provided will be grouped together to make an Evolution mail account. Please enter a name for this account in the space below. This name will be used for display purposes only. - False - False - GTK_JUSTIFY_FILL - True - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - - - @@ -690,7 +626,7 @@ For example: "Work" or "Personal" 0.5 0 0 - signature_dropdown + sigOption 0 @@ -709,12 +645,24 @@ For example: "Work" or "Personal" 6 - + True - em_account_editor_dropdown_new - 0 - 0 - Mon, 06 Sep 2004 01:00:22 GMT + True + 0 + + + + True + + + + True + Default + True + + + + 0 @@ -946,7 +894,7 @@ For example: "Work" or "Personal" 0.5 0 0 - source_type_dropdown + source_type_omenu 0 @@ -1007,12 +955,56 @@ For example: "Work" or "Personal" - + True - em_account_editor_dropdown_new - 0 - 0 - Thu, 29 Jul 2004 05:31:24 GMT + True + 0 + + + + True + + + + True + POP + True + + + + + + True + IMAPv4 + True + + + + + + True + Standard Unix mbox + True + + + + + + True + Qmail maildir + True + + + + + + True + None + True + + + + 1 @@ -1381,12 +1373,40 @@ For example: "Work" or "Personal" - + True - em_account_editor_ssl_selector_new - 0 - 0 - Tue, 03 Aug 2004 07:22:52 GMT + True + 0 + + + + True + + + + True + Always + True + + + + + + True + Whenever Possible + True + + + + + + True + Never + True + + + + 0 @@ -1541,12 +1561,32 @@ For example: "Work" or "Personal" 6 - + True - em_account_editor_dropdown_new - 0 - 0 - Thu, 29 Jul 2004 08:38:30 GMT + True + 0 + + + + True + + + + True + Password + True + + + + + + True + Kerberos + True + + + + 0 @@ -1632,10 +1672,230 @@ For example: "Work" or "Personal" + + + True + Receiving Mail + True + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + 1 + 2 + False + 18 + 6 + + + + True + False + 6 + + + + True + 1 + 2 + False + 6 + 6 + + + + True + 1 + 2 + False + 6 + 0 + + + + True + False + 0 + + + + True + <span weight="bold">Checking for New Mail</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 12 + True + 1 + 2 + False + 0 + 0 + + + + True + False + 4 + + + + True + True + Automatically check for _new mail every + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 10 1 1440 1 10 10 + + + 0 + False + True + + + + + + True + minutes + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + 0 + 2 + 0 + 1 + + + + + 0 + True + True + + + + + 0 + 2 + 0 + 1 + + + + + 0 + 2 + 0 + 1 + + + + + 0 + False + False + + + + + 0 + 2 + 0 + 1 + + + + + 0 + False + True + + + + + False + True + + + True - Receiving Email + Receiving Options True False GTK_JUSTIFY_CENTER @@ -1686,7 +1946,7 @@ For example: "Work" or "Personal" 0 0 0 - transport_type_dropdown + transport_type_omenu 0 @@ -1722,12 +1982,32 @@ For example: "Work" or "Personal" - + True - em_account_editor_dropdown_new - 0 - 0 - Thu, 29 Jul 2004 05:42:00 GMT + True + 0 + + + + True + + + + True + SMTP + True + + + + + + True + Sendmail + True + + + + 1 @@ -2055,12 +2335,40 @@ For example: "Work" or "Personal" - + True - em_account_editor_ssl_selector_new - 0 - 0 - Tue, 03 Aug 2004 07:23:50 GMT + True + 0 + + + + True + + + + True + Always + True + + + + + + True + Whenever Possible + True + + + + + + True + Never + True + + + + 0 @@ -2239,7 +2547,7 @@ For example: "Work" or "Personal" 0.5 0 0 - transport_auth_dropdown + transport_auth_omenu 0 @@ -2304,12 +2612,32 @@ For example: "Work" or "Personal" 6 - + True - em_account_editor_dropdown_new - 0 - 0 - Thu, 29 Jul 2004 08:37:13 GMT + True + 0 + + + + True + + + + True + Password + True + + + + + + True + Kerberos + True + + + + 0 @@ -4024,7 +4352,7 @@ For example: "Work" or "Personal" GDK_GRAVITY_NORTH_WEST - + True True True @@ -6122,7 +6450,7 @@ For example: "Work" or "Personal" GDK_GRAVITY_NORTH_WEST - + True True True diff --git a/mail/mail-errors.xml b/mail/mail-errors.xml index 44717434d3..9e32d5aba2 100644 --- a/mail/mail-errors.xml +++ b/mail/mail-errors.xml @@ -311,13 +311,6 @@ You can choose to ignore this folder, overwrite or append its contents, or quit.