Commit Graph

2441 Commits

Author SHA1 Message Date
Havoc Pennington
da4a311279 if we move to the front of a segment, use the "slow" technique for moving
2001-10-24  Havoc Pennington  <hp@pobox.com>

	* gtk/gtktextiter.c (gtk_text_iter_backward_chars): if we move to
	the front of a segment, use the "slow" technique for moving
	backward, so we don't mess up the any_segment field in the iter.
	Fixes #57707

	* tests/testtextbuffer.c: add code to detect #57707, to avoid
	regression
2001-10-24 04:48:21 +00:00
Havoc Pennington
fa4e7a31fd only sensitize Cut if selection contains some editable text, #60975
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (popup_targets_received): only sensitize Cut
	if selection contains some editable text, #60975
	(gtk_text_view_scroll_to_iter): remove warning about scrolling
	prior to map; it should actually be OK to do so in many cases,
	it would be nice to warn about scrolling when many lines have
	height 0, but I don't know what to do about that. Perhaps
	move part of flush_scroll into this function? comment added
	to consider this.
2001-10-23 23:35:00 +00:00
Havoc Pennington
14cc0e8f77 Correctly keep the same text on the top of the screen, considering that
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (changed_handler): Correctly keep the same
	text on the top of the screen, considering that the changed region
	may have overlapped the first paragraph. Should fix msw's "text
	widget scrolled to wrong place on map" bug, and probably some
	other scrolling cases as well.
	(gtk_text_view_set_scroll_adjustments): start adjustments at 0.0,
	instead of some random value

	* gtk/gtktextview.c (gtk_text_view_class_init): actually override
	grab_focus, so #59708 is really fixed
2001-10-23 23:06:14 +00:00
Anders Carlsson
fd3196d9ed Use an image menu item here (popup_targets_received): Call
2001-10-24  Anders Carlsson  <andersca@gnu.org>

	* gtk/gtkentry.c: (append_action_signal): Use an image menu item here
	(popup_targets_received): Call append_action_signal with stock items

	* gtk/gtklabel.c: (append_action_signal): Use an image menu item here
	(gtk_label_do_popup): Call append_action_signal with stock items

	* gtk/gtktextview.c: (append_action_signal): Use an image menu item here
	(popup_targets_received): Call append_action_signal with stock items
2001-10-23 22:43:01 +00:00
Havoc Pennington
b6ba7a5f04 queue a resize here; will temporarily slow down the widget a lot, until we
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (changed_handler): queue a resize here; will
	temporarily slow down the widget a lot, until we figure out how to
	optimize to avoid full redraw everytime we queue a resize
2001-10-23 20:13:44 +00:00
Havoc Pennington
10f47690ea handle case where offset == 0 and char_len == 0, bug #61729
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextiter.c (test_log_attrs): handle case where offset ==
	0 and char_len == 0, bug #61729
2001-10-23 19:31:56 +00:00
Havoc Pennington
85cdc1cec3 fix return value, #61714 (Vitaly Tishkov)
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextiter.c (gtk_text_iter_forward_cursor_positions): fix
	return value, #61714 (Vitaly Tishkov)
	(gtk_text_iter_backward_sentence_starts): ditto
	(gtk_text_iter_backward_word_starts): ditto
	(gtk_text_iter_forward_word_ends): ditto
	(gtk_text_iter_forward_sentence_ends): ditto
	(gtk_text_iter_backward_cursor_positions): ditto
2001-10-23 19:19:10 +00:00
Havoc Pennington
9894b89bd9 Apply fix from Dov Grobgeld, #61858
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_pixel): Apply
	fix from Dov Grobgeld, #61858
2001-10-23 17:45:33 +00:00
Havoc Pennington
bd3b53c4c7 credit Hidetoshi 2001-10-23 17:26:57 +00:00
Havoc Pennington
cfcf83664b Update IM spot location at appropriate times, #50626
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_update_im_spot_location):
	Update IM spot location at appropriate times, #50626
2001-10-23 17:26:13 +00:00
Havoc Pennington
dceeec3521 remove conflict markers 2001-10-23 16:17:15 +00:00
Havoc Pennington
13a24b1b36 scroll to cursor on grab focus, unless it's caused by button click, #59708
2001-10-23  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_grab_focus): scroll to cursor
	on grab focus, unless it's caused by button click, #59708
2001-10-23 16:07:05 +00:00
Owen Taylor
4e32ede287 Remove G_DISABLE_CONST_RETURNS.
Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.

	* gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
	G_CONST_RETURN. (Murray Cumming)

	* gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
	Make G_CONST_RETURN.

	* gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
	results of g_get_home_dir().

	* gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
	copy. Storing the return from gtk_entry_get_text() is evil.

	* gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
	gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
	gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
	gtk/gtksignal.c: Add const.

	* gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.

	* gtk/gtktreeview.c: Namespace object data keys to be safe, even
	if we are setting them on private widgets.

	* gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
	Duplicate entry->text before setting it as object data.
2001-10-23 16:02:23 +00:00
Havoc Pennington
0d5635b366 don't back up a char from the end iterator, fixes #61859 ("can't put
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
	up a char from the end iterator, fixes #61859 ("can't put cursor
	at the end of the buffer")

	* gtk/gtktextiter.c (gtk_text_iter_forward_to_line_end): fix this
	to work with delimiters other than newline.

	* tests/testtextbuffer.c: add some tests for get_chars_in_line,
	get_bytes_in_line

	* gtk/gtktextiter.c (gtk_text_iter_get_chars_in_line): fix for the
	last line, since the newline is no longer counted.
	(gtk_text_iter_get_bytes_in_line): ditto
2001-10-22 23:35:03 +00:00
Havoc Pennington
f2bf563dbd add assertion that #58290 would trigger if it reappeared, I think
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextbtree.c (_gtk_text_btree_insert): add assertion that
	#58290 would trigger if it reappeared, I think
2001-10-22 22:28:27 +00:00
Havoc Pennington
0a522533b0 add temporary code to dump btree contents on assertion failure described
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextiter.c (_gtk_text_iter_forward_indexable_segment):
	add temporary code to dump btree contents on assertion failure
	described in #62656

	* gtk/gtktextbtree.c (ensure_end_iter_segment): add some
	assertions that we're getting the right end iter segment

	* gtk/gtktextiter.c (_gtk_text_iter_forward_indexable_segment):
	verify that we aren't on the end iterator after moving
	forward one segment - fixes return value in an obscure case.
	Also, some trivial code cleanup/rearranging.
2001-10-22 22:17:21 +00:00
Havoc Pennington
6446484667 add a #error unless you define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API, so
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextlayout.h: add a #error unless you define
	GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API, so people don't use this accidentally

        * gtk/gtktext*.c: #define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API as appropriate.
2001-10-22 21:52:47 +00:00
Havoc Pennington
a959d3daf8 fix #62365
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_get_border_window_size): fix
	#62365
2001-10-22 21:28:08 +00:00
Havoc Pennington
347da0ea5f fix #62436
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_get_window_type): fix
	#62436
2001-10-22 21:06:55 +00:00
Havoc Pennington
c33d17189f Fix #62366
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_set_border_window_size): Fix
	#62366
2001-10-22 21:05:28 +00:00
Owen Taylor
c8b58228d6 Add cursor-position, selection-bound properties. (#62148, reported by
Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklabel.c: Add cursor-position, selection-bound
	properties. (#62148, reported by Padraig O'Briain)

	* gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
	to cursor_position. (1.3.x addition, text_position is an awful
	name.) Make cursor_position read-only to avoid sticky questions
	of interaction with selection_bound. (#62636, reported by
	Padraig O'Briain)
2001-10-22 21:01:47 +00:00
Owen Taylor
92d2dc0ba6 Fixing popup menus to have "Paste" sensitized correctly. Original patches
Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>

	Fixing popup menus to have "Paste" sensitized correctly. Original
	patches from Damian Ivereigh, much mangled.

	* gtk/gtkselection.c: Add functions gtk_selection_data_get_targets(),
	gtk_selection_data_targets_include_text(). (#60854)

	* gtk/gtkclipboard.c: Add a simple do-it-all non-async "check if
	the clipboard has text" function gtk_clipboard_wait_is_text_available.
	(#60854)

	* gtk/gtkentry.c: Only enable the paste item if the clipboard
	contains text. (#60973)

	* gtk/gtktextview.c: Only enable the paste item if the clipboard
	contains text. (#60975)
2001-10-22 20:47:01 +00:00
Havoc Pennington
8fe966936c rip out "height_lines" and "width_columns" properties, it doesn't make
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_class_init): rip out
	"height_lines" and "width_columns" properties, it doesn't make
	sense to set the size request on a text view really. #62103
2001-10-22 19:26:16 +00:00
Jonathan Blandford
12396ed1c5 Realized g_node_depth is broken, and that it's not worth being consistent
Mon Oct 22 15:17:05 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreestore.c (gtk_tree_store_iter_depth): Realized
	g_node_depth is broken, and that it's not worth being consistent
	with it.
2001-10-22 19:19:27 +00:00
Havoc Pennington
72e6566b0d Clarify behavior in docs, #61777 (gtk_text_iter_forward_search)
2001-10-22  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextiter.c (gtk_text_iter_set_line): Clarify behavior in
	docs, #61777
	(gtk_text_iter_forward_search) (gtk_text_iter_backward_search):
	change the two boolean args to a flags field, so we can extend
	to add case insensitive, regexp searches later. #61852
2001-10-22 19:13:28 +00:00
Jonathan Blandford
6bf176c36d update docs to reflect reality, #62810
Mon Oct 22 15:07:17 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreestore.c (gtk_tree_store_iter_depth): update docs to
	reflect reality, #62810
2001-10-22 19:08:32 +00:00
Jonathan Blandford
dc754528a0 Remove handle_box from App demo.
Mon Oct 22 14:08:26 2001  Jonathan Blandford  <jrb@redhat.com>

	* demos/gtk-demo/appwindow.c: Remove handle_box from App demo.

	* gtk/gtktreeview.c (size_allocate): Move to a different drawing
	system.  Instead of having a window the size of the tree, we have
	a window the size of widget->allocation, and simply draw with the
	offset.
	(coords_are_over_arrow): ditto.  Move to window coordinates.
	(do_prelight): ditto
	(do_unprelight): ditto

	* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
	Minor fix from Kristian Rietveld to fix unsorted case.
2001-10-22 18:24:29 +00:00
jacob berkman
eb037279db don't cast a PIXTEXT cell to a PIXMAP cell (fixes crash when using PIXTEXT
2001-10-22  jacob berkman  <jacob@ximian.com>

	* gtk/gtkclist.c (cell_size_request): don't cast a PIXTEXT cell to
	a PIXMAP cell (fixes crash when using PIXTEXT cells)
2001-10-22 17:01:11 +00:00
Owen Taylor
0c6a8f530b Deprecate gtk_entry_set_editable. (#58768, Vitaly Tishkov)
Sat Oct 20 18:58:25 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkentry.h: Deprecate gtk_entry_set_editable.
        (#58768, Vitaly Tishkov)

        * gtk/gtkobject.h: Deprecate with abandon.
        (#61942, Vitaly Tishkov, Matthias Clasen)

        * gtk/gtksignal.h: Deprecate everything.

        * gtk/gtkmain.h (GTK_PRIORITY_INTERNAL): Deprecate
        all GTK_PRIORITY_* defines other than GKT_PRIORITY_RESIZE>
        (#61942, Matthias Clasen)

        * gtk/gtkstyle.h: Deprecate gtk_draw_*. (#61140,
        Havoc Pennington)

        * gtk/gtkitemfactory.h: Deprecate compat functions
        for GtkMenuFactory code. (#62071)

        * gdk/gdkdrawable.h: Deprecate gdk_draw_string,
        gdk_draw_text,gdk_draw_text_wc. (#62071)

        * gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
        Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
        to gtk_clipboard_get().
2001-10-22 14:31:06 +00:00
Owen Taylor
7da0a01b88 Don't call g_thread_init(), we don't want to link to -lgthread if we don't
Mon Oct 22 10:12:08 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c docs/Changes-2.0.txt (gdk_threads_init): Don't call
	g_thread_init(), we don't want to link to -lgthread if we don't
	have to.
2001-10-22 14:14:33 +00:00
Owen Taylor
97ff064f22 Add a function, gdk_threads_init() that must be explicitely called to
Mon Oct 22 08:51:02 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.[ch] (gdk_threads_init) docs/Changes-2.0.txt:
	Add a function, gdk_threads_init() that must be explicitely
	called to enable the GDK thread mutex.
2001-10-22 12:59:21 +00:00
Jakub Steiner
6320fa2a0e no body parts 2001-10-22 11:50:18 +00:00
Owen Taylor
46dde80428 Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
	problem with g_return_if_fail return value.

 	* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
	virtual atom code from the gdk-multihead branch, removing the per-display
	part. Virtualizing atoms needs to be done now to prevent compat
	breakage in direct Xlib accessing code in the future. (#62208)

 	* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
 	gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().

	* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
	an opaque pointer type so the compiler catches attempts
	to mingle it with X atoms.

	* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
	  gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
	  gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
	  gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
	  tests/testdnd.c,tests/testselection.c:
	Fix up for above atom changes.

	* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
	now have the ability to add custom predefines.

	* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
	Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
	to gtk_clipboard_get().

	* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
	for GdkAtom => pointer change.

	* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
	atoms, fix for GdkAtom => pointer change.
2001-10-22 04:34:42 +00:00
Kristian Rietveld
724a552c7d remove ARROW_SIZE constant, use new function spin_button_get_arrow_size()
Mon Oct 22 00:26:46 2001  Kristian Rietveld  <kristian@planet.nl>

        * gtk/gtkspinbutton.c: remove ARROW_SIZE constant, use
        new function spin_button_get_arrow_size() instead.

        * gtk/gtkstyle.c (gtk_default_draw_arrow): actual size of
        arrow was hardcoded, it's now variable.

        Fixes bug #50200
2001-10-21 22:28:55 +00:00
Manish Singh
e952c4f45b eh, typo 2001-10-21 01:19:44 +00:00
Manish Singh
a53be4f328 PROP_MODEL and PROP_EXPANDER_COLUMN can be NULL, so don't do a object case
Sat Oct 20 18:16:04 2001  Manish Singh  <yosh@gimp.org>

        * gtk/gtktreeview.c (gtk_treeview_get_property): PROP_MODEL and
        PROP_EXPANDER_COLUMN can be NULL, so don't do a object case check
        for those
2001-10-21 01:18:42 +00:00
Owen Taylor
58b5405bd2 at Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
        in favor of g_signal_*, gtk_object_* in favor of
        g_object_*.
2001-10-20 23:39:32 +00:00
Manish Singh
3690112009 since GtkIMContext derives directly from GObject now, we have to use the
Fri Oct 19 18:35:22 2001  Manish Singh  <yosh@gimp.org>

        * gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
        from GObject now, we have to use the g_object_* functions, not
        gtk_object_*.
2001-10-20 01:39:17 +00:00
Kristian Rietveld
24f99d6447 we probably have rows_reordered nailed down now (this code is not yet
Fri Oct 19 22:46:54 2001  Kristian Rietveld  <kristian@planet.nl>

        * gtk/gtktreemodelsort.[ch]: we probably have rows_reordered
        nailed down now (this code is not yet ready for general consumption)
2001-10-19 20:53:08 +00:00
Manish Singh
a52d7cd409 correct docs for use_align
Fri Oct 19 13:44:51 2001  Manish Singh  <yosh@gimp.org>

        * gtk/gtktreeview.c (gtk_treeview_scroll_to_cell): correct docs
        for use_align
2001-10-19 20:46:43 +00:00
Owen Taylor
e9f4d40258 Missed ChangeLog commit. 2001-10-19 19:47:37 +00:00
Owen Taylor
effa390541 Make GtkIMContext derive from GObject, not GtkObject. (#62621)
Fri Oct 19 15:08:30 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
	modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
	imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
	GObject, not GtkObject. (#62621)
2001-10-19 19:28:27 +00:00
Owen Taylor
b11cee8b3a Remove now useless include of unistd.h, fix wrong argument
Fri Oct 19 12:49:12 2001  Owen Taylor  <otaylor@redhat.com>

        * tests/testsocket.c: Remove now useless include of unistd.h,
        fix wrong argument gtk_socket_steal. (Hans Breuer, #58541)
2001-10-19 17:03:14 +00:00
Owen Taylor
061fec5841 Fix up for change to Pango font API. #61933. (Untested, even for
Fri Oct 19 12:24:32 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/linux-fb/gdkfont-fb.c: Fix up for change to
	Pango font API. #61933. (Untested, even for compilation.)
2001-10-19 16:26:09 +00:00
Owen Taylor
1da46404b7 Actually export gtk_disable_setlocale(). (Caught by Sven Neumann)
Fri Oct 19 11:24:58 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.[ch] (gtk_disable_setlocale): Actually
	export gtk_disable_setlocale(). (Caught by Sven Neumann)
2001-10-19 15:27:43 +00:00
Havoc Pennington
6537d7eba7 fix compilation
2001-10-18  Havoc Pennington  <hp@redhat.com>

	* gdk/x11/gdkpixmap-x11.c (gdk_pixmap_lookup): fix compilation
2001-10-18 23:38:52 +00:00
Havoc Pennington
6e4f93735f Change button signals to GTK_RUN_LAST, #50239
2001-10-18  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkbutton.c (gtk_button_class_init): Change button signals
	to GTK_RUN_LAST, #50239
2001-10-18 23:23:34 +00:00
Hidetoshi Tajima
beb13fa4cc Support "*" for all locales with least priority when to select default im
* gtk/gtkimmodule.c (match_locale):
	Support "*" for all locales with least priority
	when to select default im module, #58201
2001-10-18 22:35:15 +00:00
Matthias Clasen
c9b4981ba4 Fix docs. (#61976)
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode):
        Fix docs. (#61976)

        * gtk/gtkplug.c (gtk_plug_get_id) : Fix docs. (#62144)

        * gtk/gtkliststore.c: Fix docs. (#61672, #61675)
2001-10-18 22:05:23 +00:00
Matthias Clasen
73e845eeab Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup and
* gdk/gdkwindow.h, gdk/gdkpixmap.h, gdk/x11/gdkx.h,
        gdk/x11/gdkwindow-x11.c, gdk/x11/gdkpixmap-x11.c,
        gdk/win32/gdkwin32.h, gdk/win32/gdkwindow-win32.c,
        gdk/win32/gdkpixmap-win32.c, gdk/linux-fb/gdkfb.h,
        gdk/linux-fb/gdkwindow-fb.c, gdk/linux-fb/gdkpixmap-fb.c:
        Add gdk_window_lookup, gdk_window_foreign_new, gdk_pixmap_lookup
        and gkd_pixmap_foreign_new to the gdk frontend api. (#62063)

        * gtk/gtkselection.c: Remove gdk backend dependencies. (#62063)
2001-10-18 20:23:17 +00:00