Remove all references to offscreen flag which was no longer used.

Thu Jun  1 23:05:13 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c: Remove all references to
	offscreen flag which was no longer used.

	* gtk/gtkprivate.h (enum): Remove unused flags and compress.

	* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
	for non-null label_widget->parent.

	* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
	which no longer was used.

	* gdk/gdkpango.c (gdk_pango_context_get_info): make static.

	* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
	for null arguments.

	* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
	check for destroyed windows.

Thu Jun  1 13:48:45 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkimmulticontext.c: Add a finalize method and unref
	the slave context there.

	* gtk/gtkinvisible.[ch]: Make reference counting behavior
	identical to GtkWindow.

Thu Jun  1 01:54:11 2000  Owen Taylor  <otaylor@redhat.com>

	* Makefile.am gdk/gdkpango.c: Copy the layout render function from
	pangox to here, so we can write them independent of rendering
	system, using GDK primitives.

	* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
	gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
	since we have a rendering-system independent implementation in
	terms of draw_glyphs().

	* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
	function to render a single line.

	* gdk/x11/gdkpango.c: Move the guts of this file mostly
	into ../gdkpango.c, which simplifies things, since we
	don't have to deal with raw X gc's.

Fri May 19 04:28:16 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
	get the logical attributes for a given GtkTextLine.

Tue May 30 16:05:39 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
	g_locale_get_codeset() to g_get_codeset() change.

Tue May 30 15:03:19 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/testcalendar.c (calendar_font_selection_ok): Use font
	descriptions.

	* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
	the entry.

	* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
	redoing (vastly simplifying) for Pango. Still needs quite
	a bit of work. (Size selection is currently poor. List of
	predefined sizes is not a good idea, since all of these
	sizes won't necessarily be distinct.)

Tue May 30 13:50:19 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
	CODESET results for LANG=C.

Mon May 29 15:49:10 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
	which takes a stringized pango font description;
	ignore the older 'font' and 'fontset' declarations.

	* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
	field with a GdkFont derived via gdk_font_from_description(),
	for compatibility. (Should we just remove it entirely?
	Probably too much compatibility breakage, but people
	should be migrating to the new Pango stuff as quickly
	as possible.)

Mon May 29 15:47:41 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.

Mon May 29 15:44:46 2000  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkcalender.c: Roughly pango-ized. Really needs
	redoing; there are some bugs in size allocation right
	now, the semi-existant distinction between header / day
	fonts was removed, but, with Pango, could actually
	be made functional in a nice way.

	* gtk/testcalender: Move calender from examples into this
	directory as a test program. (We really need to restrcture
	testgtk into a whole directory full of tests for every
	widget or functionality group, separated into multiple .c
	files.)

Mon May 29 15:19:56 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/testgtk.c (file_exists): Fix stupid typo that
	was keeping RC file from being loaded.

	* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
	RC file font code.

Mon May 29 14:31:27 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
	Add function to load a GdkFont from a PangoFontDescription.

Fri May 26 17:16:40 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
	to have any widget for the label, use a GtkLabel widget
	to display the text. (Based partially on a patch from
	Anders Carlson.)

	(Quite a bit of code reorganization - strip 90% of the
	guts out of gtkaspectframe and add a single virtual
	func to GtkFrameClass - compute_child_allocation.)

Fri May 26 12:00:02 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
	(Removed clist->row_center_offset field because caching
	it wasn't saving time or code, added private function
	_gtk_clist_create_cell_layout()).

Wed May 24 15:59:37 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkaccellabel.c: Pangoized.

	* gtk/[hv]ruler.c: Pangoized

Mon May 22 19:23:59 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (gtk_file_selection_init):
	Use gtk_clist_set_column_auto_resize() to remove need
	need for manual column width computations.

Mon May 22 18:50:26 2000  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
	ensuring Pango correctness, and considerably simplifying the
	code.

	* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.

	* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
	getting of numbers of lines.

	* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
	to the actual requested width of the lable, not to the wrap
	width we set.

	* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.

	* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
	  gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.

	* gtk/gtktextview.c: Fix structure inheritance.

	* gtk/gtkprogressbar.c: Pangoize.

Mon May 22 15:47:30 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
	in a function.

	* gtk/gtktextlayout.c (find_display_line_above): Fixed
	bug with computing line tops.

	* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.

Thu May 18 18:53:31 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
	and y_offset coordinates to do what we need now. (The offset between
	buffer and layout coordinates has been reintroduced, but is a
	bit different than before.)

	* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
	handle the adjustments ourselves, and scroll as necessary using
	the new gdk_window_scroll().

	The advantage of this is that when we are incrementally revalidating,
	we are essentially rearranging things around the visible portion
	of the screen. With the old setup, the visible portion of the
	screen was moved around in the layout, so scrolling and redrawing
	to track that caused jumping of the display. Since we now
	control the scrolling ourselves, we can suppress this and
	only redraw when things actually change.

Thu May 18 18:47:25 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
	the region not just redisplay it after-all, since we store the
	cursors in the LineDisplay. (Ugly interactions here between
	GtkLayout and GtkTextBTree here.)

	* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.

Thu May 18 18:43:21 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
	Added function to scroll contents of a window while keeping the
	window constant. Works by XCopyArea or guffaw-scrolling depending
	on the details of how the window is set up. (guffaw-scrolling
	still needs to be filled in.)

Wed May 17 22:36:53 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
	move the debugging that was tied to a global variable
	to that.

	* gtk/gtkmarshal.list: Add NONE:INT,INT,INT

	* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
	validated flag, in line data instead of setting height/width to
	-1. This allows us to perform operations with partially invalid
	buffer (using the old size for invalid lines) and thus to do
	incremental vaidation. Keep height/width aggregates up to date
	when deleting text and rebalancing the tree.

	* gtk/gtktextbtree.[ch]: Add functions validate a line
	(gtk_text_btree_validate_line), and to validate up
	to a number of pixels (gtk_text_btree_validate).

	* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
	that indicates that something is changed and a revalidation
	pass is needed. Change ::need_repaint to ::changed, and
	make it take old and new yranges instead of a rectangle.

	* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
	the line_data_destroy() function from
	gtk_text_btree_add_view() to a virtual function in
	GtkTextLayout

	* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
	since we are handling partial repaints in a different fashion
	now.

	* gtk/gtktextbtree.[ch]: Only repaint the changed portion
	of the selection instead of queueing a repaint on the
	entire widget.

	* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
	get_selection_bounds() down to btree, make the function
	in buffer a wrapper around the btree function.

	* gtk/gtktextlayout.[ch]: Add functions to check if the
	layout is valid and to recompute either a range of pixels
	aroudn a line or a certain total number of pixels.

	* gtk/gtktextlayout.[ch]: Cache a single line display;
	now that we only redraw the needed portions, the hit rate
	for this cache is quite high.

	* gtk/gtktextview.[ch]: Keep track of the first paragraph
	on the screen so that when re-laying-out the buffer, we can
	keep the same place. This requires connecting to ::value_changed
	on the adjustments

	* gtk/gtktextview.[ch]: Add idle functions to revalidate
	the buffer after we receive an ::invalidated signal.

Wed May 17 22:10:47 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
	to max of allocation and layout size, not just to the
	layout size.

	* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
	Invalidate window so it gets redrawn properly.

	* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
	to mean the entire window.

	* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
	into public header.

Mon May 15 14:51:31 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
	to get the name of a mark.

	* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
	to find the paragraph from a y position.

Thu May 11 12:57:20 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
	nodes have width/height >= 0, not > 0.

Tue May  9 21:29:06 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
	Add a size_only flag, so when we only need the size, we don't create
	useless appearance attributes.

	* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
	duplicate setting of font description.

	* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000

Wed Apr 26 01:53:23 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
	EXTRA_DIST. It does not work well when the file that
	everything depends on is not in the tarball.

Wed Apr 26 00:56:14 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/testgtk.c: Some hacks and fixes so that it basically
	works when not sitting in the GTK+ build tree.

2000-05-03  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
	Properly determine the ordering of the tag root and the current
	line within the tree. Previous algorithm only worked if the tag
	root's immediate parent was the common root of both the current
	line and the tag root.

Wed Apr 26 00:43:00 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
	alignment.

	* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
	the widget text directional dynamically.

	* gtk/gtktextview.[ch]: Added functions to get and set default
	wrap mode.

Tue Apr 25 23:47:38 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
	in cursor location computation.

Tue Apr 25 23:22:59 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
	vadjusment values properly when layout gets smaller.

	* gtk/gtktextview.c (need_repaint_handler): Areas being
	passed in are far completely inaccurate, and sometimes
	too small, so, for now, just queue a redraw on the
	whole visible region.

2000-04-25  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktextbtree.c (summary_destroy): new function to
	destroy tag summary nodes
	(gtk_text_line_next_could_contain_tag): this function was
	totally broken if the line passed in wasn't below the tag
	root. Fix it.
	(gtk_text_btree_first_could_contain_tag): In the tag == NULL
	"wildcard" case, we have to do a linear scan. Blah.
	(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
	we have to do the linear scan
	(tag_removed_cb): When a tag is removed from the tag table,
	remove the GtkTextTagInfo node from the btree.
	(gtk_text_btree_spew): Implement the spew function, for
	our debugging pleasure.

Tue Apr 25 19:40:18 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
	a problem with referring to the wrong buffer.

	* gtk/gtkentry.c: Fix focus-in/focus-out confusion.

	* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
	font description to gtk_style_new() - otherwise things
	don't work without a .gtkrc file.

	* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
	tags table if we create it ourself, too.

	* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
	it was conflicting with XKB modifiers.

	* gtk/gtktextview.[ch]: Add simple support for
	GtkIMContext.

Mon Apr 24 19:34:18 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
	with deletion from last commit.

Mon Apr 24 19:29:40 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
	in the context from the current locale.

	* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
	context, not hardcoded value.

	* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
	not logical.

Sun Apr 23 23:39:18 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
	attributes - that doesn't handle partial-glyph selection
	properly. Instead use new pango_layout_line_get_x_ranges()
	functionality to draw the selection.

	* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
	now properly handles out-of-range coordinates.

	* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.

	* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
	public.

	* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
	for paragraphs opposite to the base direction of the widget.

	* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.

	* gtk/gtktextlayout.c: Don't split segments on marks, since that
	causes Arabic words to reshape as you cursor through.

	* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
	cursor position when moving vertically with the arrow keys and
	scrolling with page-up/page-down. (Arrow keys save only the X,
	scrolling saves both X and Y.)

	This means you can line-up / line-down or page-up / page-down
	without losing your place, and also that moving vertically
	with the cursor keys keeps the same X position, not the same
	character count:

	* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
	arrow keys move by display lines, not paragraphs.

Tue Apr 18 14:16:50 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklayout.c: Make sure that the bin window is at least
	as big as the allocation. (Should we also make sure that the
	bin window is big enough to completely cover widget->window?)

	* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
	function to get the onscreen rectangle.

	* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
	for offsets in window coordinates.

Sun Apr 16 16:13:27 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
	confusion.

	* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
	from the widget direction.

	* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
	Add a "direction" attribute.

	* gtk/gtktextview.c: global s/tkxt/text_view/.

	* gtk/testtext.c: Added long block of text in Arabic, to test out
	the direction attributes. (Some problems with the shaping system
	for arabic become obvious - like the fact the cursor splits words
	into unjoined pieces.)

Fri Apr 14 12:54:34 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.

	* gtk/gtktextlayout.c: Fix up alignment.

	* gtk/testtext.c: Add some tests for centering, wrapping.

Fri Apr 14 09:26:22 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
	Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
	If we wrote GTK+-specific layout-render function this could just replace
	the draw_layout() operation in the vtable.

	* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
	pango_layout_get_cursor_pos() and use that function.

	* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
	is a non-static symbol.

	* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
	with gtk_text_btree_find_line_by_y()

	* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
	renderer that handles GtkTextAppearance attributes.

	* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:

	  - Move the values in the style that don't affect geometry into a
	    GtkTextAppearance structure.
	  - Change underline to take a PangoUnderline and "font" a string
	    representation of a font description
	  - Add a "font_desc" attribute which takes a FontDescription structure.

	* gtk/gtktextlayout.[ch]:

	  - Get rid of the display-line list per each line. Instead, we
	    generate, on demand, a GtkTextLineDisplay structure which]
	    contains a PangoLayout * and other necesary information
	    (offsets, cursor locations) for displaying a paragraph.
	  - Get rid of the code to wrap lines, create display chunks,
	    etc. Instead, we just go through a paragraph and convert
	    it into the necessary inputs to a PangoLayout.
	  - Implement a new attribute type, GtkTextAttrAppearance. This
	    holds a GtkTextAppearance, and is used to pass colors,
	    stipple, etc, through from the layout to the display without
	    having to use lots and lots of individual attributes.
	  - Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
	    in terms of PangoLayout functions.

	* gtk/gtktextview.c:

	  - Handle passing the necessary PangoContext to the layout
	  - Some fixups in painting to deal with the automatic backing store
	    and offsetting of GTK+-1.4
	  - Add a style_set handler so that the default style reacts
	    properly to theme changes.

	* gtk/gtktext?*.[ch]: Random code-style fixes.

	* gtk/testtext.c: Substitute in languages that Pango handles now for Thai

Mon Apr 10 10:33:45 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
	in original form preparatory to Pango-ization and gdkimcontext-ization.

Thu Apr  6 19:25:39 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
	so that we can derive from gtkimcontext in language bindings properly.

Thu Apr  6 16:02:52 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
	Add a compose table including (almost) all the compose combinations
	from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
	data in the XIM implementation.

	* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
	Moved functions to convert keyvalues from and to unicode here from
	the win32 port and made them public.

Wed Apr  5 16:37:29 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.

Wed Apr  5 16:27:45 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkimcontext.[ch]: Base class for new input context system

	* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
	the real input context implementation to be loaded from modules
	and switched on the fly.

	* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
	context that just does direct keysymbol => unicode translation.

	* gtk/gtkentry.[ch]: Start switching editing over to using
	GtkInputContext. (No handling of preedit yet.)

Wed Apr  5 15:48:41 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
	many substitutions. (klass should not be subsituted.)

Wed Apr  5 00:18:14 2000  Owen Taylor  <otaylor@redhat.com>

	* configure.in: Add checks for Pango

	* configure.in docs/Makefile.am: Add test for sgml2html
	and allow 'make dist' without building html, but print out
	warnings in that case. (For making snapshots)

	* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
	Add Pango libraries and C flags

	* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
	Add function (gdk_draw_layout) to draw a pango layout.

	* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
	for getting Pango contexts for GDK.

	* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()

	* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
	editing.

	* gtk/gtkentry.c: Hack in simple Hebrew input with direct
	keysym => unicode translations. More languages can be added
	here, but real input-method support is needed.

	* docs/Changes-1.4.txt: Added note about entry behavior.

	* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
	to set the reading direction for a widget and the global direction.
	Add test which allows toggling the global direction. Two private
	flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)

	* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
	  gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c

	* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango

	* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
	underlining now handled by Pango.

	* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
	to RCStyle and Style. (Having both this and the old font name and GdkFont
	is temporary.)

	* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
	convenience functions for creating contexts and layouts for widgets.

	* gtk/testgtk.c: Enhance label tests with multilingual labels.
This commit is contained in:
Havoc Pennington 2000-06-02 03:14:07 +00:00 committed by Owen Taylor
parent 3f0092c4e6
commit 9ae724bf4d
125 changed files with 38601 additions and 9392 deletions

636
ChangeLog
View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -1,3 +1,639 @@
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-05-29 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkclist.c (gtk_clist_column_titles_active): let you set the

View File

@ -7,8 +7,8 @@ you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.2.7.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.7 # change to the toplevel directory
% gzip -cd gtk+-1.3.0.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.3.0 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
@ -118,7 +118,7 @@ You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-1.2.7
./configure --with-glib=../glib-1.3.0
This, however, will not work if you built GLIB with different
source and build directories.
@ -169,7 +169,7 @@ C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 and 2.1, in which
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)

8
README
View File

@ -1,7 +1,7 @@
General Information
===================
This is GTK+ version 1.2.7. GTK+, which stands for the Gimp ToolKit,
This is GTK+ version 1.3.0. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
@ -37,9 +37,9 @@ version number. This should be separated by a blank
line from the actual headers.
Package: gtk+
Version: 1.2.7
Version: 1.3.0
[ Please substitute 1.2.7 with the version of GTK+ that
[ Please substitute 1.3.0 with the version of GTK+ that
you have installed ]
Then describe the bug. Include:
@ -82,7 +82,7 @@ From: yourname@your.address.org
Subject: handlebox test in testgtk is misnamed.
Package: gtk+
Version: 1.2.7
Version: 1.3.0
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in

View File

@ -311,6 +311,7 @@ AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
# Find the X11 include and library directories
AC_PATH_X
AC_PATH_XTRA
@ -397,6 +398,24 @@ fi
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS"
#
# Check for Pango
#
AC_PATH_PROG(PANGO_CONFIG, pango-config, no)
if test x$PANGO_CONFIG = xno ; then
AC_MSG_ERROR([*** pango-config not found])
fi
PANGO_CFLAGS="`pango-config --cflags pangox`"
CFLAGS="$CFLAGS $PANGO_CFLAGS"
PANGO_LIBS="`pango-config --libs pangox`"
AC_SUBST(PANGO_LIBS)
AC_SUBST(PANGO_CFLAGS)
AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
*** Pango not found. Pango is required to build
*** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS $x_ldflags $x_libs)
# set up things for XInput
if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
@ -620,6 +639,9 @@ fi
])
AC_PATH_PROG(SGML2HTML, sgml2html, no)
AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
AC_OUTPUT([
gtk+.spec
docs/gtk-config.1

View File

@ -106,3 +106,16 @@ Incompatible Changes from GTK+-1.2 to GTK+-1.4:
have to be moved into the ::destroy implementations. The reason for doing
this is that all object reference cycles should be broken at destruction
time.
- Inserting and deleting text in GtkEntry though functions such
as gtk_entry_insert_text() now leave the cursor at its original
position in the text instead of moving it to the location of
the insertion/deletion.
- The ->label field of GtkFrame widgets has been removed. (As part of
a change to allow the arbitrary widgets in the title position.) The
text can now be retrieved with the new function gtk_frame_get_text().
- The 'font' and 'font_set' declarations in RC files are now ignored. There
is a new 'font_name' field that holds the string form of a Pango font

View File

@ -187,15 +187,19 @@ EXTRA_DIST += \
gtk_tut_fr.sgml \
gtk_tut_packbox1.gif \
gtk_tut_packbox2.gif \
html/gtk_tut_table.gif \
html/gtk_tut_packbox1.gif \
html/gtk_tut_packbox2.gif \
gtk_tut_table.gif \
html/gdk.html \
html/gdk_toc.html \
html/gtk.html \
html/gtk_toc.html \
$(TUTORIAL_FILES) \
$(TUTORIAL_FR_FILES) \
$(TUTORIAL_IT_FILES) \
$(FAQ_FILES)
gtk_tut_table.gif
if HAVE_SGML2HTML
dist-hook: faq tutorial tutorial_it tutorial_fr
mkdir $(distdir)/html
cp -p $(srcdir)/html/*.html $(distdir)/html
cp -p $(srcdir)/html/*.gif $(distdir)/html
mkdir $(distdir)/text
cp -p $(srcdir)/text/*.txt $(distdir)/text
else
dist-hook:
echo "***"
echo "*** Warning: Tutorial and faq not built"
echo "*** DISTRIBUTION IS INCOMPLETE"
echo "***"
endif

View File

@ -15,6 +15,7 @@ INCLUDES = @STRIP_BEGIN@ \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@PANGO_CFLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@ \
@STRIP_END@
@ -30,6 +31,7 @@ libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
-export-dynamic \
@PANGO_LIBS@ \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
@ -64,6 +66,7 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
gdkim.h \
gdkimage.h \
gdkinput.h \
gdkpango.h \
gdkpixmap.h \
gdkprivate.h \
gdkproperty.h \
@ -83,8 +86,10 @@ gdk_c_sources = @STRIP_BEGIN@ \
gdkfont.c \
gdkgc.c \
gdkglobals.c \
gdkkeyuni.c \
gdkimage.c \
gdkinternals.h \
gdkpango.c \
gdkrgb.c \
gdkrectangle.c \
gdkwindow.c \

View File

@ -38,6 +38,7 @@
#include <gdk/gdkim.h>
#include <gdk/gdkimage.h>
#include <gdk/gdkinput.h>
#include <gdk/gdkpango.h>
#include <gdk/gdkpixmap.h>
#include <gdk/gdkproperty.h>
#include <gdk/gdkregion.h>
@ -144,6 +145,8 @@ guint gdk_keyval_to_lower (guint keyval);
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
guint32 gdk_keyval_to_unicode (guint keyval);
guint gdk_unicode_to_keyval (guint32 wc);
/* Threading
*/

View File

@ -445,3 +445,21 @@ gdk_draw_lines (GdkDrawable *drawable,
((GdkDrawablePrivate *)drawable)->klass->draw_lines (drawable, gc, points, npoints);
}
void
gdk_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
((GdkDrawablePrivate *)drawable)->klass->draw_glyphs (drawable, gc, font, x, y, glyphs);
}

View File

@ -108,6 +108,12 @@ struct _GdkDrawableClass
GdkGC *gc,
GdkPoint *points,
gint npoints);
void (*draw_glyphs) (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs);
};
/* Manipulation of drawables
@ -136,88 +142,105 @@ void gdk_drawable_unref (GdkDrawable *drawable);
/* Drawing
*/
void gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y);
void gdk_draw_line (GdkDrawable *drawable,
GdkGC *gc,
gint x1,
gint y1,
gint x2,
gint y2);
void gdk_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
void gdk_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
void gdk_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
void gdk_draw_string (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *string);
void gdk_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
void gdk_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
void gdk_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void gdk_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
void gdk_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y);
void gdk_draw_line (GdkDrawable *drawable,
GdkGC *gc,
gint x1,
gint y1,
gint x2,
gint y2);
void gdk_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
void gdk_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
void gdk_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
void gdk_draw_string (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *string);
void gdk_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
void gdk_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
void gdk_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void gdk_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
void gdk_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void gdk_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs);
void gdk_draw_layout_line (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y,
PangoLayoutLine *line);
void gdk_draw_layout (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y,
PangoLayout *layout);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -9,7 +9,9 @@
extern "C" {
#endif /* __cplusplus */
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20)
typedef struct _GdkEventAny GdkEventAny;
typedef struct _GdkEventExpose GdkEventExpose;

View File

@ -2,6 +2,7 @@
#define __GDK_FONT_H__
#include <gdk/gdktypes.h>
#include <pango/pango-font.h>
#ifdef __cplusplus
extern "C" {
@ -33,6 +34,11 @@ void gdk_font_list_free (gchar **font_list);
#endif
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (const gchar *fontset_name);
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (const gchar *fontset_name);
GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
GdkFont* gdk_font_ref (GdkFont *font);
void gdk_font_unref (GdkFont *font);
gint gdk_font_id (const GdkFont *font);

View File

@ -751,6 +751,7 @@
#define GDK_Serbian_nje 0x6aa
#define GDK_Serbian_tshe 0x6ab
#define GDK_Macedonia_kje 0x6ac
#define GDK_Ukrainian_ghe_with_upturn 0x6ad
#define GDK_Byelorussian_shortu 0x6ae
#define GDK_Cyrillic_dzhe 0x6af
#define GDK_Serbian_dze 0x6af
@ -773,6 +774,7 @@
#define GDK_Serbian_NJE 0x6ba
#define GDK_Serbian_TSHE 0x6bb
#define GDK_Macedonia_KJE 0x6bc
#define GDK_Ukrainian_GHE_WITH_UPTURN 0x6bd
#define GDK_Byelorussian_SHORTU 0x6be
#define GDK_Cyrillic_DZHE 0x6bf
#define GDK_Serbian_DZE 0x6bf
@ -1320,6 +1322,147 @@
#define GDK_Hangul_J_KkogjiDalrinIeung 0xef9
#define GDK_Hangul_J_YeorinHieuh 0xefa
#define GDK_Korean_Won 0xeff
#define GDK_Armenian_eternity 0x14a1
#define GDK_Armenian_section_sign 0x14a2
#define GDK_Armenian_full_stop 0x14a3
#define GDK_Armenian_verjaket 0x14a3
#define GDK_Armenian_parenright 0x14a4
#define GDK_Armenian_parenleft 0x14a5
#define GDK_Armenian_guillemotright 0x14a6
#define GDK_Armenian_guillemotleft 0x14a7
#define GDK_Armenian_em_dash 0x14a8
#define GDK_Armenian_dot 0x14a9
#define GDK_Armenian_mijaket 0x14a9
#define GDK_Armenian_separation_mark 0x14aa
#define GDK_Armenian_but 0x14aa
#define GDK_Armenian_comma 0x14ab
#define GDK_Armenian_en_dash 0x14ac
#define GDK_Armenian_hyphen 0x14ad
#define GDK_Armenian_yentamna 0x14ad
#define GDK_Armenian_ellipsis 0x14ae
#define GDK_Armenian_exclam 0x14af
#define GDK_Armenian_amanak 0x14af
#define GDK_Armenian_accent 0x14b0
#define GDK_Armenian_shesht 0x14b0
#define GDK_Armenian_question 0x14b1
#define GDK_Armenian_paruyk 0x14b1
#define GDK_Armenian_AYB 0x14b2
#define GDK_Armenian_ayb 0x14b3
#define GDK_Armenian_BEN 0x14b4
#define GDK_Armenian_ben 0x14b5
#define GDK_Armenian_GIM 0x14b6
#define GDK_Armenian_gim 0x14b7
#define GDK_Armenian_DA 0x14b8
#define GDK_Armenian_da 0x14b9
#define GDK_Armenian_YECH 0x14ba
#define GDK_Armenian_yech 0x14bb
#define GDK_Armenian_ZA 0x14bc
#define GDK_Armenian_za 0x14bd
#define GDK_Armenian_E 0x14be
#define GDK_Armenian_e 0x14bf
#define GDK_Armenian_AT 0x14c0
#define GDK_Armenian_at 0x14c1
#define GDK_Armenian_TO 0x14c2
#define GDK_Armenian_to 0x14c3
#define GDK_Armenian_ZHE 0x14c4
#define GDK_Armenian_zhe 0x14c5
#define GDK_Armenian_INI 0x14c6
#define GDK_Armenian_ini 0x14c7
#define GDK_Armenian_LYUN 0x14c8
#define GDK_Armenian_lyun 0x14c9
#define GDK_Armenian_KHE 0x14ca
#define GDK_Armenian_khe 0x14cb
#define GDK_Armenian_TSA 0x14cc
#define GDK_Armenian_tsa 0x14cd
#define GDK_Armenian_KEN 0x14ce
#define GDK_Armenian_ken 0x14cf
#define GDK_Armenian_HO 0x14d0
#define GDK_Armenian_ho 0x14d1
#define GDK_Armenian_DZA 0x14d2
#define GDK_Armenian_dza 0x14d3
#define GDK_Armenian_GHAT 0x14d4
#define GDK_Armenian_ghat 0x14d5
#define GDK_Armenian_TCHE 0x14d6
#define GDK_Armenian_tche 0x14d7
#define GDK_Armenian_MEN 0x14d8
#define GDK_Armenian_men 0x14d9
#define GDK_Armenian_HI 0x14da
#define GDK_Armenian_hi 0x14db
#define GDK_Armenian_NU 0x14dc
#define GDK_Armenian_nu 0x14dd
#define GDK_Armenian_SHA 0x14de
#define GDK_Armenian_sha 0x14df
#define GDK_Armenian_VO 0x14e0
#define GDK_Armenian_vo 0x14e1
#define GDK_Armenian_CHA 0x14e2
#define GDK_Armenian_cha 0x14e3
#define GDK_Armenian_PE 0x14e4
#define GDK_Armenian_pe 0x14e5
#define GDK_Armenian_JE 0x14e6
#define GDK_Armenian_je 0x14e7
#define GDK_Armenian_RA 0x14e8
#define GDK_Armenian_ra 0x14e9
#define GDK_Armenian_SE 0x14ea
#define GDK_Armenian_se 0x14eb
#define GDK_Armenian_VEV 0x14ec
#define GDK_Armenian_vev 0x14ed
#define GDK_Armenian_TYUN 0x14ee
#define GDK_Armenian_tyun 0x14ef
#define GDK_Armenian_RE 0x14f0
#define GDK_Armenian_re 0x14f1
#define GDK_Armenian_TSO 0x14f2
#define GDK_Armenian_tso 0x14f3
#define GDK_Armenian_VYUN 0x14f4
#define GDK_Armenian_vyun 0x14f5
#define GDK_Armenian_PYUR 0x14f6
#define GDK_Armenian_pyur 0x14f7
#define GDK_Armenian_KE 0x14f8
#define GDK_Armenian_ke 0x14f9
#define GDK_Armenian_O 0x14fa
#define GDK_Armenian_o 0x14fb
#define GDK_Armenian_FE 0x14fc
#define GDK_Armenian_fe 0x14fd
#define GDK_Armenian_apostrophe 0x14fe
#define GDK_Armenian_ligature_ew 0x14ff
#define GDK_Georgian_an 0x15d0
#define GDK_Georgian_ban 0x15d1
#define GDK_Georgian_gan 0x15d2
#define GDK_Georgian_don 0x15d3
#define GDK_Georgian_en 0x15d4
#define GDK_Georgian_vin 0x15d5
#define GDK_Georgian_zen 0x15d6
#define GDK_Georgian_tan 0x15d7
#define GDK_Georgian_in 0x15d8
#define GDK_Georgian_kan 0x15d9
#define GDK_Georgian_las 0x15da
#define GDK_Georgian_man 0x15db
#define GDK_Georgian_nar 0x15dc
#define GDK_Georgian_on 0x15dd
#define GDK_Georgian_par 0x15de
#define GDK_Georgian_zhar 0x15df
#define GDK_Georgian_rae 0x15e0
#define GDK_Georgian_san 0x15e1
#define GDK_Georgian_tar 0x15e2
#define GDK_Georgian_un 0x15e3
#define GDK_Georgian_phar 0x15e4
#define GDK_Georgian_khar 0x15e5
#define GDK_Georgian_ghan 0x15e6
#define GDK_Georgian_qar 0x15e7
#define GDK_Georgian_shin 0x15e8
#define GDK_Georgian_chin 0x15e9
#define GDK_Georgian_can 0x15ea
#define GDK_Georgian_jil 0x15eb
#define GDK_Georgian_cil 0x15ec
#define GDK_Georgian_char 0x15ed
#define GDK_Georgian_xan 0x15ee
#define GDK_Georgian_jhan 0x15ef
#define GDK_Georgian_hae 0x15f0
#define GDK_Georgian_he 0x15f1
#define GDK_Georgian_hie 0x15f2
#define GDK_Georgian_we 0x15f3
#define GDK_Georgian_har 0x15f4
#define GDK_Georgian_hoe 0x15f5
#define GDK_Georgian_fi 0x15f6
#define GDK_EcuSign 0x20a0
#define GDK_ColonSign 0x20a1
#define GDK_CruzeiroSign 0x20a2

1641
gdk/gdkkeyuni.c Normal file

File diff suppressed because it is too large Load Diff

374
gdk/gdkpango.c Normal file
View File

@ -0,0 +1,374 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2000 Red Hat, 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.
*/
#include "gdkcolor.h"
#include "gdkgc.h"
#include "gdkpango.h"
#include "gdkprivate.h"
#define GDK_INFO_KEY "gdk-info"
typedef struct _GdkPangoContextInfo GdkPangoContextInfo;
struct _GdkPangoContextInfo
{
GdkColormap *colormap;
};
static void gdk_pango_get_item_properties (PangoItem *item,
PangoUnderline *uline,
PangoAttrColor *fg_color,
gboolean *fg_set,
PangoAttrColor *bg_color,
gboolean *bg_set);
static void
gdk_pango_context_destroy (GdkPangoContextInfo *info)
{
gdk_colormap_unref (info->colormap);
g_free (info);
}
static GdkPangoContextInfo *
gdk_pango_context_get_info (PangoContext *context, gboolean create)
{
GdkPangoContextInfo *info = pango_context_get_data (context, GDK_INFO_KEY);
if (!info && create)
{
info = g_new (GdkPangoContextInfo, 1);
info->colormap = NULL;
pango_context_set_data (context, GDK_INFO_KEY,
info, (GDestroyNotify)gdk_pango_context_destroy);
}
return info;
}
static GdkGC *
gdk_pango_get_gc (PangoContext *context,
PangoAttrColor *fg_color,
GdkGC *base_gc)
{
GdkPangoContextInfo *info;
GdkColormap *colormap;
GdkColor color;
g_return_val_if_fail (context != NULL, NULL);
info = gdk_pango_context_get_info (context, FALSE);
if (info && info->colormap)
colormap = info->colormap;
else
colormap = gdk_colormap_get_system();
/* FIXME. FIXME. FIXME. Only works for true color */
color.red = fg_color->red;
color.green = fg_color->green;
color.blue = fg_color->blue;
if (gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE))
{
GdkGC *result = gdk_gc_new (gdk_parent_root);
gdk_gc_copy (result, base_gc);
gdk_gc_set_foreground (result, &color);
return result;
}
else
return gdk_gc_ref (base_gc);
}
static void
gdk_pango_free_gc (PangoContext *context,
GdkGC *gc)
{
gdk_gc_unref (gc);
}
void
gdk_pango_context_set_colormap (PangoContext *context,
GdkColormap *colormap)
{
GdkPangoContextInfo *info;
g_return_if_fail (context != NULL);
info = gdk_pango_context_get_info (context, TRUE);
g_return_if_fail (info != NULL);
if (info->colormap != colormap)
{
if (info->colormap)
gdk_colormap_unref (info->colormap);
info->colormap = colormap;
if (info->colormap)
gdk_colormap_ref (info->colormap);
}
}
/**
* gdk_draw_layout_line:
* @drawable: the drawable on which to draw the line
* @gc: base graphics to use
* @x: the x position of start of string (in pixels)
* @y: the y position of baseline (in pixels)
* @line: a #PangoLayoutLine
*
* Render a #PangoLayoutLine onto an GDK drawable
*/
void
gdk_draw_layout_line (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y,
PangoLayoutLine *line)
{
GSList *tmp_list = line->runs;
PangoRectangle overall_rect;
PangoRectangle logical_rect;
PangoRectangle ink_rect;
PangoContext *context;
gint x_off = 0;
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
g_return_if_fail (line != NULL);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
context = pango_layout_get_context (line->layout);
pango_layout_line_get_extents (line,NULL, &overall_rect);
while (tmp_list)
{
PangoUnderline uline = PANGO_UNDERLINE_NONE;
PangoLayoutRun *run = tmp_list->data;
PangoAttrColor fg_color, bg_color;
gboolean fg_set, bg_set;
GdkGC *fg_gc;
tmp_list = tmp_list->next;
gdk_pango_get_item_properties (run->item, &uline, &fg_color, &fg_set, &bg_color, &bg_set);
if (fg_set)
fg_gc = gdk_pango_get_gc (context, &fg_color, gc);
else
fg_gc = gc;
if (uline == PANGO_UNDERLINE_NONE)
pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
NULL, &logical_rect);
else
pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
&ink_rect, &logical_rect);
if (bg_set)
{
GdkGC *bg_gc = gdk_pango_get_gc (context, &bg_color, gc);
gdk_draw_rectangle (drawable, bg_gc, TRUE,
x + (x_off + logical_rect.x) / PANGO_SCALE,
y + overall_rect.y / PANGO_SCALE,
logical_rect.width / PANGO_SCALE,
overall_rect.height / PANGO_SCALE);
gdk_pango_free_gc (context, bg_gc);
}
gdk_draw_glyphs (drawable, fg_gc, run->item->analysis.font,
x + x_off / PANGO_SCALE, y, run->glyphs);
switch (uline)
{
case PANGO_UNDERLINE_NONE:
break;
case PANGO_UNDERLINE_DOUBLE:
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + 4,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 4);
/* Fall through */
case PANGO_UNDERLINE_SINGLE:
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + 2,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 2);
break;
case PANGO_UNDERLINE_LOW:
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 2,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 2);
break;
}
if (fg_set)
gdk_pango_free_gc (context, fg_gc);
x_off += logical_rect.width;
}
}
/**
* gdk_draw_layout:
* @drawable: the drawable on which to draw string
* @gc: base graphics context to use
* @x: the X position of the left of the layout (in pixels)
* @y: the Y position of the top of the layout (in pixels)
* @layout: a #PangoLayout
*
* Render a #PangoLayout onto a GDK drawable
*/
void
gdk_draw_layout (GdkDrawable *drawable,
GdkGC *gc,
int x,
int y,
PangoLayout *layout)
{
PangoRectangle logical_rect;
GSList *tmp_list;
PangoAlignment align;
gint indent;
gint width;
gint y_offset = 0;
gboolean first = FALSE;
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
g_return_if_fail (layout != NULL);
if (GDK_DRAWABLE_DESTROYED (drawable))
return;
g_return_if_fail (layout != NULL);
indent = pango_layout_get_indent (layout);
width = pango_layout_get_width (layout);
align = pango_layout_get_alignment (layout);
if (width == -1 && align != PANGO_ALIGN_LEFT)
{
pango_layout_get_extents (layout, NULL, &logical_rect);
width = logical_rect.width;
}
tmp_list = pango_layout_get_lines (layout);
while (tmp_list)
{
PangoLayoutLine *line = tmp_list->data;
int x_offset;
pango_layout_line_get_extents (line, NULL, &logical_rect);
if (width != 1 && align == PANGO_ALIGN_RIGHT)
x_offset = width - logical_rect.width;
else if (width != 1 && align == PANGO_ALIGN_CENTER)
x_offset = (width - logical_rect.width) / 2;
else
x_offset = 0;
if (first)
{
if (indent > 0)
{
if (align == PANGO_ALIGN_LEFT)
x_offset += indent;
else
x_offset -= indent;
}
first = FALSE;
}
else
{
if (indent < 0)
{
if (align == PANGO_ALIGN_LEFT)
x_offset -= indent;
else
x_offset += indent;
}
}
gdk_draw_layout_line (drawable, gc,
x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
line);
y_offset += logical_rect.height;
tmp_list = tmp_list->next;
}
}
static void
gdk_pango_get_item_properties (PangoItem *item,
PangoUnderline *uline,
PangoAttrColor *fg_color,
gboolean *fg_set,
PangoAttrColor *bg_color,
gboolean *bg_set)
{
GSList *tmp_list = item->extra_attrs;
if (fg_set)
*fg_set = FALSE;
if (bg_set)
*bg_set = FALSE;
while (tmp_list)
{
PangoAttribute *attr = tmp_list->data;
switch (attr->klass->type)
{
case PANGO_ATTR_UNDERLINE:
if (uline)
*uline = ((PangoAttrInt *)attr)->value;
break;
case PANGO_ATTR_FOREGROUND:
if (fg_color)
*fg_color = *((PangoAttrColor *)attr);
if (fg_set)
*fg_set = TRUE;
break;
case PANGO_ATTR_BACKGROUND:
if (bg_color)
*bg_color = *((PangoAttrColor *)attr);
if (bg_set)
*bg_set = TRUE;
break;
default:
break;
}
tmp_list = tmp_list->next;
}
}

45
gdk/gdkpango.h Normal file
View File

@ -0,0 +1,45 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2000 Red Hat, 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.
*/
#ifndef __GDK_PANGO_H__
#define __GDK_PANGO_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Pango interaction */
/* FIXME: The following function needs more parameters so that we can
* properly deal with different visuals, the potential for multiple
* screens in the future, etc. The PangoContext needs enough information
* in it to create new GC's and to set the colors on those GC's.
* A colormap is not sufficient.
*/
PangoContext *gdk_pango_context_get (void);
void gdk_pango_context_set_colormap (PangoContext *context,
GdkColormap *colormap);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_FONT_H__ */

View File

@ -30,6 +30,7 @@
/* GDK uses "glib". (And so does GTK).
*/
#include <glib.h>
#include <pango/pango.h>
#ifdef G_OS_WIN32
# ifdef GDK_COMPILATION
@ -115,8 +116,10 @@ typedef enum
GDK_BUTTON3_MASK = 1 << 10,
GDK_BUTTON4_MASK = 1 << 11,
GDK_BUTTON5_MASK = 1 << 12,
GDK_RELEASE_MASK = 1 << 13,
GDK_MODIFIER_MASK = 0x3fff
/* The next few modifiers are used by XKB, so we skip to the end
*/
GDK_RELEASE_MASK = 1 << 31,
GDK_MODIFIER_MASK = GDK_RELEASE_MASK | 0x1fff
} GdkModifierType;
typedef enum

View File

@ -105,6 +105,12 @@ static void gdk_window_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_window_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs);
static void gdk_window_free_paint_stack (GdkWindow *window);
@ -122,7 +128,8 @@ GdkDrawableClass _gdk_window_class = {
gdk_window_draw_drawable,
gdk_window_draw_points,
gdk_window_draw_segments,
gdk_window_draw_lines
gdk_window_draw_lines,
gdk_window_draw_glyphs,
};
GdkWindow *
@ -1097,6 +1104,30 @@ gdk_window_draw_lines (GdkDrawable *drawable,
RESTORE_GC (gc);
}
static void
gdk_window_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)drawable;
OFFSET_GC (gc);
if (private->paint_stack)
{
GdkWindowPaint *paint = private->paint_stack->data;
gdk_draw_glyphs (paint->pixmap, gc, font, x - x_offset, y - y_offset, glyphs);
}
else
_gdk_windowing_window_class.draw_glyphs (drawable, gc, font,
x - x_offset, y - y_offset, glyphs);
RESTORE_GC (gc);
}
/* Fixme - this is just like gdk_window_paint_init_bg */
static void
gdk_window_clear_backing_rect (GdkWindow *window,
@ -1201,8 +1232,6 @@ _gdk_window_draw_image (GdkDrawable *drawable,
static GSList *update_windows = NULL;
static guint update_idle = 0;
#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20)
static void
gdk_window_process_updates_internal (GdkWindow *window)
{
@ -1310,6 +1339,7 @@ gdk_window_invalidate_rect (GdkWindow *window,
GdkRectangle *rect,
gboolean invalidate_children)
{
GdkRectangle window_rect;
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
@ -1318,6 +1348,15 @@ gdk_window_invalidate_rect (GdkWindow *window,
if (GDK_DRAWABLE_DESTROYED (window))
return;
if (!rect)
{
window_rect.x = 0;
window_rect.y = 0;
window_rect.width = private->drawable.width;
window_rect.height = private->drawable.height;
rect = &window_rect;
}
if (private->update_area)
{
gdk_region_union_with_rect (private->update_area, rect);

View File

@ -120,57 +120,59 @@ struct _GdkGeometry {
/* Windows
*/
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
void gdk_window_destroy (GdkWindow *window);
void gdk_window_destroy (GdkWindow *window);
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
void gdk_window_move (GdkWindow *window,
gint x,
gint y);
void gdk_window_resize (GdkWindow *window,
gint width,
gint height);
void gdk_window_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_scroll (GdkWindow *window,
gint dx,
gint dy);
void gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y);
void gdk_window_clear (GdkWindow *window);
void gdk_window_clear_area (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_clear_area_e (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_raise (GdkWindow *window);
void gdk_window_lower (GdkWindow *window);
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
void gdk_window_move (GdkWindow *window,
gint x,
gint y);
void gdk_window_resize (GdkWindow *window,
gint width,
gint height);
void gdk_window_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y);
void gdk_window_clear (GdkWindow *window);
void gdk_window_clear_area (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_clear_area_e(GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_raise (GdkWindow *window);
void gdk_window_lower (GdkWindow *window);
void gdk_window_set_user_data (GdkWindow *window,
gpointer user_data);
void gdk_window_set_override_redirect (GdkWindow *window,
gboolean override_redirect);
void gdk_window_set_user_data (GdkWindow *window,
gpointer user_data);
void gdk_window_set_override_redirect(GdkWindow *window,
gboolean override_redirect);
void gdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
void gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
void gdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
void gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
/*
* This allows for making shaped (partially transparent) windows

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ INCLUDES = @STRIP_BEGIN@ \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@PANGO_CFLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@ \
@STRIP_END@
@ -54,9 +55,12 @@ libgdk_x11_la_SOURCES = \
gdkimage-x11.c \
gdkinput.c \
gdkmain-x11.c \
gdkpango-x11.c \
gdkpixmap-x11.c \
gdkproperty-x11.c \
gdkpoly-generic.h \
gdkpolyreg-generic.c \
gdkregion-generic.h \
gdkregion-generic.c \
gdkselection-x11.c \
gdkvisual-x11.c \
@ -70,7 +74,7 @@ libgdk_x11_la_SOURCES = \
gdkinputprivate.h \
$(xinput_sources)
libgdkinclude_HEADERS = \
libgdkinclude_HEADERS = \
gdkx.h
EXTRA_PROGRAMS = gxid

View File

@ -25,66 +25,72 @@
*/
#include "gdkprivate-x11.h"
#include <pango/pangox.h>
static void gdk_x11_drawable_destroy (GdkDrawable *drawable);
static void gdk_x11_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
static void gdk_x11_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
static void gdk_x11_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
static void gdk_x11_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
static void gdk_x11_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
static void gdk_x11_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_x11_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_x11_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
static void gdk_x11_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_x11_drawable_destroy (GdkDrawable *drawable);
static void gdk_x11_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
static void gdk_x11_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
static void gdk_x11_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
static void gdk_x11_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
static void gdk_x11_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
static void gdk_x11_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_x11_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_x11_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
static void gdk_x11_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
static void gdk_x11_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs);
GdkDrawableClass _gdk_x11_drawable_class = {
gdk_x11_drawable_destroy,
@ -97,7 +103,8 @@ GdkDrawableClass _gdk_x11_drawable_class = {
gdk_x11_draw_drawable,
gdk_x11_draw_points,
gdk_x11_draw_segments,
gdk_x11_draw_lines
gdk_x11_draw_lines,
gdk_x11_draw_glyphs,
};
/*****************************************************
@ -471,3 +478,17 @@ gdk_x11_draw_lines (GdkDrawable *drawable,
g_free (tmp_points);
}
static void
gdk_x11_draw_glyphs (GdkDrawable *drawable,
GdkGC *gc,
PangoFont *font,
gint x,
gint y,
PangoGlyphString *glyphs)
{
pango_x_render (GDK_DRAWABLE_XDISPLAY (drawable),
GDK_DRAWABLE_XID (drawable),
GDK_GC_GET_XGC (gc),
font, glyphs, x, y);
}

View File

@ -26,6 +26,9 @@
#include <X11/Xlib.h>
#include <X11/Xos.h>
#include <pango/pangox.h>
#include "gdkfont.h"
#include "gdkprivate-x11.h"
@ -133,6 +136,93 @@ gdk_font_load (const gchar *font_name)
return font;
}
static char *
gdk_font_charset_for_locale ()
{
static char *charset_map[][2] = {
{ "ANSI_X3.4-1968", "iso8859-1" },
{ "ISO-8859-1", "iso8859-1" },
{ "ISO-8859-2", "iso8859-2" },
{ "ISO-8859-3", "iso8859-3" },
{ "ISO-8859-4", "iso8859-4" },
{ "ISO-8859-5", "iso8859-5" },
{ "ISO-8859-6", "iso8859-6" },
{ "ISO-8859-7", "iso8859-7" },
{ "ISO-8859-8", "iso8859-8" },
{ "ISO-8859-9", "iso8859-9" },
};
char *codeset = g_get_codeset ();
char *result = NULL;
int i;
for (i=0; i < G_N_ELEMENTS (charset_map); i++)
if (strcmp (charset_map[i][0], codeset) == 0)
{
result = charset_map[i][1];
break;
}
g_free (codeset);
if (result)
return g_strdup (result);
else
return g_strdup ("iso-8859-1");
};
/**
* gdk_font_from_description:
* @font_desc: a #PangoFontDescription.
*
* Load a #GdkFont based on a Pango font description. This font will
* only be an approximation of the Pango font, and
* internationalization will not be handled correctly. This function
* should only be used for legacy code that cannot be easily converted
* to use Pango. Using Pango directly will produce better results.
*
* Return value: the newly loaded font, or %NULL if the font
* cannot be loaded.
**/
GdkFont*
gdk_font_from_description (PangoFontDescription *font_desc)
{
PangoFontMap *font_map;
PangoFont *font;
GdkFont *result = NULL;
g_return_val_if_fail (font_desc != NULL, NULL);
font_map = pango_x_font_map_for_display (GDK_DISPLAY ());
font = pango_font_map_load_font (font_map, font_desc);
if (font)
{
gchar *charset = gdk_font_charset_for_locale ();
gint n_subfonts;
PangoXSubfont *subfont_ids;
gint *subfont_charsets;
n_subfonts = pango_x_list_subfonts (font, &charset, 1,
&subfont_ids, &subfont_charsets);
if (n_subfonts > 0)
{
gchar *xlfd = pango_x_font_subfont_xlfd (font, subfont_ids[0]);
result = gdk_font_load (xlfd);
g_free (xlfd);
}
g_free (subfont_ids);
g_free (subfont_charsets);
g_free (charset);
g_object_unref (G_OBJECT (font));
}
return result;
}
GdkFont*
gdk_fontset_load (const gchar *fontset_name)
{

View File

@ -110,6 +110,116 @@ _gdk_window_init_position (GdkWindow *window)
gdk_window_compute_position (window, &parent_pos, &data->position_info);
}
/**
* gdk_window_scroll:
* @window: a #GdkWindow
* @dx: Amount to scroll in the X direction
* @dy: Amount to scroll in the Y direction
*
* Scroll the contents of its window, both pixels and children, by
* the given amount. Portions of the window that the scroll operation
* brings in from offscreen areas are invalidated. The invalidated
* region may be bigger than what would strictly be necessary.
* (For X11, a minimum area will be invalidated if the window has
* no subwindows, or if the edges of the window's parent do not extend
* beyond the edges of the window. In other cases, a multi-step process
* is used to scroll the window which may produce temporary visual
* artifacts and unnecessary invalidations.)
**/
void
gdk_window_scroll (GdkWindow *window,
gint dx,
gint dy)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
gboolean can_guffaw_scroll = FALSE;
GdkWindowXData *data;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_DRAWABLE_DESTROYED (window))
return;
data = (GdkWindowXData *)private->drawable.klass_data;
/* We can guffaw scroll if we are a child window, and the parent
* does not extend beyond our edges.
*/
if (GDK_DRAWABLE_TYPE (private) == GDK_WINDOW_CHILD)
{
GdkWindowPrivate *parent_private = (GdkWindowPrivate *)private->parent;
can_guffaw_scroll = (private->x <= 0 &&
private->y <= 0 &&
private->x + private->drawable.width >= parent_private->drawable.width &&
private->y + private->drawable.height >= parent_private->drawable.height);
}
if (!private->children || !can_guffaw_scroll)
{
/* Use XCopyArea, then move any children later
*/
GList *tmp_list;
GdkRegion *invalidate_region;
GdkRectangle dest_rect;
invalidate_region = gdk_region_rectangle (&data->position_info.clip_rect);
dest_rect = data->position_info.clip_rect;
dest_rect.x += dx;
dest_rect.y += dy;
gdk_rectangle_intersect (&dest_rect, &data->position_info.clip_rect, &dest_rect);
if (dest_rect.width > 0 && dest_rect.height > 0)
{
GC gc;
XGCValues values;
GdkRegion *tmp_region;
tmp_region = gdk_region_rectangle (&dest_rect);
gdk_region_subtract (invalidate_region, tmp_region);
gdk_region_destroy (tmp_region);
gdk_window_queue_translation (window, dx, dy);
values.graphics_exposures = True;
gc = XCreateGC (GDK_DRAWABLE_XDISPLAY (window), GDK_DRAWABLE_XID (window),
GCGraphicsExposures, &values);
XCopyArea (GDK_DRAWABLE_XDISPLAY (window),
GDK_DRAWABLE_XID (window),
GDK_DRAWABLE_XID (window),
gc,
dest_rect.x - dx, dest_rect.y - dy,
dest_rect.width, dest_rect.height,
dest_rect.x, dest_rect.y);
XFreeGC (GDK_DRAWABLE_XDISPLAY (window), gc);
}
gdk_window_invalidate_region (window, invalidate_region, TRUE);
gdk_region_destroy (invalidate_region);
tmp_list = private->children;
while (tmp_list)
{
private = tmp_list->data;
gdk_window_move (tmp_list->data, private->x + dx, private->y + dy);
tmp_list = tmp_list->next;
}
}
else
{
/* Guffaw scroll
*/
g_warning ("gdk_window_scroll(): guffaw scrolling not yet implemented");
}
}
void
_gdk_window_move_resize_child (GdkWindow *window,
gint x,

28
gdk/x11/gdkpango-x11.c Normal file
View File

@ -0,0 +1,28 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2000 Red Hat, 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.
*/
#include "gdkprivate-x11.h"
#include "gdkpango.h"
#include <pango/pangox.h>
PangoContext *
gdk_pango_context_get (void)
{
return pango_x_get_context (GDK_DISPLAY ());
}

View File

@ -7,8 +7,9 @@ _libs
libgtk-1.1.la
testgtk
testinput
testselection
testrgb
testselection
testtext
simple
testtree
gtkcompat.h

View File

@ -13,6 +13,7 @@ INCLUDES = @STRIP_BEGIN@ \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@PANGO_CFLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@ \
@STRIP_END@
@ -29,6 +30,7 @@ libgtk_la_LDFLAGS = @STRIP_BEGIN@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
-export-dynamic \
@PANGO_LIBS@ \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
@ -94,6 +96,8 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkhseparator.h \
gtkhsv.h \
gtkimage.h \
gtkimcontext.h \
gtkimmulticontext.h \
gtkinputdialog.h \
gtkinvisible.h \
gtkitem.h \
@ -137,6 +141,12 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkstatusbar.h \
gtktable.h \
gtktearoffmenuitem.h \
gtktextbuffer.h \
gtktextiter.h \
gtktextmark.h \
gtktexttag.h \
gtktexttagtable.h \
gtktextview.h \
gtktext.h \
gtkthemes.h \
gtktipsquery.h \
@ -157,6 +167,23 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkwidget.h \
gtkwindow.h \
@STRIP_END@
#
# GTK+ header files that we install, but don't extract enums from
# (This class is iffy; we have it for the semi-public interface
# of the Text widget, which is useful for writing new view types
# such as a Canvas text item, but isn't part of the clean public
# interface)
gtk_semipublic_h_sources = @STRIP_BEGIN@ \
gtktextbtree.h \
gtktextchild.h \
gtktextdisplay.h \
gtktextlayout.h \
gtktextsegment.h \
gtktexttypes.h \
@STRIP_END@
# GTK+ header files that don't get installed
gtk_private_h_sources = @STRIP_BEGIN@ \
@STRIP_END@
@ -207,6 +234,10 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtkhseparator.c \
gtkhsv.c \
gtkimage.c \
gtkimcontext.c \
gtkimcontextsimple.c \
gtkimcontextsimple.h \
gtkimmulticontext.c \
gtkinputdialog.c \
gtkintl.h \
gtkinvisible.c \
@ -252,6 +283,21 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtktable.c \
gtktearoffmenuitem.c \
gtktext.c \
gtktextbtree.c \
gtktextbuffer.c \
gtktextchild.c \
gtktextdisplay.c \
gtktextiter.c \
gtktextiterprivate.h \
gtktextlayout.c \
gtktextmark.c \
gtktextmarkprivate.h \
gtktextsegment.c \
gtktexttag.c \
gtktexttagprivate.h \
gtktexttagtable.c \
gtktexttypes.c \
gtktextview.c \
gtkthemes.c \
gtktipsquery.c \
gtktogglebutton.c \
@ -336,7 +382,7 @@ gdk_headers = @STRIP_BEGIN@ \
#
# setup GTK+ sources and their dependancies
#
libgtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_built_public_sources)
libgtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semipublic_h_sources) $(gtk_built_public_sources)
libgtk_la_SOURCES = $(gtk_c_sources)
MAINTAINERCLEANFILES += $(gtk_built_public_sources) $(gtk_built_sources)
EXTRA_HEADERS +=
@ -441,7 +487,7 @@ uninstall-local:
#
# test programs, not to be installed
#
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple # testthreads
noinst_PROGRAMS = testgtk testcalendar testinput testselection testrgb testdnd testtext simple # testthreads
DEPS = libgtk.la $(top_builddir)/gdk/libgdk.la
LDADDS = @STRIP_BEGIN@ \
libgtk.la \
@ -449,20 +495,25 @@ LDADDS = @STRIP_BEGIN@ \
@x_ldflags@ \
@x_libs@ \
@GDK_WLIBS@ \
@PANGO_LIBS@ \
@GLIB_LIBS@ \
@GTK_LIBS_EXTRA@ \
-lm \
@STRIP_END@
testgtk_DEPENDENCIES = $(DEPS)
testcalendar_DEPENDENCIES = $(DEPS)
testinput_DEPENDENCIES = $(DEPS)
testselection_DEPENDENCIES = $(DEPS)
testrgb_DEPENDENCIES = $(DEPS)
testtext_DEPENDENCIES = $(DEPS)
testdnd_DEPENDENCIES = $(DEPS)
simple_DEPENDENCIES = $(DEPS)
#testthreads_DEPENDENCIES = $(DEPS)
testcalendar_LDADD = $(LDADDS)
testgtk_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
testselection_LDADD = $(LDADDS)
testtext_LDADD = $(LDADDS)
testrgb_LDADD = $(LDADDS)
testdnd_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)

View File

@ -117,6 +117,8 @@
#include <gtk/gtktable.h>
#include <gtk/gtktearoffmenuitem.h>
#include <gtk/gtktext.h>
#include <gtk/gtktextbuffer.h>
#include <gtk/gtktextview.h>
#include <gtk/gtkthemes.h>
#include <gtk/gtktipsquery.h>
#include <gtk/gtktogglebutton.h>

View File

@ -230,6 +230,8 @@ gtk_accel_label_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkAccelLabel *accel_label;
PangoLayout *layout;
PangoRectangle logical_rect;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_ACCEL_LABEL (widget));
@ -239,9 +241,13 @@ gtk_accel_label_size_request (GtkWidget *widget,
if (GTK_WIDGET_CLASS (parent_class)->size_request)
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, accel_label->accel_string, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
accel_label->accel_string_width = gdk_string_width (GTK_WIDGET (accel_label)->style->font,
accel_label->accel_string);
accel_label->accel_string_width = logical_rect.width / PANGO_SCALE;
pango_layout_unref (layout);
}
static gint
@ -250,6 +256,7 @@ gtk_accel_label_expose_event (GtkWidget *widget,
{
GtkMisc *misc;
GtkAccelLabel *accel_label;
PangoLayout *layout;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_ACCEL_LABEL (widget), FALSE);
@ -279,22 +286,25 @@ gtk_accel_label_expose_event (GtkWidget *widget,
y = (widget->allocation.y * (1.0 - misc->yalign) +
(widget->allocation.y + widget->allocation.height -
(widget->requisition.height - misc->ypad * 2)) *
misc->yalign + widget->style->font->ascent) + 1.5;
misc->yalign) + 1.5;
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, accel_label->accel_string, -1);
if (GTK_WIDGET_STATE (accel_label) == GTK_STATE_INSENSITIVE)
gdk_draw_string (widget->window,
widget->style->font,
gdk_draw_layout (widget->window,
widget->style->white_gc,
x + 1,
y + 1,
accel_label->accel_string);
layout);
gdk_draw_string (widget->window,
widget->style->font,
gdk_draw_layout (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (accel_label)],
x,
y,
accel_label->accel_string);
layout);
pango_layout_unref (layout);
}
else
{

View File

@ -23,7 +23,7 @@
*/
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
@ -39,26 +39,22 @@ enum {
ARG_OBEY_CHILD
};
static void gtk_aspect_frame_class_init (GtkAspectFrameClass *klass);
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
static void gtk_aspect_frame_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_aspect_frame_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_aspect_frame_draw (GtkWidget *widget,
GdkRectangle *area);
static void gtk_aspect_frame_paint (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_aspect_frame_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_aspect_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_aspect_frame_class_init (GtkAspectFrameClass *klass);
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
static void gtk_aspect_frame_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_aspect_frame_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_aspect_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation);
#define MAX_RATIO 10000.0
#define MIN_RATIO 0.0001
static GtkFrameClass *parent_class = NULL;
GtkType
gtk_aspect_frame_get_type (void)
{
@ -88,17 +84,17 @@ static void
gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkFrameClass *frame_class;
parent_class = gtk_type_class (GTK_TYPE_FRAME);
object_class = GTK_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
frame_class = GTK_FRAME_CLASS (class);
object_class->set_arg = gtk_aspect_frame_set_arg;
object_class->get_arg = gtk_aspect_frame_get_arg;
widget_class->draw = gtk_aspect_frame_draw;
widget_class->expose_event = gtk_aspect_frame_expose;
widget_class->size_allocate = gtk_aspect_frame_size_allocate;
frame_class->compute_child_allocation = gtk_aspect_frame_compute_child_allocation;
gtk_object_add_arg_type ("GtkAspectFrame::xalign", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_XALIGN);
@ -117,10 +113,6 @@ gtk_aspect_frame_init (GtkAspectFrame *aspect_frame)
aspect_frame->yalign = 0.5;
aspect_frame->ratio = 1.0;
aspect_frame->obey_child = TRUE;
aspect_frame->center_allocation.x = -1;
aspect_frame->center_allocation.y = -1;
aspect_frame->center_allocation.width = 1;
aspect_frame->center_allocation.height = 1;
}
static void
@ -243,157 +235,17 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
}
static void
gtk_aspect_frame_paint (GtkWidget *widget,
GdkRectangle *area)
gtk_aspect_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation)
{
GtkFrame *frame;
gint height_extra;
gint label_area_width;
gint x, y, x2, y2;
GtkAllocation *allocation;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_ASPECT_FRAME (widget));
g_return_if_fail (area != NULL);
if (GTK_WIDGET_DRAWABLE (widget))
{
frame = GTK_FRAME (widget);
allocation = &GTK_ASPECT_FRAME(widget)->center_allocation;
height_extra = frame->label_height - widget->style->klass->xthickness;
height_extra = MAX (height_extra, 0);
x = GTK_CONTAINER (frame)->border_width;
y = GTK_CONTAINER (frame)->border_width;
if (frame->label)
{
label_area_width = (allocation->width +
GTK_CONTAINER (frame)->border_width * 2 -
widget->style->klass->xthickness * 2);
x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
gtk_paint_shadow_gap (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
allocation->x + x,
allocation->y + y + height_extra / 2,
allocation->width - x * 2,
allocation->height - y * 2 - height_extra / 2,
GTK_POS_TOP,
x2 + 2 - x, frame->label_width - 4);
gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
area, widget, "frame",
allocation->x + x2 + 3,
allocation->y + y2,
frame->label);
}
else
gtk_paint_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
allocation->x + x,
allocation->y + y + height_extra / 2,
allocation->width - x * 2,
allocation->height - y * 2 - height_extra / 2);
}
}
/* the only modification to the next two routines is to call
gtk_aspect_frame_paint instead of gtk_frame_paint */
static void
gtk_aspect_frame_draw (GtkWidget *widget,
GdkRectangle *area)
{
GtkBin *bin;
GdkRectangle child_area;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_ASPECT_FRAME (widget));
g_return_if_fail (area != NULL);
if (GTK_WIDGET_DRAWABLE (widget))
{
bin = GTK_BIN (widget);
gtk_aspect_frame_paint (widget, area);
if (bin->child && gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
}
}
static gint
gtk_aspect_frame_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkBin *bin;
GdkEventExpose child_event;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_ASPECT_FRAME (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
bin = GTK_BIN (widget);
gtk_aspect_frame_paint (widget, &event->area);
child_event = *event;
if (bin->child &&
GTK_WIDGET_NO_WINDOW (bin->child) &&
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
}
return FALSE;
}
static void
gtk_aspect_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkFrame *frame;
GtkAspectFrame *aspect_frame;
GtkBin *bin;
GtkAllocation child_allocation;
gint x,y;
gint width,height;
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (frame);
GtkBin *bin = GTK_BIN (frame);
gdouble ratio;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_ASPECT_FRAME (widget));
g_return_if_fail (allocation != NULL);
aspect_frame = GTK_ASPECT_FRAME (widget);
frame = GTK_FRAME (widget);
bin = GTK_BIN (widget);
if (GTK_WIDGET_DRAWABLE (widget) &&
((widget->allocation.x != allocation->x) ||
(widget->allocation.y != allocation->y) ||
(widget->allocation.width != allocation->width) ||
(widget->allocation.height != allocation->height)) &&
(widget->allocation.width != 0) &&
(widget->allocation.height != 0))
gdk_window_clear_area (widget->window,
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
widget->allocation = *allocation;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
GtkAllocation full_allocation;
if (aspect_frame->obey_child)
{
GtkRequisition child_requisition;
@ -413,43 +265,21 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
}
else
ratio = aspect_frame->ratio;
parent_class->compute_child_allocation (frame, &full_allocation);
x = (GTK_CONTAINER (frame)->border_width +
GTK_WIDGET (frame)->style->klass->xthickness);
width = allocation->width - x * 2;
y = (GTK_CONTAINER (frame)->border_width +
MAX (frame->label_height, GTK_WIDGET (frame)->style->klass->ythickness));
height = (allocation->height - y -
GTK_CONTAINER (frame)->border_width -
GTK_WIDGET (frame)->style->klass->ythickness);
/* make sure we don't allocate a negative width or height,
* since that will be cast to a (very big) guint16 */
width = MAX (1, width);
height = MAX (1, height);
if (ratio * height > width)
if (ratio * full_allocation.height > full_allocation.width)
{
child_allocation.width = width;
child_allocation.height = width/ratio + 0.5;
child_allocation->width = full_allocation.width;
child_allocation->height = full_allocation.width / ratio + 0.5;
}
else
{
child_allocation.width = ratio*height + 0.5;
child_allocation.height = height;
child_allocation->width = ratio * full_allocation.height + 0.5;
child_allocation->height = full_allocation.height;
}
child_allocation.x = aspect_frame->xalign * (width - child_allocation.width) + allocation->x + x;
child_allocation.y = aspect_frame->yalign * (height - child_allocation.height) + allocation->y + y;
aspect_frame->center_allocation.width = child_allocation.width + 2*x;
aspect_frame->center_allocation.x = child_allocation.x - x;
aspect_frame->center_allocation.height = child_allocation.height + y +
GTK_CONTAINER (frame)->border_width +
GTK_WIDGET (frame)->style->klass->ythickness;
aspect_frame->center_allocation.y = child_allocation.y - y;
gtk_widget_size_allocate (bin->child, &child_allocation);
child_allocation->x = full_allocation.x + aspect_frame->xalign * (full_allocation.width - child_allocation->width);
child_allocation->y = full_allocation.y + aspect_frame->yalign * (full_allocation.height - child_allocation->height);
}
}

View File

@ -1155,20 +1155,20 @@ gtk_calendar_size_request (GtkWidget *widget,
{
GtkCalendar *calendar;
GtkCalendarPrivateData *private_data;
PangoLayout *layout;
PangoRectangle logical_rect;
gint height;
gint i;
gchar buffer[255];
gint calendar_margin = CALENDAR_MARGIN;
gint header_width, main_width;
gint lbearing;
gint rbearing;
gint ascent;
gint descent;
gint width;
gint max_header_height = 0;
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
layout = gtk_widget_create_pango_layout (widget);
/*
* Calculate the requisition width for the widget.
@ -1181,17 +1181,21 @@ gtk_calendar_size_request (GtkWidget *widget,
private_data->max_month_width = 0;
for (i = 0; i < 12; i++)
{
pango_layout_set_text (layout, default_monthname[i], -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
private_data->max_month_width = MAX (private_data->max_month_width,
gdk_string_measure (HEADER_FONT (widget),
default_monthname[i]) + 8);
logical_rect.width / PANGO_SCALE + 8);
max_header_height = MAX (max_header_height, logical_rect.height / PANGO_SCALE);
}
private_data->max_year_width = 0;
for (i=0; i<10; i++)
{
sprintf (buffer, "%d%d%d%d", i,i,i,i);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
private_data->max_year_width = MAX (private_data->max_year_width,
gdk_string_measure (HEADER_FONT (widget),
buffer) + 8);
logical_rect.width / PANGO_SCALE + 8);
max_header_height = MAX (max_header_height, logical_rect.height / PANGO_SCALE);
}
}
else
@ -1215,9 +1219,15 @@ gtk_calendar_size_request (GtkWidget *widget,
for (i = 0; i < 9; i++)
{
sprintf (buffer, "%d%d", i, i);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
private_data->min_day_width = MAX (private_data->max_day_char_width,
gdk_string_measure (DAY_FONT (widget),
buffer));
logical_rect.width / PANGO_SCALE);
private_data->max_day_char_ascent = MAX (private_data->max_label_char_ascent,
PANGO_ASCENT (logical_rect) / PANGO_SCALE);
private_data->max_day_char_descent = MAX (private_data->max_label_char_descent,
PANGO_DESCENT (logical_rect) / PANGO_SCALE);
}
/* We add one to max_day_char_width to be able to make the marked day "bold" */
private_data->max_day_char_width = private_data->min_day_width / 2 +1;
@ -1225,19 +1235,14 @@ gtk_calendar_size_request (GtkWidget *widget,
if (calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES)
for (i = 0; i < 7; i++)
{
gdk_text_extents (LABEL_FONT (widget),
default_abbreviated_dayname[i],
strlen(default_abbreviated_dayname[i]),
&lbearing,
&rbearing,
&width,
&ascent,
&descent);
private_data->min_day_width = MAX (private_data->min_day_width, width);
private_data->max_label_char_ascent = MAX (private_data->max_label_char_ascent,
ascent);
pango_layout_set_text (layout, default_abbreviated_dayname[i], -1);
pango_layout_line_get_extents (pango_layout_get_lines (layout)->data, NULL, &logical_rect);
private_data->min_day_width = MAX (private_data->min_day_width, logical_rect.width / PANGO_SCALE);
private_data->max_label_char_ascent = MAX (private_data->max_label_char_ascent,
PANGO_ASCENT (logical_rect) / PANGO_SCALE);
private_data->max_label_char_descent = MAX (private_data->max_label_char_descent,
descent);
PANGO_DESCENT (logical_rect) / PANGO_SCALE);
}
private_data->max_week_char_width = 0;
@ -1245,8 +1250,10 @@ gtk_calendar_size_request (GtkWidget *widget,
for (i = 0; i < 9; i++)
{
sprintf (buffer, "%d%d", i, i);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
private_data->max_week_char_width = MAX (private_data->max_week_char_width,
gdk_string_measure (LABEL_FONT (widget), buffer) / 2);
logical_rect.width / PANGO_SCALE / 2);
}
main_width = (7 * (private_data->min_day_width + DAY_XPAD * 2) + (DAY_XSEP * 6) + CALENDAR_MARGIN * 2
@ -1263,9 +1270,7 @@ gtk_calendar_size_request (GtkWidget *widget,
if (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING)
{
private_data->header_h = (HEADER_FONT (widget)->ascent
+ HEADER_FONT (widget)->descent
+ CALENDAR_YSEP * 2);
private_data->header_h = (max_header_height + CALENDAR_YSEP * 2);
}
else
{
@ -1284,15 +1289,6 @@ gtk_calendar_size_request (GtkWidget *widget,
private_data->day_name_h = 0;
}
gdk_text_extents (DAY_FONT (widget),
"0123456789",
10,
&lbearing,
&rbearing,
&width,
&private_data->max_day_char_ascent,
&private_data->max_day_char_descent);
private_data->main_h = (CALENDAR_MARGIN + calendar_margin
+ 6 * (private_data->max_day_char_ascent
+ private_data->max_day_char_descent
@ -1317,6 +1313,8 @@ gtk_calendar_size_request (GtkWidget *widget,
+ private_data->main_h);
requisition->height = height + (widget->style->klass->ythickness + INNER_BORDER) * 2;
pango_layout_unref (layout);
}
static void
@ -1529,12 +1527,13 @@ gtk_calendar_paint_header (GtkWidget *widget)
GtkCalendar *calendar;
GdkGC *gc;
char buffer[255];
int y, y_arrow;
int x, y;
gint header_width, cal_height;
gint str_width;
gint max_month_width;
gint max_year_width;
GtkCalendarPrivateData *private_data;
PangoLayout *layout;
PangoRectangle logical_rect;
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
@ -1562,40 +1561,39 @@ gtk_calendar_paint_header (GtkWidget *widget)
0, 0, header_width, private_data->header_h);
layout = gtk_widget_create_pango_layout (widget);
sprintf (buffer, "%d", calendar->year);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
/* Draw title */
y = private_data->header_h - (private_data->header_h
- HEADER_FONT (widget)->ascent
+ HEADER_FONT (widget)->descent) / 2;
y_arrow = (private_data->header_h - 9) / 2;
y = (private_data->header_h - logical_rect.height / PANGO_SCALE) / 2;
/* Draw year and its arrows */
sprintf (buffer, "%d", calendar->year);
str_width = gdk_string_measure (HEADER_FONT (widget), buffer);
gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
gdk_draw_string (private_data->header_win, HEADER_FONT (widget), gc,
header_width - (3 + max_year_width
- (max_year_width - str_width)/2),
y, buffer);
x = header_width - (3 + max_year_width
- (max_year_width - logical_rect.width / PANGO_SCALE)/2);
else
gdk_draw_string (private_data->header_win, HEADER_FONT (widget), gc,
header_width - (3 + private_data->arrow_width + max_year_width
- (max_year_width - str_width)/2),
y, buffer);
x = header_width - (3 + private_data->arrow_width + max_year_width
- (max_year_width - logical_rect.width / PANGO_SCALE)/2);
gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar)));
gdk_draw_layout (private_data->header_win, gc, x, y, layout);
/* Draw month */
sprintf (buffer, "%s", default_monthname[calendar->month]);
str_width = gdk_string_measure (HEADER_FONT (widget), buffer);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
gdk_draw_string (private_data->header_win, HEADER_FONT (widget), gc,
3 + (max_month_width - str_width) / 2,
y, buffer);
x = 3 + (max_month_width - logical_rect.width / PANGO_SCALE) / 2;
else
gdk_draw_string (private_data->header_win, HEADER_FONT (widget), gc,
3 + private_data->arrow_width + (max_month_width - str_width)/2,
y, buffer);
y += CALENDAR_YSEP + HEADER_FONT (widget)->descent;
x = 3 + private_data->arrow_width + (max_month_width - logical_rect.width / PANGO_SCALE)/2;
gdk_draw_layout (private_data->header_win, gc, x, y, layout);
gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));
@ -1603,7 +1601,8 @@ gtk_calendar_paint_header (GtkWidget *widget)
gtk_calendar_paint_arrow (widget, ARROW_MONTH_RIGHT);
gtk_calendar_paint_arrow (widget, ARROW_YEAR_LEFT);
gtk_calendar_paint_arrow (widget, ARROW_YEAR_RIGHT);
pango_layout_unref (layout);
}
static void
@ -1616,7 +1615,8 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
int day_width, cal_width;
gint cal_height;
int day_wid_sep;
int str_width;
PangoLayout *layout;
PangoRectangle logical_rect;
GtkCalendarPrivateData *private_data;
g_return_if_fail (widget != NULL);
@ -1667,6 +1667,9 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
/*
* Write the labels
*/
layout = gtk_widget_create_pango_layout (widget);
gdk_gc_set_foreground (gc, &widget->style->fg[GTK_STATE_SELECTED]);
for (i = 0; i < 7; i++)
{
@ -1674,16 +1677,20 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
if (calendar->display_flags & GTK_CALENDAR_WEEK_START_MONDAY)
day= (day+1)%7;
sprintf (buffer, "%s", default_abbreviated_dayname[day]);
str_width = gdk_string_measure (LABEL_FONT (widget), buffer);
gdk_draw_string (private_data->day_name_win, LABEL_FONT (widget),
gc,
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
gdk_draw_layout (private_data->day_name_win, gc,
((private_data->week_width ? CALENDAR_XSEP : CALENDAR_MARGIN)
+ day_wid_sep * i
+ private_data->week_width
+ (day_width - str_width)/2),
CALENDAR_MARGIN + DAY_YPAD
+ private_data->max_label_char_ascent, buffer);
+ (day_width - logical_rect.width / PANGO_SCALE)/2),
CALENDAR_MARGIN + DAY_YPAD + private_data->max_label_char_ascent + logical_rect.y / PANGO_SCALE,
layout);
}
pango_layout_unref (layout);
}
static void
@ -1694,8 +1701,10 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
gint row, week = 0, year;
gint x_loc;
char buffer[3];
gint y_baseline, day_height;
gint y_loc, day_height;
GtkCalendarPrivateData *private_data;
PangoLayout *layout;
PangoRectangle logical_rect;
g_return_if_fail (widget != NULL);
g_return_if_fail (widget->window != NULL);
@ -1743,6 +1752,8 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
* Write the labels
*/
layout = gtk_widget_create_pango_layout (widget);
gdk_gc_set_foreground (gc, &widget->style->fg[GTK_STATE_SELECTED]);
day_height = row_height (calendar);
for (row = 0; row < 6; row++)
@ -1750,28 +1761,25 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
year = calendar->year;
if (calendar->day[row][6] < 15 && row > 3 && calendar->month == 11)
year++;
y_baseline = (top_y_for_row (calendar, row)
+ (day_height + LABEL_FONT (widget)->ascent
- LABEL_FONT (widget)->descent)/2);
g_return_if_fail (week_of_year (&week, &year,
((calendar->day[row][6] < 15 && row > 3 ? 1 : 0)
+ calendar->month) % 12 + 1, calendar->day[row][6]));
x_loc= (private_data->week_width - (private_data->week_width - CALENDAR_XSEP
- DAY_XPAD * 2 - CALENDAR_MARGIN ) / 2
- private_data->max_week_char_width
- CALENDAR_XSEP - DAY_XPAD);
if (week > 9)
{
sprintf (buffer, "%d", week/10);
gdk_draw_string (private_data->week_win, LABEL_FONT (widget), gc,
x_loc, y_baseline , buffer);
}
sprintf (buffer, "%d", week%10);
gdk_draw_string (private_data->week_win, LABEL_FONT (widget), gc,
x_loc + private_data->max_week_char_width, y_baseline , buffer);
sprintf (buffer, "%d", week);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
y_loc = top_y_for_row (calendar, row) + (day_height - logical_rect.height / PANGO_SCALE) / 2;
x_loc = (private_data->week_width
- logical_rect.width / PANGO_SCALE
- CALENDAR_XSEP - DAY_XPAD);
gdk_draw_layout (private_data->week_win, gc, x_loc, y_loc, layout);
}
pango_layout_unref (layout);
}
static void
@ -1816,9 +1824,11 @@ gtk_calendar_paint_day (GtkWidget *widget,
gint x_left;
gint x_loc;
gint y_top;
gint y_baseline;
gint y_loc;
gint day_xspace;
GtkCalendarPrivateData *private_data;
PangoLayout *layout;
PangoRectangle logical_rect;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CALENDAR (widget));
@ -1847,7 +1857,6 @@ gtk_calendar_paint_day (GtkWidget *widget,
x_loc = x_left + private_data->day_width / 2 + private_data->max_day_char_width;
y_top = top_y_for_row (calendar, row);
y_baseline = y_top + (day_height + private_data->max_day_char_ascent)/2;
gdk_window_clear_area (private_data->main_win, x_left, y_top,
private_data->day_width, day_height);
@ -1891,17 +1900,21 @@ gtk_calendar_paint_day (GtkWidget *widget,
}
layout = gtk_widget_create_pango_layout (widget);
sprintf (buffer, "%d", day);
x_loc -= gdk_string_measure (DAY_FONT (widget), buffer);
sprintf (buffer, "%d", day);
gdk_draw_string (private_data->main_win,
DAY_FONT (widget), gc,
x_loc, y_baseline, buffer);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
x_loc -= logical_rect.width / PANGO_SCALE;
y_loc = y_top + (day_height - logical_rect.height / PANGO_SCALE) / 2;
gdk_draw_layout (private_data->main_win, gc,
x_loc, y_loc, layout);
if (calendar->marked_date[day-1]
&& calendar->day_month[row][col] == MONTH_CURRENT)
gdk_draw_string (private_data->main_win,
DAY_FONT (widget), gc,
x_loc-1, y_baseline, buffer);
gdk_draw_layout (private_data->main_win, gc,
x_loc-1, y_loc, layout);
if (GTK_WIDGET_HAS_FOCUS (calendar)
&& calendar->focus_row == row && calendar->focus_col == col)
@ -1911,6 +1924,8 @@ gtk_calendar_paint_day (GtkWidget *widget,
private_data->day_width-1, day_height-1);
}
pango_layout_unref (layout);
}

View File

@ -277,6 +277,10 @@ gtk_check_button_size_allocate (GtkWidget *widget,
GTK_CONTAINER (widget)->border_width - 1);
child_allocation.height = MAX (1, allocation->height - (GTK_CONTAINER (widget)->border_width + 1) * 2);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
child_allocation.x = allocation->x + allocation->width
- (child_allocation.x - allocation->x + child_allocation.width);
gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
}
}
@ -401,9 +405,12 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
state_type = GTK_WIDGET_STATE (widget);
}
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
x = widget->allocation.x + widget->allocation.width - (width + x - widget->allocation.x);
gtk_paint_check (widget->style, window,
state_type, shadow_type,
area, widget, "checkbutton",
x + 1, y + 1, width, height);
x, y, width, height);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -162,7 +162,6 @@ struct _GtkCList
/* rows */
gint rows;
gint row_center_offset;
gint row_height;
GList *row_list;
GList *row_list_end;
@ -779,6 +778,11 @@ void gtk_clist_sort (GtkCList *clist);
void gtk_clist_set_auto_sort (GtkCList *clist,
gboolean auto_sort);
/* Private function for clist, ctree */
PangoLayout *_gtk_clist_create_cell_layout (GtkCList *clist,
GtkCListRow *clist_row,
gint column);
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,8 @@ typedef enum {
GTK_DEBUG_MISC = 1 << 1,
GTK_DEBUG_SIGNALS = 1 << 2,
GTK_DEBUG_DND = 1 << 3,
GTK_DEBUG_PLUGSOCKET = 1 << 4
GTK_DEBUG_PLUGSOCKET = 1 << 4,
GTK_DEBUG_TEXT = 1 << 5
} GtkDebugFlag;
#ifdef G_ENABLE_DEBUG

View File

@ -424,6 +424,9 @@ gtk_editable_insert_text (GtkEditable *editable,
klass = GTK_EDITABLE_GET_CLASS (editable);
if (new_text_length < 0)
new_text_length = strlen (new_text);
if (new_text_length <= 64)
text = buf;
else
@ -965,32 +968,3 @@ gtk_editable_changed (GtkEditable *editable)
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[CHANGED]);
}
#if 0
static void
gtk_editable_parent_set (GtkWidget *widget,
GtkWidget *old_parent,
GtkWidget *editable)
{
GtkWidget *parent;
parent = old_parent;
while (parent)
{
gtk_signal_disconnect_by_func (GTK_OBJECT (parent),
GTK_SIGNAL_FUNC (gtk_editable_parent_set),
editable);
parent = parent->parent;
}
parent = widget->parent;
while (parent)
{
gtk_signal_connect (GTK_OBJECT (parent), "parent_set",
GTK_SIGNAL_FUNC (gtk_editable_parent_set),
editable);
parent = parent->parent;
}
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,8 @@
#include <gdk/gdk.h>
#include <gtk/gtkeditable.h>
#include <gtk/gtkimcontext.h>
#include <pango/pango.h>
#ifdef __cplusplus
extern "C" {
@ -55,27 +56,21 @@ struct _GtkEntry
GdkWindow *text_area;
GdkPixmap *backing_pixmap;
GdkCursor *cursor;
GdkWChar *text;
gchar *text;
guint16 text_size; /* allocated size */
guint16 text_length; /* length in use */
guint16 text_size; /* allocated size, in bytes */
guint16 text_length; /* length in use, in chars */
guint16 text_max_length;
gint scroll_offset;
guint visible : 1; /* deprecated - see editable->visible */
guint32 timer;
/*< private >*/
guint button;
/* The x-offset of each character (including the last insertion position)
* only valid when the widget is realized */
gint *char_offset;
/* Same as 'text', but in multibyte */
gchar *text_mb;
/* If true, 'text' and 'text_mb' are not coherent */
guint text_mb_dirty : 1;
/* If true, we use the encoding of wchar_t as the encoding of 'text'.
* Otherwise we use the encoding of multi-byte characters instead. */
guint use_wchar : 1;
guint32 timer;
guint16 n_bytes; /* length in use, in bytes */
PangoLayout *layout;
gint scroll_offset;
gint ascent; /* font ascent, in pango units */
GtkIMContext *im_context;
};
struct _GtkEntryClass

View File

@ -77,6 +77,14 @@ typedef enum
GTK_DIR_RIGHT
} GtkDirectionType;
/* Reading directions for text */
typedef enum
{
GTK_TEXT_DIR_NONE,
GTK_TEXT_DIR_RTL,
GTK_TEXT_DIR_LTR
} GtkTextDirection;
/* justification for label and maybe other widgets (text?) */
typedef enum
{

View File

@ -518,6 +518,7 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row",
(GtkSignalFunc) gtk_file_selection_dir_button,
(gpointer) filesel);
gtk_clist_set_column_auto_resize (GTK_CLIST (filesel->dir_list), 0, TRUE);
gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list));
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
@ -537,6 +538,7 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row",
(GtkSignalFunc) gtk_file_selection_file_button,
(gpointer) filesel);
gtk_clist_set_column_auto_resize (GTK_CLIST (filesel->file_list), 0, TRUE);
gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list));
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
@ -672,8 +674,11 @@ gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel)
g_return_if_fail (filesel != NULL);
g_return_if_fail (GTK_IS_FILE_SELECTION (filesel));
if (filesel->fileop_ren_file)
gtk_widget_destroy (filesel->fileop_ren_file);
if (filesel->fileop_ren_file)
{
gtk_widget_destroy (filesel->fileop_ren_file);
filesel->fileop_ren_file = NULL;
}
if (filesel->fileop_del_file)
{
@ -1428,7 +1433,6 @@ win32_gtk_add_drives_to_dir_list(GtkWidget *the_dir_list)
gchar buffer[128];
char volumeNameBuf[128];
char formatBuffer[128];
gint row;
text[1] = NULL;
@ -1457,7 +1461,7 @@ win32_gtk_add_drives_to_dir_list(GtkWidget *the_dir_list)
#endif
/* Add to the list */
text[0] = formatBuffer;
row = gtk_clist_append (GTK_CLIST (the_dir_list), text);
gtk_clist_append (GTK_CLIST (the_dir_list), text);
}
textPtr += (strlen(textPtr) + 1);
}
@ -1472,15 +1476,12 @@ gtk_file_selection_populate (GtkFileSelection *fs,
CompletionState *cmpl_state;
PossibleCompletion* poss;
gchar* filename;
gint row;
gchar* rem_path = rel_path;
gchar* sel_text;
gchar* text[2];
gint did_recurse = FALSE;
gint possible_count = 0;
gint selection_index = -1;
gint file_list_width;
gint dir_list_width;
g_return_if_fail (fs != NULL);
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
@ -1505,16 +1506,10 @@ gtk_file_selection_populate (GtkFileSelection *fs,
/* Set the dir_list to include ./ and ../ */
text[1] = NULL;
text[0] = "." G_DIR_SEPARATOR_S;
row = gtk_clist_append (GTK_CLIST (fs->dir_list), text);
gtk_clist_append (GTK_CLIST (fs->dir_list), text);
text[0] = ".." G_DIR_SEPARATOR_S;
row = gtk_clist_append (GTK_CLIST (fs->dir_list), text);
/*reset the max widths of the lists*/
dir_list_width = gdk_string_width(fs->dir_list->style->font,".." G_DIR_SEPARATOR_S);
gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,dir_list_width);
file_list_width = 1;
gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,file_list_width);
gtk_clist_append (GTK_CLIST (fs->dir_list), text);
while (poss)
{
@ -1530,29 +1525,11 @@ gtk_file_selection_populate (GtkFileSelection *fs,
{
if (strcmp (filename, "." G_DIR_SEPARATOR_S) != 0 &&
strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
{
int width = gdk_string_width(fs->dir_list->style->font,
filename);
row = gtk_clist_append (GTK_CLIST (fs->dir_list), text);
if(width > dir_list_width)
{
dir_list_width = width;
gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,
width);
}
}
gtk_clist_append (GTK_CLIST (fs->dir_list), text);
}
else
{
int width = gdk_string_width(fs->file_list->style->font,
filename);
row = gtk_clist_append (GTK_CLIST (fs->file_list), text);
if(width > file_list_width)
{
file_list_width = width;
gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,
width);
}
gtk_clist_append (GTK_CLIST (fs->file_list), text);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@
#include <gdk/gdk.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtknotebook.h>
#include <gtk/gtkvbox.h>
#ifdef __cplusplus
@ -63,64 +63,10 @@ typedef struct _GtkFontSelectionClass GtkFontSelectionClass;
typedef struct _GtkFontSelectionDialog GtkFontSelectionDialog;
typedef struct _GtkFontSelectionDialogClass GtkFontSelectionDialogClass;
/* This is the number of properties which we keep in the properties array,
i.e. Weight, Slant, Set Width, Spacing, Charset & Foundry. */
#define GTK_NUM_FONT_PROPERTIES 6
/* This is the number of properties each style has i.e. Weight, Slant,
Set Width, Spacing & Charset. Note that Foundry is not included,
since it is the same for all styles of the same FontInfo. */
#define GTK_NUM_STYLE_PROPERTIES 5
/* Used to determine whether we are using point or pixel sizes. */
typedef enum
{
GTK_FONT_METRIC_PIXELS,
GTK_FONT_METRIC_POINTS
} GtkFontMetricType;
/* Used for determining the type of a font style, and also for setting filters.
These can be combined if a style has bitmaps and scalable fonts available.*/
typedef enum
{
GTK_FONT_BITMAP = 1 << 0,
GTK_FONT_SCALABLE = 1 << 1,
GTK_FONT_SCALABLE_BITMAP = 1 << 2,
GTK_FONT_ALL = 0x07
} GtkFontType;
/* These are the two types of filter available - base and user. The base
filter is set by the application and can't be changed by the user. */
#define GTK_NUM_FONT_FILTERS 2
typedef enum
{
GTK_FONT_FILTER_BASE,
GTK_FONT_FILTER_USER
} GtkFontFilterType;
/* These hold the arrays of current filter settings for each property.
If nfilters is 0 then all values of the property are OK. If not the
filters array contains the indexes of the valid property values. */
typedef struct _GtkFontFilter GtkFontFilter;
struct _GtkFontFilter
{
gint font_type;
guint16 *property_filters[GTK_NUM_FONT_PROPERTIES];
guint16 property_nfilters[GTK_NUM_FONT_PROPERTIES];
};
struct _GtkFontSelection
{
GtkNotebook notebook;
GtkVBox parent_instance;
/* These are on the font page. */
GtkWidget *main_vbox;
GtkWidget *font_label;
GtkWidget *font_entry;
GtkWidget *font_clist;
@ -132,44 +78,17 @@ struct _GtkFontSelection
GtkWidget *points_button;
GtkWidget *filter_button;
GtkWidget *preview_entry;
GtkWidget *message_label;
/* These are on the font info page. */
GtkWidget *info_vbox;
GtkWidget *info_clist;
GtkWidget *requested_font_name;
GtkWidget *actual_font_name;
/* These are on the filter page. */
GtkWidget *filter_vbox;
GtkWidget *type_bitmaps_button;
GtkWidget *type_scalable_button;
GtkWidget *type_scaled_bitmaps_button;
GtkWidget *filter_clists[GTK_NUM_FONT_PROPERTIES];
GdkFont *font;
gint font_index;
gint style;
GtkFontMetricType metric;
/* The size is either in pixels or deci-points, depending on the metric. */
gint size;
/* This is the last size explicitly selected. When the user selects different
fonts we try to find the nearest size to this. */
gint selected_size;
/* These are the current property settings. They are indexes into the
strings in the GtkFontSelInfo properties array. */
guint16 property_values[GTK_NUM_STYLE_PROPERTIES];
/* These are the base and user font filters. */
GtkFontFilter filters[GTK_NUM_FONT_FILTERS];
};
PangoContext *context;
PangoFontDescription *font_desc;
GdkFont *font; /* Cache for gdk_font_selection_get_font, so we can preserve
* refcounting behavior
*/
};
struct _GtkFontSelectionClass
{
GtkNotebookClass parent_class;
GtkVBoxClass parent_class;
};
@ -209,15 +128,6 @@ gchar* gtk_font_selection_get_font_name (GtkFontSelection *fontsel);
GdkFont* gtk_font_selection_get_font (GtkFontSelection *fontsel);
gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
const gchar *fontname);
void gtk_font_selection_set_filter (GtkFontSelection *fontsel,
GtkFontFilterType filter_type,
GtkFontType font_type,
gchar **foundries,
gchar **weights,
gchar **slants,
gchar **setwidths,
gchar **spacings,
gchar **charsets);
gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
const gchar *text);
@ -252,38 +162,6 @@ GdkFont* gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd);
gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd,
const gchar *fontname);
/* This sets one of the font filters, to limit the fonts shown. The filter_type
is GTK_FONT_FILTER_BASE or GTK_FONT_FILTER_USER. The font type is a
combination of the bit flags GTK_FONT_BITMAP, GTK_FONT_SCALABLE and
GTK_FONT_SCALABLE_BITMAP (or GTK_FONT_ALL for all font types).
The foundries, weights etc. are arrays of strings containing property
values, e.g. 'bold', 'demibold', and *MUST* finish with a NULL.
Standard long names are also accepted, e.g. 'italic' instead of 'i'.
e.g. to allow only fixed-width fonts ('char cell' or 'monospaced') to be
selected use:
gchar *spacings[] = { "c", "m", NULL };
gtk_font_selection_dialog_set_filter (GTK_FONT_SELECTION_DIALOG (fontsel),
GTK_FONT_FILTER_BASE, GTK_FONT_ALL,
NULL, NULL, NULL, NULL, spacings, NULL);
to allow only true scalable fonts to be selected use:
gtk_font_selection_dialog_set_filter (GTK_FONT_SELECTION_DIALOG (fontsel),
GTK_FONT_FILTER_BASE, GTK_FONT_SCALABLE,
NULL, NULL, NULL, NULL, NULL, NULL);
*/
void gtk_font_selection_dialog_set_filter (GtkFontSelectionDialog *fsd,
GtkFontFilterType filter_type,
GtkFontType font_type,
gchar **foundries,
gchar **weights,
gchar **slants,
gchar **setwidths,
gchar **spacings,
gchar **charsets);
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);

View File

@ -26,6 +26,7 @@
#include <string.h>
#include "gtkframe.h"
#include "gtklabel.h"
enum {
ARG_0,
@ -44,7 +45,6 @@ static void gtk_frame_set_arg (GtkObject *object,
static void gtk_frame_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_frame_finalize (GObject *object);
static void gtk_frame_paint (GtkWidget *widget,
GdkRectangle *area);
static void gtk_frame_draw (GtkWidget *widget,
@ -55,9 +55,19 @@ static void gtk_frame_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_frame_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_frame_map (GtkWidget *widget);
static void gtk_frame_unmap (GtkWidget *widget);
static void gtk_frame_remove (GtkContainer *container,
GtkWidget *child);
static void gtk_frame_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static void gtk_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation);
static void gtk_frame_real_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation);
static GtkBinClass *parent_class = NULL;
@ -90,17 +100,16 @@ gtk_frame_get_type (void)
static void
gtk_frame_class_init (GtkFrameClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
object_class = GTK_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
container_class = GTK_CONTAINER_CLASS (class);
parent_class = gtk_type_class (gtk_bin_get_type ());
gobject_class->finalize = gtk_frame_finalize;
gtk_object_add_arg_type ("GtkFrame::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL);
gtk_object_add_arg_type ("GtkFrame::label_xalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_LABEL_XALIGN);
gtk_object_add_arg_type ("GtkFrame::label_yalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_LABEL_YALIGN);
@ -113,16 +122,20 @@ gtk_frame_class_init (GtkFrameClass *class)
widget_class->expose_event = gtk_frame_expose;
widget_class->size_request = gtk_frame_size_request;
widget_class->size_allocate = gtk_frame_size_allocate;
widget_class->style_set = gtk_frame_style_set;
widget_class->map = gtk_frame_map;
widget_class->unmap = gtk_frame_unmap;
container_class->remove = gtk_frame_remove;
container_class->forall = gtk_frame_forall;
class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
}
static void
gtk_frame_init (GtkFrame *frame)
{
frame->label = NULL;
frame->label_widget = NULL;
frame->shadow_type = GTK_SHADOW_ETCHED_IN;
frame->label_width = 0;
frame->label_height = 0;
frame->label_xalign = 0.0;
frame->label_yalign = 0.5;
}
@ -167,7 +180,7 @@ gtk_frame_get_arg (GtkObject *object,
switch (arg_id)
{
case ARG_LABEL:
GTK_VALUE_STRING (*arg) = g_strdup (frame->label);
GTK_VALUE_STRING (*arg) = gtk_frame_get_label (frame);
break;
case ARG_LABEL_XALIGN:
GTK_VALUE_FLOAT (*arg) = frame->label_xalign;
@ -197,22 +210,31 @@ gtk_frame_new (const gchar *label)
}
static void
gtk_frame_style_set (GtkWidget *widget,
GtkStyle *previous_style)
gtk_frame_remove (GtkContainer *container,
GtkWidget *child)
{
GtkFrame *frame;
GtkFrame *frame = GTK_FRAME (container);
frame = GTK_FRAME (widget);
if (frame->label_widget == child)
gtk_frame_set_label_widget (frame, NULL);
else
GTK_CONTAINER_CLASS (parent_class)->remove (container, child);
}
if (frame->label)
{
frame->label_width = gdk_string_measure (GTK_WIDGET (frame)->style->font, frame->label) + 7;
frame->label_height = (GTK_WIDGET (frame)->style->font->ascent +
GTK_WIDGET (frame)->style->font->descent + 1);
}
static void
gtk_frame_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data)
{
GtkBin *bin = GTK_BIN (container);
GtkFrame *frame = GTK_FRAME (container);
if (GTK_WIDGET_CLASS (parent_class)->style_set)
GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
if (bin->child)
(* callback) (bin->child, callback_data);
if (frame->label_widget)
(* callback) (frame->label_widget, callback_data);
}
void
@ -222,43 +244,84 @@ gtk_frame_set_label (GtkFrame *frame,
g_return_if_fail (frame != NULL);
g_return_if_fail (GTK_IS_FRAME (frame));
if ((label && frame->label && (strcmp (frame->label, label) == 0)) ||
(!label && !frame->label))
return;
if (frame->label)
g_free (frame->label);
frame->label = NULL;
if (label)
if (!label)
{
frame->label = g_strdup (label);
frame->label_width = gdk_string_measure (GTK_WIDGET (frame)->style->font, frame->label) + 7;
frame->label_height = (GTK_WIDGET (frame)->style->font->ascent +
GTK_WIDGET (frame)->style->font->descent + 1);
gtk_frame_set_label_widget (frame, NULL);
}
else
{
frame->label_width = 0;
frame->label_height = 0;
GtkWidget *child = gtk_label_new (label);
gtk_widget_show (child);
gtk_frame_set_label_widget (frame, child);
}
}
if (GTK_WIDGET_DRAWABLE (frame))
{
GtkWidget *widget;
/**
* gtk_frame_get_label:
* @frame: a #GtkFrame
*
* If the frame's label widget is a #GtkLabel, return the
* text in the label widget. (The frame will have a #GtkLabel
* for the label widget if a non-%NULL argument was passed
* to gtk_frame_new().)
*
* Return value: the text in the label, or %NULL if there
* was no label widget or the lable widget was not
* a #GtkLabel. This value must be freed with g_free().
**/
gchar *
gtk_frame_get_label (GtkFrame *frame)
{
g_return_val_if_fail (frame != NULL, NULL);
g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
/* clear the old label area
*/
widget = GTK_WIDGET (frame);
gtk_widget_queue_clear_area (widget,
widget->allocation.x + GTK_CONTAINER (frame)->border_width,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
widget->allocation.width - GTK_CONTAINER (frame)->border_width,
widget->allocation.y + frame->label_height);
if (frame->label_widget && GTK_IS_LABEL (frame->label_widget))
return gtk_label_get_text (GTK_LABEL (frame->label_widget));
else
return NULL;
}
}
/**
* gtk_frame_set_label_widget:
* @frame: a #GtkFrame
* @label_widget: the new label widget
*
* Set the label widget for the frame. This is the widget that
* will appear embedded in the top edge of the frame as a
* title.
**/
void
gtk_frame_set_label_widget (GtkFrame *frame,
GtkWidget *label_widget)
{
gboolean need_resize = FALSE;
gtk_widget_queue_resize (GTK_WIDGET (frame));
g_return_if_fail (frame != NULL);
g_return_if_fail (GTK_IS_FRAME (frame));
g_return_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget));
g_return_if_fail (label_widget == NULL || label_widget->parent == NULL);
if (frame->label_widget == label_widget)
return;
if (frame->label_widget)
{
need_resize = GTK_WIDGET_VISIBLE (frame->label_widget);
gtk_widget_unparent (frame->label_widget);
}
frame->label_widget = label_widget;
if (label_widget)
{
frame->label_widget = label_widget;
gtk_widget_set_parent (label_widget, GTK_WIDGET (frame));
need_resize |= GTK_WIDGET_VISIBLE (label_widget);
}
if (GTK_WIDGET_VISIBLE (frame) && need_resize)
gtk_widget_queue_resize (GTK_WIDGET (frame));
}
void
@ -277,20 +340,6 @@ gtk_frame_set_label_align (GtkFrame *frame,
frame->label_xalign = xalign;
frame->label_yalign = yalign;
if (GTK_WIDGET_DRAWABLE (frame))
{
GtkWidget *widget;
/* clear the old label area
*/
widget = GTK_WIDGET (frame);
gtk_widget_queue_clear_area (widget,
widget->allocation.x + GTK_CONTAINER (frame)->border_width,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
widget->allocation.width - GTK_CONTAINER (frame)->border_width,
widget->allocation.y + frame->label_height);
}
gtk_widget_queue_resize (GTK_WIDGET (frame));
}
}
@ -314,79 +363,54 @@ gtk_frame_set_shadow_type (GtkFrame *frame,
}
}
static void
gtk_frame_finalize (GObject *object)
{
GtkFrame *frame;
g_return_if_fail (GTK_IS_FRAME (object));
frame = GTK_FRAME (object);
if (frame->label)
g_free (frame->label);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gtk_frame_paint (GtkWidget *widget,
GdkRectangle *area)
{
GtkFrame *frame;
gint height_extra;
gint label_area_width;
gint x, y, x2, y2;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_FRAME (widget));
g_return_if_fail (area != NULL);
gint x, y, width, height;
if (GTK_WIDGET_DRAWABLE (widget))
{
frame = GTK_FRAME (widget);
height_extra = frame->label_height - widget->style->klass->xthickness;
height_extra = MAX (height_extra, 0);
x = frame->child_allocation.x - widget->style->klass->xthickness;
y = frame->child_allocation.y - widget->style->klass->ythickness;
width = frame->child_allocation.width + 2 * widget->style->klass->xthickness;
height = frame->child_allocation.height + 2 * widget->style->klass->ythickness;
x = GTK_CONTAINER (frame)->border_width;
y = GTK_CONTAINER (frame)->border_width;
if (frame->label)
if (frame->label_widget)
{
label_area_width = (widget->allocation.width -
GTK_CONTAINER (frame)->border_width * 2 -
widget->style->klass->xthickness * 2);
x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
GtkRequisition child_requisition;
gfloat xalign;
gint height_extra;
gint x2;
gtk_paint_shadow_gap (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
widget->allocation.x + x,
widget->allocation.y + y + height_extra / 2,
widget->allocation.width - x * 2,
widget->allocation.height - y * 2 - height_extra / 2,
GTK_POS_TOP,
x2 + 2 - x, frame->label_width - 4);
gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
area, widget, "frame",
widget->allocation.x + x2 + 3,
widget->allocation.y + y2,
frame->label);
gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
xalign = frame->label_xalign;
else
xalign = 1 - frame->label_xalign;
height_extra = MAX (0, child_requisition.height - widget->style->klass->xthickness);
y -= height_extra * (1 - frame->label_yalign);
height += height_extra * (1 - frame->label_yalign);
x2 = 2 + (frame->child_allocation.width - child_requisition.width) * xalign;
gtk_paint_shadow_gap (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
x, y, width, height,
GTK_POS_TOP,
x2, child_requisition.width - 4);
}
else
gtk_paint_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
widget->allocation.x + x,
widget->allocation.y + y + height_extra / 2,
widget->allocation.width - x * 2,
widget->allocation.height - y * 2 - height_extra / 2);
x, y, width, height);
}
}
@ -394,46 +418,47 @@ static void
gtk_frame_draw (GtkWidget *widget,
GdkRectangle *area)
{
GtkBin *bin;
GtkBin *bin = GTK_BIN (widget);
GtkFrame *frame = GTK_FRAME (widget);
GdkRectangle child_area;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_FRAME (widget));
g_return_if_fail (area != NULL);
if (GTK_WIDGET_DRAWABLE (widget))
{
bin = GTK_BIN (widget);
gtk_frame_paint (widget, area);
if (bin->child && gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
if (frame->label_widget && gtk_widget_intersect (frame->label_widget, area, &child_area))
gtk_widget_draw (frame->label_widget, &child_area);
}
}
static gint
static gboolean
gtk_frame_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkBin *bin;
GtkBin *bin = GTK_BIN (widget);
GtkFrame *frame = GTK_FRAME (widget);
GdkEventExpose child_event;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_FRAME (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
bin = GTK_BIN (widget);
gtk_frame_paint (widget, &event->area);
child_event = *event;
if (bin->child &&
GTK_WIDGET_NO_WINDOW (bin->child) &&
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child))
{
child_event = *event;
if (gtk_widget_intersect (bin->child, &event->area, &child_event.area))
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
}
if (frame->label_widget && GTK_WIDGET_NO_WINDOW (frame->label_widget))
{
child_event = *event;
if (gtk_widget_intersect (frame->label_widget, &event->area, &child_event.area))
gtk_widget_event (frame->label_widget, (GdkEvent*) &child_event);
}
}
return FALSE;
@ -443,82 +468,154 @@ static void
gtk_frame_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkFrame *frame;
GtkBin *bin;
gint tmp_height;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_FRAME (widget));
g_return_if_fail (requisition != NULL);
frame = GTK_FRAME (widget);
bin = GTK_BIN (widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->xthickness) * 2;
tmp_height = frame->label_height - GTK_WIDGET (widget)->style->klass->ythickness;
tmp_height = MAX (tmp_height, 0);
requisition->height = tmp_height + (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->ythickness) * 2;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
GtkFrame *frame = GTK_FRAME (widget);
GtkBin *bin = GTK_BIN (widget);
GtkRequisition child_requisition;
if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
{
GtkRequisition child_requisition;
gtk_widget_size_request (bin->child, &child_requisition);
gtk_widget_size_request (frame->label_widget, &child_requisition);
requisition->width += MAX (child_requisition.width, frame->label_width);
requisition->height += child_requisition.height;
requisition->width = child_requisition.width;
requisition->height =
MAX (0, child_requisition.height - GTK_WIDGET (widget)->style->klass->xthickness);
}
else
{
requisition->width += frame->label_width;
requisition->width = 0;
requisition->height = 0;
}
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width = MAX (requisition->width, child_requisition.width);
requisition->height += child_requisition.height;
}
requisition->width += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->xthickness) * 2;
requisition->height += (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->xthickness) * 2;
}
static void
gtk_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkFrame *frame;
GtkBin *bin;
GtkAllocation child_allocation;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_FRAME (widget));
g_return_if_fail (allocation != NULL);
frame = GTK_FRAME (widget);
bin = GTK_BIN (widget);
if (GTK_WIDGET_MAPPED (widget) &&
((widget->allocation.x != allocation->x) ||
(widget->allocation.y != allocation->y) ||
(widget->allocation.width != allocation->width) ||
(widget->allocation.height != allocation->height)) &&
(widget->allocation.width != 0) &&
(widget->allocation.height != 0))
gtk_widget_queue_clear (widget);
GtkFrame *frame = GTK_FRAME (widget);
GtkBin *bin = GTK_BIN (widget);
widget->allocation = *allocation;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
child_allocation.x = (GTK_CONTAINER (frame)->border_width +
GTK_WIDGET (frame)->style->klass->xthickness);
child_allocation.width = MAX(1, (gint)allocation->width - child_allocation.x * 2);
GtkAllocation new_allocation;
gtk_frame_compute_child_allocation (frame, &new_allocation);
child_allocation.y = (GTK_CONTAINER (frame)->border_width +
MAX (frame->label_height, GTK_WIDGET (frame)->style->klass->ythickness));
child_allocation.height = MAX (1, ((gint)allocation->height - child_allocation.y -
(gint)GTK_CONTAINER (frame)->border_width -
(gint)GTK_WIDGET (frame)->style->klass->ythickness));
/* If the child allocation changed, that means that the frame is drawn
* in a new place, so we must redraw the entire widget.
*/
if (GTK_WIDGET_MAPPED (widget) &&
(new_allocation.x != frame->child_allocation.x ||
new_allocation.y != frame->child_allocation.y ||
new_allocation.width != frame->child_allocation.width ||
new_allocation.height != frame->child_allocation.height))
gtk_widget_queue_clear (widget);
gtk_widget_size_allocate (bin->child, &new_allocation);
frame->child_allocation = new_allocation;
}
child_allocation.x += allocation->x;
child_allocation.y += allocation->y;
if (frame->label_widget && GTK_WIDGET_VISIBLE (frame->label_widget))
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
gfloat xalign;
gtk_widget_size_allocate (bin->child, &child_allocation);
gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
xalign = frame->label_xalign;
else
xalign = 1 - frame->label_xalign;
child_allocation.x = frame->child_allocation.x +
(frame->child_allocation.width - child_requisition.width) * xalign;
child_allocation.width = child_requisition.width;
child_allocation.y = frame->child_allocation.y - child_requisition.height;
child_allocation.height = child_requisition.height;
gtk_widget_size_allocate (frame->label_widget, &child_allocation);
}
}
static void
gtk_frame_map (GtkWidget *widget)
{
GtkFrame *frame = GTK_FRAME (widget);
if (frame->label_widget &&
GTK_WIDGET_VISIBLE (frame->label_widget) &&
!GTK_WIDGET_MAPPED (frame->label_widget))
gtk_widget_map (frame->label_widget);
if (GTK_WIDGET_CLASS (parent_class)->map)
(* GTK_WIDGET_CLASS (parent_class)->map) (widget);
}
static void
gtk_frame_unmap (GtkWidget *widget)
{
GtkFrame *frame = GTK_FRAME (widget);
if (GTK_WIDGET_CLASS (parent_class)->unmap)
(* GTK_WIDGET_CLASS (parent_class)->unmap) (widget);
if (frame->label_widget && GTK_WIDGET_MAPPED (frame->label_widget))
gtk_widget_unmap (frame->label_widget);
}
static void
gtk_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation)
{
g_return_if_fail (frame != NULL);
g_return_if_fail (GTK_IS_FRAME (frame));
g_return_if_fail (child_allocation != NULL);
GTK_FRAME_GET_CLASS (frame)->compute_child_allocation (frame, child_allocation);
}
static void
gtk_frame_real_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation)
{
GtkWidget *widget = GTK_WIDGET (frame);
GtkAllocation *allocation = &widget->allocation;
GtkRequisition child_requisition;
gint top_margin;
if (frame->label_widget)
{
gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
top_margin = MAX (child_requisition.height, widget->style->klass->ythickness);
}
else
top_margin = widget->style->klass->ythickness;
child_allocation->x = (GTK_CONTAINER (frame)->border_width +
widget->style->klass->xthickness);
child_allocation->width = MAX(1, (gint)allocation->width - child_allocation->x * 2);
child_allocation->y = (GTK_CONTAINER (frame)->border_width + top_margin);
child_allocation->height = MAX (1, ((gint)allocation->height - child_allocation->y -
(gint)GTK_CONTAINER (frame)->border_width -
(gint)widget->style->klass->ythickness));
child_allocation->x += allocation->x;
child_allocation->y += allocation->y;
}

View File

@ -51,31 +51,35 @@ typedef struct _GtkFrameClass GtkFrameClass;
struct _GtkFrame
{
GtkBin bin;
gchar *label;
GtkWidget *label_widget;
gint16 shadow_type;
gint16 label_width;
gint16 label_height;
gfloat label_xalign;
gfloat label_yalign;
GtkAllocation child_allocation;
};
struct _GtkFrameClass
{
GtkBinClass parent_class;
void (*compute_child_allocation) (GtkFrame *frame, GtkAllocation *allocation);
};
GtkType gtk_frame_get_type (void);
GtkWidget* gtk_frame_new (const gchar *label);
void gtk_frame_set_label (GtkFrame *frame,
const gchar *label);
void gtk_frame_set_label_align (GtkFrame *frame,
gfloat xalign,
gfloat yalign);
void gtk_frame_set_shadow_type (GtkFrame *frame,
GtkShadowType type);
GtkType gtk_frame_get_type (void);
GtkWidget* gtk_frame_new (const gchar *label);
void gtk_frame_set_label (GtkFrame *frame,
const gchar *label);
gchar * gtk_frame_get_label (GtkFrame *frame);
void gtk_frame_set_label_widget (GtkFrame *frame,
GtkWidget *title_widget);
void gtk_frame_set_label_align (GtkFrame *frame,
gfloat xalign,
gfloat yalign);
void gtk_frame_set_shadow_type (GtkFrame *frame,
GtkShadowType type);
#ifdef __cplusplus
}

View File

@ -272,8 +272,14 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget,
{
child_allocation.width = child_width;
child_allocation.height = child_height;
child_allocation.x = x;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
child_allocation.x = x;
else
child_allocation.x = allocation->x + allocation->width - (x - allocation->x + child_width);
child_allocation.y = y;
gtk_widget_size_allocate (child->widget, &child_allocation);
x += childspace;
}

View File

@ -163,6 +163,7 @@ gtk_hbox_size_allocate (GtkWidget *widget,
gint width;
gint extra;
gint x;
GtkTextDirection direction;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_HBOX (widget));
@ -171,6 +172,8 @@ gtk_hbox_size_allocate (GtkWidget *widget,
box = GTK_BOX (widget);
widget->allocation = *allocation;
direction = gtk_widget_get_direction (widget);
nvis_children = 0;
nexpand_children = 0;
children = box->children;
@ -264,6 +267,9 @@ gtk_hbox_size_allocate (GtkWidget *widget,
child_allocation.x = x + (child_width - child_allocation.width) / 2;
}
if (direction == GTK_TEXT_DIR_RTL)
child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
gtk_widget_size_allocate (child->widget, &child_allocation);
x += child_width + box->spacing;
@ -320,6 +326,9 @@ gtk_hbox_size_allocate (GtkWidget *widget,
child_allocation.x = x + (child_width - child_allocation.width) / 2 - child_width;
}
if (direction == GTK_TEXT_DIR_RTL)
child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
gtk_widget_size_allocate (child->widget, &child_allocation);
x -= (child_width + box->spacing);

View File

@ -148,8 +148,11 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
gfloat start, end, cur;
gchar unit_str[32];
gint digit_height;
gint digit_offset;
gint text_width;
gint pos;
PangoLayout *layout;
PangoRectangle logical_rect, ink_rect;
g_return_if_fail (ruler != NULL);
g_return_if_fail (GTK_IS_HRULER (ruler));
@ -165,20 +168,28 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
xthickness = widget->style->klass->xthickness;
ythickness = widget->style->klass->ythickness;
digit_height = font->ascent; /* assume descent == 0 ? */
digit_height = ink_rect.height / PANGO_SCALE + 2;
digit_offset = ink_rect.y;
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, "012456789", -1);
pango_layout_get_extents (layout, &ink_rect, &logical_rect);
digit_height = ink_rect.height / PANGO_SCALE + 1;
digit_offset = ink_rect.y;
width = widget->allocation.width;
height = widget->allocation.height - ythickness * 2;
gtk_paint_box (widget->style, ruler->backing_store,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, widget, "hruler",
0, 0,
widget->allocation.width, widget->allocation.height);
gdk_draw_line (ruler->backing_store, gc,
gtk_paint_box (widget->style, ruler->backing_store,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, widget, "hruler",
0, 0,
widget->allocation.width, widget->allocation.height);
gdk_draw_line (ruler->backing_store, gc,
xthickness,
height + ythickness,
widget->allocation.width - xthickness,
@ -247,12 +258,18 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
if (i == 0)
{
sprintf (unit_str, "%d", (int) cur);
gdk_draw_string (ruler->backing_store, font, gc,
pos + 2, ythickness + font->ascent - 1,
unit_str);
pango_layout_set_text (layout, unit_str, -1);
pango_layout_get_extents (layout, &logical_rect, NULL);
gdk_draw_layout (ruler->backing_store, gc,
pos + 2, ythickness + (logical_rect.y - digit_offset) / PANGO_SCALE,
layout);
}
}
}
pango_layout_unref (layout);
}
static void

View File

@ -29,7 +29,6 @@
#include "gtksignal.h"
#include "gdk/gdkkeysyms.h"
#define SCALE_CLASS(w) GTK_SCALE_GET_CLASS (w)
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
@ -314,7 +313,6 @@ gtk_hscale_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkScale *scale;
gint value_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_HSCALE (widget));
@ -326,24 +324,25 @@ gtk_hscale_size_request (GtkWidget *widget,
widget->style->klass->xthickness) * 2;
requisition->height = (RANGE_CLASS (scale)->slider_width +
widget->style->klass->ythickness * 2);
if (scale->draw_value)
{
value_width = gtk_scale_get_value_width (scale);
gint value_width, value_height;
gtk_scale_get_value_size (scale, &value_width, &value_height);
if ((scale->value_pos == GTK_POS_LEFT) ||
(scale->value_pos == GTK_POS_RIGHT))
{
requisition->width += value_width + SCALE_CLASS (scale)->value_spacing;
if (requisition->height < (widget->style->font->ascent + widget->style->font->descent))
requisition->height = widget->style->font->ascent + widget->style->font->descent;
if (requisition->height < value_height)
requisition->height = value_height;
}
else if ((scale->value_pos == GTK_POS_TOP) ||
(scale->value_pos == GTK_POS_BOTTOM))
{
if (requisition->width < value_width)
requisition->width = value_width;
requisition->height += widget->style->font->ascent + widget->style->font->descent;
requisition->height += value_height;
}
}
}
@ -398,23 +397,25 @@ gtk_hscale_pos_trough (GtkHScale *hscale,
if (scale->draw_value)
{
gint value_width, value_height;
gtk_scale_get_value_size (scale, &value_width, &value_height);
*x = 0;
*y = 0;
switch (scale->value_pos)
{
case GTK_POS_LEFT:
*x += gtk_scale_get_value_width (scale) + SCALE_CLASS (scale)->value_spacing;
*x += value_width + SCALE_CLASS (scale)->value_spacing;
*y = (widget->allocation.height - *h) / 2;
*w -= *x;
break;
case GTK_POS_RIGHT:
*w -= gtk_scale_get_value_width (scale) + SCALE_CLASS (scale)->value_spacing;
*w -= value_width + SCALE_CLASS (scale)->value_spacing;
*y = (widget->allocation.height - *h) / 2;
break;
case GTK_POS_TOP:
*y = (widget->style->font->ascent + widget->style->font->descent +
(widget->allocation.height - widget->requisition.height) / 2);
*y = (value_height + (widget->allocation.height - widget->requisition.height) / 2);
break;
case GTK_POS_BOTTOM:
*y = (widget->allocation.height - widget->requisition.height) / 2;
@ -510,7 +511,6 @@ gtk_hscale_draw_value (GtkScale *scale)
GtkStateType state_type;
GtkWidget *widget;
gchar buffer[32];
gint text_width;
gint width, height;
gint x, y;
@ -521,30 +521,30 @@ gtk_hscale_draw_value (GtkScale *scale)
if (scale->draw_value)
{
sprintf (buffer, "%0.*f", GTK_RANGE (scale)->digits, GTK_RANGE (scale)->adjustment->value);
text_width = gdk_string_measure (GTK_WIDGET (scale)->style->font, buffer);
PangoLayout *layout;
PangoRectangle logical_rect;
sprintf (buffer, "%0.*f", GTK_RANGE (scale)->digits, GTK_RANGE (scale)->adjustment->value);
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, buffer, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
switch (scale->value_pos)
{
case GTK_POS_LEFT:
gdk_window_get_position (GTK_RANGE (scale)->trough, &x, &y);
gdk_window_get_size (GTK_RANGE (scale)->trough, &width, &height);
x -= SCALE_CLASS (scale)->value_spacing + text_width;
y += ((height -
(GTK_WIDGET (scale)->style->font->ascent +
GTK_WIDGET (scale)->style->font->descent)) / 2 +
GTK_WIDGET (scale)->style->font->ascent);
x -= SCALE_CLASS (scale)->value_spacing + logical_rect.width / PANGO_SCALE;
y += (height - logical_rect.height / PANGO_SCALE) / 2;
break;
case GTK_POS_RIGHT:
gdk_window_get_position (GTK_RANGE (scale)->trough, &x, &y);
gdk_window_get_size (GTK_RANGE (scale)->trough, &width, &height);
x += width + SCALE_CLASS (scale)->value_spacing;
y += ((height -
(GTK_WIDGET (scale)->style->font->ascent +
GTK_WIDGET (scale)->style->font->descent)) / 2 +
GTK_WIDGET (scale)->style->font->ascent);
y += (height - logical_rect.height / PANGO_SCALE) / 2;
break;
case GTK_POS_TOP:
gdk_window_get_position (GTK_RANGE (scale)->slider, &x, NULL);
@ -552,10 +552,10 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
x += widget->allocation.x + (width - text_width) / 2;
x += widget->allocation.x + (width - logical_rect.width / PANGO_SCALE) / 2;
x = CLAMP (x, widget->allocation.x,
widget->allocation.x + widget->allocation.width - text_width);
y -= GTK_WIDGET (scale)->style->font->descent;
widget->allocation.x + widget->allocation.width - logical_rect.width / PANGO_SCALE);
y -= logical_rect.height / PANGO_SCALE;
break;
case GTK_POS_BOTTOM:
gdk_window_get_position (GTK_RANGE (scale)->slider, &x, NULL);
@ -563,22 +563,30 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
x += widget->allocation.x + (width - text_width) / 2;
x += widget->allocation.x + (width - logical_rect.width / PANGO_SCALE) / 2;
x = CLAMP (x, widget->allocation.x,
widget->allocation.x + widget->allocation.width - text_width);
y += height + GTK_WIDGET (scale)->style->font->ascent;
widget->allocation.x + widget->allocation.width - logical_rect.width / PANGO_SCALE);
y += height;
break;
}
state_type = GTK_STATE_NORMAL;
if (!GTK_WIDGET_IS_SENSITIVE (scale))
state_type = GTK_STATE_INSENSITIVE;
#if 0
gtk_paint_string (GTK_WIDGET (scale)->style,
GTK_WIDGET (scale)->window,
state_type,
NULL, GTK_WIDGET (scale), "hscale",
x, y, buffer);
#endif
gdk_draw_layout (GTK_WIDGET (scale)->window,
GTK_WIDGET (scale)->style->fg_gc [state_type],
x, y, layout);
pango_layout_unref (layout);
}
}

View File

@ -418,7 +418,10 @@ gtk_hscrollbar_calc_slider_size (GtkHScrollbar *hscrollbar)
gdk_window_get_size (range->slider, &slider_width, &slider_height);
if (slider_width != width)
gdk_window_resize (range->slider, width, slider_height);
{
gdk_window_resize (range->slider, width, slider_height);
gdk_window_invalidate_rect (range->slider, NULL, FALSE);
}
}
}

259
gtk/gtkimcontext.c Normal file
View File

@ -0,0 +1,259 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat, 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.
*/
#include "gtkimcontext.h"
#include "gtksignal.h"
enum {
PREEDIT_START,
PREEDIT_END,
PREEDIT_CHANGED,
COMMIT,
LAST_SIGNAL
};
static guint im_context_signals[LAST_SIGNAL] = { 0 };
static void gtk_im_context_class_init (GtkIMContextClass *class);
static void gtk_im_context_init (GtkIMContext *im_context);
static void gtk_im_context_real_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs);
static gboolean gtk_im_context_real_filter_keypress (GtkIMContext *context,
GdkEventKey *event);
GtkType
gtk_im_context_get_type (void)
{
static GtkType im_context_type = 0;
if (!im_context_type)
{
static const GtkTypeInfo im_context_info =
{
"GtkIMContext",
sizeof (GtkIMContext),
sizeof (GtkIMContextClass),
(GtkClassInitFunc) gtk_im_context_class_init,
(GtkObjectInitFunc) gtk_im_context_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
im_context_type = gtk_type_unique (GTK_TYPE_OBJECT, &im_context_info);
}
return im_context_type;
}
static void
gtk_im_context_class_init (GtkIMContextClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) klass;
im_context_signals[PREEDIT_START] =
gtk_signal_new ("preedit_start",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkIMContextClass, preedit_start),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
im_context_signals[PREEDIT_END] =
gtk_signal_new ("preedit_end",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkIMContextClass, preedit_end),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
im_context_signals[PREEDIT_CHANGED] =
gtk_signal_new ("preedit_changed",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkIMContextClass, preedit_changed),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
im_context_signals[COMMIT] =
gtk_signal_new ("commit",
GTK_RUN_LAST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkIMContextClass, commit),
gtk_marshal_NONE__STRING,
GTK_TYPE_NONE, 1,
GTK_TYPE_STRING);
klass->get_preedit_string = gtk_im_context_real_get_preedit_string;
klass->filter_keypress = gtk_im_context_real_filter_keypress;
gtk_object_class_add_signals (object_class, im_context_signals, LAST_SIGNAL);
}
static void
gtk_im_context_init (GtkIMContext *im_context)
{
}
static void
gtk_im_context_real_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs)
{
if (str)
*str = g_strdup ("");
if (attrs)
*attrs = pango_attr_list_new ();
}
static gboolean
gtk_im_context_real_filter_keypress (GtkIMContext *context,
GdkEventKey *event)
{
return FALSE;
}
/**
* gtk_im_context_set_client_window:
* @context: a #GtkIMContext
* @window: the client window. This may be %NULL to indicate
* that the previous client window no longer exists.
*
* Set the client window for the input context; this is the
* #GdkWindow in which the input appears. This window is
* used in order to correctly position status windows, and may
* also be used for purposes internal to the input method.
**/
void
gtk_im_context_set_client_window (GtkIMContext *context,
GdkWindow *window)
{
GtkIMContextClass *klass;
g_return_if_fail (context != NULL);
g_return_if_fail (GTK_IS_IM_CONTEXT (context));
klass = GTK_IM_CONTEXT_GET_CLASS (context);
if (klass->set_client_window)
klass->set_client_window (context, window);
}
/**
* gtk_im_context_get_preedit_string:
* @context: a #GtkIMContext
* @str: location to store the retrieved string. The
* string retrieved must be freed with g_free ().
* @attrs: location to store the retrieved attribute list.
* When you are done with this list, you must
* unreference it with pango_attr_list_unref().
*
* Retrieve the current preedit string for the input context,
* and a list of attributes to apply to the string.
* This string should be displayed inserted at the insertion
* point.
**/
void
gtk_im_context_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs)
{
GtkIMContextClass *klass;
g_return_if_fail (context != NULL);
g_return_if_fail (GTK_IS_IM_CONTEXT (context));
klass = GTK_IM_CONTEXT_GET_CLASS (context);
klass->get_preedit_string (context, str, attrs);
}
/**
* gtk_im_context_filter_keypress:
* @context: a #GtkIMContext
* @key: the key event
*
* Allow an input method to internally handle a key press event.
* if this function returns %TRUE, then no further processing
* should be done for this keystroke.
*
* Return value: %TRUE if the input method handled the keystroke.
*
**/
gboolean
gtk_im_context_filter_keypress (GtkIMContext *context,
GdkEventKey *key)
{
GtkIMContextClass *klass;
g_return_val_if_fail (context != NULL, FALSE);
g_return_val_if_fail (GTK_IS_IM_CONTEXT (context), FALSE);
g_return_val_if_fail (key != NULL, FALSE);
klass = GTK_IM_CONTEXT_GET_CLASS (context);
return klass->filter_keypress (context, key);
}
/**
* gtk_im_context_focus_in:
* @context: a #GtkIMContext
*
* Notify the input method that the widget to which this
* input context corresponds has lost gained. The input method
* may, for example, change the displayed feedback to reflect
* this change.
**/
void
gtk_im_context_focus_in (GtkIMContext *context)
{
GtkIMContextClass *klass;
g_return_if_fail (context != NULL);
g_return_if_fail (GTK_IS_IM_CONTEXT (context));
klass = GTK_IM_CONTEXT_GET_CLASS (context);
if (klass->focus_in)
klass->focus_in (context);
}
/**
* gtk_im_context_focus_in:
* @context: a #GtkIMContext
*
* Notify the input method that the widget to which this
* input context corresponds has lost focus. The input method
* may, for example, change the displayed feedback or reset the contexts
* state to reflect this change.
**/
void
gtk_im_context_focus_out (GtkIMContext *context)
{
GtkIMContextClass *klass;
g_return_if_fail (context != NULL);
g_return_if_fail (GTK_IS_IM_CONTEXT (context));
klass = GTK_IM_CONTEXT_GET_CLASS (context);
if (klass->focus_out)
klass->focus_out (context);
}

87
gtk/gtkimcontext.h Normal file
View File

@ -0,0 +1,87 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat Software
*
* 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.
*/
#ifndef __GTK_IM_CONTEXT_H__
#define __GTK_IM_CONTEXT_H__
#include <gdk/gdk.h>
#include <gtk/gtkobject.h>
#include <pango/pango.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_IM_CONTEXT (gtk_im_context_get_type ())
#define GTK_IM_CONTEXT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContext))
#define GTK_IM_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
#define GTK_IS_IM_CONTEXT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IM_CONTEXT))
#define GTK_IS_IM_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT))
#define GTK_IM_CONTEXT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
typedef struct _GtkIMContext GtkIMContext;
typedef struct _GtkIMContextClass GtkIMContextClass;
struct _GtkIMContext
{
GtkObject object;
};
struct _GtkIMContextClass
{
GtkObjectClass parent_class;
/* Signals */
void (*preedit_start) (GtkIMContext *context);
void (*preedit_end) (GtkIMContext *context);
void (*preedit_changed) (GtkIMContext *context);
void (*commit) (GtkIMContext *context, const gchar *str);
/* Virtual functions */
void (*set_client_window) (GtkIMContext *context,
GdkWindow *window);
void (*get_preedit_string) (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs);
gboolean (*filter_keypress) (GtkIMContext *context,
GdkEventKey *event);
void (*focus_in) (GtkIMContext *context);
void (*focus_out) (GtkIMContext *context);
};
GtkType gtk_im_context_get_type (void);
void gtk_im_context_set_client_window (GtkIMContext *context,
GdkWindow *window);
void gtk_im_context_get_preedit_string (GtkIMContext *context,
char **str,
PangoAttrList **attrs);
gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
GdkEventKey *event);
void gtk_im_context_focus_in (GtkIMContext *context);
void gtk_im_context_focus_out (GtkIMContext *context);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_IM_CONTEXT_H__ */

932
gtk/gtkimcontextsimple.c Normal file
View File

@ -0,0 +1,932 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat, 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.
*/
#include <unicode.h>
#include <gdk/gdkkeysyms.h>
#include "gtksignal.h"
#include "gtkimcontextsimple.h"
typedef struct _GtkComposeSeq GtkComposeSeq;
struct _GtkComposeSeq
{
guint16 keysyms[GTK_MAX_COMPOSE_LEN];
guint16 unicode;
};
/* The following table was generated from the X compose tables include with
* XFree86 4.0 using a set of Perl scripts. Contact Owen Taylor <otaylor@redhat.com>
* to obtain the relevant perl scripts.
*
* The following compose letter letter sequences confliced
* Dstroke/dstroke and ETH/eth; resolved to Dstroke (Croation, Vietnamese, Lappish), over
* ETH (Icelandic, Faroese, old English, IPA) [ D- -D d- -d ]
* Amacron/amacron and ordfeminine; resolved to ordfeminine [ _A A_ a_ _a ]
* Amacron/amacron and Atilde/atilde; resolved to atilde [ -A A- a- -a ]
* Omacron/Omacron and masculine; resolved to masculine [ _A A_ a_ _a ]
* Omacron/omacron and Otilde/atilde; resolved to otilde [ -O O- o- -o ]
*
* [ Amacron and Omacron are in Latin-4 (Baltic). ordfeminine and masculine are used for
* spanish. atilde and otilde are used at least for Portuguese ]
*
* at and Aring; resolved to Aring [ AA ]
* guillemotleft and caron; resolved to guillemotleft [ << ]
* ogonek and cedilla; resolved to cedilla [ ,, ]
*
* This probably should be resolved by first checking an additional set of compose tables
* that depend on the locale or selected input method.
*/
GtkComposeSeq gtk_compose_seqs[] = {
{ { GDK_dead_grave, GDK_space, 0, 0 }, 0x0060 }, /* GRAVE_ACCENT */
{ { GDK_dead_grave, GDK_A, 0, 0 }, 0x00C0 }, /* LATIN_CAPITAL_LETTER_A_WITH_GRAVE */
{ { GDK_dead_grave, GDK_E, 0, 0 }, 0x00C8 }, /* LATIN_CAPITAL_LETTER_E_WITH_GRAVE */
{ { GDK_dead_grave, GDK_I, 0, 0 }, 0x00CC }, /* LATIN_CAPITAL_LETTER_I_WITH_GRAVE */
{ { GDK_dead_grave, GDK_O, 0, 0 }, 0x00D2 }, /* LATIN_CAPITAL_LETTER_O_WITH_GRAVE */
{ { GDK_dead_grave, GDK_U, 0, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_dead_grave, GDK_a, 0, 0 }, 0x00E0 }, /* LATIN_SMALL_LETTER_A_WITH_GRAVE */
{ { GDK_dead_grave, GDK_e, 0, 0 }, 0x00E8 }, /* LATIN_SMALL_LETTER_E_WITH_GRAVE */
{ { GDK_dead_grave, GDK_i, 0, 0 }, 0x00EC }, /* LATIN_SMALL_LETTER_I_WITH_GRAVE */
{ { GDK_dead_grave, GDK_o, 0, 0 }, 0x00F2 }, /* LATIN_SMALL_LETTER_O_WITH_GRAVE */
{ { GDK_dead_grave, GDK_u, 0, 0 }, 0x00F9 }, /* LATIN_SMALL_LETTER_U_WITH_GRAVE */
{ { GDK_dead_acute, GDK_space, 0, 0 }, 0x0027 }, /* APOSTROPHE */
{ { GDK_dead_acute, GDK_apostrophe, 0, 0 }, 0x00B4 }, /* ACUTE_ACCENT */
{ { GDK_dead_acute, GDK_A, 0, 0 }, 0x00C1 }, /* LATIN_CAPITAL_LETTER_A_WITH_ACUTE */
{ { GDK_dead_acute, GDK_E, 0, 0 }, 0x00C9 }, /* LATIN_CAPITAL_LETTER_E_WITH_ACUTE */
{ { GDK_dead_acute, GDK_I, 0, 0 }, 0x00CD }, /* LATIN_CAPITAL_LETTER_I_WITH_ACUTE */
{ { GDK_dead_acute, GDK_O, 0, 0 }, 0x00D3 }, /* LATIN_CAPITAL_LETTER_O_WITH_ACUTE */
{ { GDK_dead_acute, GDK_U, 0, 0 }, 0x00DA }, /* LATIN_CAPITAL_LETTER_U_WITH_ACUTE */
{ { GDK_dead_acute, GDK_Y, 0, 0 }, 0x00DD }, /* LATIN_CAPITAL_LETTER_Y_WITH_ACUTE */
{ { GDK_dead_acute, GDK_a, 0, 0 }, 0x00E1 }, /* LATIN_SMALL_LETTER_A_WITH_ACUTE */
{ { GDK_dead_acute, GDK_e, 0, 0 }, 0x00E9 }, /* LATIN_SMALL_LETTER_E_WITH_ACUTE */
{ { GDK_dead_acute, GDK_i, 0, 0 }, 0x00ED }, /* LATIN_SMALL_LETTER_I_WITH_ACUTE */
{ { GDK_dead_acute, GDK_o, 0, 0 }, 0x00F3 }, /* LATIN_SMALL_LETTER_O_WITH_ACUTE */
{ { GDK_dead_acute, GDK_u, 0, 0 }, 0x00FA }, /* LATIN_SMALL_LETTER_U_WITH_ACUTE */
{ { GDK_dead_acute, GDK_y, 0, 0 }, 0x00FD }, /* LATIN_SMALL_LETTER_Y_WITH_ACUTE */
{ { GDK_dead_acute, GDK_acute, 0, 0 }, 0x00B4 }, /* ACUTE_ACCENT */
{ { GDK_dead_acute, GDK_dead_acute, 0, 0 }, 0x00B4 }, /* ACUTE_ACCENT */
{ { GDK_dead_circumflex, GDK_space, 0, 0 }, 0x005E }, /* CIRCUMFLEX_ACCENT */
{ { GDK_dead_circumflex, GDK_minus, 0, 0 }, 0x00AF }, /* MACRON */
{ { GDK_dead_circumflex, GDK_period, 0, 0 }, 0x00B7 }, /* MIDDLE_DOT */
{ { GDK_dead_circumflex, GDK_slash, 0, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_dead_circumflex, GDK_0, 0, 0 }, 0x00B0 }, /* DEGREE_SIGN */
{ { GDK_dead_circumflex, GDK_1, 0, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_dead_circumflex, GDK_2, 0, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_dead_circumflex, GDK_3, 0, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_dead_circumflex, GDK_A, 0, 0 }, 0x00C2 }, /* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_E, 0, 0 }, 0x00CA }, /* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_I, 0, 0 }, 0x00CE }, /* LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_O, 0, 0 }, 0x00D4 }, /* LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_U, 0, 0 }, 0x00DB }, /* LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_underscore, 0, 0 }, 0x00AF }, /* MACRON */
{ { GDK_dead_circumflex, GDK_a, 0, 0 }, 0x00E2 }, /* LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_e, 0, 0 }, 0x00EA }, /* LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_i, 0, 0 }, 0x00EE }, /* LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_o, 0, 0 }, 0x00F4 }, /* LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_dead_circumflex, GDK_u, 0, 0 }, 0x00FB }, /* LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_dead_tilde, GDK_space, 0, 0 }, 0x007E }, /* TILDE */
{ { GDK_dead_tilde, GDK_A, 0, 0 }, 0x00C3 }, /* LATIN_CAPITAL_LETTER_A_WITH_TILDE */
{ { GDK_dead_tilde, GDK_I, 0, 0 }, 0x0128 }, /* LATIN_CAPITAL_LETTER_I_WITH_TILDE */
{ { GDK_dead_tilde, GDK_N, 0, 0 }, 0x00D1 }, /* LATIN_CAPITAL_LETTER_N_WITH_TILDE */
{ { GDK_dead_tilde, GDK_O, 0, 0 }, 0x00D5 }, /* LATIN_CAPITAL_LETTER_O_WITH_TILDE */
{ { GDK_dead_tilde, GDK_U, 0, 0 }, 0x0168 }, /* LATIN_CAPITAL_LETTER_U_WITH_TILDE */
{ { GDK_dead_tilde, GDK_a, 0, 0 }, 0x00E3 }, /* LATIN_SMALL_LETTER_A_WITH_TILDE */
{ { GDK_dead_tilde, GDK_i, 0, 0 }, 0x0129 }, /* LATIN_SMALL_LETTER_I_WITH_TILDE */
{ { GDK_dead_tilde, GDK_n, 0, 0 }, 0x00F1 }, /* LATIN_SMALL_LETTER_N_WITH_TILDE */
{ { GDK_dead_tilde, GDK_o, 0, 0 }, 0x00F5 }, /* LATIN_SMALL_LETTER_O_WITH_TILDE */
{ { GDK_dead_tilde, GDK_u, 0, 0 }, 0x0169 }, /* LATIN_SMALL_LETTER_U_WITH_TILDE */
{ { GDK_dead_tilde, GDK_asciitilde, 0, 0 }, 0x007E }, /* TILDE */
{ { GDK_dead_tilde, GDK_dead_tilde, 0, 0 }, 0x007E }, /* TILDE */
{ { GDK_dead_macron, GDK_A, 0, 0 }, 0x0100 }, /* LATIN_CAPITAL_LETTER_A_WITH_MACRON */
{ { GDK_dead_macron, GDK_E, 0, 0 }, 0x0112 }, /* LATIN_CAPITAL_LETTER_E_WITH_MACRON */
{ { GDK_dead_macron, GDK_I, 0, 0 }, 0x012A }, /* LATIN_CAPITAL_LETTER_I_WITH_MACRON */
{ { GDK_dead_macron, GDK_O, 0, 0 }, 0x014C }, /* LATIN_CAPITAL_LETTER_O_WITH_MACRON */
{ { GDK_dead_macron, GDK_U, 0, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_dead_macron, GDK_a, 0, 0 }, 0x0101 }, /* LATIN_SMALL_LETTER_A_WITH_MACRON */
{ { GDK_dead_macron, GDK_e, 0, 0 }, 0x0113 }, /* LATIN_SMALL_LETTER_E_WITH_MACRON */
{ { GDK_dead_macron, GDK_i, 0, 0 }, 0x012B }, /* LATIN_SMALL_LETTER_I_WITH_MACRON */
{ { GDK_dead_macron, GDK_o, 0, 0 }, 0x014D }, /* LATIN_SMALL_LETTER_O_WITH_MACRON */
{ { GDK_dead_macron, GDK_u, 0, 0 }, 0x016B }, /* LATIN_SMALL_LETTER_U_WITH_MACRON */
{ { GDK_dead_macron, GDK_macron, 0, 0 }, 0x00AF }, /* MACRON */
{ { GDK_dead_macron, GDK_dead_macron, 0, 0 }, 0x00AF }, /* MACRON */
{ { GDK_dead_breve, GDK_G, 0, 0 }, 0x011E }, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
{ { GDK_dead_breve, GDK_g, 0, 0 }, 0x011F }, /* LATIN_SMALL_LETTER_G_WITH_BREVE */
{ { GDK_dead_abovedot, GDK_E, 0, 0 }, 0x0116 }, /* LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE */
{ { GDK_dead_abovedot, GDK_I, 0, 0 }, 0x0130 }, /* LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE */
{ { GDK_dead_abovedot, GDK_e, 0, 0 }, 0x0117 }, /* LATIN_SMALL_LETTER_E_WITH_DOT_ABOVE */
{ { GDK_dead_abovedot, GDK_i, 0, 0 }, 0x0131 }, /* LATIN_SMALL_LETTER_DOTLESS_I */
{ { GDK_dead_abovedot, GDK_abovedot, 0, 0 }, 0x02D9 }, /* DOT_ABOVE */
{ { GDK_dead_abovedot, GDK_dead_abovedot, 0, 0 }, 0x02D9 }, /* DOT_ABOVE */
{ { GDK_dead_diaeresis, GDK_space, 0, 0 }, 0x00A8 }, /* DIAERESIS */
{ { GDK_dead_diaeresis, GDK_quotedbl, 0, 0 }, 0x00A8 }, /* DIAERESIS */
{ { GDK_dead_diaeresis, GDK_A, 0, 0 }, 0x00C4 }, /* LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_E, 0, 0 }, 0x00CB }, /* LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_I, 0, 0 }, 0x00CF }, /* LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_O, 0, 0 }, 0x00D6 }, /* LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_U, 0, 0 }, 0x00DC }, /* LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_Y, 0, 0 }, 0x0178 }, /* LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_a, 0, 0 }, 0x00E4 }, /* LATIN_SMALL_LETTER_A_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_e, 0, 0 }, 0x00EB }, /* LATIN_SMALL_LETTER_E_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_i, 0, 0 }, 0x00EF }, /* LATIN_SMALL_LETTER_I_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_o, 0, 0 }, 0x00F6 }, /* LATIN_SMALL_LETTER_O_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_u, 0, 0 }, 0x00FC }, /* LATIN_SMALL_LETTER_U_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_y, 0, 0 }, 0x00FF }, /* LATIN_SMALL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_dead_diaeresis, GDK_diaeresis, 0, 0 }, 0x00A8 }, /* DIAERESIS */
{ { GDK_dead_diaeresis, GDK_dead_diaeresis, 0, 0 }, 0x00A8 }, /* DIAERESIS */
{ { GDK_dead_abovering, GDK_A, 0, 0 }, 0x00C5 }, /* LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_dead_abovering, GDK_a, 0, 0 }, 0x00E5 }, /* LATIN_SMALL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_dead_abovering, GDK_dead_abovering, 0, 0 }, 0x02DA }, /* RING_ABOVE */
{ { GDK_dead_caron, GDK_C, 0, 0 }, 0x010C }, /* LATIN_CAPITAL_LETTER_C_WITH_CARON */
{ { GDK_dead_caron, GDK_S, 0, 0 }, 0x0160 }, /* LATIN_CAPITAL_LETTER_S_WITH_CARON */
{ { GDK_dead_caron, GDK_Z, 0, 0 }, 0x017D }, /* LATIN_CAPITAL_LETTER_Z_WITH_CARON */
{ { GDK_dead_caron, GDK_c, 0, 0 }, 0x010D }, /* LATIN_SMALL_LETTER_C_WITH_CARON */
{ { GDK_dead_caron, GDK_s, 0, 0 }, 0x0161 }, /* LATIN_SMALL_LETTER_S_WITH_CARON */
{ { GDK_dead_caron, GDK_z, 0, 0 }, 0x017E }, /* LATIN_SMALL_LETTER_Z_WITH_CARON */
{ { GDK_dead_caron, GDK_caron, 0, 0 }, 0x02C7 }, /* CARON */
{ { GDK_dead_caron, GDK_dead_caron, 0, 0 }, 0x02C7 }, /* CARON */
{ { GDK_dead_cedilla, GDK_comma, 0, 0 }, 0x00B8 }, /* CEDILLA */
{ { GDK_dead_cedilla, GDK_minus, 0, 0 }, 0x00AC }, /* NOT_SIGN */
{ { GDK_dead_cedilla, GDK_C, 0, 0 }, 0x00C7 }, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_G, 0, 0 }, 0x0122 }, /* LATIN_CAPITAL_LETTER_G_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_K, 0, 0 }, 0x0136 }, /* LATIN_CAPITAL_LETTER_K_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_L, 0, 0 }, 0x013B }, /* LATIN_CAPITAL_LETTER_L_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_N, 0, 0 }, 0x0145 }, /* LATIN_CAPITAL_LETTER_N_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_R, 0, 0 }, 0x0156 }, /* LATIN_CAPITAL_LETTER_R_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_S, 0, 0 }, 0x015E }, /* LATIN_CAPITAL_LETTER_S_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_c, 0, 0 }, 0x00E7 }, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_g, 0, 0 }, 0x0123 }, /* LATIN_SMALL_LETTER_G_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_k, 0, 0 }, 0x0137 }, /* LATIN_SMALL_LETTER_K_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_l, 0, 0 }, 0x013C }, /* LATIN_SMALL_LETTER_L_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_n, 0, 0 }, 0x0146 }, /* LATIN_SMALL_LETTER_N_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_r, 0, 0 }, 0x0157 }, /* LATIN_SMALL_LETTER_R_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_s, 0, 0 }, 0x015F }, /* LATIN_SMALL_LETTER_S_WITH_CEDILLA */
{ { GDK_dead_cedilla, GDK_cedilla, 0, 0 }, 0x00B8 }, /* CEDILLA */
{ { GDK_dead_cedilla, GDK_dead_cedilla, 0, 0 }, 0x00B8 }, /* CEDILLA */
{ { GDK_dead_ogonek, GDK_A, 0, 0 }, 0x0104 }, /* LATIN_CAPITAL_LETTER_A_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_E, 0, 0 }, 0x0118 }, /* LATIN_CAPITAL_LETTER_E_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_I, 0, 0 }, 0x012E }, /* LATIN_CAPITAL_LETTER_I_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_U, 0, 0 }, 0x0172 }, /* LATIN_CAPITAL_LETTER_U_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_a, 0, 0 }, 0x0105 }, /* LATIN_SMALL_LETTER_A_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_e, 0, 0 }, 0x0119 }, /* LATIN_SMALL_LETTER_E_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_i, 0, 0 }, 0x012F }, /* LATIN_SMALL_LETTER_I_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_u, 0, 0 }, 0x0173 }, /* LATIN_SMALL_LETTER_U_WITH_OGONEK */
{ { GDK_dead_ogonek, GDK_ogonek, 0, 0 }, 0x02DB }, /* OGONEK */
{ { GDK_dead_ogonek, GDK_dead_ogonek, 0, 0 }, 0x02DB }, /* OGONEK */
{ { GDK_Multi_key, GDK_space, GDK_space, 0 }, 0x00A0 }, /* NOxBREAK_SPACE */
{ { GDK_Multi_key, GDK_space, GDK_apostrophe, 0 }, 0x0027 }, /* APOSTROPHE */
{ { GDK_Multi_key, GDK_space, GDK_minus, 0 }, 0x007E }, /* TILDE */
{ { GDK_Multi_key, GDK_space, GDK_greater, 0 }, 0x005E }, /* CIRCUMFLEX_ACCENT */
{ { GDK_Multi_key, GDK_space, GDK_asciicircum, 0 }, 0x005E }, /* CIRCUMFLEX_ACCENT */
{ { GDK_Multi_key, GDK_space, GDK_grave, 0 }, 0x0060 }, /* GRAVE_ACCENT */
{ { GDK_Multi_key, GDK_space, GDK_asciitilde, 0 }, 0x007E }, /* TILDE */
{ { GDK_Multi_key, GDK_exclam, GDK_exclam, 0 }, 0x00A1 }, /* INVERTED_EXCLAMATION_MARK */
{ { GDK_Multi_key, GDK_exclam, GDK_P, 0 }, 0x00B6 }, /* PILCROW_SIGN */
{ { GDK_Multi_key, GDK_exclam, GDK_S, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_exclam, GDK_p, 0 }, 0x00B6 }, /* PILCROW_SIGN */
{ { GDK_Multi_key, GDK_exclam, GDK_s, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_quotedbl, GDK_quotedbl, 0 }, 0x00A8 }, /* DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_A, 0 }, 0x00C4 }, /* LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_E, 0 }, 0x00CB }, /* LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_I, 0 }, 0x00CF }, /* LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_O, 0 }, 0x00D6 }, /* LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_U, 0 }, 0x00DC }, /* LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_Y, 0 }, 0x0178 }, /* LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_a, 0 }, 0x00E4 }, /* LATIN_SMALL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_e, 0 }, 0x00EB }, /* LATIN_SMALL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_i, 0 }, 0x00EF }, /* LATIN_SMALL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_o, 0 }, 0x00F6 }, /* LATIN_SMALL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_u, 0 }, 0x00FC }, /* LATIN_SMALL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_quotedbl, GDK_y, 0 }, 0x00FF }, /* LATIN_SMALL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_apostrophe, GDK_space, 0 }, 0x0027 }, /* APOSTROPHE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_apostrophe, 0 }, 0x00B4 }, /* ACUTE_ACCENT */
{ { GDK_Multi_key, GDK_apostrophe, GDK_A, 0 }, 0x00C1 }, /* LATIN_CAPITAL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_E, 0 }, 0x00C9 }, /* LATIN_CAPITAL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_I, 0 }, 0x00CD }, /* LATIN_CAPITAL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_O, 0 }, 0x00D3 }, /* LATIN_CAPITAL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_U, 0 }, 0x00DA }, /* LATIN_CAPITAL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_Y, 0 }, 0x00DD }, /* LATIN_CAPITAL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_a, 0 }, 0x00E1 }, /* LATIN_SMALL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_e, 0 }, 0x00E9 }, /* LATIN_SMALL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_i, 0 }, 0x00ED }, /* LATIN_SMALL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_o, 0 }, 0x00F3 }, /* LATIN_SMALL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_u, 0 }, 0x00FA }, /* LATIN_SMALL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_apostrophe, GDK_y, 0 }, 0x00FD }, /* LATIN_SMALL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_parenleft, GDK_parenleft, 0 }, 0x005B }, /* LEFT_SQUARE_BRACKET */
{ { GDK_Multi_key, GDK_parenleft, GDK_minus, 0 }, 0x007B }, /* LEFT_CURLY_BRACKET */
{ { GDK_Multi_key, GDK_parenleft, GDK_G, 0 }, 0x011E }, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_parenleft, GDK_c, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_parenleft, GDK_g, 0 }, 0x011F }, /* LATIN_SMALL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_parenleft, GDK_r, 0 }, 0x00AE }, /* REGISTERED_SIGN */
{ { GDK_Multi_key, GDK_parenright, GDK_parenright, 0 }, 0x005D }, /* RIGHT_SQUARE_BRACKET */
{ { GDK_Multi_key, GDK_parenright, GDK_minus, 0 }, 0x007D }, /* RIGHT_CURLY_BRACKET */
{ { GDK_Multi_key, GDK_asterisk, GDK_0, 0 }, 0x00B0 }, /* DEGREE_SIGN */
{ { GDK_Multi_key, GDK_asterisk, GDK_A, 0 }, 0x00C5 }, /* LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_Multi_key, GDK_asterisk, GDK_a, 0 }, 0x00E5 }, /* LATIN_SMALL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_Multi_key, GDK_plus, GDK_plus, 0 }, 0x0023 }, /* NUMBER_SIGN */
{ { GDK_Multi_key, GDK_plus, GDK_minus, 0 }, 0x00B1 }, /* PLUSxMINUS_SIGN */
{ { GDK_Multi_key, GDK_comma, GDK_comma, 0 }, 0x00B8 }, /* CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_minus, 0 }, 0x00AC }, /* NOT_SIGN */
{ { GDK_Multi_key, GDK_comma, GDK_A, 0 }, 0x0104 }, /* LATIN_CAPITAL_LETTER_A_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_C, 0 }, 0x00C7 }, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_E, 0 }, 0x0118 }, /* LATIN_CAPITAL_LETTER_E_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_G, 0 }, 0x0122 }, /* LATIN_CAPITAL_LETTER_G_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_I, 0 }, 0x012E }, /* LATIN_CAPITAL_LETTER_I_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_K, 0 }, 0x0136 }, /* LATIN_CAPITAL_LETTER_K_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_L, 0 }, 0x013B }, /* LATIN_CAPITAL_LETTER_L_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_N, 0 }, 0x0145 }, /* LATIN_CAPITAL_LETTER_N_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_R, 0 }, 0x0156 }, /* LATIN_CAPITAL_LETTER_R_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_S, 0 }, 0x015E }, /* LATIN_CAPITAL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_U, 0 }, 0x0172 }, /* LATIN_CAPITAL_LETTER_U_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_a, 0 }, 0x0105 }, /* LATIN_SMALL_LETTER_A_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_c, 0 }, 0x00E7 }, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_e, 0 }, 0x0119 }, /* LATIN_SMALL_LETTER_E_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_g, 0 }, 0x0123 }, /* LATIN_SMALL_LETTER_G_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_i, 0 }, 0x012F }, /* LATIN_SMALL_LETTER_I_WITH_OGONEK */
{ { GDK_Multi_key, GDK_comma, GDK_k, 0 }, 0x0137 }, /* LATIN_SMALL_LETTER_K_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_l, 0 }, 0x013C }, /* LATIN_SMALL_LETTER_L_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_n, 0 }, 0x0146 }, /* LATIN_SMALL_LETTER_N_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_r, 0 }, 0x0157 }, /* LATIN_SMALL_LETTER_R_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_s, 0 }, 0x015F }, /* LATIN_SMALL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_comma, GDK_u, 0 }, 0x0173 }, /* LATIN_SMALL_LETTER_U_WITH_OGONEK */
{ { GDK_Multi_key, GDK_minus, GDK_space, 0 }, 0x007E }, /* TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_parenleft, 0 }, 0x007B }, /* LEFT_CURLY_BRACKET */
{ { GDK_Multi_key, GDK_minus, GDK_parenright, 0 }, 0x007D }, /* RIGHT_CURLY_BRACKET */
{ { GDK_Multi_key, GDK_minus, GDK_plus, 0 }, 0x00B1 }, /* PLUSxMINUS_SIGN */
{ { GDK_Multi_key, GDK_minus, GDK_comma, 0 }, 0x00AC }, /* NOT_SIGN */
{ { GDK_Multi_key, GDK_minus, GDK_minus, 0 }, 0x00AD }, /* SOFT_HYPHEN */
{ { GDK_Multi_key, GDK_minus, GDK_colon, 0 }, 0x00F7 }, /* DIVISION_SIGN */
{ { GDK_Multi_key, GDK_minus, GDK_A, 0 }, 0x00C3 }, /* LATIN_CAPITAL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_D, 0 }, 0x0110 }, /* LATIN_CAPITAL_LETTER_D_WITH_STROKE */
{ { GDK_Multi_key, GDK_minus, GDK_E, 0 }, 0x0112 }, /* LATIN_CAPITAL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_minus, GDK_I, 0 }, 0x012A }, /* LATIN_CAPITAL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_minus, GDK_L, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_minus, GDK_N, 0 }, 0x00D1 }, /* LATIN_CAPITAL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_O, 0 }, 0x00D5 }, /* LATIN_CAPITAL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_U, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_minus, GDK_Y, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_minus, GDK_asciicircum, 0 }, 0x00AF }, /* MACRON */
{ { GDK_Multi_key, GDK_minus, GDK_a, 0 }, 0x00E3 }, /* LATIN_SMALL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_d, 0 }, 0x0111 }, /* LATIN_SMALL_LETTER_D_WITH_STROKE */
{ { GDK_Multi_key, GDK_minus, GDK_e, 0 }, 0x0113 }, /* LATIN_SMALL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_minus, GDK_i, 0 }, 0x012B }, /* LATIN_SMALL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_minus, GDK_l, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_minus, GDK_n, 0 }, 0x00F1 }, /* LATIN_SMALL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_o, 0 }, 0x00F5 }, /* LATIN_SMALL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_minus, GDK_u, 0 }, 0x016B }, /* LATIN_SMALL_LETTER_U_WITH_MACRON */
{ { GDK_Multi_key, GDK_minus, GDK_y, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_period, GDK_period, 0 }, 0x02D9 }, /* DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_B, 0 }, 0x1E02 }, /* LATIN_CAPITAL_LETTER_B_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_C, 0 }, 0x010A }, /* LATIN_CAPITAL_LETTER_C_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_D, 0 }, 0x1E0A }, /* LATIN_CAPITAL_LETTER_D_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_E, 0 }, 0x0116 }, /* LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_F, 0 }, 0x1E1E }, /* LATIN_CAPITAL_LETTER_F_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_G, 0 }, 0x0120 }, /* LATIN_CAPITAL_LETTER_G_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_I, 0 }, 0x0130 }, /* LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_M, 0 }, 0x1E40 }, /* LATIN_CAPITAL_LETTER_M_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_P, 0 }, 0x1E56 }, /* LATIN_CAPITAL_LETTER_P_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_S, 0 }, 0x1E60 }, /* LATIN_CAPITAL_LETTER_S_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_T, 0 }, 0x1E6A }, /* LATIN_CAPITAL_LETTER_T_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_asciicircum, 0 }, 0x00B7 }, /* MIDDLE_DOT */
{ { GDK_Multi_key, GDK_period, GDK_b, 0 }, 0x1E03 }, /* LATIN_SMALL_LETTER_B_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_c, 0 }, 0x010B }, /* LATIN_SMALL_LETTER_C_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_d, 0 }, 0x1E0B }, /* LATIN_SMALL_LETTER_D_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_e, 0 }, 0x0117 }, /* LATIN_SMALL_LETTER_E_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_f, 0 }, 0x1E1F }, /* LATIN_SMALL_LETTER_F_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_g, 0 }, 0x0121 }, /* LATIN_SMALL_LETTER_G_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_i, 0 }, 0x0131 }, /* LATIN_SMALL_LETTER_DOTLESS_I */
{ { GDK_Multi_key, GDK_period, GDK_m, 0 }, 0x1E41 }, /* LATIN_SMALL_LETTER_M_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_p, 0 }, 0x1E57 }, /* LATIN_SMALL_LETTER_P_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_s, 0 }, 0x1E61 }, /* LATIN_SMALL_LETTER_S_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_period, GDK_t, 0 }, 0x1E6B }, /* LATIN_SMALL_LETTER_T_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_slash, GDK_slash, 0 }, 0x005C }, /* REVERSE_SOLIDUS */
{ { GDK_Multi_key, GDK_slash, GDK_less, 0 }, 0x005C }, /* REVERSE_SOLIDUS */
{ { GDK_Multi_key, GDK_slash, GDK_C, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_slash, GDK_O, 0 }, 0x00D8 }, /* LATIN_CAPITAL_LETTER_O_WITH_STROKE */
{ { GDK_Multi_key, GDK_slash, GDK_T, 0 }, 0x0166 }, /* LATIN_CAPITAL_LETTER_T_WITH_STROKE */
{ { GDK_Multi_key, GDK_slash, GDK_U, 0 }, 0x00B5 }, /* MICRO_SIGN */
{ { GDK_Multi_key, GDK_slash, GDK_asciicircum, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_Multi_key, GDK_slash, GDK_c, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_slash, GDK_o, 0 }, 0x00F8 }, /* LATIN_SMALL_LETTER_O_WITH_STROKE */
{ { GDK_Multi_key, GDK_slash, GDK_t, 0 }, 0x0167 }, /* LATIN_SMALL_LETTER_T_WITH_STROKE */
{ { GDK_Multi_key, GDK_slash, GDK_u, 0 }, 0x00B5 }, /* MICRO_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_asterisk, 0 }, 0x00B0 }, /* DEGREE_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_C, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_S, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_X, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_asciicircum, 0 }, 0x00B0 }, /* DEGREE_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_c, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_s, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_0, GDK_x, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_1, GDK_S, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_Multi_key, GDK_1, GDK_asciicircum, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_Multi_key, GDK_1, GDK_s, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_Multi_key, GDK_2, GDK_S, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_Multi_key, GDK_2, GDK_asciicircum, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_Multi_key, GDK_2, GDK_s, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_Multi_key, GDK_3, GDK_S, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_Multi_key, GDK_3, GDK_asciicircum, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_Multi_key, GDK_3, GDK_s, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_Multi_key, GDK_colon, GDK_minus, 0 }, 0x00F7 }, /* DIVISION_SIGN */
{ { GDK_Multi_key, GDK_less, GDK_slash, 0 }, 0x005C }, /* REVERSE_SOLIDUS */
{ { GDK_Multi_key, GDK_less, GDK_less, 0 }, 0x00AB }, /* LEFTxPOINTING_DOUBLE_ANGLE_QUOTATION_MARK */
{ { GDK_Multi_key, GDK_less, GDK_C, 0 }, 0x010C }, /* LATIN_CAPITAL_LETTER_C_WITH_CARON */
{ { GDK_Multi_key, GDK_less, GDK_S, 0 }, 0x0160 }, /* LATIN_CAPITAL_LETTER_S_WITH_CARON */
{ { GDK_Multi_key, GDK_less, GDK_Z, 0 }, 0x017D }, /* LATIN_CAPITAL_LETTER_Z_WITH_CARON */
{ { GDK_Multi_key, GDK_less, GDK_c, 0 }, 0x010D }, /* LATIN_SMALL_LETTER_C_WITH_CARON */
{ { GDK_Multi_key, GDK_less, GDK_s, 0 }, 0x0161 }, /* LATIN_SMALL_LETTER_S_WITH_CARON */
{ { GDK_Multi_key, GDK_less, GDK_z, 0 }, 0x017E }, /* LATIN_SMALL_LETTER_Z_WITH_CARON */
{ { GDK_Multi_key, GDK_equal, GDK_C, 0 }, 0x20AC }, /* EURO_SIGN */
{ { GDK_Multi_key, GDK_equal, GDK_L, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_equal, GDK_Y, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_equal, GDK_e, 0 }, 0x20AC }, /* EURO_SIGN */
{ { GDK_Multi_key, GDK_equal, GDK_l, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_equal, GDK_y, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_greater, GDK_space, 0 }, 0x005E }, /* CIRCUMFLEX_ACCENT */
{ { GDK_Multi_key, GDK_greater, GDK_greater, 0 }, 0x00BB }, /* RIGHTxPOINTING_DOUBLE_ANGLE_QUOTATION_MARK */
{ { GDK_Multi_key, GDK_greater, GDK_A, 0 }, 0x00C2 }, /* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_E, 0 }, 0x00CA }, /* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_I, 0 }, 0x00CE }, /* LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_O, 0 }, 0x00D4 }, /* LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_U, 0 }, 0x00DB }, /* LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_a, 0 }, 0x00E2 }, /* LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_e, 0 }, 0x00EA }, /* LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_i, 0 }, 0x00EE }, /* LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_o, 0 }, 0x00F4 }, /* LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_greater, GDK_u, 0 }, 0x00FB }, /* LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_question, GDK_question, 0 }, 0x00BF }, /* INVERTED_QUESTION_MARK */
{ { GDK_Multi_key, GDK_A, GDK_quotedbl, 0 }, 0x00C4 }, /* LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_A, GDK_apostrophe, 0 }, 0x00C1 }, /* LATIN_CAPITAL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_A, GDK_asterisk, 0 }, 0x00C5 }, /* LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_Multi_key, GDK_A, GDK_comma, 0 }, 0x0104 }, /* LATIN_CAPITAL_LETTER_A_WITH_OGONEK */
{ { GDK_Multi_key, GDK_A, GDK_minus, 0 }, 0x00C3 }, /* LATIN_CAPITAL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_A, GDK_greater, 0 }, 0x00C2 }, /* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_A, GDK_A, 0 }, 0x00C5 }, /* LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_Multi_key, GDK_A, GDK_E, 0 }, 0x00C6 }, /* LATIN_CAPITAL_LETTER_AE */
{ { GDK_Multi_key, GDK_A, GDK_asciicircum, 0 }, 0x00C2 }, /* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_A, GDK_underscore, 0 }, 0x00AA }, /* FEMININE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_A, GDK_grave, 0 }, 0x00C0 }, /* LATIN_CAPITAL_LETTER_A_WITH_GRAVE */
{ { GDK_Multi_key, GDK_A, GDK_asciitilde, 0 }, 0x00C3 }, /* LATIN_CAPITAL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_A, GDK_diaeresis, 0 }, 0x00C4 }, /* LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_A, GDK_acute, 0 }, 0x00C1 }, /* LATIN_CAPITAL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_B, GDK_period, 0 }, 0x1E02 }, /* LATIN_CAPITAL_LETTER_B_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_C, GDK_comma, 0 }, 0x00C7 }, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_C, GDK_period, 0 }, 0x010A }, /* LATIN_CAPITAL_LETTER_C_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_C, GDK_slash, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_C, GDK_0, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_C, GDK_less, 0 }, 0x010C }, /* LATIN_CAPITAL_LETTER_C_WITH_CARON */
{ { GDK_Multi_key, GDK_C, GDK_equal, 0 }, 0x20AC }, /* EURO_SIGN */
{ { GDK_Multi_key, GDK_C, GDK_O, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_C, GDK_o, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_C, GDK_bar, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_D, GDK_minus, 0 }, 0x0110 }, /* LATIN_CAPITAL_LETTER_D_WITH_STROKE */
{ { GDK_Multi_key, GDK_D, GDK_period, 0 }, 0x1E0A }, /* LATIN_CAPITAL_LETTER_D_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_E, GDK_quotedbl, 0 }, 0x00CB }, /* LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_E, GDK_apostrophe, 0 }, 0x00C9 }, /* LATIN_CAPITAL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_E, GDK_comma, 0 }, 0x0118 }, /* LATIN_CAPITAL_LETTER_E_WITH_OGONEK */
{ { GDK_Multi_key, GDK_E, GDK_minus, 0 }, 0x0112 }, /* LATIN_CAPITAL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_E, GDK_period, 0 }, 0x0116 }, /* LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_E, GDK_greater, 0 }, 0x00CA }, /* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_E, GDK_asciicircum, 0 }, 0x00CA }, /* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_E, GDK_underscore, 0 }, 0x0112 }, /* LATIN_CAPITAL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_E, GDK_grave, 0 }, 0x00C8 }, /* LATIN_CAPITAL_LETTER_E_WITH_GRAVE */
{ { GDK_Multi_key, GDK_E, GDK_diaeresis, 0 }, 0x00CB }, /* LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_E, GDK_acute, 0 }, 0x00C9 }, /* LATIN_CAPITAL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_F, GDK_period, 0 }, 0x1E1E }, /* LATIN_CAPITAL_LETTER_F_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_G, GDK_parenleft, 0 }, 0x011E }, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_G, GDK_comma, 0 }, 0x0122 }, /* LATIN_CAPITAL_LETTER_G_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_G, GDK_period, 0 }, 0x0120 }, /* LATIN_CAPITAL_LETTER_G_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_G, GDK_U, 0 }, 0x011E }, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_G, GDK_breve, 0 }, 0x011E }, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_I, GDK_quotedbl, 0 }, 0x00CF }, /* LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_I, GDK_apostrophe, 0 }, 0x00CD }, /* LATIN_CAPITAL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_I, GDK_comma, 0 }, 0x012E }, /* LATIN_CAPITAL_LETTER_I_WITH_OGONEK */
{ { GDK_Multi_key, GDK_I, GDK_minus, 0 }, 0x012A }, /* LATIN_CAPITAL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_I, GDK_period, 0 }, 0x0130 }, /* LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_I, GDK_greater, 0 }, 0x00CE }, /* LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_I, GDK_asciicircum, 0 }, 0x00CE }, /* LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_I, GDK_underscore, 0 }, 0x012A }, /* LATIN_CAPITAL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_I, GDK_grave, 0 }, 0x00CC }, /* LATIN_CAPITAL_LETTER_I_WITH_GRAVE */
{ { GDK_Multi_key, GDK_I, GDK_asciitilde, 0 }, 0x0128 }, /* LATIN_CAPITAL_LETTER_I_WITH_TILDE */
{ { GDK_Multi_key, GDK_I, GDK_diaeresis, 0 }, 0x00CF }, /* LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_I, GDK_acute, 0 }, 0x00CD }, /* LATIN_CAPITAL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_K, GDK_comma, 0 }, 0x0136 }, /* LATIN_CAPITAL_LETTER_K_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_L, GDK_comma, 0 }, 0x013B }, /* LATIN_CAPITAL_LETTER_L_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_L, GDK_minus, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_L, GDK_equal, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_L, GDK_V, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_Multi_key, GDK_M, GDK_period, 0 }, 0x1E40 }, /* LATIN_CAPITAL_LETTER_M_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_N, GDK_comma, 0 }, 0x0145 }, /* LATIN_CAPITAL_LETTER_N_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_N, GDK_minus, 0 }, 0x00D1 }, /* LATIN_CAPITAL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_N, GDK_G, 0 }, 0x014A }, /* LATIN_CAPITAL_LETTER_ENG */
{ { GDK_Multi_key, GDK_N, GDK_asciitilde, 0 }, 0x00D1 }, /* LATIN_CAPITAL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_O, GDK_quotedbl, 0 }, 0x00D6 }, /* LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_O, GDK_apostrophe, 0 }, 0x00D3 }, /* LATIN_CAPITAL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_O, GDK_minus, 0 }, 0x00D5 }, /* LATIN_CAPITAL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_O, GDK_slash, 0 }, 0x00D8 }, /* LATIN_CAPITAL_LETTER_O_WITH_STROKE */
{ { GDK_Multi_key, GDK_O, GDK_greater, 0 }, 0x00D4 }, /* LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_O, GDK_C, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_O, GDK_E, 0 }, 0x0152 }, /* LATIN_CAPITAL_LIGATURE_OE */
{ { GDK_Multi_key, GDK_O, GDK_R, 0 }, 0x00AE }, /* REGISTERED_SIGN */
{ { GDK_Multi_key, GDK_O, GDK_S, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_O, GDK_X, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_O, GDK_asciicircum, 0 }, 0x00D4 }, /* LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_O, GDK_underscore, 0 }, 0x00BA }, /* MASCULINE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_O, GDK_grave, 0 }, 0x00D2 }, /* LATIN_CAPITAL_LETTER_O_WITH_GRAVE */
{ { GDK_Multi_key, GDK_O, GDK_c, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_O, GDK_x, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_O, GDK_asciitilde, 0 }, 0x00D5 }, /* LATIN_CAPITAL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_O, GDK_diaeresis, 0 }, 0x00D6 }, /* LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_O, GDK_acute, 0 }, 0x00D3 }, /* LATIN_CAPITAL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_P, GDK_exclam, 0 }, 0x00B6 }, /* PILCROW_SIGN */
{ { GDK_Multi_key, GDK_P, GDK_period, 0 }, 0x1E56 }, /* LATIN_CAPITAL_LETTER_P_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_R, GDK_comma, 0 }, 0x0156 }, /* LATIN_CAPITAL_LETTER_R_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_R, GDK_O, 0 }, 0x00AE }, /* REGISTERED_SIGN */
{ { GDK_Multi_key, GDK_S, GDK_exclam, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_S, GDK_comma, 0 }, 0x015E }, /* LATIN_CAPITAL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_S, GDK_period, 0 }, 0x1E60 }, /* LATIN_CAPITAL_LETTER_S_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_S, GDK_0, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_S, GDK_1, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_Multi_key, GDK_S, GDK_2, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_Multi_key, GDK_S, GDK_3, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_Multi_key, GDK_S, GDK_less, 0 }, 0x0160 }, /* LATIN_CAPITAL_LETTER_S_WITH_CARON */
{ { GDK_Multi_key, GDK_S, GDK_O, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_S, GDK_cedilla, 0 }, 0x015E }, /* LATIN_CAPITAL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_T, GDK_minus, 0 }, 0x0166 }, /* LATIN_CAPITAL_LETTER_T_WITH_STROKE */
{ { GDK_Multi_key, GDK_T, GDK_period, 0 }, 0x1E6A }, /* LATIN_CAPITAL_LETTER_T_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_T, GDK_slash, 0 }, 0x0166 }, /* LATIN_CAPITAL_LETTER_T_WITH_STROKE */
{ { GDK_Multi_key, GDK_T, GDK_H, 0 }, 0x00DE }, /* LATIN_CAPITAL_LETTER_THORN */
{ { GDK_Multi_key, GDK_U, GDK_quotedbl, 0 }, 0x00DC }, /* LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_U, GDK_apostrophe, 0 }, 0x00DA }, /* LATIN_CAPITAL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_U, GDK_comma, 0 }, 0x0172 }, /* LATIN_CAPITAL_LETTER_U_WITH_OGONEK */
{ { GDK_Multi_key, GDK_U, GDK_minus, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_U, GDK_slash, 0 }, 0x00B5 }, /* MICRO_SIGN */
{ { GDK_Multi_key, GDK_U, GDK_greater, 0 }, 0x00DB }, /* LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_U, GDK_asciicircum, 0 }, 0x00DB }, /* LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_U, GDK_underscore, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_U, GDK_grave, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_U, GDK_asciitilde, 0 }, 0x0168 }, /* LATIN_CAPITAL_LETTER_U_WITH_TILDE */
{ { GDK_Multi_key, GDK_U, GDK_diaeresis, 0 }, 0x00DC }, /* LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_U, GDK_acute, 0 }, 0x00DA }, /* LATIN_CAPITAL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_V, GDK_L, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_Multi_key, GDK_W, GDK_asciicircum, 0 }, 0x0174 }, /* LATIN_CAPITAL_LETTER_W_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_X, GDK_0, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_X, GDK_O, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_X, GDK_o, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_Y, GDK_quotedbl, 0 }, 0x0178 }, /* LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_Y, GDK_apostrophe, 0 }, 0x00DD }, /* LATIN_CAPITAL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_Y, GDK_minus, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_Y, GDK_equal, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_Y, GDK_asciicircum, 0 }, 0x0176 }, /* LATIN_CAPITAL_LETTER_Y_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_Y, GDK_diaeresis, 0 }, 0x0178 }, /* LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_Y, GDK_acute, 0 }, 0x00DD }, /* LATIN_CAPITAL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_Z, GDK_less, 0 }, 0x017D }, /* LATIN_CAPITAL_LETTER_Z_WITH_CARON */
{ { GDK_Multi_key, GDK_asciicircum, GDK_space, 0 }, 0x005E }, /* CIRCUMFLEX_ACCENT */
{ { GDK_Multi_key, GDK_asciicircum, GDK_minus, 0 }, 0x00AF }, /* MACRON */
{ { GDK_Multi_key, GDK_asciicircum, GDK_period, 0 }, 0x00B7 }, /* MIDDLE_DOT */
{ { GDK_Multi_key, GDK_asciicircum, GDK_slash, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_Multi_key, GDK_asciicircum, GDK_0, 0 }, 0x00B0 }, /* DEGREE_SIGN */
{ { GDK_Multi_key, GDK_asciicircum, GDK_1, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_Multi_key, GDK_asciicircum, GDK_2, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_Multi_key, GDK_asciicircum, GDK_3, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_Multi_key, GDK_asciicircum, GDK_A, 0 }, 0x00C2 }, /* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_E, 0 }, 0x00CA }, /* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_I, 0 }, 0x00CE }, /* LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_O, 0 }, 0x00D4 }, /* LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_U, 0 }, 0x00DB }, /* LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_W, 0 }, 0x0174 }, /* LATIN_CAPITAL_LETTER_W_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_Y, 0 }, 0x0176 }, /* LATIN_CAPITAL_LETTER_Y_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_underscore, 0 }, 0x00AF }, /* MACRON */
{ { GDK_Multi_key, GDK_asciicircum, GDK_a, 0 }, 0x00E2 }, /* LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_e, 0 }, 0x00EA }, /* LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_i, 0 }, 0x00EE }, /* LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_o, 0 }, 0x00F4 }, /* LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_u, 0 }, 0x00FB }, /* LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_w, 0 }, 0x0175 }, /* LATIN_SMALL_LETTER_W_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_asciicircum, GDK_y, 0 }, 0x0177 }, /* LATIN_SMALL_LETTER_Y_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_underscore, GDK_A, 0 }, 0x00AA }, /* FEMININE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_underscore, GDK_E, 0 }, 0x0112 }, /* LATIN_CAPITAL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_underscore, GDK_I, 0 }, 0x012A }, /* LATIN_CAPITAL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_underscore, GDK_O, 0 }, 0x00BA }, /* MASCULINE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_underscore, GDK_U, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_underscore, GDK_asciicircum, 0 }, 0x00AF }, /* MACRON */
{ { GDK_Multi_key, GDK_underscore, GDK_underscore, 0 }, 0x00AF }, /* MACRON */
{ { GDK_Multi_key, GDK_underscore, GDK_a, 0 }, 0x00AA }, /* FEMININE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_underscore, GDK_e, 0 }, 0x0113 }, /* LATIN_SMALL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_underscore, GDK_i, 0 }, 0x012B }, /* LATIN_SMALL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_underscore, GDK_o, 0 }, 0x00BA }, /* MASCULINE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_underscore, GDK_u, 0 }, 0x016B }, /* LATIN_SMALL_LETTER_U_WITH_MACRON */
{ { GDK_Multi_key, GDK_grave, GDK_space, 0 }, 0x0060 }, /* GRAVE_ACCENT */
{ { GDK_Multi_key, GDK_grave, GDK_A, 0 }, 0x00C0 }, /* LATIN_CAPITAL_LETTER_A_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_E, 0 }, 0x00C8 }, /* LATIN_CAPITAL_LETTER_E_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_I, 0 }, 0x00CC }, /* LATIN_CAPITAL_LETTER_I_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_O, 0 }, 0x00D2 }, /* LATIN_CAPITAL_LETTER_O_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_U, 0 }, 0x00D9 }, /* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_a, 0 }, 0x00E0 }, /* LATIN_SMALL_LETTER_A_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_e, 0 }, 0x00E8 }, /* LATIN_SMALL_LETTER_E_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_i, 0 }, 0x00EC }, /* LATIN_SMALL_LETTER_I_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_o, 0 }, 0x00F2 }, /* LATIN_SMALL_LETTER_O_WITH_GRAVE */
{ { GDK_Multi_key, GDK_grave, GDK_u, 0 }, 0x00F9 }, /* LATIN_SMALL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_a, GDK_quotedbl, 0 }, 0x00E4 }, /* LATIN_SMALL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_a, GDK_apostrophe, 0 }, 0x00E1 }, /* LATIN_SMALL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_a, GDK_asterisk, 0 }, 0x00E5 }, /* LATIN_SMALL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_Multi_key, GDK_a, GDK_comma, 0 }, 0x0105 }, /* LATIN_SMALL_LETTER_A_WITH_OGONEK */
{ { GDK_Multi_key, GDK_a, GDK_minus, 0 }, 0x00E3 }, /* LATIN_SMALL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_a, GDK_greater, 0 }, 0x00E2 }, /* LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_a, GDK_asciicircum, 0 }, 0x00E2 }, /* LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_a, GDK_underscore, 0 }, 0x00AA }, /* FEMININE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_a, GDK_grave, 0 }, 0x00E0 }, /* LATIN_SMALL_LETTER_A_WITH_GRAVE */
{ { GDK_Multi_key, GDK_a, GDK_a, 0 }, 0x00E5 }, /* LATIN_SMALL_LETTER_A_WITH_RING_ABOVE */
{ { GDK_Multi_key, GDK_a, GDK_e, 0 }, 0x00E6 }, /* LATIN_SMALL_LETTER_AE */
{ { GDK_Multi_key, GDK_a, GDK_asciitilde, 0 }, 0x00E3 }, /* LATIN_SMALL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_a, GDK_diaeresis, 0 }, 0x00E4 }, /* LATIN_SMALL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_a, GDK_acute, 0 }, 0x00E1 }, /* LATIN_SMALL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_b, GDK_period, 0 }, 0x1E03 }, /* LATIN_SMALL_LETTER_B_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_c, GDK_comma, 0 }, 0x00E7 }, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_c, GDK_period, 0 }, 0x010B }, /* LATIN_SMALL_LETTER_C_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_c, GDK_slash, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_c, GDK_0, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_c, GDK_less, 0 }, 0x010D }, /* LATIN_SMALL_LETTER_C_WITH_CARON */
{ { GDK_Multi_key, GDK_c, GDK_O, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_c, GDK_o, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_c, GDK_bar, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_d, GDK_minus, 0 }, 0x0111 }, /* LATIN_SMALL_LETTER_D_WITH_STROKE */
{ { GDK_Multi_key, GDK_d, GDK_period, 0 }, 0x1E0B }, /* LATIN_SMALL_LETTER_D_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_e, GDK_quotedbl, 0 }, 0x00EB }, /* LATIN_SMALL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_e, GDK_apostrophe, 0 }, 0x00E9 }, /* LATIN_SMALL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_e, GDK_comma, 0 }, 0x0119 }, /* LATIN_SMALL_LETTER_E_WITH_OGONEK */
{ { GDK_Multi_key, GDK_e, GDK_minus, 0 }, 0x0113 }, /* LATIN_SMALL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_e, GDK_period, 0 }, 0x0117 }, /* LATIN_SMALL_LETTER_E_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_e, GDK_equal, 0 }, 0x20AC }, /* EURO_SIGN */
{ { GDK_Multi_key, GDK_e, GDK_greater, 0 }, 0x00EA }, /* LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_e, GDK_asciicircum, 0 }, 0x00EA }, /* LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_e, GDK_underscore, 0 }, 0x0113 }, /* LATIN_SMALL_LETTER_E_WITH_MACRON */
{ { GDK_Multi_key, GDK_e, GDK_grave, 0 }, 0x00E8 }, /* LATIN_SMALL_LETTER_E_WITH_GRAVE */
{ { GDK_Multi_key, GDK_e, GDK_diaeresis, 0 }, 0x00EB }, /* LATIN_SMALL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_e, GDK_acute, 0 }, 0x00E9 }, /* LATIN_SMALL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_f, GDK_period, 0 }, 0x1E1F }, /* LATIN_SMALL_LETTER_F_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_g, GDK_parenleft, 0 }, 0x011F }, /* LATIN_SMALL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_g, GDK_comma, 0 }, 0x0123 }, /* LATIN_SMALL_LETTER_G_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_g, GDK_period, 0 }, 0x0121 }, /* LATIN_SMALL_LETTER_G_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_g, GDK_U, 0 }, 0x011F }, /* LATIN_SMALL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_g, GDK_breve, 0 }, 0x011F }, /* LATIN_SMALL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_i, GDK_quotedbl, 0 }, 0x00EF }, /* LATIN_SMALL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_i, GDK_apostrophe, 0 }, 0x00ED }, /* LATIN_SMALL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_i, GDK_comma, 0 }, 0x012F }, /* LATIN_SMALL_LETTER_I_WITH_OGONEK */
{ { GDK_Multi_key, GDK_i, GDK_minus, 0 }, 0x012B }, /* LATIN_SMALL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_i, GDK_period, 0 }, 0x0131 }, /* LATIN_SMALL_LETTER_DOTLESS_I */
{ { GDK_Multi_key, GDK_i, GDK_greater, 0 }, 0x00EE }, /* LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_i, GDK_asciicircum, 0 }, 0x00EE }, /* LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_i, GDK_underscore, 0 }, 0x012B }, /* LATIN_SMALL_LETTER_I_WITH_MACRON */
{ { GDK_Multi_key, GDK_i, GDK_grave, 0 }, 0x00EC }, /* LATIN_SMALL_LETTER_I_WITH_GRAVE */
{ { GDK_Multi_key, GDK_i, GDK_asciitilde, 0 }, 0x0129 }, /* LATIN_SMALL_LETTER_I_WITH_TILDE */
{ { GDK_Multi_key, GDK_i, GDK_diaeresis, 0 }, 0x00EF }, /* LATIN_SMALL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_i, GDK_acute, 0 }, 0x00ED }, /* LATIN_SMALL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_k, GDK_comma, 0 }, 0x0137 }, /* LATIN_SMALL_LETTER_K_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_k, GDK_k, 0 }, 0x0138 }, /* LATIN_SMALL_LETTER_KRA */
{ { GDK_Multi_key, GDK_l, GDK_comma, 0 }, 0x013C }, /* LATIN_SMALL_LETTER_L_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_l, GDK_minus, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_l, GDK_equal, 0 }, 0x00A3 }, /* POUND_SIGN */
{ { GDK_Multi_key, GDK_l, GDK_v, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_Multi_key, GDK_m, GDK_period, 0 }, 0x1E41 }, /* LATIN_SMALL_LETTER_M_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_n, GDK_comma, 0 }, 0x0146 }, /* LATIN_SMALL_LETTER_N_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_n, GDK_minus, 0 }, 0x00F1 }, /* LATIN_SMALL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_n, GDK_g, 0 }, 0x014B }, /* LATIN_SMALL_LETTER_ENG */
{ { GDK_Multi_key, GDK_n, GDK_asciitilde, 0 }, 0x00F1 }, /* LATIN_SMALL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_o, GDK_quotedbl, 0 }, 0x00F6 }, /* LATIN_SMALL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_o, GDK_apostrophe, 0 }, 0x00F3 }, /* LATIN_SMALL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_o, GDK_minus, 0 }, 0x00F5 }, /* LATIN_SMALL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_o, GDK_slash, 0 }, 0x00F8 }, /* LATIN_SMALL_LETTER_O_WITH_STROKE */
{ { GDK_Multi_key, GDK_o, GDK_greater, 0 }, 0x00F4 }, /* LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_o, GDK_C, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_o, GDK_X, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_o, GDK_asciicircum, 0 }, 0x00F4 }, /* LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_o, GDK_underscore, 0 }, 0x00BA }, /* MASCULINE_ORDINAL_INDICATOR */
{ { GDK_Multi_key, GDK_o, GDK_grave, 0 }, 0x00F2 }, /* LATIN_SMALL_LETTER_O_WITH_GRAVE */
{ { GDK_Multi_key, GDK_o, GDK_c, 0 }, 0x00A9 }, /* COPYRIGHT_SIGN */
{ { GDK_Multi_key, GDK_o, GDK_e, 0 }, 0x0153 }, /* LATIN_SMALL_LIGATURE_OE */
{ { GDK_Multi_key, GDK_o, GDK_s, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_o, GDK_x, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_o, GDK_asciitilde, 0 }, 0x00F5 }, /* LATIN_SMALL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_o, GDK_diaeresis, 0 }, 0x00F6 }, /* LATIN_SMALL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_o, GDK_acute, 0 }, 0x00F3 }, /* LATIN_SMALL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_p, GDK_exclam, 0 }, 0x00B6 }, /* PILCROW_SIGN */
{ { GDK_Multi_key, GDK_p, GDK_period, 0 }, 0x1E57 }, /* LATIN_SMALL_LETTER_P_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_r, GDK_comma, 0 }, 0x0157 }, /* LATIN_SMALL_LETTER_R_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_s, GDK_exclam, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_s, GDK_comma, 0 }, 0x015F }, /* LATIN_SMALL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_s, GDK_period, 0 }, 0x1E61 }, /* LATIN_SMALL_LETTER_S_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_s, GDK_0, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_s, GDK_1, 0 }, 0x00B9 }, /* SUPERSCRIPT_ONE */
{ { GDK_Multi_key, GDK_s, GDK_2, 0 }, 0x00B2 }, /* SUPERSCRIPT_TWO */
{ { GDK_Multi_key, GDK_s, GDK_3, 0 }, 0x00B3 }, /* SUPERSCRIPT_THREE */
{ { GDK_Multi_key, GDK_s, GDK_less, 0 }, 0x0161 }, /* LATIN_SMALL_LETTER_S_WITH_CARON */
{ { GDK_Multi_key, GDK_s, GDK_o, 0 }, 0x00A7 }, /* SECTION_SIGN */
{ { GDK_Multi_key, GDK_s, GDK_s, 0 }, 0x00DF }, /* LATIN_SMALL_LETTER_SHARP_S */
{ { GDK_Multi_key, GDK_s, GDK_cedilla, 0 }, 0x015F }, /* LATIN_SMALL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_t, GDK_minus, 0 }, 0x0167 }, /* LATIN_SMALL_LETTER_T_WITH_STROKE */
{ { GDK_Multi_key, GDK_t, GDK_period, 0 }, 0x1E6B }, /* LATIN_SMALL_LETTER_T_WITH_DOT_ABOVE */
{ { GDK_Multi_key, GDK_t, GDK_slash, 0 }, 0x0167 }, /* LATIN_SMALL_LETTER_T_WITH_STROKE */
{ { GDK_Multi_key, GDK_t, GDK_h, 0 }, 0x00FE }, /* LATIN_SMALL_LETTER_THORN */
{ { GDK_Multi_key, GDK_u, GDK_quotedbl, 0 }, 0x00FC }, /* LATIN_SMALL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_u, GDK_apostrophe, 0 }, 0x00FA }, /* LATIN_SMALL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_u, GDK_comma, 0 }, 0x0173 }, /* LATIN_SMALL_LETTER_U_WITH_OGONEK */
{ { GDK_Multi_key, GDK_u, GDK_minus, 0 }, 0x016B }, /* LATIN_SMALL_LETTER_U_WITH_MACRON */
{ { GDK_Multi_key, GDK_u, GDK_slash, 0 }, 0x00B5 }, /* MICRO_SIGN */
{ { GDK_Multi_key, GDK_u, GDK_greater, 0 }, 0x00FB }, /* LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_u, GDK_asciicircum, 0 }, 0x00FB }, /* LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_u, GDK_underscore, 0 }, 0x016B }, /* LATIN_SMALL_LETTER_U_WITH_MACRON */
{ { GDK_Multi_key, GDK_u, GDK_grave, 0 }, 0x00F9 }, /* LATIN_SMALL_LETTER_U_WITH_GRAVE */
{ { GDK_Multi_key, GDK_u, GDK_asciitilde, 0 }, 0x0169 }, /* LATIN_SMALL_LETTER_U_WITH_TILDE */
{ { GDK_Multi_key, GDK_u, GDK_diaeresis, 0 }, 0x00FC }, /* LATIN_SMALL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_u, GDK_acute, 0 }, 0x00FA }, /* LATIN_SMALL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_v, GDK_Z, 0 }, 0x017D }, /* LATIN_CAPITAL_LETTER_Z_WITH_CARON */
{ { GDK_Multi_key, GDK_v, GDK_l, 0 }, 0x007C }, /* VERTICAL_LINE */
{ { GDK_Multi_key, GDK_v, GDK_z, 0 }, 0x017E }, /* LATIN_SMALL_LETTER_Z_WITH_CARON */
{ { GDK_Multi_key, GDK_w, GDK_asciicircum, 0 }, 0x0175 }, /* LATIN_SMALL_LETTER_W_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_x, GDK_0, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_x, GDK_O, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_x, GDK_o, 0 }, 0x00A4 }, /* CURRENCY_SIGN */
{ { GDK_Multi_key, GDK_x, GDK_x, 0 }, 0x00D7 }, /* MULTIPLICATION_SIGN */
{ { GDK_Multi_key, GDK_y, GDK_quotedbl, 0 }, 0x00FF }, /* LATIN_SMALL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_y, GDK_apostrophe, 0 }, 0x00FD }, /* LATIN_SMALL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_y, GDK_minus, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_y, GDK_equal, 0 }, 0x00A5 }, /* YEN_SIGN */
{ { GDK_Multi_key, GDK_y, GDK_asciicircum, 0 }, 0x0177 }, /* LATIN_SMALL_LETTER_Y_WITH_CIRCUMFLEX */
{ { GDK_Multi_key, GDK_y, GDK_diaeresis, 0 }, 0x00FF }, /* LATIN_SMALL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_y, GDK_acute, 0 }, 0x00FD }, /* LATIN_SMALL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_z, GDK_less, 0 }, 0x017E }, /* LATIN_SMALL_LETTER_Z_WITH_CARON */
{ { GDK_Multi_key, GDK_bar, GDK_C, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_bar, GDK_c, 0 }, 0x00A2 }, /* CENT_SIGN */
{ { GDK_Multi_key, GDK_asciitilde, GDK_space, 0 }, 0x007E }, /* TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_A, 0 }, 0x00C3 }, /* LATIN_CAPITAL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_I, 0 }, 0x0128 }, /* LATIN_CAPITAL_LETTER_I_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_N, 0 }, 0x00D1 }, /* LATIN_CAPITAL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_O, 0 }, 0x00D5 }, /* LATIN_CAPITAL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_U, 0 }, 0x0168 }, /* LATIN_CAPITAL_LETTER_U_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_a, 0 }, 0x00E3 }, /* LATIN_SMALL_LETTER_A_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_i, 0 }, 0x0129 }, /* LATIN_SMALL_LETTER_I_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_n, 0 }, 0x00F1 }, /* LATIN_SMALL_LETTER_N_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_o, 0 }, 0x00F5 }, /* LATIN_SMALL_LETTER_O_WITH_TILDE */
{ { GDK_Multi_key, GDK_asciitilde, GDK_u, 0 }, 0x0169 }, /* LATIN_SMALL_LETTER_U_WITH_TILDE */
{ { GDK_Multi_key, GDK_diaeresis, GDK_A, 0 }, 0x00C4 }, /* LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_E, 0 }, 0x00CB }, /* LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_I, 0 }, 0x00CF }, /* LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_O, 0 }, 0x00D6 }, /* LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_U, 0 }, 0x00DC }, /* LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_Y, 0 }, 0x0178 }, /* LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_a, 0 }, 0x00E4 }, /* LATIN_SMALL_LETTER_A_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_e, 0 }, 0x00EB }, /* LATIN_SMALL_LETTER_E_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_i, 0 }, 0x00EF }, /* LATIN_SMALL_LETTER_I_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_o, 0 }, 0x00F6 }, /* LATIN_SMALL_LETTER_O_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_u, 0 }, 0x00FC }, /* LATIN_SMALL_LETTER_U_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_diaeresis, GDK_y, 0 }, 0x00FF }, /* LATIN_SMALL_LETTER_Y_WITH_DIAERESIS */
{ { GDK_Multi_key, GDK_acute, GDK_A, 0 }, 0x00C1 }, /* LATIN_CAPITAL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_E, 0 }, 0x00C9 }, /* LATIN_CAPITAL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_I, 0 }, 0x00CD }, /* LATIN_CAPITAL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_O, 0 }, 0x00D3 }, /* LATIN_CAPITAL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_U, 0 }, 0x00DA }, /* LATIN_CAPITAL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_Y, 0 }, 0x00DD }, /* LATIN_CAPITAL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_a, 0 }, 0x00E1 }, /* LATIN_SMALL_LETTER_A_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_e, 0 }, 0x00E9 }, /* LATIN_SMALL_LETTER_E_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_i, 0 }, 0x00ED }, /* LATIN_SMALL_LETTER_I_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_o, 0 }, 0x00F3 }, /* LATIN_SMALL_LETTER_O_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_u, 0 }, 0x00FA }, /* LATIN_SMALL_LETTER_U_WITH_ACUTE */
{ { GDK_Multi_key, GDK_acute, GDK_y, 0 }, 0x00FD }, /* LATIN_SMALL_LETTER_Y_WITH_ACUTE */
{ { GDK_Multi_key, GDK_cedilla, GDK_S, 0 }, 0x015E }, /* LATIN_CAPITAL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_cedilla, GDK_s, 0 }, 0x015F }, /* LATIN_SMALL_LETTER_S_WITH_CEDILLA */
{ { GDK_Multi_key, GDK_breve, GDK_G, 0 }, 0x011E }, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
{ { GDK_Multi_key, GDK_breve, GDK_g, 0 }, 0x011F }, /* LATIN_SMALL_LETTER_G_WITH_BREVE */
};
guint16 gtk_compose_ignore[] = {
GDK_Shift_L,
GDK_Shift_R,
GDK_Control_L,
GDK_Control_R,
GDK_Caps_Lock,
GDK_Shift_Lock,
GDK_Meta_L,
GDK_Meta_R,
GDK_Alt_L,
GDK_Alt_R,
GDK_Super_L,
GDK_Super_R,
GDK_Hyper_L,
GDK_Hyper_R
};
static void gtk_im_context_simple_class_init (GtkIMContextSimpleClass *class);
static void gtk_im_context_simple_init (GtkIMContextSimple *im_context_simple);
static gboolean gtk_im_context_simple_filter_keypress (GtkIMContext *context,
GdkEventKey *key);
GtkType
gtk_im_context_simple_get_type (void)
{
static GtkType im_context_simple_type = 0;
if (!im_context_simple_type)
{
static const GtkTypeInfo im_context_simple_info =
{
"GtkIMContextSimple",
sizeof (GtkIMContextSimple),
sizeof (GtkIMContextSimpleClass),
(GtkClassInitFunc) gtk_im_context_simple_class_init,
(GtkObjectInitFunc) gtk_im_context_simple_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
im_context_simple_type = gtk_type_unique (GTK_TYPE_IM_CONTEXT, &im_context_simple_info);
}
return im_context_simple_type;
}
static void
gtk_im_context_simple_class_init (GtkIMContextSimpleClass *class)
{
GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class);
im_context_class->filter_keypress = gtk_im_context_simple_filter_keypress;
}
static void
gtk_im_context_simple_init (GtkIMContextSimple *im_context_simple)
{
}
GtkIMContext *
gtk_im_context_simple_new (void)
{
return GTK_IM_CONTEXT (gtk_type_new (GTK_TYPE_IM_CONTEXT_SIMPLE));
}
/**
* unicode_guchar4_to_utf8:
* @ch: a ISO10646 character code
* @out: output buffer, must have at least 6 bytes of space.
*
* Convert a single character to utf8
*
* Return value: number of bytes written
**/
static int
ucs4_to_utf8 (unicode_char_t c, char *outbuf)
{
size_t len = 0;
int first;
int i;
if (c < 0x80)
{
first = 0;
len = 1;
}
else if (c < 0x800)
{
first = 0xc0;
len = 2;
}
else if (c < 0x10000)
{
first = 0xe0;
len = 3;
}
else if (c < 0x200000)
{
first = 0xf0;
len = 4;
}
else if (c < 0x4000000)
{
first = 0xf8;
len = 5;
}
else
{
first = 0xfc;
len = 6;
}
for (i = len - 1; i > 0; --i)
{
outbuf[i] = (c & 0x3f) | 0x80;
c >>= 6;
}
outbuf[0] = c | first;
return len;
}
static void
gtk_im_context_simple_commit_char (GtkIMContext *context,
unicode_char_t ch)
{
gchar buf[7];
gint len;
len = ucs4_to_utf8 (ch, buf);
buf[len] = '\0';
gtk_signal_emit_by_name (GTK_OBJECT (context), "commit", &buf);
}
static int
compare_seq (const void *key, const void *value)
{
int i = 0;
const guint *keysyms = key;
const GtkComposeSeq *seq = value;
while (keysyms[i])
{
if (keysyms[i] < seq->keysyms[i])
return -1;
else if (keysyms[i] > seq->keysyms[i])
return 1;
i++;
}
return 0;
}
static gboolean
gtk_im_context_simple_filter_keypress (GtkIMContext *context,
GdkEventKey *event)
{
GtkIMContextSimple *context_simple = GTK_IM_CONTEXT_SIMPLE (context);
GtkComposeSeq *seq;
unicode_char_t ch;
int n_compose = 0;
int i;
/* Ignore modifier key presses
*/
for (i=0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
if (event->keyval == gtk_compose_ignore[i])
return FALSE;
/* Then, check for compose sequences
*/
while (context_simple->compose_buffer[n_compose] != 0)
n_compose++;
context_simple->compose_buffer[n_compose++] = event->keyval;
context_simple->compose_buffer[n_compose] = 0;
seq = bsearch (context_simple->compose_buffer,
gtk_compose_seqs, G_N_ELEMENTS (gtk_compose_seqs),
sizeof (GtkComposeSeq), compare_seq);
if (seq)
{
if (n_compose == GTK_MAX_COMPOSE_LEN ||
seq->keysyms[n_compose] == 0) /* complete sequence */
{
gtk_im_context_simple_commit_char (context, seq->unicode);
context_simple->compose_buffer[0] = 0;
}
return TRUE;
}
/* No compose sequences found, try simple conversion to unicode
*/
context_simple->compose_buffer[0] = 0;
if (n_compose > 1) /* Invalid sequence */
{
gdk_beep();
return TRUE;
}
ch = gdk_keyval_to_unicode (event->keyval);
if (ch != 0)
{
gtk_im_context_simple_commit_char (context, ch);
return TRUE;
}
else
return FALSE;
}

63
gtk/gtkimcontextsimple.h Normal file
View File

@ -0,0 +1,63 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat Software
*
* 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.
*/
#ifndef __GTK_IM_CONTEXT_SIMPLE_H__
#define __GTK_IM_CONTEXT_SIMPLE_H__
#include <gtk/gtkimcontext.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_IM_CONTEXT_SIMPLE (gtk_im_context_simple_get_type ())
#define GTK_IM_CONTEXT_SIMPLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IM_CONTEXT_SIMPLE, GtkIMContextSimple))
#define GTK_IM_CONTEXT_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT_SIMPLE, GtkIMContextSimpleClass))
#define GTK_IS_IM_CONTEXT_SIMPLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IM_CONTEXT_SIMPLE))
#define GTK_IS_IM_CONTEXT_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT_SIMPLE))
#define GTK_IM_CONTEXT_SIMPLE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT_SIMPLE, GtkIMContextSimpleClass))
typedef struct _GtkIMContextSimple GtkIMContextSimple;
typedef struct _GtkIMContextSimpleClass GtkIMContextSimpleClass;
#define GTK_MAX_COMPOSE_LEN 4
struct _GtkIMContextSimple
{
GtkIMContext object;
guint compose_buffer[GTK_MAX_COMPOSE_LEN + 1];
};
struct _GtkIMContextSimpleClass
{
GtkIMContextClass parent_class;
};
GtkType gtk_im_context_simple_get_type (void);
GtkIMContext *gtk_im_context_simple_new (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_IM_CONTEXT_SIMPLE_H__ */

247
gtk/gtkimmulticontext.c Normal file
View File

@ -0,0 +1,247 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat, 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.
*/
#include "gtksignal.h"
#include "gtkimmulticontext.h"
#include "gtkimcontextsimple.h"
static void gtk_im_multicontext_class_init (GtkIMMulticontextClass *class);
static void gtk_im_multicontext_init (GtkIMMulticontext *im_multicontext);
static void gtk_im_multicontext_finalize (GObject *object);
static void gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
GtkIMContext *slave);
static void gtk_im_multicontext_set_client_window (GtkIMContext *context,
GdkWindow *window);
static void gtk_im_multicontext_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs);
static gboolean gtk_im_multicontext_filter_keypress (GtkIMContext *context,
GdkEventKey *event);
static void gtk_im_multicontext_focus_in (GtkIMContext *context);
static void gtk_im_multicontext_focus_out (GtkIMContext *context);
void gtk_im_multicontext_preedit_start_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext);
void gtk_im_multicontext_preedit_end_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext);
void gtk_im_multicontext_preedit_changed_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext);
void gtk_im_multicontext_commit_cb (GtkIMContext *slave,
const gchar *str,
GtkIMMulticontext *multicontext);
static GtkIMContextClass *parent_class;
GtkType
gtk_im_multicontext_get_type (void)
{
static GtkType im_multicontext_type = 0;
if (!im_multicontext_type)
{
static const GtkTypeInfo im_multicontext_info =
{
"GtkIMMulticontext",
sizeof (GtkIMMulticontext),
sizeof (GtkIMMulticontextClass),
(GtkClassInitFunc) gtk_im_multicontext_class_init,
(GtkObjectInitFunc) gtk_im_multicontext_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
im_multicontext_type = gtk_type_unique (GTK_TYPE_IM_CONTEXT, &im_multicontext_info);
}
return im_multicontext_type;
}
static void
gtk_im_multicontext_class_init (GtkIMMulticontextClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
im_context_class->set_client_window = gtk_im_multicontext_set_client_window;
im_context_class->get_preedit_string = gtk_im_multicontext_get_preedit_string;
im_context_class->filter_keypress = gtk_im_multicontext_filter_keypress;
im_context_class->focus_in = gtk_im_multicontext_focus_in;
im_context_class->focus_out = gtk_im_multicontext_focus_out;
gobject_class->finalize = gtk_im_multicontext_finalize;
}
static void
gtk_im_multicontext_init (GtkIMMulticontext *multicontext)
{
multicontext->slave = NULL;
}
GtkIMContext *
gtk_im_multicontext_new (void)
{
return GTK_IM_CONTEXT (gtk_type_new (GTK_TYPE_IM_MULTICONTEXT));
}
static void
gtk_im_multicontext_finalize (GObject *object)
{
gtk_im_multicontext_set_slave (GTK_IM_MULTICONTEXT (object), NULL);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
GtkIMContext *slave)
{
if (multicontext->slave)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (multicontext->slave), multicontext);
gtk_object_unref (GTK_OBJECT (multicontext->slave));
}
multicontext->slave = slave;
if (multicontext->slave)
{
gtk_object_ref (GTK_OBJECT (multicontext->slave));
gtk_object_sink (GTK_OBJECT (multicontext->slave));
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "preedit_start",
GTK_SIGNAL_FUNC (gtk_im_multicontext_preedit_start_cb),
multicontext);
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "preedit_end",
GTK_SIGNAL_FUNC (gtk_im_multicontext_preedit_end_cb),
multicontext);
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "preedit_changed",
GTK_SIGNAL_FUNC (gtk_im_multicontext_preedit_changed_cb),
multicontext);
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "commit",
GTK_SIGNAL_FUNC (gtk_im_multicontext_commit_cb),
multicontext);
}
}
static GtkIMContext *
gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext)
{
if (!multicontext->slave)
gtk_im_multicontext_set_slave (multicontext, gtk_im_context_simple_new ());
return multicontext->slave;
}
static void
gtk_im_multicontext_set_client_window (GtkIMContext *context,
GdkWindow *window)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
if (slave)
gtk_im_context_set_client_window (slave, window);
}
static void
gtk_im_multicontext_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
if (slave)
gtk_im_context_get_preedit_string (slave, str, attrs);
else
{
if (str)
*str = g_strdup ("");
if (attrs)
*attrs = pango_attr_list_new ();
}
}
static gboolean
gtk_im_multicontext_filter_keypress (GtkIMContext *context,
GdkEventKey *event)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
if (slave)
return gtk_im_context_filter_keypress (slave, event);
else
return FALSE;
}
static void
gtk_im_multicontext_focus_in (GtkIMContext *context)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
if (slave)
return gtk_im_context_focus_in (slave);
}
static void
gtk_im_multicontext_focus_out (GtkIMContext *context)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
if (slave)
return gtk_im_context_focus_out (slave);
}
void
gtk_im_multicontext_preedit_start_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "preedit_start");
}
void
gtk_im_multicontext_preedit_end_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "preedit_end");
}
void
gtk_im_multicontext_preedit_changed_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "preedit_changed");
}
void
gtk_im_multicontext_commit_cb (GtkIMContext *slave,
const gchar *str,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "commit", str);;
}

61
gtk/gtkimmulticontext.h Normal file
View File

@ -0,0 +1,61 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat Software
*
* 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.
*/
#ifndef __GTK_IM_MULTICONTEXT_H__
#define __GTK_IM_MULTICONTEXT_H__
#include <gtk/gtkimcontext.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_IM_MULTICONTEXT (gtk_im_multicontext_get_type ())
#define GTK_IM_MULTICONTEXT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IM_MULTICONTEXT, GtkIMMulticontext))
#define GTK_IM_MULTICONTEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_MULTICONTEXT, GtkIMMulticontextClass))
#define GTK_IS_IM_MULTICONTEXT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IM_MULTICONTEXT))
#define GTK_IS_IM_MULTICONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_MULTICONTEXT))
#define GTK_IM_MULTICONTEXT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_IM_MULTICONTEXT, GtkIMMulticontextClass))
typedef struct _GtkIMMulticontext GtkIMMulticontext;
typedef struct _GtkIMMulticontextClass GtkIMMulticontextClass;
struct _GtkIMMulticontext
{
GtkIMContext object;
GtkIMContext *slave;
};
struct _GtkIMMulticontextClass
{
GtkIMContextClass parent_class;
};
GtkType gtk_im_multicontext_get_type (void);
GtkIMContext *gtk_im_multicontext_new (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_IM_MULTICONTEXT_H__ */

View File

@ -29,6 +29,7 @@
static void gtk_invisible_class_init (GtkInvisibleClass *klass);
static void gtk_invisible_init (GtkInvisible *invisible);
static void gtk_invisible_destroy (GtkObject *object);
static void gtk_invisible_realize (GtkWidget *widget);
static void gtk_invisible_show (GtkWidget *widget);
static void gtk_invisible_size_allocate (GtkWidget *widget,
@ -62,13 +63,17 @@ gtk_invisible_get_type (void)
static void
gtk_invisible_class_init (GtkInvisibleClass *class)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
widget_class = (GtkWidgetClass*) class;
object_class = (GtkObjectClass*) class;
widget_class->realize = gtk_invisible_realize;
widget_class->show = gtk_invisible_show;
widget_class->size_allocate = gtk_invisible_size_allocate;
object_class->destroy = gtk_invisible_destroy;
}
static void
@ -78,6 +83,20 @@ gtk_invisible_init (GtkInvisible *invisible)
gtk_widget_ref (GTK_WIDGET (invisible));
gtk_object_sink (GTK_OBJECT (invisible));
invisible->has_user_ref_count = TRUE;
}
static void
gtk_invisible_destroy (GtkObject *object)
{
GtkInvisible *invisible = GTK_INVISIBLE (object);
if (invisible->has_user_ref_count)
{
invisible->has_user_ref_count = FALSE;
gtk_widget_unref (GTK_WIDGET (invisible));
}
}
GtkWidget*

View File

@ -51,6 +51,7 @@ typedef struct _GtkInvisibleClass GtkInvisibleClass;
struct _GtkInvisible
{
GtkWidget widget;
gboolean has_user_ref_count;
};
struct _GtkInvisibleClass

File diff suppressed because it is too large Load Diff

View File

@ -54,14 +54,14 @@ struct _GtkLabel
GtkMisc misc;
gchar *label;
GdkWChar *label_wc;
gchar *pattern;
gchar *pattern;
GtkLabelWord *words;
guint max_width : 16;
guint jtype : 2;
gboolean wrap;
gboolean wrap : 1;
/*< private >*/
gint rtl : 2; /* Base dir, cached to detect changes */
PangoLayout *layout;
};
struct _GtkLabelClass
@ -69,18 +69,17 @@ struct _GtkLabelClass
GtkMiscClass parent_class;
};
GtkType gtk_label_get_type (void);
GtkWidget * gtk_label_new (const char *str);
void gtk_label_set_text (GtkLabel *label,
const char *str);
void gtk_label_set_justify (GtkLabel *label,
GtkJustification jtype);
void gtk_label_set_pattern (GtkLabel *label,
const gchar *pattern);
void gtk_label_set_line_wrap (GtkLabel *label,
gboolean wrap);
gchar * gtk_label_get_text (GtkLabel *label);
GtkType gtk_label_get_type (void);
GtkWidget *gtk_label_new (const char *str);
void gtk_label_set_text (GtkLabel *label,
const char *str);
gchar * gtk_label_get_text (GtkLabel *label);
void gtk_label_set_justify (GtkLabel *label,
GtkJustification jtype);
void gtk_label_set_pattern (GtkLabel *label,
const gchar *pattern);
void gtk_label_set_line_wrap (GtkLabel *label,
gboolean wrap);
/* Convenience function to set the name and pattern by parsing
* a string with embedded underscores, and return the appropriate
* key symbol for the accelerator.

View File

@ -270,25 +270,52 @@ gtk_layout_move (GtkLayout *layout,
}
}
static void
gtk_layout_set_adjustment_upper (GtkAdjustment *adj, gfloat upper)
{
if (upper != adj->upper)
{
gfloat min = MAX (0., upper - adj->page_size);
gboolean value_changed = FALSE;
adj->upper = upper;
if (adj->value > min)
{
adj->value = min;
value_changed = TRUE;
}
gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed");
if (value_changed)
gtk_signal_emit_by_name (GTK_OBJECT (adj), "value_changed");
}
}
void
gtk_layout_set_size (GtkLayout *layout,
guint width,
guint height)
{
GtkWidget *widget;
g_return_if_fail (layout != NULL);
g_return_if_fail (GTK_IS_LAYOUT (layout));
widget = GTK_WIDGET (layout);
layout->width = width;
layout->height = height;
layout->hadjustment->upper = layout->width;
gtk_signal_emit_by_name (GTK_OBJECT (layout->hadjustment), "changed");
layout->vadjustment->upper = layout->height;
gtk_signal_emit_by_name (GTK_OBJECT (layout->vadjustment), "changed");
gtk_layout_set_adjustment_upper (layout->hadjustment, layout->width);
gtk_layout_set_adjustment_upper (layout->vadjustment, layout->height);
if (GTK_WIDGET_REALIZED (layout))
gdk_window_resize (layout->bin_window, width, height);
{
width = MAX (width, widget->allocation.width);
height = MAX (height, widget->allocation.height);
gdk_window_resize (layout->bin_window, width, height);
}
}
void
@ -433,8 +460,8 @@ gtk_layout_realize (GtkWidget *widget)
attributes.x = 0;
attributes.y = 0;
attributes.width = layout->width;
attributes.height = layout->height;
attributes.width = MAX (layout->width, widget->allocation.width);
attributes.height = MAX (layout->height, widget->allocation.height);
attributes.event_mask = GDK_EXPOSURE_MASK | GDK_SCROLL_MASK |
gtk_widget_get_events (widget);
@ -561,18 +588,22 @@ gtk_layout_size_allocate (GtkWidget *widget,
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
gdk_window_resize (layout->bin_window,
MAX (layout->width, allocation->width),
MAX (layout->height, allocation->height));
}
layout->hadjustment->page_size = allocation->width;
layout->hadjustment->page_increment = allocation->width / 2;
layout->hadjustment->lower = 0;
layout->hadjustment->upper = layout->width;
layout->hadjustment->upper = MAX (allocation->width, layout->width);
gtk_signal_emit_by_name (GTK_OBJECT (layout->hadjustment), "changed");
layout->vadjustment->page_size = allocation->height;
layout->vadjustment->page_increment = allocation->height / 2;
layout->vadjustment->lower = 0;
layout->vadjustment->upper = layout->height;
layout->vadjustment->upper = MAX (allocation->height, layout->height);
gtk_signal_emit_by_name (GTK_OBJECT (layout->vadjustment), "changed");
}

View File

@ -150,7 +150,8 @@ static const GDebugKey gtk_debug_keys[] = {
{"misc", GTK_DEBUG_MISC},
{"signals", GTK_DEBUG_SIGNALS},
{"dnd", GTK_DEBUG_DND},
{"plugsocket", GTK_DEBUG_PLUGSOCKET}
{"plugsocket", GTK_DEBUG_PLUGSOCKET},
{"text", GTK_DEBUG_TEXT}
};
static const guint gtk_ndebug_keys = sizeof (gtk_debug_keys) / sizeof (GDebugKey);

View File

@ -7,6 +7,7 @@ BOOL:POINTER,STRING,STRING,POINTER
ENUM:ENUM
INT:POINTER
INT:POINTER,CHAR,CHAR
INT:OBJECT,BOXED,POINTER
NONE:BOOL
NONE:BOXED
NONE:ENUM
@ -14,6 +15,7 @@ NONE:ENUM,FLOAT
NONE:ENUM,FLOAT,BOOL
NONE:INT
NONE:INT,INT
NONE:INT,INT,INT
NONE:INT,INT,POINTER
NONE:NONE
NONE:OBJECT

View File

@ -7,6 +7,7 @@ BOOL:POINTER,STRING,STRING,POINTER
ENUM:ENUM
INT:POINTER
INT:POINTER,CHAR,CHAR
INT:OBJECT,BOXED,POINTER
NONE:BOOL
NONE:BOXED
NONE:ENUM
@ -14,6 +15,7 @@ NONE:ENUM,FLOAT
NONE:ENUM,FLOAT,BOOL
NONE:INT
NONE:INT,INT
NONE:INT,INT,INT
NONE:INT,INT,POINTER
NONE:NONE
NONE:OBJECT

View File

@ -42,28 +42,26 @@ extern "C" {
typedef enum
{
PRIVATE_GTK_USER_STYLE = 1 << 0,
PRIVATE_GTK_REDRAW_PENDING = 1 << 1,
PRIVATE_GTK_RESIZE_PENDING = 1 << 2,
PRIVATE_GTK_RESIZE_NEEDED = 1 << 3,
PRIVATE_GTK_LEAVE_PENDING = 1 << 4,
PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
PRIVATE_GTK_IN_REPARENT = 1 << 6,
PRIVATE_GTK_IS_OFFSCREEN = 1 << 7,
PRIVATE_GTK_FULLDRAW_PENDING = 1 << 8
PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */
PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */
} GtkPrivateFlags;
/* Macros for extracting a widgets private_flags from GtkWidget.
*/
#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags)
#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0)
#define GTK_WIDGET_REDRAW_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_PENDING) != 0)
#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0)
#define GTK_WIDGET_RESIZE_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_NEEDED) != 0)
#define GTK_WIDGET_LEAVE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_LEAVE_PENDING) != 0)
#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
#define GTK_WIDGET_IS_OFFSCREEN(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IS_OFFSCREEN) != 0)
#define GTK_WIDGET_FULLDRAW_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_FULLDRAW_PENDING) != 0)
#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0)
#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0)
/* Macros for setting and clearing private widget flags.
* we use a preprocessor string concatenation here for a clear

View File

@ -349,6 +349,8 @@ gtk_progress_bar_size_request (GtkWidget *widget,
GtkProgress *progress;
GtkProgressBar *pbar;
gchar *buf;
PangoRectangle logical_rect;
PangoLayout *layout;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_PROGRESS_BAR (widget));
@ -357,26 +359,30 @@ gtk_progress_bar_size_request (GtkWidget *widget,
progress = GTK_PROGRESS (widget);
pbar = GTK_PROGRESS_BAR (widget);
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
buf = gtk_progress_get_text_from_value (progress, progress->adjustment->upper);
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, buf, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
pango_layout_unref (layout);
g_free (buf);
}
if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
{
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
buf = gtk_progress_get_text_from_value (progress,
progress->adjustment->upper);
requisition->width = MAX (MIN_HORIZONTAL_BAR_WIDTH,
2 * widget->style->klass->xthickness + 3 +
gdk_text_width (widget->style->font,
buf, strlen (buf)) +
2 * TEXT_SPACING);
logical_rect.width / PANGO_SCALE + 2 * TEXT_SPACING);
requisition->height = MAX (MIN_HORIZONTAL_BAR_HEIGHT,
2 * widget->style->klass->ythickness + 3 +
gdk_text_height (widget->style->font,
buf, strlen (buf)) +
2 * TEXT_SPACING);
g_free (buf);
logical_rect.height / PANGO_SCALE + 2 * TEXT_SPACING);
}
else
{
@ -388,21 +394,13 @@ gtk_progress_bar_size_request (GtkWidget *widget,
{
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
buf = gtk_progress_get_text_from_value (progress,
progress->adjustment->upper);
requisition->width = MAX (MIN_VERTICAL_BAR_WIDTH,
2 * widget->style->klass->xthickness + 3 +
gdk_text_width (widget->style->font,
buf, strlen (buf)) +
2 * TEXT_SPACING);
logical_rect.width / PANGO_SCALE + 2 * TEXT_SPACING);
requisition->height = MAX (MIN_VERTICAL_BAR_HEIGHT,
2 * widget->style->klass->ythickness + 3 +
gdk_text_height (widget->style->font,
buf, strlen (buf)) +
2 * TEXT_SPACING);
g_free (buf);
logical_rect.height / PANGO_SCALE + 2 * TEXT_SPACING);
}
else
{
@ -707,17 +705,23 @@ gtk_progress_bar_paint (GtkProgress *progress)
gint y;
gchar *buf;
GdkRectangle rect;
PangoLayout *layout;
PangoRectangle logical_rect;
buf = gtk_progress_get_current_text (progress);
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, buf, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
x = widget->style->klass->xthickness + 1 +
(widget->allocation.width - 2 * widget->style->klass->xthickness -
3 - gdk_text_width (widget->style->font, buf, strlen (buf)))
3 - logical_rect.width / PANGO_SCALE)
* progress->x_align;
y = widget->style->font->ascent + 1 +
y = widget->style->klass->ythickness + 1 +
(widget->allocation.height - 2 * widget->style->klass->ythickness -
3 - gdk_text_height (widget->style->font, buf, strlen (buf)))
3 - logical_rect.height / PANGO_SCALE)
* progress->y_align;
rect.x = widget->style->klass->xthickness + 1;
@ -730,12 +734,13 @@ gtk_progress_bar_paint (GtkProgress *progress)
gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state],
&rect);
gdk_draw_text (progress->offscreen_pixmap, widget->style->font,
widget->style->fg_gc[widget->state],
x, y, buf, strlen (buf));
gdk_draw_layout (progress->offscreen_pixmap,
widget->style->fg_gc[widget->state],
x, y, layout);
gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state],
NULL);
pango_layout_unref (layout);
g_free (buf);
}
}

View File

@ -417,6 +417,9 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
else
shadow_type = GTK_SHADOW_OUT;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
x = widget->allocation.x + widget->allocation.width - (width + x - widget->allocation.x);
gtk_paint_option (widget->style, widget->window,
GTK_WIDGET_STATE (widget), shadow_type,
area, widget, "radiobutton",

View File

@ -125,6 +125,8 @@ static guint gtk_rc_parse_font (GScanner *scanner,
GtkRcStyle *rc_style);
static guint gtk_rc_parse_fontset (GScanner *scanner,
GtkRcStyle *rc_style);
static guint gtk_rc_parse_font_name (GScanner *scanner,
GtkRcStyle *rc_style);
static guint gtk_rc_parse_engine (GScanner *scanner,
GtkRcStyle *rc_style);
static guint gtk_rc_parse_pixmap_path (GScanner *scanner);
@ -199,6 +201,7 @@ static const struct
{ "text", GTK_RC_TOKEN_TEXT },
{ "font", GTK_RC_TOKEN_FONT },
{ "fontset", GTK_RC_TOKEN_FONTSET },
{ "font_name", GTK_RC_TOKEN_FONT_NAME },
{ "bg_pixmap", GTK_RC_TOKEN_BG_PIXMAP },
{ "pixmap_path", GTK_RC_TOKEN_PIXMAP_PATH },
{ "style", GTK_RC_TOKEN_STYLE },
@ -803,10 +806,8 @@ gtk_rc_style_unref (GtkRcStyle *rc_style)
if (rc_style->name)
g_free (rc_style->name);
if (rc_style->fontset_name)
g_free (rc_style->fontset_name);
if (rc_style->font_name)
g_free (rc_style->font_name);
if (rc_style->font_desc)
pango_font_description_free (rc_style->font_desc);
for (i=0 ; i<5 ; i++)
if (rc_style->bg_pixmap_name[i])
@ -1048,8 +1049,8 @@ gtk_rc_add_rc_sets (GSList *slist,
new_style = gtk_rc_style_new ();
*new_style = *rc_style;
new_style->name = g_strdup (rc_style->name);
new_style->font_name = g_strdup (rc_style->font_name);
new_style->fontset_name = g_strdup (rc_style->fontset_name);
if (rc_style->font_desc)
new_style->font_desc = pango_font_description_copy (rc_style->font_desc);
for (i = 0; i < 5; i++)
new_style->bg_pixmap_name[i] = g_strdup (rc_style->bg_pixmap_name[i]);
@ -1249,26 +1250,20 @@ gtk_rc_style_to_style (GtkRcStyle *rc_style)
style = gtk_style_new ();
style->rc_style = rc_style;
if (rc_style->fontset_name)
if (rc_style->font_desc)
{
pango_font_description_free (style->font_desc);
style->font_desc = pango_font_description_copy (rc_style->font_desc);
old_font = style->font;
style->font = gdk_fontset_load (rc_style->fontset_name);
style->font = gdk_font_from_description (style->font_desc);
if (style->font)
gdk_font_unref (old_font);
else
style->font = old_font;
}
else if (rc_style->font_name)
{
old_font = style->font;
style->font = gdk_font_load (rc_style->font_name);
if (style->font)
gdk_font_unref (old_font);
else
style->font = old_font;
}
for (i = 0; i < 5; i++)
{
if (rc_style->color_flags[i] & GTK_RC_FG)
@ -1349,10 +1344,8 @@ gtk_rc_style_init (GSList *rc_styles)
}
}
if (!proto_style->font_name && rc_style->font_name)
proto_style->font_name = g_strdup (rc_style->font_name);
if (!proto_style->fontset_name && rc_style->fontset_name)
proto_style->fontset_name = g_strdup (rc_style->fontset_name);
if (!proto_style->font_desc && rc_style->font_desc)
proto_style->font_desc = pango_font_description_copy (rc_style->font_desc);
if (!proto_style->engine && rc_style->engine)
{
@ -1505,17 +1498,11 @@ gtk_rc_parse_style (GScanner *scanner)
rc_style->base[i] = parent_style->base[i];
}
if (parent_style->fontset_name)
if (parent_style->font_desc)
{
if (rc_style->fontset_name)
g_free (rc_style->fontset_name);
rc_style->fontset_name = g_strdup (parent_style->fontset_name);
}
else if (parent_style->font_name)
{
if (rc_style->font_name)
g_free (rc_style->font_name);
rc_style->font_name = g_strdup (parent_style->font_name);
if (rc_style->font_desc)
pango_font_description_free (rc_style->font_desc);
rc_style->font_desc = pango_font_description_copy (parent_style->font_desc);
}
for (i = 0; i < 5; i++)
@ -1562,6 +1549,9 @@ gtk_rc_parse_style (GScanner *scanner)
case GTK_RC_TOKEN_FONTSET:
token = gtk_rc_parse_fontset (scanner, rc_style);
break;
case GTK_RC_TOKEN_FONT_NAME:
token = gtk_rc_parse_font_name (scanner, rc_style);
break;
case GTK_RC_TOKEN_ENGINE:
token = gtk_rc_parse_engine (scanner, rc_style);
break;
@ -1575,10 +1565,9 @@ gtk_rc_parse_style (GScanner *scanner)
{
if (insert)
{
if (rc_style->fontset_name)
g_free (rc_style->fontset_name);
if (rc_style->font_name)
g_free (rc_style->font_name);
if (rc_style->font_desc)
pango_font_description_free (rc_style->font_desc);
for (i = 0; i < 5; i++)
if (rc_style->bg_pixmap_name[i])
g_free (rc_style->bg_pixmap_name[i]);
@ -1594,10 +1583,8 @@ gtk_rc_parse_style (GScanner *scanner)
{
if (insert)
{
if (rc_style->fontset_name)
g_free (rc_style->fontset_name);
if (rc_style->font_name)
g_free (rc_style->font_name);
if (rc_style->font_desc)
pango_font_description_free (rc_style->font_desc);
for (i = 0; i < 5; i++)
if (rc_style->bg_pixmap_name[i])
@ -1849,10 +1836,8 @@ gtk_rc_parse_font (GScanner *scanner,
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
if (rc_style->font_name)
g_free (rc_style->font_name);
rc_style->font_name = g_strdup (scanner->value.v_string);
/* Ignore, do nothing */
return G_TOKEN_NONE;
}
@ -1874,10 +1859,31 @@ gtk_rc_parse_fontset (GScanner *scanner,
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
/* Do nothing - silently ignore */
if (rc_style->fontset_name)
g_free (rc_style->fontset_name);
rc_style->fontset_name = g_strdup (scanner->value.v_string);
return G_TOKEN_NONE;
}
static guint
gtk_rc_parse_font_name (GScanner *scanner,
GtkRcStyle *rc_style)
{
guint token;
token = g_scanner_get_next_token (scanner);
if (token != GTK_RC_TOKEN_FONT_NAME)
return GTK_RC_TOKEN_FONT;
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_EQUAL_SIGN)
return G_TOKEN_EQUAL_SIGN;
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
rc_style->font_desc = pango_font_description_from_string (scanner->value.v_string);
return G_TOKEN_NONE;
}

View File

@ -46,9 +46,8 @@ typedef enum {
struct _GtkRcStyle
{
gchar *name;
gchar *font_name;
gchar *fontset_name;
gchar *bg_pixmap_name[5];
PangoFontDescription *font_desc;
GtkRcFlags color_flags[5];
GdkColor fg[5];
@ -113,6 +112,7 @@ typedef enum {
GTK_RC_TOKEN_TEXT,
GTK_RC_TOKEN_FONT,
GTK_RC_TOKEN_FONTSET,
GTK_RC_TOKEN_FONT_NAME,
GTK_RC_TOKEN_BG_PIXMAP,
GTK_RC_TOKEN_PIXMAP_PATH,
GTK_RC_TOKEN_STYLE,

View File

@ -28,7 +28,6 @@
#include "gtkcontainer.h"
#include "gtkscale.h"
enum {
ARG_0,
ARG_DIGITS,
@ -260,25 +259,29 @@ gtk_scale_set_value_pos (GtkScale *scale,
}
}
gint
gtk_scale_get_value_width (GtkScale *scale)
void
gtk_scale_get_value_size (GtkScale *scale,
gint *width,
gint *height)
{
GtkRange *range;
gchar buffer[128];
gfloat value;
gint temp;
gint return_val;
gint digits;
gint i, j;
g_return_val_if_fail (scale != NULL, 0);
g_return_val_if_fail (GTK_IS_SCALE (scale), 0);
g_return_if_fail (scale != NULL);
g_return_if_fail (GTK_IS_SCALE (scale));
return_val = 0;
if (scale->draw_value)
{
PangoLayout *layout;
PangoRectangle logical_rect;
gchar buffer[128];
gfloat value;
gint digits;
gint i, j;
range = GTK_RANGE (scale);
layout = gtk_widget_create_pango_layout (GTK_WIDGET (scale));
value = ABS (range->adjustment->lower);
if (value == 0) value = 1;
digits = log10 (value) + 1;
@ -296,8 +299,14 @@ gtk_scale_get_value_width (GtkScale *scale)
buffer[i++] = '0';
buffer[i] = '\0';
return_val = gdk_string_measure (GTK_WIDGET (scale)->style->font, buffer);
pango_layout_set_text (layout, buffer, i);
pango_layout_get_extents (layout, NULL, &logical_rect);
if (width)
*width = logical_rect.width / PANGO_SCALE;
if (height)
*height = logical_rect.width / PANGO_SCALE;
value = ABS (range->adjustment->upper);
if (value == 0) value = 1;
digits = log10 (value) + 1;
@ -315,11 +324,37 @@ gtk_scale_get_value_width (GtkScale *scale)
buffer[i++] = '0';
buffer[i] = '\0';
temp = gdk_string_measure (GTK_WIDGET (scale)->style->font, buffer);
return_val = MAX (return_val, temp);
pango_layout_set_text (layout, buffer, i);
pango_layout_get_extents (layout, NULL, &logical_rect);
if (width)
*width = MAX (*width, logical_rect.width / PANGO_SCALE);
if (height)
*height = MAX (*height, logical_rect.height / PANGO_SCALE);
pango_layout_unref (layout);
}
else
{
if (width)
*width = 0;
if (height)
*height = 0;
}
return return_val;
}
gint
gtk_scale_get_value_width (GtkScale *scale)
{
gint width;
g_return_val_if_fail (scale != NULL, 0);
g_return_val_if_fail (GTK_IS_SCALE (scale), 0);
gtk_scale_get_value_size (scale, &width, NULL);
return width;
}
void

View File

@ -66,7 +66,6 @@ struct _GtkScaleClass
void (* draw_value) (GtkScale *scale);
};
GtkType gtk_scale_get_type (void);
void gtk_scale_set_digits (GtkScale *scale,
gint digits);
@ -75,10 +74,12 @@ void gtk_scale_set_draw_value (GtkScale *scale,
void gtk_scale_set_value_pos (GtkScale *scale,
GtkPositionType pos);
gint gtk_scale_get_value_width (GtkScale *scale);
void gtk_scale_get_value_size (GtkScale *scale,
gint *width,
gint *height);
void gtk_scale_draw_value (GtkScale *scale);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -513,6 +513,9 @@ gtk_spin_button_size_allocate (GtkWidget *widget,
if (child_allocation.width > ARROW_SIZE + 2 * widget->style->klass->xthickness)
child_allocation.width -= ARROW_SIZE + 2 * widget->style->klass->xthickness;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
child_allocation.x += ARROW_SIZE + 2 * widget->style->klass->xthickness;
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, &child_allocation);
widget->allocation = *allocation;
@ -520,9 +523,14 @@ gtk_spin_button_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget))
{
child_allocation.width = ARROW_SIZE + 2 * widget->style->klass->xthickness;
child_allocation.height = widget->requisition.height;
child_allocation.x = (allocation->x + allocation->width - ARROW_SIZE -
2 * widget->style->klass->xthickness);
child_allocation.height = widget->requisition.height;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
child_allocation.x = (allocation->x + allocation->width - ARROW_SIZE -
2 * widget->style->klass->xthickness);
else
child_allocation.x = allocation->x;
child_allocation.y = allocation->y + (allocation->height - widget->requisition.height) / 2;
gdk_window_move_resize (GTK_SPIN_BUTTON (widget)->panel,

View File

@ -403,10 +403,12 @@ gtk_style_new (void)
style = g_new0 (GtkStyle, 1);
style->font_desc = pango_font_description_from_string ("Sans 10");
if (!default_font)
{
default_font =
gdk_font_load ("-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1");
default_font = gdk_font_from_description (style->font_desc);
if (!default_font)
default_font = gdk_font_load ("fixed");
if (!default_font)
@ -746,9 +748,11 @@ gtk_style_destroy (GtkStyle *style)
}
gdk_font_unref (style->font);
pango_font_description_free (style->font_desc);
if (style->rc_style)
gtk_rc_style_unref (style->rc_style);
g_free (style);
}
@ -3141,7 +3145,7 @@ gtk_default_draw_handle (GtkStyle *style,
gtk_paint_box (style, window, state_type, shadow_type, area, widget,
detail, x, y, width, height);
if (!strcmp (detail, "paned"))
{
/* we want to ignore the shadow border in paned widgets */

View File

@ -30,6 +30,7 @@
#include <gdk/gdk.h>
#include <gtk/gtkenums.h>
#include <pango/pango.h>
#ifdef __cplusplus
extern "C" {
@ -72,6 +73,7 @@ struct _GtkStyle
GdkColor black;
GdkColor white;
GdkFont *font;
PangoFontDescription *font_desc;
GdkGC *fg_gc[5];
GdkGC *bg_gc[5];
@ -96,7 +98,7 @@ struct _GtkStyle
GtkThemeEngine *engine;
gpointer engine_data;
GtkRcStyle *rc_style; /* the Rc style from which this style
* was created
*/

View File

@ -1487,6 +1487,7 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
gint x, y;
gint row, col;
GtkAllocation allocation;
GtkWidget *widget = GTK_WIDGET (table);
children = table->children;
while (children)
@ -1551,6 +1552,10 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
allocation.height = child_requisition.height;
allocation.y = y + (max_height - allocation.height) / 2;
}
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
allocation.x = widget->allocation.x + widget->allocation.width
- (allocation.x - widget->allocation.x) - allocation.width;
gtk_widget_size_allocate (child->widget, &allocation);
}

6349
gtk/gtktextbtree.c Normal file

File diff suppressed because it is too large Load Diff

279
gtk/gtktextbtree.h Normal file
View File

@ -0,0 +1,279 @@
#ifndef GTK_TEXT_BTREE_H
#define GTK_TEXT_BTREE_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <gtk/gtktextbuffer.h>
#include <gtk/gtktexttag.h>
#include <gtk/gtktextmark.h>
#include <gtk/gtktextchild.h>
#include <gtk/gtktextsegment.h>
#include <gtk/gtktextiter.h>
GtkTextBTree *gtk_text_btree_new (GtkTextTagTable *table,
GtkTextBuffer *buffer);
void gtk_text_btree_ref (GtkTextBTree *tree);
void gtk_text_btree_unref (GtkTextBTree *tree);
GtkTextBuffer *gtk_text_btree_get_buffer (GtkTextBTree *tree);
guint gtk_text_btree_get_chars_changed_stamp (GtkTextBTree *tree);
guint gtk_text_btree_get_segments_changed_stamp (GtkTextBTree *tree);
void gtk_text_btree_segments_changed (GtkTextBTree *tree);
/* Indexable segment mutation */
void gtk_text_btree_delete (GtkTextIter *start,
GtkTextIter *end);
void gtk_text_btree_insert (GtkTextIter *iter,
const gchar *text,
gint len);
void gtk_text_btree_insert_pixmap (GtkTextIter *iter,
GdkPixmap *pixmap,
GdkBitmap *mask);
/* View stuff */
GtkTextLine *gtk_text_btree_find_line_by_y (GtkTextBTree *tree,
gpointer view_id,
gint ypixel,
gint *line_top_y);
gint gtk_text_btree_find_line_top (GtkTextBTree *tree,
GtkTextLine *line,
gpointer view_id);
void gtk_text_btree_add_view (GtkTextBTree *tree,
GtkTextLayout *layout);
void gtk_text_btree_remove_view (GtkTextBTree *tree,
gpointer view_id);
void gtk_text_btree_invalidate_region (GtkTextBTree *tree,
const GtkTextIter *start,
const GtkTextIter *end);
void gtk_text_btree_get_view_size (GtkTextBTree *tree,
gpointer view_id,
gint *width,
gint *height);
gboolean gtk_text_btree_is_valid (GtkTextBTree *tree,
gpointer view_id);
gboolean gtk_text_btree_validate (GtkTextBTree *tree,
gpointer view_id,
gint max_pixels,
gint *y,
gint *old_height,
gint *new_height);
void gtk_text_btree_validate_line (GtkTextBTree *tree,
GtkTextLine *line,
gpointer view_id);
/* Tag */
void gtk_text_btree_tag (const GtkTextIter *start,
const GtkTextIter *end,
GtkTextTag *tag,
gboolean apply);
/* "Getters" */
GtkTextLine * gtk_text_btree_get_line (GtkTextBTree *tree,
gint line_number,
gint *real_line_number);
GtkTextLine * gtk_text_btree_get_line_at_char (GtkTextBTree *tree,
gint char_index,
gint *line_start_index,
gint *real_char_index);
GtkTextTag** gtk_text_btree_get_tags (const GtkTextIter *iter,
gint *num_tags);
gchar *gtk_text_btree_get_text (const GtkTextIter *start,
const GtkTextIter *end,
gboolean include_hidden,
gboolean include_nonchars);
gint gtk_text_btree_line_count (GtkTextBTree *tree);
gint gtk_text_btree_char_count (GtkTextBTree *tree);
gboolean gtk_text_btree_char_is_invisible (const GtkTextIter *iter);
/* Get iterators (these are implemented in gtktextiter.c) */
void gtk_text_btree_get_iter_at_char (GtkTextBTree *tree,
GtkTextIter *iter,
gint char_index);
void gtk_text_btree_get_iter_at_line_char (GtkTextBTree *tree,
GtkTextIter *iter,
gint line_number,
gint char_index);
void gtk_text_btree_get_iter_at_line_byte (GtkTextBTree *tree,
GtkTextIter *iter,
gint line_number,
gint byte_index);
gboolean gtk_text_btree_get_iter_from_string (GtkTextBTree *tree,
GtkTextIter *iter,
const gchar *string);
gboolean gtk_text_btree_get_iter_at_mark_name (GtkTextBTree *tree,
GtkTextIter *iter,
const gchar *mark_name);
void gtk_text_btree_get_iter_at_mark (GtkTextBTree *tree,
GtkTextIter *iter,
GtkTextLineSegment *mark);
void gtk_text_btree_get_last_iter (GtkTextBTree *tree,
GtkTextIter *iter);
void gtk_text_btree_get_iter_at_line (GtkTextBTree *tree,
GtkTextIter *iter,
GtkTextLine *line,
gint byte_offset);
gboolean gtk_text_btree_get_iter_at_first_toggle (GtkTextBTree *tree,
GtkTextIter *iter,
GtkTextTag *tag);
gboolean gtk_text_btree_get_iter_at_last_toggle (GtkTextBTree *tree,
GtkTextIter *iter,
GtkTextTag *tag);
/* Manipulate marks */
GtkTextLineSegment *gtk_text_btree_set_mark (GtkTextBTree *tree,
const gchar *name,
gboolean left_gravity,
const GtkTextIter *index,
gboolean should_exist);
void gtk_text_btree_remove_mark_by_name (GtkTextBTree *tree,
const gchar *name);
void gtk_text_btree_remove_mark (GtkTextBTree *tree,
GtkTextLineSegment *segment);
gboolean gtk_text_btree_get_selection_bounds (GtkTextBTree *tree,
GtkTextIter *start,
GtkTextIter *end);
void gtk_text_btree_place_cursor (GtkTextBTree *tree,
const GtkTextIter *where);
gboolean gtk_text_btree_mark_is_insert (GtkTextBTree *tree,
GtkTextLineSegment *segment);
gboolean gtk_text_btree_mark_is_selection_bound (GtkTextBTree *tree,
GtkTextLineSegment *segment);
GtkTextLineSegment *gtk_text_btree_get_mark_by_name (GtkTextBTree *tree,
const gchar *name);
GtkTextLine * gtk_text_btree_first_could_contain_tag (GtkTextBTree *tree,
GtkTextTag *tag);
GtkTextLine * gtk_text_btree_last_could_contain_tag (GtkTextBTree *tree,
GtkTextTag *tag);
/* Lines */
/* Chunk of data associated with a line; views can use this to store
info at the line. They should "subclass" the header struct here. */
typedef struct _GtkTextLineData GtkTextLineData;
struct _GtkTextLineData {
gpointer view_id;
GtkTextLineData *next;
gint height;
gint width : 24;
gint valid : 8;
};
/*
* The data structure below defines a single line of text (from newline
* to newline, not necessarily what appears on one line of the screen).
*
* You can consider this line a "paragraph" also
*/
struct _GtkTextLine {
GtkTextBTreeNode *parent; /* Pointer to parent node containing
* line. */
GtkTextLine *next; /* Next in linked list of lines with
* same parent node in B-tree. NULL
* means end of list. */
GtkTextLineSegment *segments; /* First in ordered list of segments
* that make up the line. */
GtkTextLineData *views; /* data stored here by views */
};
gint gtk_text_line_get_number (GtkTextLine *line);
gboolean gtk_text_line_char_has_tag (GtkTextLine *line,
GtkTextBTree *tree,
gint char_in_line,
GtkTextTag *tag);
gboolean gtk_text_line_byte_has_tag (GtkTextLine *line,
GtkTextBTree *tree,
gint byte_in_line,
GtkTextTag *tag);
GtkTextLine * gtk_text_line_next (GtkTextLine *line);
GtkTextLine * gtk_text_line_previous (GtkTextLine *line);
void gtk_text_line_add_data (GtkTextLine *line,
GtkTextLineData *data);
gpointer gtk_text_line_remove_data (GtkTextLine *line,
gpointer view_id);
gpointer gtk_text_line_get_data (GtkTextLine *line,
gpointer view_id);
void gtk_text_line_invalidate_wrap (GtkTextLine *line,
GtkTextLineData *ld);
gint gtk_text_line_char_count (GtkTextLine *line);
gint gtk_text_line_byte_count (GtkTextLine *line);
gint gtk_text_line_char_index (GtkTextLine *line);
GtkTextLineSegment *gtk_text_line_byte_to_segment (GtkTextLine *line,
gint byte_offset,
gint *seg_offset);
GtkTextLineSegment *gtk_text_line_char_to_segment (GtkTextLine *line,
gint char_offset,
gint *seg_offset);
void gtk_text_line_byte_locate (GtkTextLine *line,
gint byte_offset,
GtkTextLineSegment **segment,
GtkTextLineSegment **any_segment,
gint *seg_byte_offset,
gint *line_byte_offset);
void gtk_text_line_char_locate (GtkTextLine *line,
gint char_offset,
GtkTextLineSegment **segment,
GtkTextLineSegment **any_segment,
gint *seg_char_offset,
gint *line_char_offset);
void gtk_text_line_byte_to_char_offsets (GtkTextLine *line,
gint byte_offset,
gint *line_char_offset,
gint *seg_char_offset);
void gtk_text_line_char_to_byte_offsets (GtkTextLine *line,
gint char_offset,
gint *line_byte_offset,
gint *seg_byte_offset);
GtkTextLineSegment *gtk_text_line_byte_to_any_segment (GtkTextLine *line,
gint byte_offset,
gint *seg_offset);
GtkTextLineSegment *gtk_text_line_char_to_any_segment (GtkTextLine *line,
gint char_offset,
gint *seg_offset);
gint gtk_text_line_byte_to_char (GtkTextLine *line,
gint byte_offset);
gint gtk_text_line_char_to_byte (GtkTextLine *line,
gint char_offset);
GtkTextLine * gtk_text_line_next_could_contain_tag (GtkTextLine *line,
GtkTextBTree *tree,
GtkTextTag *tag);
GtkTextLine * gtk_text_line_previous_could_contain_tag (GtkTextLine *line,
GtkTextBTree *tree,
GtkTextTag *tag);
/* Debug */
void gtk_text_btree_check (GtkTextBTree *tree);
void gtk_text_btree_spew (GtkTextBTree *tree);
extern gboolean gtk_text_view_debug_btree;
/* ignore, exported only for gtktextsegment.c */
void toggle_segment_check_func (GtkTextLineSegment *segPtr,
GtkTextLine *line);
void change_node_toggle_count (GtkTextBTreeNode *node,
GtkTextTagInfo *info,
gint delta);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

1652
gtk/gtktextbuffer.c Normal file

File diff suppressed because it is too large Load Diff

309
gtk/gtktextbuffer.h Normal file
View File

@ -0,0 +1,309 @@
#ifndef GTK_TEXT_BUFFER_H
#define GTK_TEXT_BUFFER_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* This is the PUBLIC representation of a text buffer.
* GtkTextBTree is the PRIVATE internal representation of it.
*/
#include <gtk/gtkwidget.h>
#include <gtk/gtktexttagtable.h>
#include <gtk/gtktextiter.h>
#include <gtk/gtktextmark.h>
typedef struct _GtkTextBTree GtkTextBTree;
#define GTK_TYPE_TEXT_BUFFER (gtk_text_buffer_get_type())
#define GTK_TEXT_BUFFER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TEXT_BUFFER, GtkTextBuffer))
#define GTK_TEXT_BUFFER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_BUFFER, GtkTextBufferClass))
#define GTK_IS_TEXT_BUFFER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TEXT_BUFFER))
#define GTK_IS_TEXT_BUFFER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_BUFFER))
#define GTK_TEXT_BUFFER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TEXT_BUFFER, GtkTextBufferClass))
typedef struct _GtkTextBufferClass GtkTextBufferClass;
struct _GtkTextBuffer {
GtkObject parent_instance;
GtkTextTagTable *tag_table;
GtkTextBTree *tree;
/* Text currently pasted to the clipboard */
gchar *clipboard_text;
/* Whether the buffer has been modified since last save */
gboolean modified;
/* We use this for selections */
GtkWidget *selection_widget;
gboolean have_selection;
gboolean selection_handlers_installed;
};
struct _GtkTextBufferClass {
GtkObjectClass parent_class;
void (* insert_text) (GtkTextBuffer *buffer,
GtkTextIter *pos,
const gchar *text,
gint length);
void (* delete_text) (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
/* Only for text changed, marks/tags don't cause this
to be emitted */
void (* changed) (GtkTextBuffer *buffer);
/* New value for the modified flag */
void (* modified_changed) (GtkTextBuffer *buffer);
/* Mark moved or created */
void (* mark_set) (GtkTextBuffer *buffer,
const GtkTextIter *location,
const gchar *mark_name);
void (* mark_deleted) (GtkTextBuffer *buffer,
const gchar *mark_name);
void (* apply_tag) (GtkTextBuffer *buffer,
GtkTextTag *tag,
const GtkTextIter *start_char,
const GtkTextIter *end_char);
void (* remove_tag) (GtkTextBuffer *buffer,
GtkTextTag *tag,
const GtkTextIter *start_char,
const GtkTextIter *end_char);
};
GtkType gtk_text_buffer_get_type (void);
/* table is NULL to create a new one */
GtkTextBuffer *gtk_text_buffer_new (GtkTextTagTable *table);
gint gtk_text_buffer_get_line_count (GtkTextBuffer *buffer);
gint gtk_text_buffer_get_char_count (GtkTextBuffer *buffer);
/* Insert into the buffer */
void gtk_text_buffer_insert (GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len);
void gtk_text_buffer_insert_at_cursor (GtkTextBuffer *buffer,
const gchar *text,
gint len);
void gtk_text_buffer_insert_at_char (GtkTextBuffer *buffer,
gint char_pos,
const gchar *text,
gint len);
void gtk_text_buffer_insert_after_line (GtkTextBuffer *buffer,
gint after_this_line,
const gchar *text,
gint len);
/* Delete from the buffer */
void gtk_text_buffer_delete (GtkTextBuffer *buffer,
GtkTextIter *start_iter,
GtkTextIter *end_iter);
void gtk_text_buffer_delete_chars (GtkTextBuffer *buffer,
gint start_char,
gint end_char);
void gtk_text_buffer_delete_lines (GtkTextBuffer *buffer,
gint start_line,
gint end_line);
void gtk_text_buffer_delete_from_line (GtkTextBuffer *buffer,
gint line,
gint start_char,
gint end_char);
/* Obtain strings from the buffer */
gchar *gtk_text_buffer_get_text (GtkTextBuffer *buffer,
const GtkTextIter *start_iter,
const GtkTextIter *end_iter,
gboolean include_hidden_chars);
gchar *gtk_text_buffer_get_text_chars (GtkTextBuffer *buffer,
gint start_char,
gint end_char,
gboolean include_hidden_chars);
gchar *gtk_text_buffer_get_text_from_line (GtkTextBuffer *buffer,
gint line,
gint start_char,
gint end_char,
gboolean include_hidden_chars);
gchar *gtk_text_buffer_get_slice (GtkTextBuffer *buffer,
const GtkTextIter *start_iter,
const GtkTextIter *end_iter,
gboolean include_hidden_chars);
gchar *gtk_text_buffer_get_slice_chars (GtkTextBuffer *buffer,
gint start_char,
gint end_char,
gboolean include_hidden_chars);
gchar *gtk_text_buffer_get_slice_from_line (GtkTextBuffer *buffer,
gint line,
gint start_char,
gint end_char,
gboolean include_hidden_chars);
/* Insert a pixmap */
void gtk_text_buffer_insert_pixmap (GtkTextBuffer *buffer,
GtkTextIter *iter,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gtk_text_buffer_insert_pixmap_at_char (GtkTextBuffer *buffer,
gint char_index,
GdkPixmap *pixmap,
GdkBitmap *mask);
/* Mark manipulation */
GtkTextMark *gtk_text_buffer_create_mark (GtkTextBuffer *buffer,
const gchar *mark_name,
const GtkTextIter *where,
gboolean left_gravity);
void gtk_text_buffer_move_mark (GtkTextBuffer *buffer,
const gchar *mark_name,
const GtkTextIter *where);
void gtk_text_buffer_delete_mark (GtkTextBuffer *buffer,
const gchar *name);
GtkTextMark *gtk_text_buffer_get_mark (GtkTextBuffer *buffer,
const gchar *name);
/* efficiently move insert and selection_bound to same location */
void gtk_text_buffer_place_cursor (GtkTextBuffer *buffer,
const GtkTextIter *where);
/* Tag manipulation */
void gtk_text_buffer_apply_tag_to_chars (GtkTextBuffer *buffer,
const gchar *name,
gint start_char,
gint end_char);
void gtk_text_buffer_remove_tag_from_chars (GtkTextBuffer *buffer,
const gchar *name,
gint start_char,
gint end_char);
void gtk_text_buffer_apply_tag (GtkTextBuffer *buffer,
const gchar *name,
const GtkTextIter *start_index,
const GtkTextIter *end_index);
void gtk_text_buffer_remove_tag (GtkTextBuffer *buffer,
const gchar *name,
const GtkTextIter *start_index,
const GtkTextIter *end_index);
/* You can either ignore the return value, or use it to
set the attributes of the tag */
GtkTextTag *gtk_text_buffer_create_tag (GtkTextBuffer *buffer,
const gchar *tag_name);
/* Obtain iterators pointed at various places, then you can move the
iterator around using the GtkTextIter operators */
void gtk_text_buffer_get_iter_at_line_char (GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number,
gint char_number);
void gtk_text_buffer_get_iter_at_char (GtkTextBuffer *buffer,
GtkTextIter *iter,
gint char_index);
void gtk_text_buffer_get_iter_at_line (GtkTextBuffer *buffer,
GtkTextIter *iter,
gint line_number);
void gtk_text_buffer_get_last_iter (GtkTextBuffer *buffer,
GtkTextIter *iter);
void gtk_text_buffer_get_bounds (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
gboolean gtk_text_buffer_get_iter_at_mark (GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *name);
/* There's no get_first_iter because you just get the iter for
line or char 0 */
/*
Parses a string, read the man page for the Tk text widget; the only
variation from that is we don't support getting the index at a
certain pixel since the buffer has no pixel knowledge. This
function is mostly useful for language bindings I think.
*/
gboolean gtk_text_buffer_get_iter_from_string (GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *iter_string);
GSList *gtk_text_buffer_get_tags (GtkTextBuffer *buffer,
const GtkTextIter *iter);
/* Used to keep track of whether the buffer needs saving; anytime the
buffer contents change, the modified flag is turned on. Whenever
you save, turn it off. Tags and marks do not affect the modified
flag, but if you would like them to you can connect a handler to
the tag/mark signals and call set_modified in your handler */
gboolean gtk_text_buffer_modified (GtkTextBuffer *buffer);
void gtk_text_buffer_set_modified (GtkTextBuffer *buffer,
gboolean setting);
void gtk_text_buffer_set_clipboard_contents (GtkTextBuffer *buffer,
const gchar *text);
const gchar *gtk_text_buffer_get_clipboard_contents (GtkTextBuffer *buffer);
void gtk_text_buffer_paste_primary_selection (GtkTextBuffer *buffer,
GtkTextIter *override_location,
guint32 time);
gboolean gtk_text_buffer_delete_selection (GtkTextBuffer *buffer);
void gtk_text_buffer_cut (GtkTextBuffer *buffer,
guint32 time);
void gtk_text_buffer_copy (GtkTextBuffer *buffer,
guint32 time);
void gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer,
guint32 time);
gboolean gtk_text_buffer_get_selection_bounds (GtkTextBuffer *buffer,
GtkTextIter *start,
GtkTextIter *end);
/* This function is not implemented. */
gboolean gtk_text_buffer_find_string(GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *str,
const GtkTextIter *start,
const GtkTextIter *end);
#if 0
/* Waiting on glib 1.4 regexp facility */
gboolean gtk_text_buffer_find_regexp(GtkTextBuffer *buffer,
GRegexp *regexp,
const GtkTextIter *start,
const GtkTextIter *end);
#endif
/* INTERNAL private stuff */
void gtk_text_buffer_spew (GtkTextBuffer *buffer);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

1304
gtk/gtktextchild.c Normal file

File diff suppressed because it is too large Load Diff

24
gtk/gtktextchild.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef GTK_TEXT_CHILD_H
#define GTK_TEXT_CHILD_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <gtk/gtktexttypes.h>
typedef struct _GtkTextPixmap GtkTextPixmap;
struct _GtkTextPixmap {
GdkPixmap *pixmap;
GdkBitmap *mask;
};
GtkTextLineSegment *gtk_text_pixmap_segment_new(GdkPixmap *pixmap, GdkBitmap *mask);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

609
gtk/gtktextdisplay.c Normal file
View File

@ -0,0 +1,609 @@
/* gtktextdisplay.c - display layed-out text
*
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 2000 Red Hat, Inc.
* Tk->Gtk port by Havoc Pennington
*
*
* This software is copyrighted by the Regents of the University of
* California, Sun Microsystems, Inc., and other parties. The
* following terms apply to all files associated with the software
* unless explicitly disclaimed in individual files.
*
* The authors hereby grant permission to use, copy, modify,
* distribute, and license this software and its documentation for any
* purpose, provided that existing copyright notices are retained in
* all copies and that this notice is included verbatim in any
* distributions. No written agreement, license, or royalty fee is
* required for any of the authorized uses. Modifications to this
* software may be copyrighted by their authors and need not follow
* the licensing terms described here, provided that the new terms are
* clearly indicated on the first page of each file where they apply.
*
* IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY
* PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
* DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION,
* OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
* NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
* AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* GOVERNMENT USE: If you are acquiring this software on behalf of the
* U.S. government, the Government shall have only "Restricted Rights"
* in the software and related documentation as defined in the Federal
* Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
* are acquiring the software on behalf of the Department of Defense,
* the software shall be classified as "Commercial Computer Software"
* and the Government shall have only "Restricted Rights" as defined
* in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
* foregoing, the authors grant the U.S. Government and others acting
* in its behalf permission to use and distribute the software in
* accordance with the terms specified in this license.
*
*/
#include "gtktextdisplay.h"
#include "gtktextiterprivate.h"
#include <pango/pangox.h>
#include "x11/gdkx.h"
typedef struct _GtkTextRenderState GtkTextRenderState;
struct _GtkTextRenderState
{
GtkWidget *widget;
GtkTextAppearance *last_appearance;
GdkGC *fg_gc;
GdkGC *bg_gc;
GdkRectangle clip_rect;
};
static void get_item_properties (PangoItem *item,
GtkTextAppearance **appearance);
static GdkRegion *get_selected_clip (GtkTextRenderState *render_state,
PangoLayout *layout,
PangoLayoutLine *line,
int x,
int y,
int height,
int start_index,
int end_index);
static GtkTextRenderState *
gtk_text_render_state_new (GtkWidget *widget,
GdkDrawable *drawable,
GdkRectangle *clip_rect)
{
GtkTextRenderState *state = g_new0 (GtkTextRenderState, 1);
state->widget = widget;
state->fg_gc = gdk_gc_new (drawable);
state->bg_gc = gdk_gc_new (drawable);
state->clip_rect = *clip_rect;
return state;
}
static void
gtk_text_render_state_destroy (GtkTextRenderState *state)
{
gdk_gc_unref (state->fg_gc);
gdk_gc_unref (state->bg_gc);
g_free (state);
}
static void
gtk_text_render_state_set_color (GtkTextRenderState *state,
GdkGC *gc,
GdkColor *color)
{
gdk_colormap_alloc_color (gtk_widget_get_colormap (state->widget), color, FALSE, TRUE);
gdk_gc_set_foreground (gc, color);
}
static void
gtk_text_render_state_update (GtkTextRenderState *state,
GtkTextAppearance *new_appearance)
{
if (!state->last_appearance ||
!gdk_color_equal (&new_appearance->fg_color, &state->last_appearance->fg_color))
gtk_text_render_state_set_color (state, state->fg_gc, &new_appearance->fg_color);
if (!state->last_appearance ||
new_appearance->fg_stipple != state->last_appearance->fg_stipple)
{
if (new_appearance->fg_stipple)
{
gdk_gc_set_fill(state->fg_gc, GDK_STIPPLED);
gdk_gc_set_stipple(state->fg_gc, new_appearance->fg_stipple);
}
else
{
gdk_gc_set_fill(state->fg_gc, GDK_SOLID);
}
}
if (new_appearance->draw_bg)
{
if (!state->last_appearance ||
!gdk_color_equal (&new_appearance->bg_color, &state->last_appearance->bg_color))
gtk_text_render_state_set_color (state, state->bg_gc, &new_appearance->bg_color);
if (!state->last_appearance ||
new_appearance->bg_stipple != state->last_appearance->bg_stipple)
{
if (new_appearance->bg_stipple)
{
gdk_gc_set_fill(state->bg_gc, GDK_STIPPLED);
gdk_gc_set_stipple(state->bg_gc, new_appearance->bg_stipple);
}
else
{
gdk_gc_set_fill(state->bg_gc, GDK_SOLID);
}
}
}
state->last_appearance = new_appearance;
}
static void
render_layout_line (GdkDrawable *drawable,
GtkTextRenderState *render_state,
PangoLayoutLine *line,
int x,
int y,
gboolean selected)
{
GSList *tmp_list = line->runs;
PangoRectangle overall_rect;
PangoRectangle logical_rect;
PangoRectangle ink_rect;
gint x_off = 0;
pango_layout_line_get_extents (line, NULL, &overall_rect);
while (tmp_list)
{
PangoLayoutRun *run = tmp_list->data;
GtkTextAppearance *appearance;
tmp_list = tmp_list->next;
get_item_properties (run->item, &appearance);
if (appearance) /* A text segment */
{
GdkGC *fg_gc;
if (selected)
{
fg_gc = render_state->widget->style->fg_gc[GTK_STATE_SELECTED];
}
else
{
gtk_text_render_state_update (render_state, appearance);
fg_gc = render_state->fg_gc;
}
if (appearance->underline == PANGO_UNDERLINE_NONE && !appearance->overstrike)
pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
NULL, &logical_rect);
else
pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
&ink_rect, &logical_rect);
if (appearance->draw_bg && !selected)
gdk_draw_rectangle (drawable, render_state->bg_gc, TRUE,
x + (x_off + logical_rect.x) / PANGO_SCALE,
y + logical_rect.y / PANGO_SCALE,
logical_rect.width / PANGO_SCALE,
logical_rect.height / PANGO_SCALE);
gdk_draw_glyphs (drawable, fg_gc,
run->item->analysis.font,
x + x_off / PANGO_SCALE, y, run->glyphs);
switch (appearance->underline)
{
case PANGO_UNDERLINE_NONE:
break;
case PANGO_UNDERLINE_DOUBLE:
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + 4,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 4);
/* Fall through */
case PANGO_UNDERLINE_SINGLE:
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + 2,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 2);
break;
case PANGO_UNDERLINE_LOW:
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 2,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 2);
break;
}
if (appearance->overstrike)
{
gint overstrike_y = y + (0.3 * logical_rect.y) / PANGO_SCALE;
gdk_draw_line (drawable, fg_gc,
x + (x_off + ink_rect.x) / PANGO_SCALE - 1, overstrike_y,
x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, overstrike_y);
}
x_off += logical_rect.width;
}
}
}
static void
render_para (GdkDrawable *drawable,
GtkTextRenderState *render_state,
GtkTextLineDisplay *line_display,
int x,
int y,
int selection_start_index,
int selection_end_index)
{
PangoRectangle logical_rect;
GSList *tmp_list;
PangoAlignment align;
PangoLayout *layout = line_display->layout;
int indent;
int total_width;
int y_offset = 0;
int byte_offset = 0;
gboolean first = TRUE;
indent = pango_layout_get_indent (layout);
total_width = pango_layout_get_width (layout);
align = pango_layout_get_alignment (layout);
if (total_width < 0)
total_width = line_display->total_width * PANGO_SCALE;
tmp_list = pango_layout_get_lines (layout);
while (tmp_list)
{
PangoLayoutLine *line = tmp_list->data;
int x_offset;
int selection_y, selection_height;
pango_layout_line_get_extents (line, NULL, &logical_rect);
x_offset = line_display->left_margin * PANGO_SCALE;
switch (align)
{
case PANGO_ALIGN_RIGHT:
x_offset += total_width - logical_rect.width;
break;
case PANGO_ALIGN_CENTER:
x_offset += (total_width - logical_rect.width) / 2;
break;
default:
break;
}
if (first)
{
if (indent > 0)
{
if (align == PANGO_ALIGN_LEFT)
x_offset += indent;
else
x_offset -= indent;
}
}
else
{
if (indent < 0)
{
if (align == PANGO_ALIGN_LEFT)
x_offset -= indent;
else
x_offset += indent;
}
}
selection_y = y + y_offset / PANGO_SCALE;
selection_height = logical_rect.height / PANGO_SCALE;
if (first)
{
selection_y -= line_display->top_margin;
selection_height += line_display->top_margin;
}
if (!tmp_list->next)
selection_height += line_display->bottom_margin;
first = FALSE;
if (selection_start_index < byte_offset &&
selection_end_index > line->length + byte_offset) /* All selected */
{
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
TRUE,
x + line_display->left_margin, selection_y,
total_width / PANGO_SCALE, selection_height);
render_layout_line (drawable, render_state,
line, x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
TRUE);
}
else
{
render_layout_line (drawable, render_state,
line, x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
FALSE);
if (selection_start_index < byte_offset + line->length &&
selection_end_index > byte_offset) /* Some selected */
{
GdkRegion *clip_region = get_selected_clip (render_state, layout, line,
x + line_display->x_offset,
selection_y, selection_height,
selection_start_index, selection_end_index);
gdk_gc_set_clip_region (render_state->widget->style->fg_gc [GTK_STATE_SELECTED], clip_region);
gdk_gc_set_clip_region (render_state->widget->style->bg_gc [GTK_STATE_SELECTED], clip_region);
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
TRUE,
x + x_offset / PANGO_SCALE, selection_y,
logical_rect.width / PANGO_SCALE,
selection_height);
render_layout_line (drawable, render_state,
line, x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE,
TRUE);
gdk_gc_set_clip_region (render_state->widget->style->fg_gc [GTK_STATE_SELECTED], NULL);
gdk_gc_set_clip_region (render_state->widget->style->bg_gc [GTK_STATE_SELECTED], NULL);
gdk_region_destroy (clip_region);
/* Paint in the ends of the line */
if (x_offset > line_display->left_margin * PANGO_SCALE &&
((line_display->direction == GTK_TEXT_DIR_LTR && selection_start_index < byte_offset) ||
(line_display->direction == GTK_TEXT_DIR_RTL && selection_end_index > byte_offset + line->length)))
{
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
TRUE,
x + line_display->left_margin, selection_y,
x + x_offset / PANGO_SCALE - line_display->left_margin,
selection_height);
}
if (x_offset + logical_rect.width < line_display->left_margin * PANGO_SCALE + total_width &&
((line_display->direction == GTK_TEXT_DIR_LTR && selection_end_index > byte_offset + line->length) ||
(line_display->direction == GTK_TEXT_DIR_RTL && selection_start_index < byte_offset)))
{
gdk_draw_rectangle (drawable,
render_state->widget->style->bg_gc[GTK_STATE_SELECTED],
TRUE,
x + (x_offset + logical_rect.width) / PANGO_SCALE,
selection_y,
x + (line_display->left_margin * PANGO_SCALE + total_width - x_offset - logical_rect.width) / PANGO_SCALE,
selection_height);
}
}
}
byte_offset += line->length;
y_offset += logical_rect.height;
tmp_list = tmp_list->next;
}
}
static GdkRegion *
get_selected_clip (GtkTextRenderState *render_state,
PangoLayout *layout,
PangoLayoutLine *line,
int x,
int y,
int height,
int start_index,
int end_index)
{
gint *ranges;
gint n_ranges, i;
GdkRegion *clip_region = gdk_region_new ();
GdkRegion *tmp_region;
PangoRectangle logical_rect;
pango_layout_line_get_extents (line, NULL, &logical_rect);
pango_layout_line_get_x_ranges (line, start_index, end_index, &ranges, &n_ranges);
for (i=0; i < n_ranges; i++)
{
GdkRectangle rect;
rect.x = x + ranges[2*i] / PANGO_SCALE;
rect.y = y;
rect.width = (ranges[2*i + 1] - ranges[2*i]) / PANGO_SCALE;
rect.height = height;
gdk_region_union_with_rect (clip_region, &rect);
}
tmp_region = gdk_region_rectangle (&render_state->clip_rect);
gdk_region_intersect (clip_region, tmp_region);
gdk_region_destroy (tmp_region);
g_free (ranges);
return clip_region;
}
static void
get_item_properties (PangoItem *item,
GtkTextAppearance **appearance)
{
GSList *tmp_list = item->extra_attrs;
*appearance = NULL;
while (tmp_list)
{
PangoAttribute *attr = tmp_list->data;
if (attr->klass->type == gtk_text_attr_appearance_type)
{
*appearance = &((GtkTextAttrAppearance *)attr)->appearance;
return;
}
}
}
void
gtk_text_layout_draw (GtkTextLayout *layout,
GtkWidget *widget,
GdkDrawable *drawable,
/* Location of the layout
in buffer coordinates */
gint x_offset,
gint y_offset,
/* Region of the layout to
render */
gint x,
gint y,
gint width,
gint height)
{
GdkRectangle clip;
gint current_y;
GSList *line_list;
GSList *tmp_list;
GSList *cursor_list;
GtkTextRenderState *render_state;
GtkTextIter selection_start, selection_end;
gboolean have_selection = FALSE;
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
g_return_if_fail (layout->default_style != NULL);
g_return_if_fail (layout->buffer != NULL);
g_return_if_fail (drawable != NULL);
g_return_if_fail (x_offset >= 0);
g_return_if_fail (y_offset >= 0);
g_return_if_fail (width >= 0);
g_return_if_fail (height >= 0);
if (width == 0 || height == 0)
return;
line_list = gtk_text_layout_get_lines (layout, y + y_offset, y + y_offset + height, &current_y);
current_y -= y_offset;
if (line_list == NULL)
return; /* nothing on the screen */
clip.x = x;
clip.y = y;
clip.width = width;
clip.height = height;
render_state = gtk_text_render_state_new (widget, drawable, &clip);
gdk_gc_set_clip_rectangle (render_state->fg_gc, &clip);
gdk_gc_set_clip_rectangle (render_state->bg_gc, &clip);
gtk_text_layout_wrap_loop_start (layout);
if (gtk_text_buffer_get_selection_bounds (layout->buffer,
&selection_start,
&selection_end))
have_selection = TRUE;
tmp_list = line_list;
while (tmp_list != NULL)
{
GtkTextLineDisplay *line_display;
gint selection_start_index = -1;
gint selection_end_index = -1;
GtkTextLine *line = tmp_list->data;
line_display = gtk_text_layout_get_line_display (layout, line, FALSE);
if (have_selection)
{
GtkTextIter line_start, line_end;
gint byte_count = gtk_text_line_byte_count (line);
gtk_text_btree_get_iter_at_line (layout->buffer->tree, &line_start,
line, 0);
gtk_text_btree_get_iter_at_line (layout->buffer->tree, &line_end,
line, byte_count - 1);
if (gtk_text_iter_compare (&selection_start, &line_end) < 0 &&
gtk_text_iter_compare (&selection_end, &line_start) > 0)
{
if (gtk_text_iter_compare (&selection_start, &line_start) >= 0)
selection_start_index = gtk_text_iter_get_line_byte (&selection_start);
else
selection_start_index = -1;
if (gtk_text_iter_compare (&selection_end, &line_end) <= 0)
selection_end_index = gtk_text_iter_get_line_byte (&selection_end);
else
selection_end_index = byte_count;
}
}
render_para (drawable, render_state, line_display,
- x_offset,
current_y + line_display->top_margin,
selection_start_index, selection_end_index);
/* We paint the cursors last, because they overlap another chunk
and need to appear on top. */
cursor_list = line_display->cursors;
while (cursor_list)
{
GtkTextCursorDisplay *cursor = cursor_list->data;
GdkGC *gc;
if (cursor->is_strong)
gc = widget->style->bg_gc[GTK_STATE_SELECTED];
else
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
gdk_draw_line (drawable, gc,
line_display->x_offset + cursor->x,
current_y + line_display->top_margin + cursor->y,
line_display->x_offset + cursor->x,
current_y + line_display->top_margin + cursor->y + cursor->height);
cursor_list = cursor_list->next;
}
current_y += line_display->height;
gtk_text_layout_free_line_display (layout, line_display);
tmp_list = g_slist_next (tmp_list);
}
gtk_text_layout_wrap_loop_end (layout);
gtk_text_render_state_destroy (render_state);
g_slist_free (line_list);
}

39
gtk/gtktextdisplay.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef GTK_TEXT_DISPLAY_H
#define GTK_TEXT_DISPLAY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
A semi-public header intended for use by code that also
uses GtkTextLayout
*/
#include <gtk/gtktextlayout.h>
/* The drawable should be pre-initialized to your preferred
background. */
void gtk_text_layout_draw (GtkTextLayout *layout,
/* Widget to grab some style info from */
GtkWidget *widget,
/* Drawable to render to */
GdkDrawable *drawable,
/* Position of the drawable
in layout coordinates */
gint x_offset,
gint y_offset,
/* Region of the layout to
render. x,y must be inside
the drawable. */
gint x,
gint y,
gint width,
gint height);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

2384
gtk/gtktextiter.c Normal file

File diff suppressed because it is too large Load Diff

182
gtk/gtktextiter.h Normal file
View File

@ -0,0 +1,182 @@
#ifndef GTK_TEXT_ITER_H
#define GTK_TEXT_ITER_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Iter: represents a location in the text. Becomes invalid if the
* characters/pixmaps/widgets (indexable objects) in the text buffer
* are changed.
*/
#include <gtk/gtktexttag.h>
typedef struct _GtkTextBuffer GtkTextBuffer;
struct _GtkTextIter {
gpointer dummy1;
gpointer dummy2;
gint dummy3;
gint dummy4;
gint dummy10;
gint dummy11;
gint dummy5;
gint dummy6;
gpointer dummy7;
gpointer dummy8;
gint dummy9;
gpointer pad1;
gint pad2;
};
/* This is primarily intended for language bindings that want to avoid
a "buffer" argument to text insertions, deletions, etc. */
GtkTextBuffer *gtk_text_iter_get_buffer(const GtkTextIter *iter);
/*
* Life cycle
*/
GtkTextIter *gtk_text_iter_copy (const GtkTextIter *iter);
void gtk_text_iter_free (GtkTextIter *iter);
/*
* Convert to different kinds of index
*/
gint gtk_text_iter_get_char_index (const GtkTextIter *iter);
gint gtk_text_iter_get_line_number (const GtkTextIter *iter);
gint gtk_text_iter_get_line_char (const GtkTextIter *iter);
gint gtk_text_iter_get_line_byte (const GtkTextIter *iter);
/*
* "Dereference" operators
*/
gint gtk_text_iter_get_char (const GtkTextIter *iter);
/* includes the 0xFFFD char for pixmaps/widgets, so char offsets
into the returned string map properly into buffer char offsets */
gchar *gtk_text_iter_get_slice (const GtkTextIter *start,
const GtkTextIter *end);
/* includes only text, no 0xFFFD */
gchar *gtk_text_iter_get_text (const GtkTextIter *start,
const GtkTextIter *end);
/* exclude invisible chars */
gchar *gtk_text_iter_get_visible_slice (const GtkTextIter *start,
const GtkTextIter *end);
gchar *gtk_text_iter_get_visible_text (const GtkTextIter *start,
const GtkTextIter *end);
/* Returns TRUE if the iterator pointed at a pixmap */
gboolean gtk_text_iter_get_pixmap (const GtkTextIter *iter,
GdkPixmap **pixmap,
GdkBitmap **mask);
/* Return list of tags toggled at this point (toggled_on determines
whether the list is of on-toggles or off-toggles) */
GSList *gtk_text_iter_get_toggled_tags (const GtkTextIter *iter,
gboolean toggled_on);
gboolean gtk_text_iter_begins_tag (const GtkTextIter *iter,
GtkTextTag *tag);
gboolean gtk_text_iter_ends_tag (const GtkTextIter *iter,
GtkTextTag *tag);
gboolean gtk_text_iter_toggles_tag (const GtkTextIter *iter,
GtkTextTag *tag);
gboolean gtk_text_iter_has_tag (const GtkTextIter *iter,
GtkTextTag *tag);
gboolean gtk_text_iter_starts_line (const GtkTextIter *iter);
gboolean gtk_text_iter_ends_line (const GtkTextIter *iter);
gint gtk_text_iter_get_chars_in_line (const GtkTextIter *iter);
/*
* Moving around the buffer
*/
gboolean gtk_text_iter_forward_char (GtkTextIter *iter);
gboolean gtk_text_iter_backward_char (GtkTextIter *iter);
gboolean gtk_text_iter_forward_chars (GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_backward_chars (GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_forward_line (GtkTextIter *iter);
gboolean gtk_text_iter_backward_line (GtkTextIter *iter);
gboolean gtk_text_iter_forward_lines (GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_backward_lines (GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_forward_word_ends(GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_backward_word_starts(GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_forward_word_end(GtkTextIter *iter);
gboolean gtk_text_iter_backward_word_start(GtkTextIter *iter);
gboolean gtk_text_iter_up_lines (GtkTextIter *iter,
gint count);
gboolean gtk_text_iter_down_lines (GtkTextIter *iter,
gint count);
void gtk_text_iter_set_char_index (GtkTextIter *iter,
gint char_index);
void gtk_text_iter_set_line_number (GtkTextIter *iter,
gint line_number);
void gtk_text_iter_set_line_char (GtkTextIter *iter,
gint char_on_line);
void gtk_text_iter_forward_to_end (GtkTextIter *iter);
gboolean gtk_text_iter_forward_to_newline(GtkTextIter *iter);
/* returns TRUE if a toggle was found; NULL for the tag pointer
means "any tag toggle", otherwise the next toggle of the
specified tag is located. */
gboolean gtk_text_iter_forward_find_tag_toggle (GtkTextIter *iter,
GtkTextTag *tag);
gboolean gtk_text_iter_backward_find_tag_toggle (GtkTextIter *iter,
GtkTextTag *tag);
typedef gboolean (* GtkTextViewCharPredicate) (guint16 ch, gpointer user_data);
gboolean gtk_text_iter_forward_find_char (GtkTextIter *iter,
GtkTextViewCharPredicate pred,
gpointer user_data);
gboolean gtk_text_iter_backward_find_char (GtkTextIter *iter,
GtkTextViewCharPredicate pred,
gpointer user_data);
/*
* Comparisons
*/
gboolean gtk_text_iter_equal (const GtkTextIter *lhs,
const GtkTextIter *rhs);
gint gtk_text_iter_compare (const GtkTextIter *lhs,
const GtkTextIter *rhs);
gboolean gtk_text_iter_in_region (const GtkTextIter *iter,
const GtkTextIter *start,
const GtkTextIter *end);
/* Put these two in ascending order */
void gtk_text_iter_reorder (GtkTextIter *first,
GtkTextIter *second);
/* Debug */
void gtk_text_iter_spew (const GtkTextIter *iter,
const gchar *desc);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

32
gtk/gtktextiterprivate.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef GTK_TEXT_ITER_PRIVATE_H
#define GTK_TEXT_ITER_PRIVATE_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <gtk/gtktextiter.h>
GtkTextLineSegment *gtk_text_iter_get_indexable_segment(const GtkTextIter *iter);
GtkTextLineSegment *gtk_text_iter_get_any_segment(const GtkTextIter *iter);
GtkTextLine *gtk_text_iter_get_line(const GtkTextIter *iter);
GtkTextBTree *gtk_text_iter_get_btree(const GtkTextIter *iter);
gboolean gtk_text_iter_forward_indexable_segment(GtkTextIter *iter);
gboolean gtk_text_iter_backward_indexable_segment(GtkTextIter *iter);
gint gtk_text_iter_get_segment_byte(const GtkTextIter *iter);
gint gtk_text_iter_get_segment_char(const GtkTextIter *iter);
/* debug */
void gtk_text_iter_check(const GtkTextIter *iter);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

2159
gtk/gtktextlayout.c Normal file

File diff suppressed because it is too large Load Diff

251
gtk/gtktextlayout.h Normal file
View File

@ -0,0 +1,251 @@
#ifndef GTK_TEXT_LAYOUT_H
#define GTK_TEXT_LAYOUT_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* This is a "semi-private" header; it is intended for
* use by the text widget, and the text canvas item,
* but that's all. We may have to install it so the
* canvas item can use it, but users are not supposed
* to use it.
*/
#include <gtk/gtktextbuffer.h>
#include <gtk/gtktextiter.h>
#include <gtk/gtktextbtree.h>
#define GTK_TYPE_TEXT_LAYOUT (gtk_text_layout_get_type())
#define GTK_TEXT_LAYOUT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TEXT_LAYOUT, GtkTextLayout))
#define GTK_TEXT_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_LAYOUT, GtkTextLayoutClass))
#define GTK_IS_TEXT_LAYOUT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TEXT_LAYOUT))
#define GTK_IS_TEXT_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_LAYOUT))
#define GTK_TEXT_LAYOUT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TEXT_LAYOUT, GtkTextLayoutClass))
typedef struct _GtkTextLayoutClass GtkTextLayoutClass;
typedef struct _GtkTextLineDisplay GtkTextLineDisplay;
typedef struct _GtkTextCursorDisplay GtkTextCursorDisplay;
typedef struct _GtkTextAttrAppearance GtkTextAttrAppearance;
struct _GtkTextLayout
{
GtkObject parent_instance;
/* width of the display area on-screen,
* i.e. pixels we should wrap to fit inside. */
gint screen_width;
/* width/height of the total logical area being layed out */
gint width;
gint height;
GtkTextBuffer *buffer;
/* Default style used if no tags override it */
GtkTextStyleValues *default_style;
/* Pango contexts used for creating layouts */
PangoContext *ltr_context;
PangoContext *rtl_context;
/* A cache of one style; this is used to ensure
* we don't constantly regenerate the style
* over long runs with the same style. */
GtkTextStyleValues *one_style_cache;
/* A cache of one line display. Getting the same line
* many times in a row is the most common case.
*/
GtkTextLineDisplay *one_display_cache;
/* Whether we are allowed to wrap right now */
gint wrap_loop_count;
};
struct _GtkTextLayoutClass
{
GtkObjectClass parent_class;
/* Some portion of the layout was invalidated
*/
void (* invalidated) (GtkTextLayout *layout);
/* A range of the layout changed appearance and possibly height
*/
void (* changed) (GtkTextLayout *layout,
gint y,
gint old_height,
gint new_height);
GtkTextLineData *(* wrap) (GtkTextLayout *layout,
GtkTextLine *line,
/* may be NULL */
GtkTextLineData *line_data);
void (* get_log_attrs) (GtkTextLayout *layout,
GtkTextLine *line,
PangoLogAttr **attrs,
gint *n_attrs);
void (* invalidate) (GtkTextLayout *layout,
const GtkTextIter *start,
const GtkTextIter *end);
void (* free_line_data) (GtkTextLayout *layout,
GtkTextLine *line,
GtkTextLineData *line_data);
};
struct _GtkTextAttrAppearance
{
PangoAttribute attr;
GtkTextAppearance appearance;
};
struct _GtkTextCursorDisplay
{
gint x;
gint y;
gint height;
guint is_strong : 1;
guint is_weak : 1;
};
struct _GtkTextLineDisplay
{
PangoLayout *layout;
GSList *cursors;
GtkTextDirection direction;
gint width; /* Width of layout */
gint total_width; /* width - margins, if no width set on layout, if width set on layout, -1 */
gint height;
gint x_offset; /* Amount layout is shifted from left edge */
gint left_margin;
gint right_margin;
gint top_margin;
gint bottom_margin;
gboolean size_only;
GtkTextLine *line;
};
extern PangoAttrType gtk_text_attr_appearance_type;
GtkType gtk_text_layout_get_type (void);
GtkTextLayout *gtk_text_layout_new (void);
void gtk_text_layout_set_buffer (GtkTextLayout *layout,
GtkTextBuffer *buffer);
void gtk_text_layout_set_default_style (GtkTextLayout *layout,
GtkTextStyleValues *values);
void gtk_text_layout_set_contexts (GtkTextLayout *layout,
PangoContext *ltr_context,
PangoContext *rtl_context);
void gtk_text_layout_default_style_changed (GtkTextLayout *layout);
void gtk_text_layout_set_screen_width (GtkTextLayout *layout,
gint width);
/* Getting the size or the lines potentially results in a call to
* recompute, which is pretty massively expensive. Thus it should
* basically only be done in an idle handler.
*
* Long-term, we would really like to be able to do these without
* a full recompute so they may get cheaper over time.
*/
void gtk_text_layout_get_size (GtkTextLayout *layout,
gint *width,
gint *height);
GSList *gtk_text_layout_get_lines (GtkTextLayout *layout,
/* [top_y, bottom_y) */
gint top_y,
gint bottom_y,
gint *first_line_y);
void gtk_text_layout_wrap_loop_start (GtkTextLayout *layout);
void gtk_text_layout_wrap_loop_end (GtkTextLayout *layout);
GtkTextLineDisplay *gtk_text_layout_get_line_display (GtkTextLayout *layout,
GtkTextLine *line,
gboolean size_only);
void gtk_text_layout_free_line_display (GtkTextLayout *layout,
GtkTextLineDisplay *display);
void gtk_text_layout_get_line_at_y (GtkTextLayout *layout,
GtkTextIter *target_iter,
gint y,
gint *line_top);
void gtk_text_layout_get_iter_at_pixel (GtkTextLayout *layout,
GtkTextIter *iter,
gint x,
gint y);
void gtk_text_layout_invalidate (GtkTextLayout *layout,
const GtkTextIter *start,
const GtkTextIter *end);
void gtk_text_layout_free_line_data (GtkTextLayout *layout,
GtkTextLine *line,
GtkTextLineData *line_data);
gboolean gtk_text_layout_is_valid (GtkTextLayout *layout);
void gtk_text_layout_validate_yrange (GtkTextLayout *layout,
GtkTextIter *anchor_line,
gint y0,
gint y1);
void gtk_text_layout_validate (GtkTextLayout *layout,
gint max_pixels);
/* This function should return the passed-in line data,
OR remove the existing line data from the line, and
return a NEW line data after adding it to the line.
That is, invariant after calling the callback is that
there should be exactly one line data for this view
stored on the btree line. */
GtkTextLineData *gtk_text_layout_wrap (GtkTextLayout *layout,
GtkTextLine *line,
/* may be NULL */
GtkTextLineData *line_data);
void gtk_text_layout_get_log_attrs (GtkTextLayout *layout,
GtkTextLine *line,
PangoLogAttr **attrs,
gint *n_attrs);
void gtk_text_layout_changed (GtkTextLayout *layout,
gint y,
gint old_height,
gint new_height);
void gtk_text_layout_get_iter_location (GtkTextLayout *layout,
const GtkTextIter *iter,
GdkRectangle *rect);
gint gtk_text_layout_get_line_y (GtkTextLayout *layout,
const GtkTextIter *iter);
void gtk_text_layout_get_cursor_locations (GtkTextLayout *layout,
GtkTextIter *iter,
GdkRectangle *strong_pos,
GdkRectangle *weak_pos);
gboolean gtk_text_layout_clamp_iter_to_vrange (GtkTextLayout *layout,
GtkTextIter *iter,
gint top,
gint bottom);
void gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
GtkTextIter *iter);
void gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout,
GtkTextIter *iter);
void gtk_text_layout_move_iter_to_x (GtkTextLayout *layout,
GtkTextIter *iter,
gint x);
void gtk_text_layout_move_iter_visually (GtkTextLayout *layout,
GtkTextIter *iter,
gint count);
void gtk_text_layout_spew (GtkTextLayout *layout);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

339
gtk/gtktextmark.c Normal file
View File

@ -0,0 +1,339 @@
/*
* tkTextMark.c --
*
* This file contains the procedure that implement marks for
* text widgets.
*
* Copyright (c) 1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id$
*/
#include "gtktextbtree.h"
gboolean
gtk_text_mark_is_visible(GtkTextMark *mark)
{
GtkTextLineSegment *seg;
seg = (GtkTextLineSegment*)mark;
return seg->body.mark.visible;
}
char *
gtk_text_mark_get_name (GtkTextMark *mark)
{
GtkTextLineSegment *seg;
seg = (GtkTextLineSegment*)mark;
return g_strdup (seg->body.mark.name);
}
/*
* Macro that determines the size of a mark segment:
*/
#define MSEG_SIZE ((unsigned) (G_STRUCT_OFFSET(GtkTextLineSegment, body) \
+ sizeof(GtkTextMarkBody)))
GtkTextLineSegment*
mark_segment_new(GtkTextBTree *tree,
gboolean left_gravity,
const gchar *name)
{
GtkTextLineSegment *mark;
mark = (GtkTextLineSegment *) g_malloc0(MSEG_SIZE);
mark->body.mark.name = g_strdup(name);
if (left_gravity)
mark->type = &gtk_text_left_mark_type;
else
mark->type = &gtk_text_right_mark_type;
mark->byte_count = 0;
mark->char_count = 0;
mark->body.mark.tree = tree;
mark->body.mark.line = NULL;
mark->next = NULL;
mark->body.mark.refcount = 1;
mark->body.mark.visible = FALSE;
return mark;
}
void
mark_segment_ref(GtkTextLineSegment *mark)
{
g_return_if_fail(mark != NULL);
g_return_if_fail(mark->type == &gtk_text_right_mark_type ||
mark->type == &gtk_text_left_mark_type);
g_return_if_fail(mark->body.mark.refcount > 0);
mark->body.mark.refcount += 1;
}
void
mark_segment_unref(GtkTextLineSegment *mark)
{
g_return_if_fail(mark != NULL);
g_return_if_fail(mark->type == &gtk_text_right_mark_type ||
mark->type == &gtk_text_left_mark_type);
g_return_if_fail(mark->body.mark.refcount > 0);
mark->body.mark.refcount -= 1;
if (mark->body.mark.refcount == 0)
{
g_free(mark->body.mark.name);
g_free(mark);
}
}
/*
* Forward references for procedures defined in this file:
*/
static int mark_segment_delete_func (GtkTextLineSegment *segPtr,
GtkTextLine *line,
int treeGone);
static GtkTextLineSegment *mark_segment_cleanup_func (GtkTextLineSegment *segPtr,
GtkTextLine *line);
static void mark_segment_check_func (GtkTextLineSegment *segPtr,
GtkTextLine *line);
/*
* The following structures declare the "mark" segment types.
* There are actually two types for marks, one with left gravity
* and one with right gravity. They are identical except for
* their gravity property.
*/
GtkTextLineSegmentClass gtk_text_right_mark_type = {
"mark", /* name */
FALSE, /* leftGravity */
(GtkTextLineSegmentSplitFunc) NULL, /* splitFunc */
mark_segment_delete_func, /* deleteFunc */
mark_segment_cleanup_func, /* cleanupFunc */
(GtkTextLineSegmentLineChangeFunc) NULL, /* lineChangeFunc */
mark_segment_check_func /* checkFunc */
};
GtkTextLineSegmentClass gtk_text_left_mark_type = {
"mark", /* name */
TRUE, /* leftGravity */
(GtkTextLineSegmentSplitFunc) NULL, /* splitFunc */
mark_segment_delete_func, /* deleteFunc */
mark_segment_cleanup_func, /* cleanupFunc */
(GtkTextLineSegmentLineChangeFunc) NULL, /* lineChangeFunc */
mark_segment_check_func /* checkFunc */
};
/*
*--------------------------------------------------------------
*
* mark_segment_delete_func --
*
* This procedure is invoked by the text B-tree code whenever
* a mark lies in a range of characters being deleted.
*
* Results:
* Returns 1 to indicate that deletion has been rejected.
*
* Side effects:
* None (even if the whole tree is being deleted we don't
* free up the mark; it will be done elsewhere).
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static int
mark_segment_delete_func(segPtr, line, treeGone)
GtkTextLineSegment *segPtr; /* Segment being deleted. */
GtkTextLine *line; /* Line containing segment. */
int treeGone; /* Non-zero means the entire tree is
* being deleted, so everything must
* get cleaned up. */
{
return 1;
}
/*
*--------------------------------------------------------------
*
* mark_segment_cleanup_func --
*
* This procedure is invoked by the B-tree code whenever a
* mark segment is moved from one line to another.
*
* Results:
* None.
*
* Side effects:
* The line field of the segment gets updated.
*
*--------------------------------------------------------------
*/
static GtkTextLineSegment *
mark_segment_cleanup_func(markPtr, line)
GtkTextLineSegment *markPtr; /* Mark segment that's being moved. */
GtkTextLine *line; /* Line that now contains segment. */
{
markPtr->body.mark.line = line;
return markPtr;
}
#if 0
/*
*--------------------------------------------------------------
*
* GtkTextInsertDisplayFunc --
*
* This procedure is called to display the insertion
* cursor.
*
* Results:
* None.
*
* Side effects:
* Graphics are drawn.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
void
GtkTextInsertDisplayFunc(chunkPtr, x, y, height, baseline, display, dst, screenY)
GtkTextDisplayChunk *chunkPtr; /* Chunk that is to be drawn. */
int x; /* X-position in dst at which to
* draw this chunk (may differ from
* the x-position in the chunk because
* of scrolling). */
int y; /* Y-position at which to draw this
* chunk in dst (x-position is in
* the chunk itself). */
int height; /* Total height of line. */
int baseline; /* Offset of baseline from y. */
Display *display; /* Display to use for drawing. */
Drawable dst; /* Pixmap or window in which to draw
* chunk. */
int screenY; /* Y-coordinate in text window that
* corresponds to y. */
{
GtkTextView *tkxt = (GtkTextView *) chunkPtr->clientData;
int halfWidth = tkxt->insertWidth/2;
if ((x + halfWidth) < 0) {
/*
* The insertion cursor is off-screen. Just return.
*/
return;
}
/*
* As a special hack to keep the cursor visible on mono displays
* (or anywhere else that the selection and insertion cursors
* have the same color) write the default background in the cursor
* area (instead of nothing) when the cursor isn't on. Otherwise
* the selection might hide the cursor.
*/
if (tkxt->flags & INSERT_ON) {
Tk_Fill3DRectangle(tkxt->tkwin, dst, tkxt->insertBorder,
x - tkxt->insertWidth/2, y, tkxt->insertWidth,
height, tkxt->insertBorderWidth, TK_RELIEF_RAISED);
} else if (tkxt->selBorder == tkxt->insertBorder) {
Tk_Fill3DRectangle(tkxt->tkwin, dst, tkxt->border,
x - tkxt->insertWidth/2, y, tkxt->insertWidth,
height, 0, TK_RELIEF_FLAT);
}
}
/*
*--------------------------------------------------------------
*
* InsertUndisplayFunc --
*
* This procedure is called when the insertion cursor is no
* longer at a visible point on the display. It does nothing
* right now.
*
* Results:
* None.
*
* Side effects:
* None.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static void
InsertUndisplayFunc(tkxt, chunkPtr)
GtkTextView *tkxt; /* Overall information about text
* widget. */
GtkTextDisplayChunk *chunkPtr; /* Chunk that is about to be freed. */
{
return;
}
#endif
/*
*--------------------------------------------------------------
*
* mark_segment_check_func --
*
* This procedure is invoked by the B-tree code to perform
* consistency checks on mark segments.
*
* Results:
* None.
*
* Side effects:
* The procedure panics if it detects anything wrong with
* the mark.
*
*--------------------------------------------------------------
*/
static void
mark_segment_check_func(markPtr, line)
GtkTextLineSegment *markPtr; /* Segment to check. */
GtkTextLine *line; /* Line containing segment. */
{
if (markPtr->body.mark.line != line)
g_error("mark_segment_check_func: markPtr->body.mark.line bogus");
/* No longer do this because we don't have access to btree
struct members */
#if 0
/*
* Make sure that the mark is still present in the text's mark
* hash table.
*/
for (hPtr = Tcl_FirstHashEntry(&markPtr->body.mark.tkxt->markTable,
&search); hPtr != markPtr->body.mark.hPtr;
hPtr = Tcl_NextHashEntry(&search)) {
if (hPtr == NULL) {
panic("mark_segment_check_func couldn't find hash table entry for mark");
}
}
#endif
}

24
gtk/gtktextmark.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef GTK_TEXT_MARK_H
#define GTK_TEXT_MARK_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* The GtkTextMark data type */
typedef struct _GtkTextMark GtkTextMark;
void gtk_text_mark_set_visible (GtkTextMark *mark,
gboolean setting);
gboolean gtk_text_mark_is_visible (GtkTextMark *mark);
char * gtk_text_mark_get_name (GtkTextMark *mark);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

37
gtk/gtktextmarkprivate.h Normal file
View File

@ -0,0 +1,37 @@
#ifndef GTK_TEXT_MARK_PRIVATE_H
#define GTK_TEXT_MARK_PRIVATE_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <gtk/gtktexttypes.h>
/*
* The data structure below defines line segments that represent
* marks. There is one of these for each mark in the text.
*/
struct _GtkTextMarkBody {
guint refcount;
gchar *name;
GtkTextBTree *tree;
GtkTextLine *line;
gboolean visible;
};
GtkTextLineSegment *mark_segment_new (GtkTextBTree *tree,
gboolean left_gravity,
const gchar *name);
void mark_segment_ref (GtkTextLineSegment *mark);
void mark_segment_unref (GtkTextLineSegment *mark);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

626
gtk/gtktextsegment.c Normal file
View File

@ -0,0 +1,626 @@
/*
* gtktextsegment.c --
*
* Code for segments in general, and toggle/char segments in particular.
*
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
* Copyright (c) 2000 Red Hat, Inc.
* Tk -> Gtk port by Havoc Pennington <hp@redhat.com>
*
* This software is copyrighted by the Regents of the University of
* California, Sun Microsystems, Inc., and other parties. The
* following terms apply to all files associated with the software
* unless explicitly disclaimed in individual files.
*
* The authors hereby grant permission to use, copy, modify,
* distribute, and license this software and its documentation for any
* purpose, provided that existing copyright notices are retained in
* all copies and that this notice is included verbatim in any
* distributions. No written agreement, license, or royalty fee is
* required for any of the authorized uses. Modifications to this
* software may be copyrighted by their authors and need not follow
* the licensing terms described here, provided that the new terms are
* clearly indicated on the first page of each file where they apply.
*
* IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY
* PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
* DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION,
* OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
* NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
* AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* GOVERNMENT USE: If you are acquiring this software on behalf of the
* U.S. government, the Government shall have only "Restricted Rights"
* in the software and related documentation as defined in the Federal
* Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
* are acquiring the software on behalf of the Department of Defense,
* the software shall be classified as "Commercial Computer Software"
* and the Government shall have only "Restricted Rights" as defined
* in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
* foregoing, the authors grant the U.S. Government and others acting
* in its behalf permission to use and distribute the software in
* accordance with the terms specified in this license.
*
*/
#include "gtktextbtree.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include "gtktexttag.h"
#include "gtktexttagtable.h"
#include "gtktextlayout.h"
#include "gtktextiterprivate.h"
#include "gtkdebug.h"
/*
*--------------------------------------------------------------
*
* split_segment --
*
* This procedure is called before adding or deleting
* segments. It does three things: (a) it finds the segment
* containing iter; (b) if there are several such
* segments (because some segments have zero length) then
* it picks the first segment that does not have left
* gravity; (c) if the index refers to the middle of
* a segment then it splits the segment so that the
* index now refers to the beginning of a segment.
*
* Results:
* The return value is a pointer to the segment just
* before the segment corresponding to iter (as
* described above). If the segment corresponding to
* iter is the first in its line then the return
* value is NULL.
*
* Side effects:
* The segment referred to by iter is split unless
* iter refers to its first character.
*
*--------------------------------------------------------------
*/
GtkTextLineSegment*
gtk_text_line_segment_split(const GtkTextIter *iter)
{
GtkTextLineSegment *prev, *seg;
GtkTextBTree *tree;
GtkTextLine *line;
int count;
line = gtk_text_iter_get_line(iter);
tree = gtk_text_iter_get_btree(iter);
count = gtk_text_iter_get_line_byte(iter);
prev = NULL;
seg = line->segments;
while (seg != NULL)
{
if (seg->byte_count > count)
{
if (count == 0)
{
return prev;
}
else
{
g_assert(count != seg->byte_count);
g_assert(seg->byte_count > 0);
gtk_text_btree_segments_changed(tree);
seg = (*seg->type->splitFunc)(seg, count);
if (prev == NULL)
line->segments = seg;
else
prev->next = seg;
return seg;
}
}
else if ((seg->byte_count == 0) && (count == 0)
&& !seg->type->leftGravity)
{
return prev;
}
count -= seg->byte_count;
prev = seg;
seg = seg->next;
}
g_error("split_segment reached end of line!");
return NULL;
}
/*
* Macros that determine how much space to allocate for new segments:
*/
#define CSEG_SIZE(chars) ((unsigned) (G_STRUCT_OFFSET(GtkTextLineSegment, body) \
+ 1 + (chars)))
#define TSEG_SIZE ((unsigned) (G_STRUCT_OFFSET(GtkTextLineSegment, body) \
+ sizeof(GtkTextToggleBody)))
/*
* Type functions
*/
static void
char_segment_self_check(GtkTextLineSegment *seg)
{
/* This function checks the segment itself, but doesn't
assume the segment has been validly inserted into
the btree. */
g_assert(seg != NULL);
if (seg->byte_count <= 0)
{
g_error("char_segment_check_func: segment has size <= 0");
}
if (strlen(seg->body.chars) != seg->byte_count)
{
g_error("char_segment_check_func: segment has wrong size");
}
if (gtk_text_view_num_utf_chars(seg->body.chars, seg->byte_count) != seg->char_count)
{
g_error("char segment has wrong character count");
}
}
GtkTextLineSegment*
char_segment_new(const gchar *text, guint len)
{
GtkTextLineSegment *seg;
g_assert(gtk_text_byte_begins_utf8_char(text));
seg = g_malloc(CSEG_SIZE(len));
seg->type = &gtk_text_char_type;
seg->next = NULL;
seg->byte_count = len;
memcpy(seg->body.chars, text, len);
seg->body.chars[len] = '\0';
seg->char_count = gtk_text_view_num_utf_chars(seg->body.chars, seg->byte_count);
if (gtk_debug_flags & GTK_DEBUG_TEXT)
char_segment_self_check(seg);
return seg;
}
GtkTextLineSegment*
char_segment_new_from_two_strings(const gchar *text1, guint len1,
const gchar *text2, guint len2)
{
GtkTextLineSegment *seg;
g_assert(gtk_text_byte_begins_utf8_char(text1));
g_assert(gtk_text_byte_begins_utf8_char(text2));
seg = g_malloc(CSEG_SIZE(len1+len2));
seg->type = &gtk_text_char_type;
seg->next = NULL;
seg->byte_count = len1 + len2;
memcpy(seg->body.chars, text1, len1);
memcpy(seg->body.chars + len1, text2, len2);
seg->body.chars[len1+len2] = '\0';
/* In principle this function could probably take chars1 and chars2
as args, since it's typically used to merge two char segments */
seg->char_count = gtk_text_view_num_utf_chars(seg->body.chars, seg->byte_count);
if (gtk_debug_flags & GTK_DEBUG_TEXT)
char_segment_self_check(seg);
return seg;
}
/*
*--------------------------------------------------------------
*
* char_segment_split_func --
*
* This procedure implements splitting for character segments.
*
* Results:
* The return value is a pointer to a chain of two segments
* that have the same characters as segPtr except split
* among the two segments.
*
* Side effects:
* Storage for segPtr is freed.
*
*--------------------------------------------------------------
*/
static GtkTextLineSegment *
char_segment_split_func(GtkTextLineSegment *seg, int index)
{
GtkTextLineSegment *new1, *new2;
g_assert(index < seg->byte_count);
if (gtk_debug_flags & GTK_DEBUG_TEXT)
{
char_segment_self_check(seg);
}
new1 = char_segment_new(seg->body.chars, index);
new2 = char_segment_new(seg->body.chars + index, seg->byte_count - index);
g_assert(gtk_text_byte_begins_utf8_char(new1->body.chars));
g_assert(gtk_text_byte_begins_utf8_char(new2->body.chars));
g_assert(new1->byte_count + new2->byte_count == seg->byte_count);
g_assert(new1->char_count + new2->char_count == seg->char_count);
new1->next = new2;
new2->next = seg->next;
if (gtk_debug_flags & GTK_DEBUG_TEXT)
{
char_segment_self_check(new1);
char_segment_self_check(new2);
}
g_free(seg);
return new1;
}
/*
*--------------------------------------------------------------
*
* char_segment_cleanup_func --
*
* This procedure merges adjacent character segments into
* a single character segment, if possible.
*
* Results:
* The return value is a pointer to the first segment in
* the (new) list of segments that used to start with segPtr.
*
* Side effects:
* Storage for the segments may be allocated and freed.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static GtkTextLineSegment *
char_segment_cleanup_func(segPtr, line)
GtkTextLineSegment *segPtr; /* Pointer to first of two adjacent
* segments to join. */
GtkTextLine *line; /* Line containing segments (not
* used). */
{
GtkTextLineSegment *segPtr2, *newPtr;
if (gtk_debug_flags & GTK_DEBUG_TEXT)
char_segment_self_check(segPtr);
segPtr2 = segPtr->next;
if ((segPtr2 == NULL) || (segPtr2->type != &gtk_text_char_type))
{
return segPtr;
}
newPtr = char_segment_new_from_two_strings(segPtr->body.chars, segPtr->byte_count,
segPtr2->body.chars, segPtr2->byte_count);
newPtr->next = segPtr2->next;
if (gtk_debug_flags & GTK_DEBUG_TEXT)
char_segment_self_check(newPtr);
g_free(segPtr);
g_free(segPtr2);
return newPtr;
}
/*
*--------------------------------------------------------------
*
* char_segment_delete_func --
*
* This procedure is invoked to delete a character segment.
*
* Results:
* Always returns 0 to indicate that the segment was deleted.
*
* Side effects:
* Storage for the segment is freed.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static int
char_segment_delete_func(segPtr, line, treeGone)
GtkTextLineSegment *segPtr; /* Segment to delete. */
GtkTextLine *line; /* Line containing segment. */
int treeGone; /* Non-zero means the entire tree is
* being deleted, so everything must
* get cleaned up. */
{
g_free((char*) segPtr);
return 0;
}
/*
*--------------------------------------------------------------
*
* char_segment_check_func --
*
* This procedure is invoked to perform consistency checks
* on character segments.
*
* Results:
* None.
*
* Side effects:
* If the segment isn't inconsistent then the procedure
* g_errors.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static void
char_segment_check_func(segPtr, line)
GtkTextLineSegment *segPtr; /* Segment to check. */
GtkTextLine *line; /* Line containing segment. */
{
char_segment_self_check(segPtr);
if (segPtr->next == NULL)
{
if (segPtr->body.chars[segPtr->byte_count-1] != '\n')
{
g_error("char_segment_check_func: line doesn't end with newline");
}
}
else
{
if (segPtr->next->type == &gtk_text_char_type)
{
g_error("char_segment_check_func: adjacent character segments weren't merged");
}
}
}
GtkTextLineSegment*
toggle_segment_new(GtkTextTagInfo *info, gboolean on)
{
GtkTextLineSegment *seg;
seg = g_malloc(TSEG_SIZE);
seg->type = on ? &gtk_text_toggle_on_type : &gtk_text_toggle_off_type;
seg->next = NULL;
seg->byte_count = 0;
seg->char_count = 0;
seg->body.toggle.info = info;
seg->body.toggle.inNodeCounts = 0;
return seg;
}
/*
*--------------------------------------------------------------
*
* toggle_segment_delete_func --
*
* This procedure is invoked to delete toggle segments.
*
* Results:
* Returns 1 to indicate that the segment may not be deleted,
* unless the entire B-tree is going away.
*
* Side effects:
* If the tree is going away then the toggle's memory is
* freed; otherwise the toggle counts in GtkTextBTreeNodes above the
* segment get updated.
*
*--------------------------------------------------------------
*/
static int
toggle_segment_delete_func(segPtr, line, treeGone)
GtkTextLineSegment *segPtr; /* Segment to check. */
GtkTextLine *line; /* Line containing segment. */
int treeGone; /* Non-zero means the entire tree is
* being deleted, so everything must
* get cleaned up. */
{
if (treeGone)
{
g_free((char *) segPtr);
return 0;
}
/*
* This toggle is in the middle of a range of characters that's
* being deleted. Refuse to die. We'll be moved to the end of
* the deleted range and our cleanup procedure will be called
* later. Decrement GtkTextBTreeNode toggle counts here, and set a flag
* so we'll re-increment them in the cleanup procedure.
*/
if (segPtr->body.toggle.inNodeCounts)
{
change_node_toggle_count(line->parent,
segPtr->body.toggle.info, -1);
segPtr->body.toggle.inNodeCounts = 0;
}
return 1;
}
/*
*--------------------------------------------------------------
*
* toggle_segment_cleanup_func --
*
* This procedure is called when a toggle is part of a line that's
* been modified in some way. It's invoked after the
* modifications are complete.
*
* Results:
* The return value is the head segment in a new list
* that is to replace the tail of the line that used to
* start at segPtr. This allows the procedure to delete
* or modify segPtr.
*
* Side effects:
* Toggle counts in the GtkTextBTreeNodes above the new line will be
* updated if they're not already. Toggles may be collapsed
* if there are duplicate toggles at the same position.
*
*--------------------------------------------------------------
*/
static GtkTextLineSegment *
toggle_segment_cleanup_func(segPtr, line)
GtkTextLineSegment *segPtr; /* Segment to check. */
GtkTextLine *line; /* Line that now contains segment. */
{
GtkTextLineSegment *segPtr2, *prevPtr;
int counts;
/*
* If this is a toggle-off segment, look ahead through the next
* segments to see if there's a toggle-on segment for the same tag
* before any segments with non-zero size. If so then the two
* toggles cancel each other; remove them both.
*/
if (segPtr->type == &gtk_text_toggle_off_type)
{
for (prevPtr = segPtr, segPtr2 = prevPtr->next;
(segPtr2 != NULL) && (segPtr2->byte_count == 0);
prevPtr = segPtr2, segPtr2 = prevPtr->next)
{
if (segPtr2->type != &gtk_text_toggle_on_type)
{
continue;
}
if (segPtr2->body.toggle.info != segPtr->body.toggle.info)
{
continue;
}
counts = segPtr->body.toggle.inNodeCounts
+ segPtr2->body.toggle.inNodeCounts;
if (counts != 0)
{
change_node_toggle_count(line->parent,
segPtr->body.toggle.info, -counts);
}
prevPtr->next = segPtr2->next;
g_free((char *) segPtr2);
segPtr2 = segPtr->next;
g_free((char *) segPtr);
return segPtr2;
}
}
if (!segPtr->body.toggle.inNodeCounts)
{
change_node_toggle_count(line->parent,
segPtr->body.toggle.info, 1);
segPtr->body.toggle.inNodeCounts = 1;
}
return segPtr;
}
/*
*--------------------------------------------------------------
*
* toggle_segment_line_change_func --
*
* This procedure is invoked when a toggle segment is about
* to move from one line to another.
*
* Results:
* None.
*
* Side effects:
* Toggle counts are decremented in the GtkTextBTreeNodes above the line.
*
*--------------------------------------------------------------
*/
static void
toggle_segment_line_change_func(segPtr, line)
GtkTextLineSegment *segPtr; /* Segment to check. */
GtkTextLine *line; /* Line that used to contain segment. */
{
if (segPtr->body.toggle.inNodeCounts)
{
change_node_toggle_count(line->parent,
segPtr->body.toggle.info, -1);
segPtr->body.toggle.inNodeCounts = 0;
}
}
/*
* Virtual tables
*/
GtkTextLineSegmentClass gtk_text_char_type = {
"character", /* name */
0, /* leftGravity */
char_segment_split_func, /* splitFunc */
char_segment_delete_func, /* deleteFunc */
char_segment_cleanup_func, /* cleanupFunc */
NULL, /* lineChangeFunc */
char_segment_check_func /* checkFunc */
};
/*
* Type record for segments marking the beginning of a tagged
* range:
*/
GtkTextLineSegmentClass gtk_text_toggle_on_type = {
"toggleOn", /* name */
0, /* leftGravity */
NULL, /* splitFunc */
toggle_segment_delete_func, /* deleteFunc */
toggle_segment_cleanup_func, /* cleanupFunc */
toggle_segment_line_change_func, /* lineChangeFunc */
toggle_segment_check_func /* checkFunc */
};
/*
* Type record for segments marking the end of a tagged
* range:
*/
GtkTextLineSegmentClass gtk_text_toggle_off_type = {
"toggleOff", /* name */
1, /* leftGravity */
NULL, /* splitFunc */
toggle_segment_delete_func, /* deleteFunc */
toggle_segment_cleanup_func, /* cleanupFunc */
toggle_segment_line_change_func, /* lineChangeFunc */
toggle_segment_check_func /* checkFunc */
};

128
gtk/gtktextsegment.h Normal file
View File

@ -0,0 +1,128 @@
#ifndef GTK_TEXT_SEGMENT_H
#define GTK_TEXT_SEGMENT_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Segments: each line is divided into one or more segments, where each
* segment is one of several things, such as a group of characters, a
* tag toggle, a mark, or an embedded widget. Each segment starts with
* a standard header followed by a body that varies from type to type.
*/
/* This header has the segment type, and two specific segments
(character and toggle segments) */
#include <gtk/gtktexttag.h>
#include <gtk/gtktextiter.h>
#include <gtk/gtktextmarkprivate.h>
#include <gtk/gtktextchild.h>
/* Information a BTree stores about a tag. */
typedef struct _GtkTextTagInfo GtkTextTagInfo;
struct _GtkTextTagInfo {
GtkTextTag *tag;
GtkTextBTreeNode *tag_root; /* highest-level node containing the tag */
gint toggle_count; /* total toggles of this tag below tag_root */
};
/* Body of a segment that toggles a tag on or off */
struct _GtkTextToggleBody {
GtkTextTagInfo *info; /* Tag that starts or ends here. */
gboolean inNodeCounts; /* TRUE means this toggle has been
* accounted for in node toggle
* counts; FALSE means it hasn't, yet. */
};
/* Class struct for segments */
typedef GtkTextLineSegment *(* GtkTextLineSegmentSplitFunc) (GtkTextLineSegment *segPtr,
int index);
typedef gboolean (* GtkTextViewSegDeleteFunc) (GtkTextLineSegment *segPtr,
GtkTextLine *line,
gboolean treeGone);
typedef GtkTextLineSegment *(* GtkTextViewSegCleanupFunc) (GtkTextLineSegment *segPtr,
GtkTextLine *line);
typedef void (* GtkTextLineSegmentLineChangeFunc) (GtkTextLineSegment *segPtr,
GtkTextLine *line);
typedef void (* GtkTextViewSegCheckFunc) (GtkTextLineSegment *segPtr,
GtkTextLine *line);
struct _GtkTextLineSegmentClass {
char *name; /* Name of this kind of segment. */
gboolean leftGravity; /* If a segment has zero size (e.g. a
* mark or tag toggle), does it
* attach to character to its left
* or right? 1 means left, 0 means
* right. */
GtkTextLineSegmentSplitFunc splitFunc; /* Procedure to split large segment
* into two smaller ones. */
GtkTextViewSegDeleteFunc deleteFunc; /* Procedure to call to delete
* segment. */
GtkTextViewSegCleanupFunc cleanupFunc; /* After any change to a line, this
* procedure is invoked for all
* segments left in the line to
* perform any cleanup they wish
* (e.g. joining neighboring
* segments). */
GtkTextLineSegmentLineChangeFunc lineChangeFunc;
/* Invoked when a segment is about
* to be moved from its current line
* to an earlier line because of
* a deletion. The line is that
* for the segment's old line.
* CleanupFunc will be invoked after
* the deletion is finished. */
GtkTextViewSegCheckFunc checkFunc; /* Called during consistency checks
* to check internal consistency of
* segment. */
};
/*
* The data structure below defines line segments.
*/
struct _GtkTextLineSegment {
GtkTextLineSegmentClass *type; /* Pointer to record describing
* segment's type. */
GtkTextLineSegment *next; /* Next in list of segments for this
* line, or NULL for end of list. */
int char_count; /* # of chars of index space occupied */
int byte_count; /* Size of this segment (# of bytes
* of index space it occupies). */
union {
char chars[4]; /* Characters that make up character
* info. Actual length varies to
* hold as many characters as needed.*/
GtkTextToggleBody toggle; /* Information about tag toggle. */
GtkTextMarkBody mark; /* Information about mark. */
GtkTextPixmap pixmap; /* Child pixmap */
#if 0
GtkTextChild child; /* child widget */
#endif
} body;
};
GtkTextLineSegment *gtk_text_line_segment_split(const GtkTextIter *iter);
GtkTextLineSegment *char_segment_new(const gchar *text, guint len);
GtkTextLineSegment *char_segment_new_from_two_strings(const gchar *text1, guint len1,
const gchar *text2, guint len2);
GtkTextLineSegment *toggle_segment_new(GtkTextTagInfo *info, gboolean on);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

1272
gtk/gtktexttag.c Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More