INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Display Graphics Context"
project: "Visual Eiffel"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: grape
class DISPLAY_GRAPHICS_CONTEXT
inherit

GRAPHICS_CONTEXT
rename
f_save_gc as dgc_save_gc,
f_restore_gc as dgc_restore_gc,
f_select_font as dgc_select_font,
f_select_pen as dgc_select_pen
redefine
device_to_screen,
screen_to_device
end
creation

make,
make_with_assignment
creation {WRAPPER}

adapt
feature -- Graphics context constructor methods

make
-- Builds a new display graphics context and initializes its internal
-- strutures.

make_with_assignment (a_tile: TILE)
-- Builds a new display graphics context and initializes its internal
-- strutures.
-- Also a tile is assigned as an output target.

assign_target_tile (a_tile: TILE)
-- Assigns to the GC a Tile object, which is used as output for
-- all drawing operations. This method can be used to share a
-- graphics context between several tiles.
feature -- Graphics context manipulation methods

begin_paint, f_begin_paint
-- Initializes a new graphics device context by assigning to it
-- default values and anchoring to it a tile.
-- Every reauest to the graphics engine is valid only betwwen calling
-- this method and the end_paint method.
require
device_context_is_already_released: is_gc_released
target_tile_is_assigned: is_target_tile_assigned or else adapted_gc /= 0
ensure
valid_graphics_context: is_valid_gc

end_paint
-- Delete the graphics context and frees system resources
require
valid_graphics_context: is_valid_gc
ensure
graphics_context_successfully_released: error_code = 1 and system_gc = 0
feature -- Graphics Context helper functions
-- This group of methods is related mainly to Tile objects
-- and are valid only to Display GC.

client_area: RECT
-- Retrieves the boundaries of window's client area.
-- For sequential use it is recommended to to store the returned value
-- in another statical object.
require
valid_target_tile: is_target_tile_valid

get_update_rectangle: RECT
-- Retrieves the coordinates of the smallest rectangle that completely
-- encloses the update region of the given tile. If there is no update
-- region, get_update_rectangle makes the rectangle empty (sets all
-- coordinates to zero).
require
valid_target_tile: is_target_tile_valid

draw_focus_rectangle (x1, y1, x2, y2: REAL)
-- Draws a rectangle in the style used to indicate that the rectangle
-- has the focus.
require
valid_graphics_context: is_valid_gc
correct_coordinates: x2 >= x1 and y2 >= y1

gray_rectangle (x, y, w, h: REAL)

put_icon (ico: ICON; x, y: REAL)
feature

screen_to_device (p_size: SIZE)

device_to_screen (p_size: SIZE)
feature

is_gc_released: BOOLEAN

is_target_tile_assigned: BOOLEAN

is_target_tile_valid: BOOLEAN
feature {WRAPPER}

adapt (gc2adapt: INTEGER)
-- This an internal creation method which make possible adaptation
-- to platform dependent graphics device context.
end -- class DISPLAY_GRAPHICS_CONTEXT

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES