Display Class Referenceabstract

#include <Display.h>

Description

Backend that controls how data is displayed to the user.

The display is abstracted as a rectangle, with a width, height, and position, that consumes a rendered visual of data from a renderer.

Data Structures

class  CloseCallback
 
class  ResizeCallback
 

Public Types

enum  Capability {
  CanResize,
  CanMove,
  CanFullscreen,
  CanHide,
  CanLockSize
}
 
enum  ViewPolicy {
  NoPolicy,
  MatchSize
}
 
enum  DisplayHandleType {
  X11Display,
  WINAPIHandle,
  Unknown
}
 
enum  DisplayEventType {
  X11Event,
  WINAPIMsg,
  Unknown
}
 

Functions

virtual void Resize (int w, int h)=0
 
virtual void SetPosition (int x, int y)=0
 
virtual void Fullscreen (bool)=0
 
virtual void Hide (bool)=0
 
virtual bool HasInputFocus ()=0
 
virtual void LockClientResize (bool)=0
 
virtual void LockClientPosition (bool)=0
 
virtual void SetViewPolicy (ViewPolicy)=0
 
virtual int Width ()=0
 
virtual int Height ()=0
 
virtual int X ()=0
 
virtual int Y ()=0
 
virtual void SetName (const std::string &)=0
 
virtual void AddResizeCallback (ResizeCallback *)=0
 
virtual void RemoveResizeCallback (ResizeCallback *)=0
 
virtual void AddCloseCallback (CloseCallback *)=0
 
virtual void RemoveCloseCallback (CloseCallback *)=0
 
virtual bool IsCapable (Capability)=0
 
virtual void AttachSource (Framebuffer *)=0
 
virtual FramebufferGetSource ()=0
 
virtual void Update ()=0
 
virtual DisplayHandleType GetSystemHandleType ()=0
 
virtual void * GetSystemHandle ()=0
 
virtual DisplayEventType GetSystemEventType ()=0
 
virtual void * GetLastSystemEvent ()=0
 

Member Enumeration Documentation

enum Capability
strong

The standard functional capabilities of a Display.

Enumerator
CanResize 

The Display can be resized.

CanMove 

The Display's position can be moved.

CanFullscreen 

The Display's size can consume the entire physical device, often in a special state.

CanHide 

The Display can be hidden.

CanLockSize 

The Display can prevent the user from changing the dimensions of the Display.

enum ViewPolicy
strong

Controls how the Display displays Rendered data.

Enumerator
NoPolicy 

The Display will show the attached Framebuffer's contents with no transformation.

MatchSize 

The Display will stretch the attached Framebuffer's contents to match the windows dimensions.

enum DisplayHandleType
strong

The variety of system handle types that Display can represent.

Enumerator
X11Display 

The display handle is an X11Display instance. In this case, the display is a window in an X11 environment.

WINAPIHandle 

The display handle is a MS Windows HWND instance.

Unknown 

The handle's type is not known and should not be relied on.

enum DisplayEventType
strong

The varienty of system event types that Display can give.

Enumerator
X11Event 

The event is a pointer to a std::vector<XEvent>.

WINAPIMsg 

The event is a pointer to a std::vector<MSG>.

Unknown 

The event's type is not known and should not be relied on.

Member Function Documentation

virtual void Resize ( int  w,
int  h 
)
pure virtual

Resizes the display. If the display does not support resizing, no action is taken.

virtual void SetPosition ( int  x,
int  y 
)
pure virtual

Sets the position of the display.

Usually, this is relative to whatever environment the display exists in. For example, in a desktop environment, this could be an offset from the DE's origin. If the display does not support moving, no action is taken.

virtual void Fullscreen ( bool  )
pure virtual

Set the display into a fullscreen context. If fullscreen is not supported, no action is taken.

virtual void Hide ( bool  )
pure virtual

Attempts to hide the display. If hiding is not supported, no action is taken.

virtual bool HasInputFocus ( )
pure virtual

Returns whether the display has user input focus. On display implementations where this doesnt apply, i.e. where there is only one logical display available,, this will always return true.

virtual void LockClientResize ( bool  )
pure virtual

Attempts to prevent resizing on the user's side.

For example, in a desktop environment, this would disable the feature of resizing the window.

virtual void LockClientPosition ( bool  )
pure virtual

Attempts to prevent moving on the user's side.

virtual void SetViewPolicy ( ViewPolicy  )
pure virtual

Controls how the Renderer's information is displayed. The default policy is "MatchSize" See ViewPolicy for more information.

virtual int Width ( )
pure virtual

Returns the width of the display.

virtual int Height ( )
pure virtual

Returns the height of the display.

virtual int X ( )
pure virtual

Returns the X position of the display.

virtual int Y ( )
pure virtual

Returns the Y position of the display.

virtual void SetName ( const std::string &  )
pure virtual

Sets the name of the display. On some systems, this can, for example, set the title bar of the application to the specified name.

virtual void AddResizeCallback ( ResizeCallback )
pure virtual

Adds an additional callback function to be be called after the occurance of a resize event.Callbacks are run in the order that they were added in.

virtual void RemoveResizeCallback ( ResizeCallback )
pure virtual

Removes the callback of the same instance as one given via AddResizeCallback.

virtual void AddCloseCallback ( CloseCallback )
pure virtual

Adds an additional callback function to be be called after the occurance of a closing event.

Typically on desktop systems, this is triggered by pressing the close button on the window associated with the Display. Callbacks are run in the order that they were added in.

virtual void RemoveCloseCallback ( CloseCallback )
pure virtual

Removes the callback of the same instance as one given via AddCloseCallback.

virtual bool IsCapable ( Capability  )
pure virtual

Returns whether or not the Display is able to perform the requested capability.

virtual void AttachSource ( Framebuffer )
pure virtual

Attaches the given framebuffer as the source of the display. Any updates to the display reflect the content of the source framebuffer. Setting the source as nullptr will nullify any request for updating.

virtual Framebuffer* GetSource ( )
pure virtual

Returns the frame data to read from.

virtual void Update ( )
pure virtual

Updates display with input visual data that is populated in the internal framebuffer. THe framebuffer's data canbe populated by modifying the framebuffer in GetSource()

virtual DisplayHandleType GetSystemHandleType ( )
pure virtual

Returns the type associated with data returned by GetSystemHandle. Meant for internal use, but can be handy when doing weird things.

virtual void* GetSystemHandle ( )
pure virtual

Returns an implementation-specific handle that represents this Display or this Display's properties. Meant for internal use, but can be handy when doing weird things.

virtual DisplayEventType GetSystemEventType ( )
pure virtual

Returns the type of the system events returned by GetLastSystemEvent(). Like getting the system handle, it's mostly meant for internal use, but can come in handy when doing weird things.

virtual void* GetLastSystemEvent ( )
pure virtual

Returns an implementation-specific value that represents the last processed event generated form the display. It is guaranteed to be updated after Update() has been called and is valid until the next Update() call.


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Backends/Display/Display.h