HAL.Framebuffer

Entities

Simple Types

Interface Types

Access Types

Subtypes

Subprograms

Description

---------------------------------------------------------------------------- -- Copyright (C) 2015-2016, AdaCore -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are -- met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in -- the documentation and/or other materials provided with the -- distribution. -- 3. Neither the name of the copyright holder nor the names of its -- contributors may be used to endorse or promote products derived -- from this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- ----------------------------------------------------------------------------

Any_Frame_Buffer_Display

type Any_Frame_Buffer_Display is access all Frame_Buffer_Display'Class;

Color_Mode

function Color_Mode
  (This  : Frame_Buffer_Display;
   Layer : Positive) return FB_Color_Mode

Retrieves the current color mode for the layer.

Parameters
This
Layer
Return Value

Display_Orientation

type Display_Orientation is
  (Default, Landscape, Portrait);
Enumeration Literal
Default
Landscape
Portrait

FB_Color_Mode

subtype FB_Color_Mode is HAL.Bitmap.Bitmap_Color_Mode range
  HAL.Bitmap.ARGB_8888 .. HAL.Bitmap.M_1;

Frame_Buffer_Display

type Frame_Buffer_Display is limited interface;

Height

function Height
  (This : Frame_Buffer_Display) return Positive
Parameters
This
Return Value

Hidden_Buffer

function Hidden_Buffer
  (This  : in out Frame_Buffer_Display;
   Layer : Positive)
   return not null HAL.Bitmap.Any_Bitmap_Buffer

Retrieves the current hidden buffer for the layer.

Parameters
This
Layer
Return Value

Initialize_Layer

procedure Initialize_Layer
  (This   : in out Frame_Buffer_Display;
   Layer  : Positive;
   Mode   : FB_Color_Mode;
   X      : Natural := 0;
   Y      : Natural := 0;
   Width  : Positive := Positive'Last;
   Height : Positive := Positive'Last)

All layers are double buffered, so an explicit call to Update_Layer needs to be performed to actually display the current buffer attached to the layer. Alloc is called to create the actual buffer.

Parameters
This
Layer
Mode
X
Y
Width
Height

Initialized

function Initialized
  (This : Frame_Buffer_Display) return Boolean
Parameters
This
Return Value

Initialized

function Initialized
  (This  : Frame_Buffer_Display;
   Layer : Positive) return Boolean
Parameters
This
Layer
Return Value

Max_Layers

function Max_Layers
  (This : Frame_Buffer_Display) return Positive
Parameters
This
Return Value

Pixel_Size

function Pixel_Size
  (Display : Frame_Buffer_Display;
   Layer   : Positive) return Positive

Retrieves the current hidden buffer for the layer.

Parameters
Display
Layer
Return Value

Set_Background

procedure Set_Background
  (This : Frame_Buffer_Display; R, G, B : UInt8)
Parameters
This
R
G
B

Set_Mode

procedure Set_Mode
  (This    : in out Frame_Buffer_Display;
   Mode    : Wait_Mode)
Parameters
This
Mode

Set_Orientation

procedure Set_Orientation
  (This        : in out Frame_Buffer_Display;
   Orientation : Display_Orientation)
Parameters
This
Orientation

Supported

function Supported
  (This : Frame_Buffer_Display;
   Mode : FB_Color_Mode) return Boolean
Parameters
This
Mode
Return Value

Swapped

function Swapped
  (This : Frame_Buffer_Display) return Boolean

Whether X/Y coordinates are considered Swapped by the drawing primitives This simulates Landscape/Portrait orientation on displays not supporting hardware orientation change.

Parameters
This
Return Value

Update_Layer

procedure Update_Layer
  (This      : in out Frame_Buffer_Display;
   Layer     : Positive;
   Copy_Back : Boolean := False)

Updates the layer so that the hidden buffer is displayed.

Parameters
This
Layer
Copy_Back

Update_Layers

procedure Update_Layers
  (This : in out Frame_Buffer_Display)

Updates all initialized layers at once with their respective hidden buffer.

Parameters
This

Wait_Mode

type Wait_Mode is (Polling, Interrupt);
Enumeration Literal
Polling
Interrupt

Width

function Width
  (This : Frame_Buffer_Display) return Positive
Parameters
This
Return Value