indexing
	description: "Contains information about the button images of the toolbar."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_TOOL_BAR_BITMAP

create 

	make (a_bitmap_id: INTEGER)
			-- Initialize a toolbar bitmap with the resource bitmap
			-- identifier a_bitmap_id.
		require
			positive_bitmap_id: a_bitmap_id > 0
		ensure
			bitmap_id_set: bitmap_id = a_bitmap_id

	make_from_bitmap (a_bitmap: WEL_BITMAP)
			-- Create a toolbar bitmap with a common bitmap.
		require
			bitmap_not_void: a_bitmap /= void
			bitmap_exists: a_bitmap.exists
		ensure
			bitmap_set: bitmap_id = a_bitmap.to_integer

	make_by_predefined_id (a_bitmap_id: INTEGER)
			-- Initialize a toolbar bitmap with the system
			-- predefined resource bitmap identifier a_bitmap_id.
			-- See class WEL_IDB_CONSTANTS for a_bitmap_id values.
		require
			valid_tool_bar_bitmap_constant: valid_tool_bar_bitmap_constant (a_bitmap_id)
		ensure
			bitmap_id_set: bitmap_id = a_bitmap_id

feature -- Access

	bitmap_id: INTEGER
			-- Resource identifier of the bitmap resource that
			-- contains the button images.

	instance: WEL_INSTANCE
			-- Instance that contains the bitmap resource
			-- bitmap_id
		ensure
			result_not_void: Result /= void

	item: POINTER
			-- Generic Windows handle or structure pointer.
			-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
			-- (from WEL_ANY)
	
feature -- Measurement

	structure_size: INTEGER
			-- Size to allocate (in bytes)
		ensure -- from WEL_STRUCTURE
			positive_result: Result > 0
	
feature -- Status report

	exists: BOOLEAN
			-- Does the item exist?
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = (item /= default_pointer)

	shared: BOOLEAN
			-- Is item shared by another object?
			-- If False (by default), item will
			-- be destroyed by destroy_item.
			-- If True, item will not be destroyed.
			-- (from WEL_ANY)
	
feature  -- Status report

	valid_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN
			-- Is c a valid tool bar bitmap constant?
			-- (from WEL_IDB_CONSTANTS)
	
feature -- Status setting

	set_shared
			-- Set shared to True.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			shared: shared

	set_unshared
			-- Set shared to False.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			unshared: not shared
	
feature -- Element change

	set_bitmap_id (a_bitmap_id: INTEGER)
			-- Set bitmap_id with a_bitmap_id.
		require
			positive_bitmap_id: a_bitmap_id > 0
		ensure
			bitmap_id_set: bitmap_id = a_bitmap_id

	set_item (an_item: POINTER)
			-- Set item with an_item
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = an_item

	set_predefined_bitmap_id (a_bitmap_id: INTEGER)
			-- Set bitmap_id with the system predefined resource
			-- bitmap identifier a_bitmap_id.
			-- See class WEL_IDB_CONSTANTS for a_bitmap_id values.
		require
			valid_tool_bar_bitmap_constant: valid_tool_bar_bitmap_constant (a_bitmap_id)
		ensure
			bitmap_id_set: bitmap_id = a_bitmap_id
	
feature -- Removal

	dispose
			-- Destroy the inner structure of Current.
			--
			-- This function should be called by the GC when the
			-- object is collected or by the user if Current is
			-- no more usefull.
			-- (from WEL_ANY)
	
feature -- Conversion

	to_integer: INTEGER
			-- Converts item to an integer.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = cwel_pointer_to_integer (item)
	
feature -- Basic operations

	initialize
			-- Fill Current with zeros.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	initialize_with_character (a_character: CHARACTER)
			-- Fill current with a_character.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	memory_copy (source_pointer: POINTER; length: INTEGER)
			-- Copy length bytes from source_pointer to item.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			length_small_enough: length <= structure_size
			length_large_enough: length > 0
			exists: exists
	
feature -- Status Report

	predefined_id: BOOLEAN
			-- Are we using predefined bitmap (Cut, Copy, ...) ?
			-- (This is not compatible with the ImageList)
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOL_BAR_BITMAP