class DECORATOR

All features

The most complex decorator

Direct parents

conformant parents

DECORATION

Summary

creation features

exported features

Adding segments or polygons: In those algorithms we call "segment" any array of one or more points: indeed, of type FAST_ARRAY[POINT]

Adding arcs and pies:

Painting:

Resizing:

Structure: The structure is pretty complex. SEGMENTS:

 - The dictionary has points as keys. Each point links to every segment
   having it (as an end or not!)
 - The list allows fast painting of all segments
 - Polygons are filled segments
ARCS:
 - The dictionary has centers as keys. Each point links to another
   dictionary; this one has (width, height) as keys. Those keys in turn
   point to every arc having this center and this size.
 - The list allows fast painting of all arcs
 - Pies are filled arcs

Basics:

Maximum:

Minimum:

Bits:

Details

make (s: BOOLEAN)

ensure

  • scaleable = s

expose_paint

expose_paint paint with depth limited to the first window Containers have to propagate, with special attention to windows where expose_paint do nothing.

set_geometry (x: INTEGER, y: INTEGER, w: INTEGER, h: INTEGER)

require

  • x >= 0
  • y >= 0
  • w >= min_width
  • h >= min_height

ensure

  • width = w
  • height = h

std_height: INTEGER
std_width: INTEGER
make (s: BOOLEAN)

ensure

  • scaleable = s

scaleable: BOOLEAN

if True, the points are modified when the decorator is resized

add_segment (x1: INTEGER, y1: INTEGER, x2: INTEGER, y2: INTEGER)
add_arc (x: INTEGER, y: INTEGER, w: INTEGER, h: INTEGER, angle1: INTEGER, angle2: INTEGER)
add_polygon (x1: INTEGER, y1: INTEGER, x2: INTEGER, y2: INTEGER)
add_pie (x: INTEGER, y: INTEGER, w: INTEGER, h: INTEGER, angle1: INTEGER, angle2: INTEGER)
paint (x: INTEGER, y: INTEGER)
resize (w: INTEGER, h: INTEGER)

require

  • w >= min_width
  • h >= min_height

ensure

  • width = w
  • height = h

show (dictionary: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT])
do_add_segment (x1: INTEGER, y1: INTEGER, x2: INTEGER, y2: INTEGER, dictionary: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT], list: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]])
exists_segment (p1: POINT, p2: POINT, dictionary: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT]): BOOLEAN

require

  • dictionary.has(p1)
  • dictionary.has(p2)

try_add_point_to_segment (p: POINT, segs: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]], anchor: POINT, dictionary: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT], list: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]])

require

  • dictionary.has(anchor)

    redundant check! not dictionary.has(p) -- this one is not True: the thing is, there must not be a segment between p and anchor

make_segment_in (p1: POINT, p2: POINT, segs: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]], list: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]])
make_segment (p1: POINT, p2: POINT, dictionary: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT], list: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]])
join (seg1: FAST_ARRAY [E_][POINT], seg2: FAST_ARRAY [E_][POINT], first: BOOLEAN, backwards: BOOLEAN)

Add seg2 to seg1. If first, prepend it; otherwise append it. If backwards, add it in reverse order.

do_add_arc (x: INTEGER, y: INTEGER, w: INTEGER, h: INTEGER, angle1: INTEGER, angle2: INTEGER, dictionary: HASHED_DICTIONARY [V_, K_ -> HASHABLE][HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][ARC]POINT]POINT], list: FAST_ARRAY [E_][ARC])
last_x: INTEGER
last_y: INTEGER
do_paint_segments (x: INTEGER, y: INTEGER, fill: BOOLEAN, list: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]])
do_paint_arcs (x: INTEGER, y: INTEGER, fill: BOOLEAN, list: FAST_ARRAY [E_][ARC])
do_resize (w: INTEGER, h: INTEGER)
do_scale_segments (scale_w: REAL, scale_h: REAL)
do_scale_arcs (scale_w: REAL, scale_h: REAL)
do_scale_polygons (scale_w: REAL, scale_h: REAL)
do_scale_pies (scale_w: REAL, scale_h: REAL)
dic_arcs: HASHED_DICTIONARY [V_, K_ -> HASHABLE][HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][ARC]POINT]POINT]
dic_segments: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT]
dic_pies: HASHED_DICTIONARY [V_, K_ -> HASHABLE][HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][ARC]POINT]POINT]
dic_polygons: HASHED_DICTIONARY [V_, K_ -> HASHABLE][FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]POINT]
all_arcs: FAST_ARRAY [E_][ARC]
all_segments: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]
all_pies: FAST_ARRAY [E_][ARC]
all_polygons: FAST_ARRAY [E_][FAST_ARRAY [E_][POINT]]
basic_guikit_drawlines (peer: POINTER, points: POINTER, count_points: INTEGER, dx: INTEGER, dy: INTEGER)
basic_guikit_fillpolygon (peer: POINTER, points: POINTER, count_points: INTEGER, dx: INTEGER, dy: INTEGER)
basic_guikit_drawarcs (peer: POINTER, arcs: POINTER, count_arcs: INTEGER, dx: INTEGER, dy: INTEGER)
basic_guikit_fillarcs (peer: POINTER, arcs: POINTER, count_arcs: INTEGER, dx: INTEGER, dy: INTEGER)
basic_guikit_point_size: INTEGER
basic_guikit_arc_size: INTEGER
set_widget (w: POINTER)
widget: POINTER
width: INTEGER
height: INTEGER
min_width: INTEGER
min_height: INTEGER
max_width: INTEGER
max_height: INTEGER
parent: CONTAINER
pos_x: INTEGER
pos_y: INTEGER
x_shrink_allowed: BOOLEAN
x_expand_allowed: BOOLEAN
y_shrink_allowed: BOOLEAN
y_expand_allowed: BOOLEAN
valid_width (w: INTEGER): BOOLEAN
valid_height (h: INTEGER): BOOLEAN
area: RECT
root_area: RECT
set_x_shrink (b: BOOLEAN)
set_x_expand (b: BOOLEAN)
set_y_shrink (b: BOOLEAN)
set_y_expand (b: BOOLEAN)
set_shrink (b: BOOLEAN)

change both x and y shrink state

set_expand (b: BOOLEAN)

change both x and y expand state

set_parent (p: CONTAINER)

require

  • p = Void implies parent /= Void
  • p /= Void implies parent = Void
  • p /= Void implies p.has_child(Current)

ensure

  • parent = p

computing_size: BOOLEAN
state: INTEGER

use values from STATE_CONSTANTS

frozen is_state_normal: BOOLEAN
frozen is_state_active: BOOLEAN
frozen is_state_prelight: BOOLEAN
frozen is_state_selected: BOOLEAN
frozen is_state_insensitive: BOOLEAN
frozen set_state_normal
frozen set_state_active
frozen set_state_prelight
frozen set_state_selected
frozen set_state_insensitive
set_state (n: INTEGER)
renderer: RENDERER
state_normal: INTEGER
state_active: INTEGER
state_prelight: INTEGER
state_selected: INTEGER
state_insensitive: INTEGER
Maximum_character_code: INTEGER_16

Largest supported code for CHARACTER values.

ensure

  • meaningful: Result >= 127

Maximum_integer_8: INTEGER_8

Largest supported value of type INTEGER_8.

Maximum_integer_16: INTEGER_16

Largest supported value of type INTEGER_16.

Maximum_integer: INTEGER

Largest supported value of type INTEGER/INTEGER_32.

Maximum_integer_32: INTEGER

Largest supported value of type INTEGER/INTEGER_32.

Maximum_integer_64: INTEGER_64

Largest supported value of type INTEGER_64.

Maximum_real_32: REAL_32

Largest non-special (no NaNs nor infinity) supported value of type REAL_32.

Maximum_real: REAL

Largest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: 1.79769313486231570....e+308

Maximum_real_64: REAL

Largest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: 1.79769313486231570....e+308

Maximum_real_80: REAL_EXTENDED

Largest supported value of type REAL_80.

ensure

  • meaningful: Result >= Maximum_real

Minimum_character_code: INTEGER_16

Smallest supported code for CHARACTER values.

ensure

  • meaningful: Result <= 0

Minimum_integer_8: INTEGER_8

Smallest supported value of type INTEGER_8.

Minimum_integer_16: INTEGER_16

Smallest supported value of type INTEGER_16.

Minimum_integer: INTEGER

Smallest supported value of type INTEGER/INTEGER_32.

Minimum_integer_32: INTEGER

Smallest supported value of type INTEGER/INTEGER_32.

Minimum_integer_64: INTEGER_64

Smallest supported value of type INTEGER_64.

Minimum_real_32: REAL_32

Smallest non-special (no NaNs nor infinity) supported value of type REAL_32.

Minimum_real: REAL

Smallest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: -1.79769313486231570....e+308

Minimum_real_64: REAL

Smallest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: -1.79769313486231570....e+308

Minimum_real_80: REAL

Smallest supported value of type REAL_80.

ensure

  • meaningful: Result <= 0.0

Boolean_bits: INTEGER

Number of bits in a value of type BOOLEAN.

ensure

  • meaningful: Result >= 1

Character_bits: INTEGER

Number of bits in a value of type CHARACTER.

ensure

  • meaningful: Result >= 1
  • large_enough: 2.to_integer ^ Result >= Maximum_character_code

Integer_bits: INTEGER

Number of bits in a value of type INTEGER.

ensure

  • integer_definition: Result = 32

Real_bits: INTEGER

Number of bits in a value of type REAL.

Pointer_bits: INTEGER

Number of bits in a value of type POINTER.

Class invariant