Commit Graph

139 Commits

Author SHA1 Message Date
5847ef8566 If lines is NULL here split into lines and just return that the point is
2001-07-03  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c (e_text_point): If lines is NULL here split
	into lines and just return that the point is outside this text
	object.

svn path=/trunk/; revision=10730
2001-07-03 04:43:42 +00:00
c187a911c8 Do nothing if passed NULL. (e_completion_match_compare): Move the
2001-06-29  Jon Trowbridge  <trow@ximian.com>

	* gal/e-text/e-completion-match.c (e_completion_match_unref): Do
        nothing if passed NULL.
	(e_completion_match_compare): Move the sort_major comparison out
	to make it the primary sort key (followed by score and then
	sort_minor).
	(e_completion_match_compare_alpha): Move the sort_major comparison
	out to make it the primary sort key.

svn path=/trunk/; revision=10625
2001-06-30 05:01:02 +00:00
dea54a3fdf Removed unused frame variable.
2001-06-09  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-completion-view.c (e_completion_view_construct):
	Removed unused frame variable.

svn path=/trunk/; revision=10174
2001-06-09 10:35:25 +00:00
04aed95972 Turned off alternating row colors in our ETable specification.
2001-06-08  Jon Trowbridge  <trow@ximian.com>

        * gal/e-text/e-completion-view.c: Turned off alternating row
        colors in our ETable specification.

        * gal/e-text/e-completion-match.c (e_completion_match_compare_alpha):
        Fix the sort routine to properly use the major & minor keys for
        sorting grouped elements with the same match text.  I had this all
        wrong.

svn path=/trunk/; revision=10159
2001-06-08 18:31:27 +00:00
011e2ddb2e we can ignore the border, as e-text takes care of that for us
2001-06-07  jacob berkman  <jacob@ximian.com>

	* gal/e-text/e-entry.c (canvas_size_allocate): we can ignore the
	border, as e-text takes care of that for us
	(canvas_size_request): correctly handle when borders should be
	drawn

	* gal/e-text/e-completion-view.c (e_completion_view_paint): fix a
	small bug in the drawing-2-pixel-border change to my patch

svn path=/trunk/; revision=10149
2001-06-07 15:50:51 +00:00
35e7e49201 Applied patch from Jacob Berkman to un-offset the completion popup and add
2001-06-06  Jon Trowbridge  <trow@ximian.com>

	* gal/e-text/e-entry.c:
	* gal/e-text/e-completion-view.c: Applied patch from Jacob Berkman
	to un-offset the completion popup and add a border around it.  I
	tweaked it slightly to make the border two pixels thick instead of
	one.  (Which I like, but might annoy everyone else.  We'll see.)

svn path=/trunk/; revision=10133
2001-06-06 17:57:19 +00:00
f90d524db3 Oops. Forgot to remove some debugging code before committing.
svn path=/trunk/; revision=10119
2001-06-05 17:48:07 +00:00
dc04c9c3fa Small changes throughout to use ECompletionMatch.
2001-06-05  Jon Trowbridge  <trow@gnu.org>

	* gal/e-text/e-entry.c: Small changes throughout to use
	ECompletionMatch.

	* gal/e-text/e-completion-view.c: Small changes throughout
	to use ECompletionMatch.

	* gal/e-text/e-completion.c: Small changes throughout to use
	ECompletionMatch.

	* gal/e-text/e-completion-match.h:
	* gal/e-text/e-completion-match.c: Added.  A struct to contain
	completion matches.  This lets us more easily pass around
	information between the various bits of completion machinery.

svn path=/trunk/; revision=10118
2001-06-05 17:46:56 +00:00
0213507193 set allow_newlines on the etext item to false, since we are like an entry
2001-05-31  jacob berkman  <jacob@ximian.com>

	* gal/e-text/e-entry.c (e_entry_init): set allow_newlines on the
	etext item to false, since we are like an entry

svn path=/trunk/; revision=10061
2001-05-31 16:54:28 +00:00
b63edae65e Validate utf8 to avoid lock-ups. (_get_position): Validate utf8 to avoid
2001-05-14  Jon Trowbridge  <trow@ximian.com>

	* gal/e-text/e-text.c (calc_line_widths): Validate utf8 to avoid
        lock-ups.
   	(_get_position): Validate utf8 to avoid lock-ups.

svn path=/trunk/; revision=9797
2001-05-14 20:57:35 +00:00
36e820522e Request an update if just our line widths needed recalculation. This fixes
2001-05-07  Federico Mena Quintero  <federico@ximian.com>

	* gal/e-text/e-text.c (e_text_reflow): Request an update if just
	our line widths needed recalculation.  This fixes the bug where
	the text item would not repaint itself if the canvas lost the
	focus.

svn path=/trunk/; revision=9705
2001-05-08 00:08:19 +00:00
c4ff4d8239 Made fewer calls to functions like split_into_lines to save time when
2001-04-29  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c: Made fewer calls to functions like
	split_into_lines to save time when possible.

svn path=/trunk/; revision=9629
2001-04-29 19:06:24 +00:00
f413877346 add e-completion-test
svn path=/trunk/; revision=9615
2001-04-27 17:15:22 +00:00
70353ea6c6 Remove UNICODE_CFLAGS (e_text_test_LDADD, e_entry_test_LDADD,
* gal/e-text/Makefile.am (INCLUDES): Remove UNICODE_CFLAGS
        (e_text_test_LDADD, e_entry_test_LDADD, e_text_model_test_LDADD,
        e_completion_test_LDADD): remove -lunicode, add libunicode.la

        * gal/e-text/e-text.c: Remove <unicode.h>, use gunicode functions.

svn path=/trunk/; revision=9516
2001-04-23 20:02:27 +00:00
7221bd79c2 Limit total matches, for better performance on slow machines. It is
2001-04-20  Jon Trowbridge  <trow@ximian.com>

	* gal/e-text/e-completion-test.c: Limit total matches, for better
	performance on slow machines.  It is supposed to be a test, so
	correctness of the completion operations isn't really a
	priority...

	* gal/e-text/e-completion-view.c (e_completion_view_construct):
	Set GTK_CAN_FOCUS flag.

	* gal/e-text/e-entry.c (e_entry_show_popup): Evil! Evil! Unclean!
	Unclean!  Manually check if the pointer is in the area where the
	popup is going to appear, and if it is, warp the pointer out of
	the way.  After days of fucking around, this horrible hack is the
	only way that I've been able to figure out to keep the focus from
	being taken away from the entry and ending up somewhere strange
	when the popup pops up.  (The main problem is with the case of
	focus-follows-cursor --- click-to-focus works fine.  Sawfish
	idiocincracies may also be causing problems, but I don't want to
	unjustly accuse the WM of anything, as tempting and appealing as
	that can be.)
	(key_press_cb): Proxy for forwarding the popup's key press events
	to the entry.
	(key_release_cb): Proxy for forwarding the popup's key release
	events to the entry.
	These proxies should be enough to take care of my focus problems.
	Unfortunately, they aren't, and the pointer-warping-focus-horror
	is required for reasons that I don't fully understand.

	* gal/e-text/e-text.c (_get_xy_from_position): Made
        _get_xy_from_position return a boolean.  It returns TRUE if the
		computation was successful
	(and if valid data is now in *xp and *yp), FALSE otherwise.  Make
	sure that text->lines is not NULL, and return FALSE if it is.
	(_get_position): Test that _get_xy_from_position returns TRUE
	before using the values in x and y.
	(_get_position): Test that _get_xy_from_position returns TRUE
	before using the values in x and y.
	Garbage values being returned in passed-in pointers created a race
	condition where you could hang an EText if you deleted the entire
	contents of the buffer really quickly.

svn path=/trunk/; revision=9468
2001-04-20 08:15:24 +00:00
62e82291e8 Propagate the event after sending it to the base EText.
2001-04-16  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c (tooltip_event): Propagate the event after
	sending it to the base EText.

svn path=/trunk/; revision=9379
2001-04-16 16:20:52 +00:00
17bc3ae168 Made setting the rgba color work even if you're using the non-aa canvas
2001-04-15  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c: Made setting the rgba color work even if
	you're using the non-aa canvas (except for the a.)

svn path=/trunk/; revision=9337
2001-04-16 02:06:57 +00:00
8da0e6054f Added strikeout argument.
2001-04-15  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c, gal/e-text/e-text.h: Added strikeout
	argument.

svn path=/trunk/; revision=9327
2001-04-15 16:50:36 +00:00
655592d3a8 Use e_canvas_hide_tooltip and e_canvas_popup_tooltip. Set bold on the
2001-04-15  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c (tooltip_event): Use e_canvas_hide_tooltip
	and e_canvas_popup_tooltip.  Set bold on the tooltip.

	* gal/widgets/e-canvas.c, gal/widgets/e-canvas.h: Added
	e_canvas_popup_tooltip and e_canvas_hide_tooltip.

svn path=/trunk/; revision=9323
2001-04-15 14:18:02 +00:00
15541de2db Added "bold" argument.
2001-04-15  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c, gal/e-text/e-text.h: Added "bold" argument.

svn path=/trunk/; revision=9319
2001-04-15 12:59:16 +00:00
c457df3f5c add a missing \
* tests/test-tree-3.c (INITIAL_SPEC): add a missing \

        * gal/e-text/e-text.c (_get_position_from_xy): Add a "break;" to
        an otherwise-empty default case to make it ANSI.

svn path=/trunk/; revision=9201
2001-04-07 16:05:50 +00:00
c77e63e2cc Some small header cleanups & fixes, and fix to translate all popup menus
(woohoo!):

2001-04-05  Gediminas Paulauskas <menesis@delfi.lt>

	* gal/widgets/e-popup-menu.c: Copied gnome_app_helper_gettext function
	here, and use it for translating menu names (they are passed from app as
	well as from gal in arrays with N_(), and domains differ).

svn path=/trunk/; revision=9190
2001-04-05 00:26:43 +00:00
7957a3085c Fixed headers. Moved the .h associated with each .c to the top of the list
2001-04-04  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text-model-uri.c, gal/e-text/e-text.c,
	gal/e-text/e-text.h, gal/e-text/e-text-event-processor.c,
	gal/util/e-xml-utils.c, gal/widgets/e-cursors.c,
	gal/widgets/e-cursors.h: Fixed headers.  Moved the .h associated
	with each .c to the top of the list of included files.

	* gal/util/e-util.h: Removed the bonobo-xobject.h header here.

	* gal/util/e-xml-utils.c: Replaced strcasecmp with g_strcasecmp.

	* gal/widgets/e-canvas-vbox.c: Make this work even if the item is
	destroyed after the vbox.

	* gal/widgets/e-categories.c (do_parse_categories): Made this
	translate using e_utf8_from_locale string as it should.

svn path=/trunk/; revision=9175
2001-04-04 12:25:55 +00:00
8940bcc90c Fix headers. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto. Same. Ditto. Same
2001-04-04  Kjartan Maraas  <kmaraas@gnome.org>

	* gal/e-text/e-entry.c: Fix headers.
	* gal/e-text/e-table-text-model.[ch]: Ditto.
	* gal/e-text/e-table-text-model-uri.c: Ditto.
	* gal/e-text/e-text-model-uri.[ch]: Ditto.
	* gal/e-text/e-text-model.[ch]: Ditto.
	* gal/e-text/e-text.[ch]: Ditto.
	* gal/util/e-text-event-processor-emacs-like.[ch]: Ditto.
	* gal/util/e-text-event-processor.[ch]: Same.
	* gal/util/e-util.h: Ditto.
	* gal/util/e-xml-utils.[ch]: Same here.
	* gal/widgets/color-group.[ch]: Ditto.
	* gal/widgets/color-palette.[ch]: Ditto.
	* gal/widgets/e-canvas-utils.h: Ditto.
	* gal/widgets/e-canvas-vbox.[ch]: Ditto.
	* gal/widgets/e-canvas.[ch]: Ditto.
	* gal/widgets/e-categories.h: Ditto.
	* gal/widgets/e-colors.[ch]: Ditto.
	* gal/widgets/e-cursors.c: Ditto.
	* gal/widgets/e-gui-utils.c: Ditto
	* gal/widgets/e-popup-menu.[ch]: Same.
	* gal/widgets/e-reflow-sorted.c: Same.
	* gal/widgets/e-reflow.[ch]: Same.
	* gal/widgets/e-selection-model.c: Same
	* gal/widgets/e-unicode.[ch]: Same.
	* gal/widgets/gtk-combo-stack.[ch]: Same.
	* gal/widgets/widget-color-combo.[ch]: Same.
	* gal/widgets/widget-pixmap-combo.[ch]: Same.

svn path=/trunk/; revision=9168
2001-04-04 07:33:09 +00:00
b04c89fedd Set the size of the thing to a decent value that lets us test stuff.
2001-03-18  Miguel de Icaza  <miguel@ximian.com>

	* tests/test-tree-1.c (create_tree): Set the size of the thing to
	a decent value that lets us test stuff.

2001-03-16  Miguel de Icaza  <miguel@ximian.com>

	* gal/e-text/e-entry.h: Expose the canvas/item that used to be
	public and that were privatized.

svn path=/trunk/; revision=8802
2001-03-18 23:54:39 +00:00
7b003b963e Comment out text after #endif. Add #include <string.h> for strcmp().
2001-03-16  Kjartan Maraas  <kmaraas@gnome.org>

	* gal/widgets/widget-pixmap-combo.h: Comment out text after #endif.
	* gal/e-text/e-completion.c: Add #include <string.h> for strcmp().

svn path=/trunk/; revision=8758
2001-03-16 13:30:13 +00:00
3b21f3119c Make this take an extra argument saying whether or not to grab the
* gal/widgets/e-canvas.c (e_canvas_item_grab_focus): Make this
	take an extra argument saying whether or not to grab the
	widget-level focus.

	* gal/e-text/e-text.c (e_text_event): Update arguments to
	e_canvas_item_grab_focus.

svn path=/trunk/; revision=8745
2001-03-15 22:47:47 +00:00
267af7a6fa Renamed "temp" as "new_text", to avoid confusion.
2001-03-12  Jon Trowbridge  <trow@ximian.com>

	* gal/e-text/e-text-model.c (e_text_model_real_insert_length):
	Renamed "temp" as "new_text", to avoid confusion.
	(e_text_model_real_delete): Renamed "temp" as "new_text", to avoid
	confusion.

svn path=/trunk/; revision=8640
2001-03-12 19:18:46 +00:00
10d0e730ec Added. This is part of a change of sematics that makes things much nicer
2001-03-06  Jon Trowbridge  <trow@gnu.org>

	* gal/e-text/e-entry.c (e_entry_text_keypress): Added.  This is
	part of a change of sematics that makes things much nicer for the
	user --- auto-activate the completion popup only on keypresses
	than also change the entry.
	(e_entry_proxy_changed): Record that the underlying EText has
	changed, and set up a timeout to clear the changed_since_keypress
	flag in a very short amount of time.
	(e_entry_init): Connect to the EText's "keypress" signal".
	(e_entry_destroy): If our completion_delay_tag timeout is still
	floating around out there when we are winding things down, remove
	it.

	* gal/e-text/e-text.c (e_text_class_init): Added keypress signal.
	(e_text_text_model_reposition): Removed some old cruft.
	(e_text_event): Emit our keypress signal after handling events of
	type GDK_KEY_PRESS.

svn path=/trunk/; revision=8566
2001-03-06 09:47:08 +00:00
1bdc6e147f Set version number to 0.5.99.5
2001-03-05  Jon Trowbridge  <trow@gnu.org>

        * configure.in: Set version number to 0.5.99.5

        * gal/e-text/e-entry.c (e_entry_class_init): Add a "popup" signal.
        If you have trepidations about this, see the technical argument
        below.
        (e_entry_init): Connect to the EText's popup signal.
        (e_entry_proxy_popup): Proxy emitter for popup signals from the
        EText.

        * gal/e-text/e-text.c (e_text_class_init): Added a "popup" signal.
        (e_text_event): Emit the "popup" signal on right-clicks.  Now you
        could ask yourself: "should there be a signal named 'popup' in
        EText that gets emitted on right-clicks?"  And this is a
        reasonable question, since... well, this has a funny feeling to
        it.  But the whole point of GNOME, or at least one of the original
        points of GNOME, was to impose policy in a reasonable way when it
        made sense in order to simplify the user's experience.  Convention
        dictates that popup menus are tied to right-clicks --- so rather
        than setting up some elaborate forwarding of button-press signals,
        why not just impose a little policy and set up a signal that is
        closely tied to a familiar set of semantics?  Maybe it isn't the
        best thing to do from a aesthetics-of-the-API point of view, but I
        doubt anyone could condemn it as being anything more than mostly
        harmless.

svn path=/trunk/; revision=8565
2001-03-06 00:13:23 +00:00
abfe245a43 Upped the version number to 0.5.99.4.
2001-03-05  Christopher James Lahey  <clahey@ximian.com>

	* configure.in: Upped the version number to 0.5.99.4.

	* gal/e-text/e-text.c (e_text_draw): Fixed a crash here.

svn path=/trunk/; revision=8556
2001-03-05 16:06:53 +00:00
fae87e8d3d Boost version number to 0.5.99.3.
2001-03-01  Jon Trowbridge  <trow@ximian.com>

        * configure.in: Boost version number to 0.5.99.3.

        * gal/e-text/e-entry.c (e_entry_show_popup): Grab pointer when the
        popup is visible, and then hide the popup if any button press
        events occur outside of the popup.  This lets up avoid most of the
        worst "floating popup" cases that would occur if windows are
        moved, desktops changed, etc. with the mouse.  (Doing things like
        changing desktop w/ keybindings can still cause a "floating
        popup", but that is also true of Gtk's own combo box.)  Change
        popup positioning to slightly offset it from the entry, rather
        than just plopping it down directly below.
        (button_press_cb): Determine if a button press occured outside of
        the popup when the pointer was grabbed, and unbrowse accordingly.

        * gal/e-text/e-completion-view.c
        (e_completion_view_key_press_handler): Improve keystroke handling.
        Allow Tabs to pass through (after hiding the pop-up) in order to
        allow focus change requests to work properly.
        (e_completion_view_construct): Disable horizontal scrollbars.

        * gal/e-text/e-completion-test.c (main): Reworked to use signals
        instead of explicit callbacks.

        * gal/e-text/e-completion.h:
        * gal/e-text/e-completion.c: Fix the awkward mix of signals and
        explicitly-specified callbacks by taking out the explicit
        callbacks.  This approach is more gtk-ish, after all.

svn path=/trunk/; revision=8458
2001-03-01 20:59:42 +00:00
6a8d4951dc Changed e_table_selection_model_clear to e_selection_model_clear.
2001-02-27  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-completion-view.c: Changed
	e_table_selection_model_clear to e_selection_model_clear.

	* tests/test-tree-3.c: Changed E_TABLE_CURSOR_LINE to
	E_CURSOR_LINE.

From gal/e-table/ChangeLog:

2001-02-27  Christopher James Lahey  <clahey@ximian.com>

	* e-table-click-to-add.c, e-table-group-container.c,
	e-table-group-container.h, e-table-group-leaf.c,
	e-table-group-leaf.h, e-table-item.c, e-table-item.h,
	e-table-specification.c, e-table-specification.h, e-table.c,
	e-table.h: Changed a lot of the ETableSelectionModels to
	ESelectionModels, a lot of the ETableSorters to ESorters, all the
	ETableCursorModes to ECursorModes, and all of the
	ETableForeachFuncs into EForeachFuncs.

	* e-table-defines.h: Moved ETableForeachFunc and ETableCursorMode
	to e-selection-model.h.

	* e-table-selection-model.c, e-table-selection-model.h: Made this
	a subclass of ESelectionModel which simple connects to an
	ETableModel.

	* e-table-sorter.c, e-table-sorter.h: Made this a subclass of
	ESorter so that implements the same semantics it used to.

svn path=/trunk/; revision=8422
2001-02-28 03:36:29 +00:00
3fc425dee9 Fixed. (e_entry_select_region): Fixed. (e_entry_show_popup): Grab/ungrab
2001-02-23  Jon Trowbridge  <trow@ximian.com>

	* gal/e-text/e-entry.c (e_entry_set_position): Fixed.
	(e_entry_select_region): Fixed.
	(e_entry_show_popup): Grab/ungrab the pointer and keyboard when
	the popup appears/disappears.  This (mostly) solves the "floating
	popup" problem.
	(button_press_cb): Added.  We catch button presses outside of
	the popup, and hide the popup when they occur.

	* gal/e-text/e-completion-view.c (e_completion_view_get_type,
	e_completion_view_class_init): Changed base class to GtkEventBox.
	(e_completion_view_key_press_handler): Make Escape always cause an
	unbrowse, even wehen we are editting.

svn path=/trunk/; revision=8369
2001-02-23 17:27:51 +00:00
58eeaa0977 Changed the version number to 0.5.99.1.
2001-02-19  Christopher James Lahey  <clahey@ximian.com>

	* configure.in: Changed the version number to 0.5.99.1.

	* gal/Makefile.am (libgal_la_LIBADD): Change the directories for
	e-table-text-model.lo, e-text-event-processor.lo, and
	e-text-event-processor-emacs-like.lo.  Reordered the e-text
	directory to be after the e-table directory in build order.

	* gal/e-text/Makefile.am: Removed
	e-text-event-processor-emacs-like.c,
	e-text-event-processor-emacs-like.h,
	e-text-event-processor-types.h, e-text-event-processor.c, and
	e-text-event-processor.h.  Added e-table-text-model.c and
	e-table-text-model.h.

	* gal/e-text/e-table-text-model.c: Changed the signature of these
	mehtods to match the changed signature in ETextModel.

	* gal/e-text/e-text-event-processor-emacs-like.c,
	gal/e-text/e-text-event-processor-emacs-like.h,
	gal/e-text/e-text-event-processor-types.h,
	gal/e-text/e-text-event-processor.c,
	gal/e-text/e-text-event-processor.h: Moved these to gal/util/.

	* gal/e-text/e-text.c, gal/e-text/e-text.h: Changed the includes
	to match the moved files.

	* gal/util/Makefile.am: Added e-text-event-processor-emacs-like.c,
	e-text-event-processor-emacs-like.h,
	e-text-event-processor-types.h, e-text-event-processor.c, and
	e-text-event-processor.h.

	* gal/util/e-text-event-processor-emacs-like.h,
	gal/util/e-text-event-processor.h: Changed the includes to match
	the moved files.

2001-02-19  Christopher James Lahey  <clahey@ximian.com>

	* Makefile.am: Removed e-table-text-model.c and
	e-table-text-model.h.

	* e-table-text-model.c, e-table-text-model.h: Moved these to
	gal/e-text/.

	* e-cell-text.c: Changed the include line for
	e-text-event-processor.h and e-text-event-processor-emacs-like.h.

svn path=/trunk/; revision=8298
2001-02-20 03:25:48 +00:00
54105acd4e Forgot to add. Doh!
svn path=/trunk/; revision=8281
2001-02-19 22:48:03 +00:00
0e3e3e9914 Added. Allows you to attach an ECompletion to an EEntry, and have that
2001-02-19  Jon Trowbridge  <trow@ximian.com>

        * gal/e-text/e-entry.c (e_entry_enable_completion_full): Added.
        Allows you to attach an ECompletion to an EEntry, and have that
        ECompletion be used for (obviously enough) completions.

        * gal/e-text/e-completion-view.h, gal/e-text/e-completion-view.c:
        Added.  ECompletionView is a widget for displaying the results of
        a completion request in a format that is appropriate for a
        drop-down window.

        * gal/e-text/e-completion.h, gal/e-text/e-completion.c: Added.
        ECompletion is a "pure virtual base class" for completion-type
        operations.  It is implemented so that completions can be either
        synchronous or asynchronous.

        * gal/e-text/e-text.c: Lots of changes to accomodate the
        ETextModel changes.  First of all, we render embedded text objects
        as being underlined.  We also cause the model to emit the
        appropriate object activation signal when an embedded object is
        double-clicked.  Also, all of the code that moves the cursor in
        response to user input has been removed.  Instead, the EText now
        listens for "reposition" events from the underlying model, and
        bases all cursor motions on those.
        (get_bounds_item_relative): Fixed bug in the handling of
        differently-anchored text.  Being differently-anchored is not a
        crime or a perversion --- it is an alternative lifestyle that we
        have to respect.

        * gal/e-text/e-text-model-uri.h, gal/e-text/e-text-model-uri.c: A
        sample ETextModel that converts URIs into embedded objects that
        get opened in the browser when you double-click them.

        * gal/e-text/e-text-model-repos.h,
        gal/e-text/e-text-model-repos.c: Added.  A group of simple
        structures & functions for handling various cursor movement rules.
        These are the sorts of things that are passed as arguments to
        ETextModel "reposition" event handlers.

        * gal/e-text/e-text-model.h, gal/e-text/e-text-model.c: Privitized
        the ETextModel struct and "methodized" all of the operations, so
        that derived classes can do arbitrarily respond to get/set
        requests in arbitrarily strange ways.  Also added the concept of
        declaring regions of the text as "embedded text objects".
        Finally, caused operations that change the text to emit a
        "reposition" signal that passes information that can be used by a
        view (like an EText) to move the cursor or selection in an
        intelligent way in response to those changes.  This means that you
        can now open two ETexts that look at the same ETextModel, and have
        the cursor in one do the right thing when you edit the other.  (As
	opposed to producing a lot of potential segfaults, as it was
	before.)

svn path=/trunk/; revision=8280
2001-02-19 22:47:23 +00:00
7eb5320460 Commented out this function since it's not being used.
2001-02-08  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text-model-test.c (describe_model): Commented out
	this function since it's not being used.

svn path=/trunk/; revision=8109
2001-02-08 17:40:01 +00:00
6827ac920d Don't handle C-Enter.
2001-02-08  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text-event-processor-emacs-like.c
	(e_text_event_processor_emacs_like_event): Don't handle C-Enter.

svn path=/trunk/; revision=8107
2001-02-08 16:48:09 +00:00
a48def7054 Store the whole GdkColor instead of just the pixel.
2001-02-07  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-text.c, gal/e-text/e-text.h (e_text_realize): Store
	the whole GdkColor instead of just the pixel.

svn path=/trunk/; revision=8063
2001-02-07 22:16:47 +00:00
ab0f7d1ccb Added e-text-model-test
2001-02-05  Jeffrey Stedfast  <fejj@ximian.com>

	* gal/e-text/.cvsignore: Added e-text-model-test

svn path=/trunk/; revision=8015
2001-02-06 04:36:28 +00:00
88b4d80571 Changed draw_borders from a gboolean to a a guint : 1.
2001-02-05  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-entry.h: Changed draw_borders from a gboolean to a
	a guint : 1.

svn path=/trunk/; revision=7990
2001-02-05 21:31:34 +00:00
7932df2252 added gboolean draw_borders to make it compile, probably some forgotten
2001-01-31  Radek Doulik  <rodo@ximian.com>

	* gal/e-text/e-entry.h: added gboolean draw_borders to make it
	compile, probably some forgotten commit of e-entry.h

svn path=/trunk/; revision=7926
2001-01-31 17:39:23 +00:00
500a985e34 Fixed allocation and placement of text for no bordered text.
2001-01-30  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-entry.c (canvas_size_allocate, et_set_arg): Fixed
	allocation and placement of text for no bordered text.

svn path=/trunk/; revision=7922
2001-01-31 00:36:57 +00:00
1a2f7014e8 Fixed allocation and placement of text window.
2001-01-30  Christopher James Lahey  <clahey@ximian.com>

	* gal/e-text/e-entry.c (canvas_size_allocate, et_set_arg): Fixed
	allocation and placement of text window.

	* gal/e-text/e-text.c (e_text_draw): Fixed display of the text.

svn path=/trunk/; revision=7920
2001-01-31 00:00:27 +00:00
2dee35819c Reverted the latest change to EText since we're in feature freeze.
2001-01-30  Christopher James Lahey  <clahey@helixcode.com>

	* Reverted the latest change to EText since we're in feature freeze.

svn path=/trunk/; revision=7912
2001-01-30 11:54:53 +00:00
b0046a3699 Connect to the model's "position" signal. (e_text_init): Set default value
2001-01-29  Jon Trowbridge  <trow@gnu.org>

	* gal/e-text/e-text.c (e_text_init): Connect to the model's
	"position" signal.
	(e_text_init): Set default value for rgba_object as blue.
	(e_text_destroy): Disconnect model position signal.
	(fix_selection): Some extra sanity checking to keep the selection
	from spilling outside of the bounds of the text string as it
	expands or contracts.  Should be obsolete due to the changes to
	objectify_uris --- but I'll leave this in here for now, in an
	attempt to avoid non-\0-terminated strings, segfaults, and all of
	that fun stuff.
	(e_text_text_model_position): Move our cursor according to the
	suggestions made by our ETextModel, via the "position" signal.
	(text_width_with_objects): Check that text is not NULL.
	(text_draw_with_objects): Accept an extra GdkGC for use in drawing
	objects.
	(e_text_set_arg): Properly handle the "position" signal when
	changing models.
	(e_text_draw): Initialize the GC for drawing objects, if
	necessary.
	(_insert): Comment out the code that adjustes text->selection_*.
	The cursor is now moved by the ETextModel directly via the
	position signal, not by the view.

	* gal/e-text/e-text-model-uri.c (objectify_uris): Add more
	sophisticated uri recognition via regular expressions.
	(objectify_uris): Changed to track position changes as model->text
	expands and contracts along with the objects.  Block the
	objectification of any chunks of text that straddle our current
	position.
	(e_text_model_uri_set_text): Added position info to objectify_uris
	call.
	(e_text_model_uri_insert): Added position info to objectify_uris
	call.
	(e_text_model_uri_insert_length): Added position info to
	objectify_uris call.
	(e_text_model_uri_delete): Added position info to objectify_uris
	call.

	* gal/e-text/e-text-model.c (e_text_model_class_init): Added a
	"position" signal that allows the ETextModel to send cursor
	positioning information back to any view.  We need this for text
	with objects, where the text string can grow and shrink in ways
	that the view doesn't expect.
	(e_text_model_real_insert): Added sanity checking of args and a
	position emission.
	(e_text_model_real_insert_length): Added sanity checking of args
	and a position emission.
	(e_text_model_real_delete): Added sanity checking of args.
	(e_text_model_suggest_position): A wrapper around the "position"
	signal emitter.

svn path=/trunk/; revision=7894
2001-01-29 20:27:38 +00:00
8c1c827496 Added; a new test program that demonstrates objects in ETexts.
2001-01-26  Jon Trowbridge  <trow@gnu.org>

        * gal/e-text/e-text-model-test.c: Added; a new test program that
        demonstrates objects in ETexts.

        * gal/e-text/e-text-model-uri.c: Added; a text model that converts
        URIs in the text into objects that are passed off to the GNOME URI
        handler when activated.  This is actually still extremely broken;
        I got it just working enough to test out my EText changes.

        * gal/e-text/e-text.c: A whole lot of changes, designed to make
        ETextModel objects render properly.  The basic idea of the changes
        is pretty simple, though.
        (text_width_with_objects): First of all, this function is an
        alternative to e_font_utf8_text_width that takes into the account
        the embedded \1s in the text string and properly accounts for the
        width of the object strings.
        (unicode_strlen_with_objects): Next, this function finds the
        proper strlen of a string, expanding the \1s.
        (text_draw_with_objects): Finally, this is just a replacement for
        e_font_draw_utf8_text that does the right thing for objects.  I've
        gone through all of e-text.c and replace calls by those original
        functions with my new object-enabled alternatives.
        (split_into_lines): Some tweaking to get line breaking to work
        properly.  Made \1 into a "break character", so that we can break
        lines between multiple adjacent objects.  (Which seemed like the
        right thing to do, but there may be cases where that is
        undesireable.)
        (_get_position_from_xy): Fixed to properly handle embedded
        objects, and to get the right selection semantics for objects.
        (Or at least semantics that feel right to me.)  Also fixed a bug
        that caused selection, etc. to not work properly if the text was
        anchored anywhere other than with GTK_ANCHOR_NORTH*.
        (_get_position): Hacked to cause objects to activate when they are
        double-clicked.  There is probably a better way to do this.

        * gal/e-text/e-text-model.c (e_text_model_real_object_count):
        Provide a default implementation of an object counter.  Derived
        classes might want to override this for efficiency reasons.
        (e_text_model_strdup_expanded_text): Added.  Allocates and returns
        a string contains the model's text with the objects "expanded"
        within.

        * gal/e-text/e-text-model.h: Added obj_count, get_nth_obj, and
        activate_nth_obj virtual methods to ETextModelClass.

svn path=/trunk/; revision=7842
2001-01-26 22:10:51 +00:00
26f5efce64 Fixed text misplacement.
2001-01-18  Christopher James Lahey  <clahey@helixcode.com>

	* gal/e-text/e-entry.c: Fixed text misplacement.

svn path=/trunk/; revision=7632
2001-01-19 04:35:22 +00:00
00fadf4666 Make tooltip appear properly even if anchor is set.
2001-01-18  Christopher James Lahey  <clahey@helixcode.com>

	* gal/e-text/e-text.c (_do_tooltip): Make tooltip appear properly
	even if anchor is set.

svn path=/trunk/; revision=7620
2001-01-18 10:58:42 +00:00