note description: "A builder to create GAME_WINDOW" author: "Louis Marchand" date: "Fri, 03 Apr 2015 02:41:42 +0000" revision: "2.0" deferred class interface GAME_WINDOW_BUILDER feature -- Access flags: NATURAL_32 assign set_flags -- The internal GAME_WINDOW create flags -- Note: Normally, you should not have to mess with this, -- Do it only if you know what you are doing. -- Default: 0 set_flags (a_flags: NATURAL_32) -- Assing to flags the value of a_flags -- Note: Normally, you should not have to mess with this, -- Do it only if you know what you are doing. ensure is_set: flags = a_flags is_hidden: BOOLEAN assign set_is_hidden -- Is the generate_window will be -- hidden at creation -- Default: False set_is_hidden (a_value: BOOLEAN) -- Assign to is_hidden the value of a_value ensure is_assign: is_hidden ~ a_value enable_hidden -- Make the generate_window hidden at creation ensure is_enabled: is_hidden disable_hidden -- Make the generate_window showed at creation ensure is_disabled: not is_hidden has_border: BOOLEAN assign set_has_border -- Is the generate_window will have -- decoration border -- Default: True set_has_border (a_value: BOOLEAN) -- Assign to has_border the value of a_value ensure is_assign: has_border ~ a_value disable_border -- Make the generate_window without decoration border ensure is_disabled: not has_border enable_border -- Make the generate_window with decoration border ensure is_enabled: has_border is_minimized: BOOLEAN assign set_is_minimized -- Is the generate_window will be -- minimized at creation -- Default: False set_is_minimized (a_value: BOOLEAN) -- Assign to is_minimized the value of a_value ensure is_assign: is_minimized ~ a_value enable_minimized -- Make the generate_window minimized at creation ensure is_enabled: is_minimized disable_minimized -- Make the generate_window not minimized at creation ensure is_disabled: not is_minimized is_maximized: BOOLEAN assign set_is_maximized -- Is the generate_window will be -- maximized at creation -- Default: False set_is_maximized (a_value: BOOLEAN) -- Assign to is_maximized the value of a_value ensure is_assign: is_maximized ~ a_value enable_maximized -- Make the generate_window maximized at creation ensure is_enabled: is_maximized disable_maximized -- Make the generate_window not maximized at creation ensure is_disabled: not is_maximized is_input_grabbed: BOOLEAN assign set_is_input_grabbed -- Is the generate_window will grab -- all input -- Default: False set_is_input_grabbed (a_value: BOOLEAN) -- Assign to is_input_grabbed the value of a_value ensure is_assign: is_input_grabbed ~ a_value enable_input_grabbed -- Make the generate_window grab all input ensure is_enabled: is_input_grabbed disable_input_grabbed -- Make the generate_window not grab all input ensure is_disabled: not is_input_grabbed is_resizable: BOOLEAN assign set_is_resizable -- Is the generate_window will be resizable -- Default: False set_is_resizable (a_value: BOOLEAN) -- Assign to is_resizable the value of a_value ensure is_assign: is_resizable ~ a_value enable_resizable -- Make the generate_window resizable ensure is_enabled: is_resizable disable_resizable -- Make the generate_window not resizable ensure is_disabled: not is_resizable is_fullscreen: BOOLEAN assign set_is_fullscreen -- Is the generate_window will be fullscreened -- Default: False set_is_fullscreen (a_value: BOOLEAN) -- Assign to is_fullscreen the value of a_value ensure is_assign: is_fullscreen ~ a_value enable_fullscreen -- Make the generate_window fullscreened -- Note: is_fake_fullscreen will be disable ensure is_enabled: is_fullscreen is_fake_fullscreen_disabled: not is_fake_fullscreen disable_fullscreen -- Make the generate_window windowed ensure is_disabled: not is_fullscreen is_fake_fullscreen: BOOLEAN assign set_is_fake_fullscreen -- Is the generate_window will be fullscreened -- (but without changing resolution) -- Default: False set_is_fake_fullscreen (a_value: BOOLEAN) -- Assign to is_fake_fullscreen the value of a_value ensure is_assign: is_fake_fullscreen ~ a_value enable_fake_fullscreen -- Make the generate_window fullscreened -- (but without changing resolution) -- Note: is_fullscreen will be disable ensure is_enabled: is_fake_fullscreen disable_fake_fullscreen -- Make the generate_window windowed ensure is_disabled: not is_fake_fullscreen title: READABLE_STRING_GENERAL assign set_title -- The caption used to represent the generate_window -- Default: Empty string set_title (a_title: READABLE_STRING_GENERAL) -- Assign to title the value of a_title ensure is_set: title ~ a_title is_position_x_centered: BOOLEAN assign set_is_position_x_centered -- Is the generate_window will be horizontally -- centered in the display -- Default: False set_is_position_x_centered (a_value: BOOLEAN) -- Assign to is_position_x_centered the value of a_value ensure is_assign: is_position_x_centered ~ a_value enable_position_x_centered -- On creation, center the horizontal position of the -- generate_window ensure is_enabled: is_position_x_centered is_undefine_not_set: not is_position_x_undefined disable_position_x_centered -- On creation, use position_x value for the -- horizontal position of the generate_window ensure is_disabled: not is_position_x_centered is_position_y_centered: BOOLEAN assign set_is_position_y_centered -- Is the generate_window will be vertically -- centered in the display -- Default: False set_is_position_y_centered (a_value: BOOLEAN) -- Assign to is_position_y_centered the value of a_value ensure is_assign: is_position_y_centered ~ a_value enable_position_y_centered -- On creation, center the vertical position of the -- generate_window ensure is_enabled: is_position_y_centered is_undefine_not_set: not is_position_y_undefined disable_position_y_centered -- On creation, use position_y value for the -- vertical position of the generate_window ensure is_disabled: not is_position_y_centered is_position_centered: BOOLEAN assign set_is_position_centered -- Is the generate_window will be horizontally -- and vertically centered in the display -- Default: False set_is_position_centered (a_value: BOOLEAN) -- Assign to is_position_centered the value of a_value ensure is_assign: is_position_centered ~ a_value enable_position_centered -- On creation, center the horizontal and vertical -- position of the generate_window ensure is_enabled: is_position_centered is_undefine_not_set: not is_position_undefined disable_position_centered -- On creation, use position_x and position_y -- values respectively for the horizontal and -- vertical position of the generate_window ensure is_disabled: not is_position_centered is_position_x_undefined: BOOLEAN assign set_is_position_x_undefined -- Is the horizontal position of generate_window -- does not matters -- Note: If display is not Void, the window will appear on it -- Default: True set_is_position_x_undefined (a_value: BOOLEAN) -- Assign to is_position_x_undefined the value of a_value ensure is_assign: is_position_x_undefined ~ a_value enable_position_x_undefined -- create generate_window so that the horizontal position -- does not matter -- Note: If display is not Void, the window will appear on it ensure is_enabled: is_position_x_undefined is_centered_not_set: not is_position_x_centered disable_position_x_undefined -- On creation, use position_x value for the -- horizontal position of the generate_window ensure is_disabled: not is_position_x_undefined is_position_y_undefined: BOOLEAN assign set_is_position_y_undefined -- Is the vertical position of generate_window -- does not matters -- Note: If display is not Void, the window will appear on it -- Default: True set_is_position_y_undefined (a_value: BOOLEAN) -- Assign to is_position_y_undefined the value of a_value ensure is_assign: is_position_y_undefined ~ a_value enable_position_y_undefined -- create generate_window so that the vertical position -- does not matter -- Note: If display is not Void, the window will appear on it ensure is_enabled: is_position_y_undefined is_centered_not_set: not is_position_y_centered disable_position_y_undefined -- On creation, use position_y value for the -- vertical position of the generate_window ensure is_disabled: not is_position_y_undefined is_position_undefined: BOOLEAN assign set_is_position_undefined -- Is the horizontal and vertical position of generate_window -- does not matters -- Note: If display is not Void, the window will appear on it -- Default: True set_is_position_undefined (a_value: BOOLEAN) -- Assign to is_position_undefined the value of a_value ensure is_assign: is_position_undefined ~ a_value enable_position_undefined -- create generate_window so that the horizontal and -- vertical position does not matter -- Note: If display is not Void, the window will appear on it ensure is_enabled: is_position_undefined is_centered_not_set: not is_position_centered disable_position_undefined -- On creation, use position_x and position_y -- values respectively for the horizontal and -- vertical position of the generate_window ensure is_disabled: not is_position_undefined position_x: INTEGER_32 assign set_position_x -- The vertical position that the generate_window -- will be create at. -- Note: If position_x_centered is set, this value -- is not used. -- Default: 0 (unused -> undefined by default) set_position_x (a_position_x: INTEGER_32) -- Assign to position_x the value of a_position_x -- note: disable is_position_x_centered and -- is_position_centered ensure is_set: position_x = a_position_x not_centered: not is_position_x_centered not_undefined: not is_position_x_undefined position_y: INTEGER_32 assign set_position_y -- The horizontal position that the generate_window -- will be create at. -- Note: If position_y_centered is set, this value -- is not used. -- Default: 0 (unused -> undefined by default) set_position_y (a_position_y: INTEGER_32) -- Assign to position_y the value of a_position_y -- note: disable is_position_y_centered and -- is_position_centered ensure is_set: position_y = a_position_y not_centered: not is_position_y_centered not_undefined: not is_position_y_undefined position: TUPLE [x: INTEGER_32; y: INTEGER_32] -- The position of the generate_window at -- creation -- Default: [0,0] (unused -> undefined by default) set_position (a_x, a_y: INTEGER_32) -- Assign to position the values of a_x and a_y -- Note: disable is_position_x_centered, -- is_position_y_centered and is_position_centered ensure is_set: position.x = a_x and position.y = a_y is_not_centered: not is_position_x_centered and not is_position_y_centered is_not_undefine: not is_position_x_undefined and not is_position_y_undefined width: INTEGER_32 assign set_width -- The vertical dimension of the generate_window -- at creation -- Default: 800 set_width (a_width: INTEGER_32) -- Assign to width the value of a_width require width_valid: a_width > 0 ensure is_set: width = a_width height: INTEGER_32 assign set_height -- The horizontal dimension of the generate_window -- at creation -- Default: 600 set_height (a_height: INTEGER_32) -- Assign to height the value of a_height require height_valid: a_height > 0 ensure is_set: height = a_height dimension: TUPLE [width: INTEGER_32; height: INTEGER_32] -- The horizontal and vertical dimension of -- the generate_window at creation -- Default: [800, 600] set_dimension (a_width, a_height: INTEGER_32) -- assign to dimension the value of a_width and a_height require width_valid: a_width > 0 height_valid: a_height > 0 ensure is_set: dimension.width = a_width and dimension.height = a_height display: detachable GAME_DISPLAY assign set_display -- The GAME_DISPLAY (screen) that the -- generate_window will be drawed -- into at creation. -- Note: only useful if one of is_position_centered, -- is_position_x_centered, is_position_y_centered, -- is_position_undefined, is_position_x_undefined or -- is_position_y_undefined is set -- Default: Void set_display (a_display: detachable GAME_DISPLAY) -- assign to display the value of a_display ensure is_set: display ~ a_display unset_display -- Remove the previously set display ensure is_unset: not attached display generate_window: GAME_WINDOW -- The GAME_WINDOW that fit all attributes of Current require game_screen_video_enabled: Game_library.is_video_enable ensure is_created: Result.has_error or Result.exists invariant position_is_valid: position.x = position_x and position.y = position_y position_centered_valid: is_position_centered implies (is_position_x_centered and is_position_y_centered) position_undefine_valid: is_position_undefined implies (is_position_x_undefined and is_position_y_undefined) position_centered_undefined_valid: is_position_centered implies not is_position_undefined position_x_centered_undefined_valid: is_position_x_centered implies not is_position_x_undefined position_y_centered_undefined_valid: is_position_y_centered implies not is_position_y_undefined dimension_is_valid: dimension.width = width and dimension.height = height end -- class GAME_WINDOW_BUILDER
Generated by ISE EiffelStudio