INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Abstract graphics context"
project: "Visual Eiffel"
revision: "$Revision: 1.2 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: grape
deferred class GRAPHICS_CONTEXT
inherit

GDI_RESOURCE_IDS
end

MATH
end
feature -- Constructors

initialize
-- Initialization of internal structures and assignig default values
-- to the attributes of the context.
feature -- Graphics context manipulation methods

begin_paint, f_begin_paint
-- Initializes a new graphics device context by establishing a link to
-- the target output device.
-- Every reauest to the graphics engine is valid only betwen calls
-- of this method and the end_paint method.
-- Only methods affecting the state of the graphics context are allowed
-- outside these methods.

end_paint
-- Delete the link to the target output device graphics context
-- and frees previously allocated system resources.
-- IMPORTANT: This method should be called from a descendent class
-- as the first method in graphics context deinitialization methods
-- sequence.

save_gc, f_save_gc
-- Saves the current state of graphics context.
-- The context is pushed into a stack.
-- Saves the current state of the given device context by copying state
-- information (such as clipping region, selected objects, and
-- mapping mode) to a context stack. The saved device context can later
-- be restored by using the restore function.
require
valid_graphics_context: is_valid_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.

restore_gc, f_restore_gc
-- Restores the last saved graphics context
require
valid_graphics_context: is_valid_gc

select_resource (resource: GDI_RESOURCE): GDI_RESOURCE
-- Selects an object into the given graphics context. The new object
-- replaces the previous object of the same type.
-- Returns the previously (old) selected GDI resource.

select_pen, f_select_pen (a_pen: PEN)
-- This method explicitly selects a pen resource in current GC

select_brush (a_brush: BRUSH)
-- This method explicitly selects a brush resource in current GC

select_font, f_select_font (a_font: FONT)
-- This method explicitly selects a font resource in current GC

is_valid_gc: BOOLEAN
-- Checks to see if the graphics context is initialized correctly

is_valid_virtual_resource: BOOLEAN

reset_to_default
feature -- Graphics-Context Attributes
-- The following group of methods can be invoked anytime
-- not only between begin_paint and end_paint.

move_to (x, y: REAL)
-- Moves the current pen pointer position to a new location
require
valid_virtual_resource: is_valid_virtual_resource

current_position: COORD
-- Retrieves the current Pen position
require
valid_virtual_resource: is_valid_virtual_resource

set_draw_mode (raster_operation: INTEGER)
-- Sets the current drawing mode. The drawing mode specifies how the
-- colors of the pen and the interior of filled objects are combined with
-- the color already on the screen surface.
require
valid_virtual_resource: is_valid_virtual_resource
valid_raster_operation: raster_operation >= 0 and raster_operation <= 15
is_raster_device:

get_draw_mode: INTEGER
-- Retrieves the current drawing mode. The drawing mode specifies how
-- the colors of the pen and the interior of filled objects are
-- combined with the color already on the screen surface.
require
valid_virtual_resource: is_valid_virtual_resource

ROP_CLEAR: INTEGER

ROP_AND: INTEGER

ROP_AND_REVERSE: INTEGER

ROP_COPY: INTEGER

ROP_AND_INVERTED: INTEGER

ROP_NOOP: INTEGER

ROP_XOR: INTEGER

ROP_OR: INTEGER

ROP_NOR: INTEGER

ROP_EQUIV: INTEGER

ROP_INVERT: INTEGER

ROP_OR_REVERSE: INTEGER

ROP_COPY_INVERTED: INTEGER

ROP_OR_INVERTED: INTEGER

ROP_NAND: INTEGER

ROP_SET: INTEGER

set_background_color (a_color: COLOR)
-- Sets the current background color to the specified color.
-- If the background mode is OPAQUE, the system uses the background
-- color to fill the gaps in styled lines, the gaps between hatched
-- lines in brushes, and the background in character cells.
-- If the device cannot display the specified color, the system sets
-- the background color to the nearest physical color.
require
valid_virtual_resource: is_valid_virtual_resource
valid_color: a_color /= void

get_background_color: COLOR
-- Returns the current background color.
require
valid_virtual_resource: is_valid_virtual_resource

set_background_mode (a_mode: INTEGER)
-- Sets the specified background mode. The background mode defines whether
-- the system removes existing background colors on the drawing surface
-- before drawing text, hatched brushes, or any pen style that is not a
-- solid line.
require
valid_virtual_resource: is_valid_virtual_resource
valid_background_mode: a_mode >= transparent_background and a_mode <= opaque_background

get_background_mode: INTEGER
-- Return the current background mode
require
valid_virtual_resource: is_valid_virtual_resource

TRANSPARENT_BACKGROUND: INTEGER

OPAQUE_BACKGROUND: INTEGER

set_mapping_mode (a_mode: INTEGER)
-- Set new mapping mode
require
valid_virtual_resource: is_valid_virtual_resource
valid_mapping_mode: a_mode >= mm_text and a_mode <= mm_anisotropic

get_mapping_mode: INTEGER
-- Return the current mapping mode
require
valid_virtual_resource: is_valid_virtual_resource

MM_TEXT: INTEGER

MM_ISOTROPIC: INTEGER

MM_ANISOTROPIC: INTEGER

set_viewport_origin (vp: POINT)
-- Set new viewport origin
require
system_gc /= 0

get_viewport_origin: POINT
-- Return the current viewport origin
require
system_gc /= 0
feature -- 2-D geometric primitives (outlines)
-- Most primitives can be drawn with a set of two functions
-- differing in their coordinate system. The first use
-- rectangular coordinates, the second - angular.

draw_point (x, y: REAL; a_color: COLOR)
-- Draws a point at specified coordinates with specified color
require
valid_graphics_context: is_valid_gc

draw_points (points: ARRAY [REAL]; a_color: COLOR)
-- Draws multiple points at specified locations, using a supplied
-- color
require
valid_graphics_context: is_valid_gc
even_number_of_coords: points.count \\ 2 = 0

line_to (x, y: REAL)
-- Draws a line from the current position up to, but not including,
-- the specified endpoint. The function uses the selected pen to draw
-- the line and sets the current position to the coordinates (x,y)
require
valid_graphics_context: is_valid_gc

draw_line (x1, y1, x2, y2: REAL)
-- Draws a line between 2 points. The current point position is not
-- changed
require
valid_graphics_context: is_valid_gc

draw_polyline (points: ARRAY [REAL])
-- Draws a set of line segments, connecting the specified points.
-- The lines are drawn from the first point through subsequent points,
-- using the current pen. Unlike the line_to function, the polyline
-- function neither uses nor updates the current position.
require
valid_graphics_context: is_valid_gc
even_number_of_coords: points.count \\ 2 = 0

draw_segments (segments: ARRAY [REAL])
-- Draws multiple disjoint line segments. Each line is specified by a
-- pair of points, so the line may be connnected or disjoint.
require
valid_graphics_context: is_valid_gc
even_number_of_point_couples: segments.count \\ 4 = 0

draw_rectangle (x1, y1, x2, y2: REAL)
-- Draws an outline of a rectangle, using the current pen.
require
valid_graphics_context: is_valid_gc
correct_coordinates: x2 >= x1 and y2 >= y1

draw_rectangles (rectangles: ARRAY [REAL])
-- Draws multiple rectangles
require
valid_graphics_context: is_valid_gc
even_number_of_point_couples: rectangles.count \\ 4 = 0

draw_rounded_rectangle (x1: REAL; y1: REAL; x2: REAL; y2: REAL; width: REAL; height: REAL)
-- Draws a rectangle with rounded corners, using the current pen.
require
valid_graphics_context: is_valid_gc

draw_polygon (vertices: ARRAY [REAL])
-- Draws a polygon consisting of two or more points (vertices) connected
-- by lines. The system closes the polygon automatically, if necessary,
-- by drawing a line from the last vertex to the first. Polygons are
-- surrounded by a frame drawn by using the current pen and filled by
-- using the current brush.
require
valid_graphics_context: is_valid_gc
even_number_of_coords: vertices.count \\ 2 = 0
correct_vertices_number: vertices.count >= 6

draw_polygons (polygons: ARRAY [ARRAYREAL])
-- Creates two or more polygons that may be disjoint or overlapping.
require
valid_graphics_context: is_valid_gc

draw_ellipse (x1: REAL; y1: REAL; x2: REAL; y2: REAL)
-- Draws an ellipse. The center of the ellipse is the center of the
-- specified bounding rectangle. The ellipse is drawn by using
require
valid_graphics_context: is_valid_gc

draw_ellipses (ellipses: ARRAY [REAL])
-- Draws multiple ellipses
require
valid_graphics_context: is_valid_gc
correct_number_of_rectangles: ellipses.count \\ 4 = 0

draw_circle (xc: REAL; yc: REAL; radius: REAL)
require
valid_graphics_context: is_valid_gc
positive_radius: radius > 0

draw_circles (circles: ARRAY [REAL])
-- Draws multiple circles
require
valid_graphics_context: is_valid_gc
correctly_defined_circles: circles.count \\ 3 = 0

draw_arc (x1: REAL; y1: REAL; x2: REAL; y2: REAL; x1_arc: REAL; y1_arc: REAL; x2_arc: REAL; y2_arc: REAL)
-- The arc drawn by using the draw_arc function is a segment of the
-- ellipse defined by the specified bounding rectangle. The starting
-- point of the arc is the point at which a ray drawn from the center
-- of the bounding rectangle through the specified starting point
-- intersects the ellipse. The end point of the arc is the point at
-- which a ray drawn from the center of the bounding rectangle through
-- the specified end point intersects the ellipse. The arc is drawn in
-- a counterclockwise direction.
require
valid_graphics_context: is_valid_gc

draw_arcs (arcs: ARRAY [REAL])
-- Draws multiple arcs
require
valid_graphics_context: is_valid_gc
correctly_defined_arcs: arcs.count \\ 8 = 0

draw_angle_arc (xc: REAL; yc: REAL; width: REAL; height: REAL; start_angle: REAL; end_angle: REAL)
-- Draws an arc using circular coordinates.
-- Angles are signed values in radians, with positive values
-- indicating counter-clockwise motion and negative values indicating
-- clockwise motion.
require
valid_graphics_context: is_valid_gc

draw_angle_arcs (arcs: ARRAY [REAL])
-- Draws multiple angular elliptic arcs.
require
valid_graphics_context: is_valid_gc
correctly_defined_arcs: arcs.count \\ 6 = 0

draw_sector (x1: REAL; y1: REAL; x2: REAL; y2: REAL; x1_arc: REAL; y1_arc: REAL; x2_arc: REAL; y2_arc: REAL)
-- Draws a sector by drawing an elliptical arc whose center and two
-- endpoints are joined by lines.
require
valid_graphics_context: is_valid_gc
not_implemented_yet: (0 /= 0)

draw_sectors (sectors: ARRAY [ARRAYREAL])
-- Draws multiple sectors
require
this_method_is_not_implemented_yet: (0 /= 0)

draw_angle_sector (xc: REAL; yc: REAL; width: REAL; height: REAL; start_angle: REAL; end_angle: REAL)
-- Draws a sector using angular coordinates
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_angle_sectors (sectors: ARRAY [REAL])
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_chord (x1: REAL; y1: REAL; x2: REAL; y2: REAL; x1_arc: REAL; y1_arc: REAL; x2_arc: REAL; y2_arc: REAL)
-- Draws a chord (a closed figure bounded by the intersection of
-- an ellipse and a line segment.
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_chords (chords: ARRAY [ARRAYREAL])
-- Draws multiple chords
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_angle_chord (xc: REAL; yc: REAL; width: REAL; height: REAL; start_angle: REAL; end_angle: REAL)
-- Draws a chord using angular coordinates
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_angle_chords (chords: ARRAY [ARRAYREAL])
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_bezier (x1, y1, x2, y2, x3, y3, x4, y4: REAL)
-- Draws a cubic Bezier spline using specified control points.
-- The curve is drawn from the first point to the fourth point using the
-- second and third points as control points.
-- The Current position is neither used nor updated.
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

draw_poly_bezier (bezier: ARRAY [REAL])
-- Draws one or more Bezier Curves. The first curve is drawn
-- from the first point to the fourth point using the second and third
-- points as control points. Each subsequent curve in the sequence needs
-- exactly three more points: the end point of the previous curve is
-- used as the start point, the next two points in the sequence are
-- control points, and the third point is the end point.
-- The Current position is neither used nor updated.
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)
feature -- 2-D geometric filled primitives (Paint Operation)
-- All those primitives will be drawn with the current pen
-- and filled with the current brush.

paint_rectangle (x1, y1, x2, y2: REAL)
-- Draws a Rectangle, using the current pen. The interior of the
-- rectangle is filled by using the current brush.
-- The figure this function draws extends up to, but does not include,
-- the right and bottom coordinates. This means that the height of the
-- figure is y2 - y1 and the width of the figure is x2 - x1.
require
valid_graphics_context: is_valid_gc
correct_coordinates: x2 >= x1 and y2 >= y1

paint_rectangles (rectangles: ARRAY [REAL])
-- paints multiple rectangles
require
valid_graphics_context: is_valid_gc
correct_number_of_rectangles: rectangles.count \\ 4 = 0

paint_rounded_rectangle (x1: REAL; y1: REAL; x2: REAL; y2: REAL; width: REAL; height: REAL)
-- Draws a rectangle with rounded corners, using the current pen. The
-- interior of the rectangle is filled by using the current brush.
-- The figure this function draws extends up to, but does not include,
-- the right and bottom coordinates.
require
valid_graphics_context: is_valid_gc

paint_rounded_rectangles (rectangles: ARRAY [REAL])
-- Draws multiple rectangles with rounded corners, using the current pen. The
-- interior of the rectangle is filled by using the current brush.
require
valid_graphics_context: is_valid_gc
correct_number_of_rectangles: rectangles.count \\ 6 = 0

paint_polygon (vertices: ARRAY [REAL])
-- paints a polygon consisting of two or more points (vertices) connected
-- by lines. The system closes the polygon automatically, if necessary,
-- by painting a line from the last vertex to the first. Polygons are
-- surrounded by a frame paintn by using the current pen and filled by
-- using the current brush.
require
valid_graphics_context: is_valid_gc
even_number_of_coords: vertices.count \\ 2 = 0

paint_polygons (polygons: ARRAY [ARRAYREAL])
-- Creates two or more polygons that may be disjoint or overlapping.
require
valid_graphics_context: is_valid_gc
this_method_is_not_implemented_yet: (0 /= 0)

paint_ellipse (x1: REAL; y1: REAL; x2: REAL; y2: REAL)
-- paints an ellipse. The center of the ellipse is the center of the
-- specified bounding rectangle. The ellipse is paintn by using
-- the current pen.
-- The figure drawn by this function extends up to but does not include
-- the right and bottom coordinates.
require
valid_graphics_context: is_valid_gc

paint_ellipses (ellipses: ARRAY [REAL])
-- paints multiple ellipses
require
valid_graphics_context: is_valid_gc
correct_number_of_ellipses: ellipses.count \\ 4 = 0

paint_circle (xc: REAL; yc: REAL; radius: REAL)
require
valid_graphics_context: is_valid_gc
positive_radius: radius > 0

paint_circles (circles: ARRAY [REAL])
-- paints multiple circles
require
valid_graphics_context: is_valid_gc
correct_circles: circles.count \\ 3 = 0

paint_sector (x1: REAL; y1: REAL; x2: REAL; y2: REAL; x1_arc: REAL; y1_arc: REAL; x2_arc: REAL; y2_arc: REAL)
-- Paints a sector by painting an elliptical arc whose center and two
-- endpoints are joined by lines.
-- The center of the arc drawn by this function is the center of the
-- bounding rectangle specified by x1, y1, x2, y2 parameters.
-- The function draws the arc by using the selected pen, moving in a
-- counterclockwise direction. It then draws two additional lines from
-- each endpoint to the arc's center. Finally, it fills the pie-shaped area by using
-- the current brush.
-- The figure drawn by this function extends up to but does not include the
-- right and bottom coordinates.
require
valid_graphics_context: is_valid_gc

paint_sectors (sectors: ARRAY [REAL])
-- paints multiple sectors
require
valid_graphics_context: is_valid_gc
correct_sectors: sectors.count \\ 8 = 0

paint_angle_sector (xc: REAL; yc: REAL; width: REAL; height: REAL; start_angle: REAL; end_angle: REAL)
-- paints a sector using angular coordinates
require
valid_graphics_context: is_valid_gc

paint_angle_sectors (sectors: ARRAY [REAL])
-- Paints multiple angle sectors
require
valid_graphics_context: is_valid_gc
correct_sectors: sectors.count \\ 6 = 0

paint_chord (x1: REAL; y1: REAL; x2: REAL; y2: REAL; x1_arc: REAL; y1_arc: REAL; x2_arc: REAL; y2_arc: REAL)
-- paints a chord (a closed figure bounded by the intersection of
-- an ellipse and a line segment.
-- The chord is drawn by using the selected pen and is filled by using
-- the selected brush.
-- The figure the Chord function draws extends up to but does not
-- include the right and bottom coordinates.
require
valid_graphics_context: is_valid_gc

paint_chords (chords: ARRAY [REAL])
-- paints multiple chords
require
valid_graphics_context: is_valid_gc
correct_chords: chords.count \\ 8 = 0

paint_angle_chord (xc: REAL; yc: REAL; width: REAL; height: REAL; start_angle: REAL; end_angle: REAL)
-- paints a chord using angular coordinates
require
valid_graphics_context: is_valid_gc

paint_angle_chords (chords: ARRAY [REAL])
require
valid_graphics_context: is_valid_gc
correct_chords: chords.count \\ 8 = 0
feature -- 2-D geometric filled primitives (Fill Operation)
-- All those primitives will be filled with the specified
-- brush.

fill_rectangle (x1, y1, x2, y2: REAL; a_brush: BRUSH)
-- Fills a Rectangle, using a specified brush. This function fills the
-- complete rectangle, including the left and top borders, but does not
-- fill the right and bottom borders.
require
valid_graphics_context: is_valid_gc
correct_coordinates: x2 >= x1 and y2 >= y1
valid_brush_supplied: a_brush /= void
feature -- 2-D geometric primitives Invert Operation
-- On monochrome screens, those functions makes white pixels
-- black and black pixels white. On color screens, the
-- inversion depends on how colors are generated for the
-- screen. Calling the same function twice, specifying the same
-- boundaries, restores the display to its previous colors.

invert_rectangle (x1, y1, x2, y2: REAL)
-- This function inverts a rectangular area. Inversion is a logical
-- NOT operation and flips the bits of each pixel.
require
valid_graphics_context: is_valid_gc
correct_coordinates: x2 >= x1 and y2 >= y1
feature -- 2-D geometric primitives Erase Operation (filling their
-- contents with the background pattern.

erase_rectangle (x1, y1, x2, y2: REAL)
-- This function erases a rectangular area.
require
valid_graphics_context: is_valid_gc
correct_coordinates: x2 >= x1 and y2 >= y1
this_method_is_not_implemented_yet: (0 /= 0)
feature -- Font manipulation methods group

TA_TOP: INTEGER

TA_BASELINE: INTEGER

TA_BOTTOM: INTEGER

TA_LEFT: INTEGER

TA_CENTER: INTEGER

TA_RIGHT: INTEGER

PTC_TOP: INTEGER

PTC_CENTER: INTEGER

PTC_BOTTOM: INTEGER

PTC_LEFT: INTEGER

PTC_RIGHT: INTEGER

get_font_face_name: STRING
-- Retrieves the typeface name of the current font selected in the GC
require
valid_graphics_context: is_valid_gc

get_font_cell_height: REAL
-- Retrieves the height of character cells. (The height is the sum of
-- the Ascent and Descent of a character cell)
require
valid_graphics_context: is_valid_gc

get_font_ascent: REAL
-- Retrieves the ascent of character cells. (The ascent is the space
-- between the base line and the top of the character cell.)
require
valid_graphics_context: is_valid_gc

get_font_descent: REAL
-- Retrieves the descent of character cells. (The descent is the space
-- between the bottom of the character cell and the base line.)
require
valid_graphics_context: is_valid_gc

get_font_internal_leading: REAL
-- Retrieves the difference between the point size of a font and the
-- physical size of the font.
require
valid_graphics_context: is_valid_gc

get_font_external_leading: REAL
-- Retrieves the amount of extra leading (space) that the application
-- adds between rows. Since this area is outside the character cell,
-- it contains no marks and will not be altered by text output calls
-- in either opaque or transparent mode.
require
valid_graphics_context: is_valid_gc

get_font_average_char_width: REAL
-- Retrieves the average width of characters in the font.
require
valid_graphics_context: is_valid_gc

get_font_max_char_width: REAL
-- Retrieves the "B" spacing of the widest character in the font.
require
valid_graphics_context: is_valid_gc

get_font_default_char: INTEGER
-- Retrieves the value of the character that will be substituted
-- for characters that are not in the font.
require
valid_graphics_context: is_valid_gc

get_font_break_char: INTEGER
-- Retrieves the value of the character that will be used to define
-- word breaks for text justification.
require
valid_graphics_context: is_valid_gc

measure_char_width (char: INTEGER): REAL
-- Computes the width of a character, using the current font to compute
-- the dimensions.
require
valid_graphics_context: is_valid_gc

measure_text_width (s: STRING): REAL
-- Computes the width of a line of text, using the current font to
-- compute the dimensions.
require
valid_graphics_context: is_valid_gc

measure_substring_width (s: STRING; start_pos, len: INTEGER): REAL
-- Computes the width of a substring of text,
-- using the current font to compute the dimensions.
-- start_pos should start from 1 (not from 0)
require
valid_graphics_context: is_valid_gc

measure_text_height (s: STRING): REAL
-- Computes the height of a line of text, using the current font to
-- compute the dimensions.
require
valid_graphics_context: is_valid_gc

measure_text_height_clipping (s: STRING; w: REAL): REAL
require
valid_graphics_context: is_valid_gc

get_horizontal_text_alignment: INTEGER
require
valid_graphics_context: is_valid_gc

get_vertical_text_alignment: INTEGER
require
valid_graphics_context: is_valid_gc

get_intercharacter_spacing: REAL
require
valid_graphics_context: is_valid_gc

set_vertical_text_alignment (code: INTEGER)
require
valid_graphics_context: is_valid_gc

set_horizontal_text_alignment (code: INTEGER)
require
valid_graphics_context: is_valid_gc

set_intercharacter_spacing (val: REAL)
require
valid_graphics_context: is_valid_gc

set_update_current_pos (flag: BOOLEAN)
require
valid_graphics_context: is_valid_gc

put_character (c: CHARACTER; x, y: REAL)
require
valid_graphics_context: is_valid_gc

put_string (s: STRING; x, y: REAL)
require
valid_graphics_context: is_valid_gc

put_string_clipping (s: STRING; tx, ty, x, y, w, h: REAL)
require
valid_graphics_context: is_valid_gc

put_text (s: STRING; x, y: REAL)
require
valid_graphics_context: is_valid_gc

put_text_clipping (s: STRING; x, y, w, h: REAL; ha, va: INTEGER)
require
valid_graphics_context: is_valid_gc

put_text_clipping_ptr (s: POINTER; x, y, w, h: REAL; ha, va: INTEGER)
require
valid_graphics_context: is_valid_gc

fill_with_string (s: STRING; x, y, width: REAL)
require
valid_graphics_context: is_valid_gc
feature

PIXEL_UNIT: INTEGER

POINT_UNIT: INTEGER

MILLIMETER_UNIT: INTEGER

get_device_size (sz: SIZE; unit: INTEGER)
require
valid_graphics_context: is_valid_gc
non_void_size: sz /= void

to_pixel_size_from (sz: SIZE; unit: INTEGER)
require
valid_graphics_context: is_valid_gc
non_void_size: sz /= void

from_pixel_size_to (sz: SIZE; unit: INTEGER)
require
non_void_size: sz /= void

screen_to_device (p_size: SIZE)
require
valid_graphics_context: is_valid_gc
non_void_size: p_size /= void

device_to_screen (p_size: SIZE)
require
valid_graphics_context: is_valid_gc
non_void_size: p_size /= void

set_client_rect (p_rect: RECT)

get_client_rect: RECT

logical_to_mm (p_size: SIZE)
-- Covert the the size in logical coordinate units to the
-- millimeters on output device surface
require
valid_graphics_context: is_valid_gc
non_void_size: p_size /= void

mm_to_logical (p_size: SIZE)
-- Covert the the millimeters on output device surface to the actual
-- number of logical coordinate units
require
valid_graphics_context: is_valid_gc
non_void_size: p_size /= void

get_resolution: SIZE
-- The size of phisical device attached to the context in pixels

get_size: SIZE
-- The size of phisical device attached to the context in millimeters
require
valid_graphics_context: is_valid_gc
feature -- Picture manipulation.
-- It is possible to display picture at specified location.
-- Previous contents of this screen area is replaced by picture.
--

put_picture (p: PICTURE; x, y: REAL)
require
valid_graphics_context: is_valid_gc

put_transparent_picture (p: PICTURE; x, y: REAL; c: COLOR)
require
valid_graphics_context: is_valid_gc
valid_color: c /= void
feature

system_gc: INTEGER
end -- class GRAPHICS_CONTEXT

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES