indexing
	description: "[
		Objects that permit graphical drawing operations to be performed which respect the
		theming state of Windows XP.
	]"
	legal: "See notice at end of class."
	status: "See notice at end of class."
	date: "$Date: 2006-05-16 08:48:18 -0700 (Tue, 16 May 2006) $"
	revision: "$Revision: 58994 $"

class interface
	EV_XP_THEME_DRAWER_IMP

create 
	default_create
			-- Process instances of classes with no creation clause.
			-- (Default: do nothing.)
			-- (from ANY)

feature -- Access

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)
	
feature -- Comparison

	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void
			-- or attached to isomorphic object structures?
			-- (from ANY)
		ensure -- from ANY
			shallow_implies_deep: standard_equal (some, other) implies Result
			both_or_none_void: (some = Void) implies (Result = (other = Void))
			same_type: (Result and (some /= Void)) implies some.same_type (other)
			symmetric: Result implies deep_equal (other, some)

	frozen equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached
			-- to objects considered equal?
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

	is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object considered
			-- equal to current object?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result

	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached to
			-- field-by-field identical objects of the same type?
			-- Always uses default object comparison criterion.
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

	frozen standard_is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object of the same type
			-- as current object, and field-by-field identical to it?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			same_type: Result implies same_type (other)
			symmetric: Result implies other.standard_is_equal (Current)
	
feature -- Status report

	conforms_to (other: ANY): BOOLEAN
			-- Does type of current object conform to type
			-- of `other' (as per Eiffel: The Language, chapter 13)?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void

	same_type (other: ANY): BOOLEAN
			-- Is type of current object identical to type of `other'?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			definition: Result = (conforms_to (other) and other.conforms_to (Current))
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to `other', so as to yield equal objects.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)

	frozen deep_copy (other: like Current)
			-- Effect equivalent to that of:
			--		copy (`other' . deep_twin)
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			deep_equal: deep_equal (Current, other)

	frozen deep_twin: like Current
			-- New object structure recursively duplicated from Current.
			-- (from ANY)
		ensure -- from ANY
			deep_equal: deep_equal (Current, Result)

	frozen standard_copy (other: like Current)
			-- Copy every field of `other' onto corresponding field
			-- of current object.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_standard_equal: standard_is_equal (other)

	frozen standard_twin: like Current
			-- New object field-by-field identical to `other'.
			-- Always uses default copying semantics.
			-- (from ANY)
		ensure -- from ANY
			standard_twin_not_void: Result /= Void
			equal: standard_equal (Result, Current)

	frozen twin: like Current
			-- New object equal to `Current'
			-- twin calls copy; to change copying/twining semantics, redefine copy.
			-- (from ANY)
		ensure -- from ANY
			twin_not_void: Result /= Void
			is_equal: Result.is_equal (Current)
	
feature -- Basic operations

	close_theme_data (item: POINTER)
			-- Close theme data for WEL_WINDOW represented by `item'.

	frozen default: like Current
			-- Default value of object's type
			-- (from ANY)

	frozen default_pointer: POINTER
			-- Default value of type `POINTER'
			-- (Avoid the need to write `p'.default for
			-- some `p' of type `POINTER'.)
			-- (from ANY)

	default_rescue
			-- Process exception for routines with no Rescue clause.
			-- (Default: do nothing.)
			-- (from ANY)

	frozen do_nothing
			-- Execute a null action.
			-- (from ANY)

	draw_bitmap_on_dc (dc: WEL_DC; a_bitmap, mask_bitmap: WEL_BITMAP; an_x, a_y: INTEGER_32; is_sensitive: BOOLEAN)
			-- Draw `a_bitmap' on `dc' at `an_x'. `a_y'.
			-- Take `is_sensitive' into acount, and draw `a_bitmap' greyed out if not `is_sensitive'.
			-- (from EV_THEME_DRAWER_IMP)
		require -- from EV_THEME_DRAWER_IMP
			dc_not_void: dc /= Void
			a_bitmap_not_void: a_bitmap /= Void

	draw_button_edge (memory_dc: WEL_DC; a_state_id: INTEGER_32; a_rect: WEL_RECT)
			-- Draw the edge of a button into `memory_dc' using `a_state_id' to give the current
			-- button state. `a_rect' gives the boundaries of the drawing.
		require -- from EV_THEME_DRAWER_IMP
			memory_dc_not_void: memory_dc /= Void
			a_rect_not_void: a_rect /= Void

	draw_notebook_background (notebook: EV_NOTEBOOK_IMP; a_hdc: WEL_DC; a_rect: WEL_RECT; background_brush: WEL_BRUSH)
			-- Draw the background of `notebook'. Does nothing as on XP, the background is drawn automatically.
		require -- from EV_THEME_DRAWER_IMP
			notebook_not_void: notebook /= Void
			a_hdc_not_void: a_hdc /= Void
			a_rect_not_void: a_rect /= Void
			background_brush /= Void

	draw_text (theme: POINTER; a_hdc: WEL_DC; a_part_id, a_state_id: INTEGER_32; text: STRING_GENERAL; dw_text_flags: INTEGER_32; is_sensitive: BOOLEAN; a_content_rect: WEL_RECT; foreground_color: EV_COLOR_IMP)
			-- Draw `text' using theme `theme' on `a_hdc' within `a_content_rect' corresponding to part `a_part_id', `a_state_id'. Respect state of `is_sensitive'
		require -- from EV_THEME_DRAWER_IMP
			a_hdc_not_void: a_hdc /= Void
			text_not_void: text /= Void
			a_content_rect_not_void: a_content_rect /= Void
			foreground_color_not_void: foreground_color /= Void

	draw_theme_background (theme: POINTER; a_hdc: WEL_DC; a_part_id, a_state_id: INTEGER_32; a_rect, a_clip_rect: WEL_RECT; background_brush: WEL_BRUSH)
			-- Draw a background theme using `theme' into `a_hdc'. `a_part_id' represents the part type to draw and `a_state_id' represents
			-- the item state. Drawing is performed into `a_rect' and clipped to `a_clip_rect'. `background_brush' is not used for this themed version.
		require -- from EV_THEME_DRAWER_IMP
			a_hdc_not_void: a_hdc /= Void
			a_rect_not_void: a_rect /= Void
			background_brush_not_void: background_brush /= Void
		require else
			theme_exists: theme /= default_pointer

	draw_theme_parent_background (wel_item: POINTER; a_hdc: WEL_DC; a_rect: WEL_RECT; background_brush: WEL_BRUSH)
			-- For the  WEL_WINDOW represented by `wel_item', copy the background of it's parent into `a_hdc' bounded by
			-- `a_rect'. `background_brush' is not used. Warning. If this is used recursively in nested widget structures,
			-- it appears to slow things down a great deal.
		require -- from EV_THEME_DRAWER_IMP
			wel_item_exists: wel_item /= default_pointer
			a_hdc_not_void: a_hdc /= Void
			a_rect_not_void: a_rect /= Void

	draw_widget_background (a_widget: EV_WIDGET_IMP; a_hdc: WEL_DC; a_rect: WEL_RECT; background_brush: WEL_BRUSH)
			-- Draw the background for `a_widget' onto `a_hdc' restricted to `a_rect'. If `a_widget' is contained at some level within
			-- a notebook then apply the theming of the notebook background to `a_widget', otherwise draw the background using `background_brush'.
			-- The theming is ignored if `a_widget' has had a background color specifically set or if one of the containers `a_widget' is contained in
			-- between itself and the notebook have a background color specifically set.
		require -- from EV_THEME_DRAWER_IMP
			a_widget_not_void: a_widget /= Void
			a_hdc_not_void: a_hdc /= Void
			a_rect_not_void: a_rect /= Void
			background_brush_not_void: background_brush /= Void

	get_notebook_parent (a_widget: EV_WIDGET_IMP): EV_NOTEBOOK_IMP
			-- Return the first notebook parent of `Current' in the widget structure
			-- unless a widget with a background color or a container with a background pixmap
			-- is found.
		require
			a_widget_not_void: a_widget /= Void

	get_window_theme (item: POINTER): POINTER
			-- Retrieve a theme handle for WEL_WINDOW `item'.
		require -- from EV_THEME_DRAWER_IMP
			item_not_default_pointer: item /= default_pointer

	internal_draw_text (item: POINTER; dc: WEL_DC; text: STRING_GENERAL; r: WEL_RECT; flags: INTEGER_32; is_sensitive: BOOLEAN; foreground_color: EV_COLOR_IMP)
			-- Draw `text' of `Current' on `dc', in `r'.
			-- If not `is_sensitive' then perform appropriate
			-- higlighting on text.
			-- (from EV_THEME_DRAWER_IMP)

	open_theme_data (item: POINTER; a_class_name: STRING_GENERAL): POINTER
			-- Open theme data for WEL_WINDOW represented by `item'
			-- with type of theme `class_name'. See "Parts and States" of MSDN
			-- for a list of valid class names.
		require -- from EV_THEME_DRAWER_IMP
			item_exists: item /= default_pointer
			class_name_not_void: a_class_name /= Void

	update_button_pixmap_coordinates_for_state (open_theme: POINTER; a_state: INTEGER_32; coordinate: EV_COORDINATE)
			-- Update `coordinate' to reflect new coordinates for a pixmap drawn on a button with state `a_state'.
		require -- from EV_THEME_DRAWER_IMP
			coordinate_not_void: coordinate /= Void

	update_button_text_rect_for_state (wel_item: POINTER; a_state_is: INTEGER_32; a_rect: WEL_RECT)
			-- Update `a_rect' to reflect new position for text drawn on a button with state `a_state'.
		require -- from EV_THEME_DRAWER_IMP
			a_rect_not_void: a_rect /= Void
	
feature -- Output

	io: STD_FILES
			-- Handle to standard file setup
			-- (from ANY)

	out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of tagged_out.
			-- (from ANY)

	print (some: ANY)
			-- Write terse external representation of `some'
			-- on standard output.
			-- (from ANY)

	frozen tagged_out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of out.
			-- (from ANY)
	
feature -- Platform

	operating_environment: OPERATING_ENVIRONMENT
			-- Objects available from the operating system
			-- (from ANY)
	
feature -- Query

	is_color_id_valid (a_color_id: INTEGER_32): BOOLEAN
			-- If a_color_id valid?
			-- (from EV_THEME_DRAWER_IMP)

	theme_color (a_theme: POINTER; a_color_id: INTEGER_32): EV_COLOR
			-- Theme color
			-- a_color_id is one value from EV_THEME_COLOR_CONTANTS
		require -- from EV_THEME_DRAWER_IMP
			valid: is_color_id_valid (a_color_id)
		ensure -- from EV_THEME_DRAWER_IMP
			not_void: Result /= Void
	
invariant
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

indexing
	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		356 Storke Road, Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class EV_XP_THEME_DRAWER_IMP