FreeRDP
uwac.h File Reference
#include <wayland-client.h>
#include <stdbool.h>
This graph shows which files directly or indirectly include this file:

Data Structures

struct  UwacSize
 a rectangle size measure More...
 
struct  UwacOutputNewEvent
 
struct  UwacSeatNewEvent
 
struct  UwacSeatRemovedEvent
 
struct  UwacKeyboardEnterLeaveEvent
 
struct  UwacPointerEnterLeaveEvent
 
struct  UwacPointerMotionEvent
 
struct  UwacPointerButtonEvent
 
struct  UwacPointerAxisEvent
 
struct  UwacTouchCancel
 
struct  UwacTouchMotion
 
struct  UwacFrameDoneEvent
 
struct  UwacConfigureEvent
 
struct  UwacKeyEvent
 
struct  UwacCloseEvent
 
union  UwacEvent
 

Macros

#define UWAC_API
 

Typedefs

typedef uint32_t UwacSeatId
 
typedef bool(* UwacErrorHandler) (UwacDisplay *d, UwacReturnCode code, const char *msg,...)
 

Enumerations

enum  UwacReturnCode {
  UWAC_SUCCESS = 0, UWAC_ERROR_NOMEMORY, UWAC_ERROR_UNABLE_TO_CONNECT, UWAC_ERROR_INVALID_DISPLAY,
  UWAC_NOT_ENOUGH_RESOURCES, UWAC_TIMEDOUT, UWAC_NOT_FOUND, UWAC_ERROR_CLOSED,
  UWAC_ERROR_INTERNAL, UWAC_ERROR_LAST
}
 error codes More...
 
enum  { UWAC_MOD_SHIFT_MASK = 0x01, UWAC_MOD_ALT_MASK = 0x02, UWAC_MOD_CONTROL_MASK = 0x04 }
 input modifiers More...
 
enum  {
  UWAC_EVENT_NEW_SEAT = 0, UWAC_EVENT_REMOVED_SEAT, UWAC_EVENT_NEW_OUTPUT, UWAC_EVENT_CONFIGURE,
  UWAC_EVENT_POINTER_ENTER, UWAC_EVENT_POINTER_LEAVE, UWAC_EVENT_POINTER_MOTION, UWAC_EVENT_POINTER_BUTTONS,
  UWAC_EVENT_POINTER_AXIS, UWAC_EVENT_KEYBOARD_ENTER, UWAC_EVENT_KEY, UWAC_EVENT_TOUCH_FRAME_BEGIN,
  UWAC_EVENT_TOUCH_UP, UWAC_EVENT_TOUCH_DOWN, UWAC_EVENT_TOUCH_MOTION, UWAC_EVENT_TOUCH_CANCEL,
  UWAC_EVENT_TOUCH_FRAME_END, UWAC_EVENT_FRAME_DONE, UWAC_EVENT_CLOSE
}
 event types More...
 
enum  { UWAC_WINDOW_MAXIMIZED = 0x1, UWAC_WINDOW_RESIZING = 0x2, UWAC_WINDOW_FULLSCREEN = 0x4, UWAC_WINDOW_ACTIVATED = 0x8 }
 window states More...
 

Functions

UWAC_API void UwacInstallErrorHandler (UwacErrorHandler handler)
 
UWAC_API UwacDisplay * UwacOpenDisplay (const char *name, UwacReturnCode *err)
 
UWAC_API UwacReturnCode UwacCloseDisplay (UwacDisplay **pdisplay)
 
UWAC_API int UwacDisplayGetFd (UwacDisplay *display)
 
UWAC_API const char * UwacErrorString (UwacReturnCode error)
 
UWAC_API UwacReturnCode UwacDisplayGetLastError (const UwacDisplay *display)
 
UWAC_API UwacReturnCode UwacDisplayQueryInterfaceVersion (const UwacDisplay *display, const char *name, uint32_t *version)
 
UWAC_API uint32_t UwacDisplayQueryGetNbShmFormats (UwacDisplay *display)
 
UWAC_API UwacReturnCode UwacDisplayQueryShmFormats (const UwacDisplay *display, enum wl_shm_format *formats, int formats_size, int *filled)
 
UWAC_API uint32_t UwacDisplayGetNbOutputs (UwacDisplay *display)
 
UWAC_API UwacOutput * UwacDisplayGetOutput (UwacDisplay *display, int index)
 
UWAC_API UwacReturnCode UwacOutputGetResolution (UwacOutput *output, UwacSize *resolution)
 
UWAC_API UwacWindow * UwacCreateWindowShm (UwacDisplay *display, uint32_t width, uint32_t height, enum wl_shm_format format)
 
UWAC_API UwacReturnCode UwacDestroyWindow (UwacWindow **window)
 
UWAC_API UwacReturnCode UwacWindowSetOpaqueRegion (UwacWindow *window, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 
UWAC_API UwacReturnCode UwacWindowSetInputRegion (UwacWindow *window, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 
UWAC_API voidUwacWindowGetDrawingBuffer (UwacWindow *window)
 
UWAC_API UwacReturnCode UwacWindowAddDamage (UwacWindow *window, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 
UWAC_API UwacReturnCode UwacWindowSubmitBuffer (UwacWindow *window, bool copyContentForNextFrame)
 
UWAC_API UwacReturnCode UwacWindowGetGeometry (UwacWindow *window, UwacSize *geometry)
 
UWAC_API UwacReturnCode UwacWindowSetFullscreenState (UwacWindow *window, UwacOutput *output, bool isFullscreen)
 
UWAC_API void UwacWindowSetTitle (UwacWindow *window, const char *name)
 
UWAC_API int UwacDisplayDispatch (UwacDisplay *display, int timeout)
 
UWAC_API bool UwacHasEvent (UwacDisplay *display)
 
UWAC_API UwacReturnCode UwacNextEvent (UwacDisplay *display, UwacEvent *event)
 
UWAC_API const char * UwacSeatGetName (const UwacSeat *seat)
 
UWAC_API UwacSeatId UwacSeatGetId (const UwacSeat *seat)
 

Macro Definition Documentation

#define UWAC_API

Typedef Documentation

typedef bool(* UwacErrorHandler) (UwacDisplay *d, UwacReturnCode code, const char *msg,...)
typedef uint32_t UwacSeatId

Enumeration Type Documentation

anonymous enum

input modifiers

Enumerator
UWAC_MOD_SHIFT_MASK 
UWAC_MOD_ALT_MASK 
UWAC_MOD_CONTROL_MASK 
anonymous enum

event types

Enumerator
UWAC_EVENT_NEW_SEAT 
UWAC_EVENT_REMOVED_SEAT 
UWAC_EVENT_NEW_OUTPUT 
UWAC_EVENT_CONFIGURE 
UWAC_EVENT_POINTER_ENTER 
UWAC_EVENT_POINTER_LEAVE 
UWAC_EVENT_POINTER_MOTION 
UWAC_EVENT_POINTER_BUTTONS 
UWAC_EVENT_POINTER_AXIS 
UWAC_EVENT_KEYBOARD_ENTER 
UWAC_EVENT_KEY 
UWAC_EVENT_TOUCH_FRAME_BEGIN 
UWAC_EVENT_TOUCH_UP 
UWAC_EVENT_TOUCH_DOWN 
UWAC_EVENT_TOUCH_MOTION 
UWAC_EVENT_TOUCH_CANCEL 
UWAC_EVENT_TOUCH_FRAME_END 
UWAC_EVENT_FRAME_DONE 
UWAC_EVENT_CLOSE 
anonymous enum

window states

Enumerator
UWAC_WINDOW_MAXIMIZED 
UWAC_WINDOW_RESIZING 
UWAC_WINDOW_FULLSCREEN 
UWAC_WINDOW_ACTIVATED 

error codes

Enumerator
UWAC_SUCCESS 
UWAC_ERROR_NOMEMORY 
UWAC_ERROR_UNABLE_TO_CONNECT 
UWAC_ERROR_INVALID_DISPLAY 
UWAC_NOT_ENOUGH_RESOURCES 
UWAC_TIMEDOUT 
UWAC_NOT_FOUND 
UWAC_ERROR_CLOSED 
UWAC_ERROR_INTERNAL 
UWAC_ERROR_LAST 

Function Documentation

UWAC_API UwacReturnCode UwacCloseDisplay ( UwacDisplay **  pdisplay)

closes the corresponding UwacDisplay

Parameters
pdisplaya pointer on the display to close
Returns
UWAC_SUCCESS if the operation was successful, the corresponding error otherwise

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API UwacWindow* UwacCreateWindowShm ( UwacDisplay *  display,
uint32_t  width,
uint32_t  height,
enum wl_shm_format  format 
)

creates a window using a SHM surface

Parameters
displaythe display to attach the window to
widththe width of the window
heightthe heigh of the window
formatformat to use for the SHM surface
Returns
the created UwacWindow, NULL if something failed (use UwacDisplayGetLastError() to know more about this)

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API UwacReturnCode UwacDestroyWindow ( UwacWindow **  window)

destroys the corresponding UwacWindow

Parameters
windowa pointer on the UwacWindow to destroy
Returns
if the operation completed successfully

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API int UwacDisplayDispatch ( UwacDisplay *  display,
int  timeout 
)
Parameters
display
timeout
Returns

Here is the caller graph for this function:

UWAC_API int UwacDisplayGetFd ( UwacDisplay *  display)

Returns the file descriptor associated with the UwacDisplay, this is useful when you want to poll that file descriptor for activity.

Parameters
displayan opened UwacDisplay
Returns
the corresponding descriptor

Here is the caller graph for this function:

UWAC_API UwacReturnCode UwacDisplayGetLastError ( const UwacDisplay *  display)

returns the last error that occurred on a display

Parameters
displaythe display
Returns
the last error that have been set for this display
UWAC_API uint32_t UwacDisplayGetNbOutputs ( UwacDisplay *  display)

returns the number of registered outputs

Parameters
displaythe display to query
Returns
the number of outputs
UWAC_API UwacOutput* UwacDisplayGetOutput ( UwacDisplay *  display,
int  index 
)

retrieve a particular UwacOutput object

Parameters
displaythe display to query
indexindex of the output
Returns
the given UwacOutput, NULL if something failed (so you should query UwacDisplayGetLastError() to have the reason)

Here is the caller graph for this function:

UWAC_API uint32_t UwacDisplayQueryGetNbShmFormats ( UwacDisplay *  display)

returns the number SHM formats that have been reported by the compositor

Parameters
displaya connected UwacDisplay
Returns
the number of SHM formats supported
UWAC_API UwacReturnCode UwacDisplayQueryInterfaceVersion ( const UwacDisplay *  display,
const char *  name,
uint32_t *  version 
)

retrieves the version of a given interface

Parameters
displaythe display connection
namethe name of the interface
versionthe output variable for the version
Returns
UWAC_SUCCESS if the interface was found, UWAC_NOT_FOUND otherwise
UWAC_API UwacReturnCode UwacDisplayQueryShmFormats ( const UwacDisplay *  display,
enum wl_shm_format *  formats,
int  formats_size,
int *  filled 
)

returns the supported ShmFormats

Parameters
displaya connected UwacDisplay
formatsa pointer on an array of wl_shm_format with enough place for formats_size items
formats_sizethe size of the formats array
filledthe number of filled entries in the formats array
Returns
UWAC_SUCCESS on success, an error otherwise

Here is the call graph for this function:

UWAC_API const char* UwacErrorString ( UwacReturnCode  error)

Returns a human readable form of a Uwac error code

Parameters
errorthe error number
Returns
the associated string
UWAC_API bool UwacHasEvent ( UwacDisplay *  display)

Returns if you have some pending events, and you can UwacNextEvent() without blocking

Parameters
displaythe UwacDisplay
Returns
if there's some pending events

Here is the caller graph for this function:

UWAC_API void UwacInstallErrorHandler ( UwacErrorHandler  handler)

install a handler that will be called when UWAC encounter internal errors. The handler is supposed to answer if the execution can continue. I can also be used to log things.

Parameters
handler

Here is the call graph for this function:

UWAC_API UwacReturnCode UwacNextEvent ( UwacDisplay *  display,
UwacEvent *  event 
)

Waits until an event occurs, and when it's there copy the event from the queue to event.

Parameters
displaythe Uwac display
eventthe event to fill
Returns
if the operation completed successfully

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API UwacDisplay* UwacOpenDisplay ( const char *  name,
UwacReturnCode err 
)

Opens the corresponding wayland display, using NULL you will open the default display.

Parameters
namethe name of the display to open
Returns
the created UwacDisplay object

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API UwacReturnCode UwacOutputGetResolution ( UwacOutput *  output,
UwacSize *  resolution 
)

retrieve the resolution of a given UwacOutput

Parameters
outputthe UwacOutput
resolutiona pointer on the
Returns
UWAC_SUCCESS on success

Here is the caller graph for this function:

UWAC_API UwacSeatId UwacSeatGetId ( const UwacSeat *  seat)

returns the id of the given UwacSeat

Parameters
seatthe UwacSeat
Returns
the id of the seat
UWAC_API const char* UwacSeatGetName ( const UwacSeat *  seat)

returns the name of the given UwacSeat

Parameters
seatthe UwacSeat
Returns
the name of the seat
UWAC_API UwacReturnCode UwacWindowAddDamage ( UwacWindow *  window,
uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)

sets a rectangle as dirty for the next frame of a window

Parameters
windowthe UwacWindow
xleft coordinate
ytop coordinate
widththe width of the dirty rectangle
heightthe height of the dirty rectangle
Returns
UWAC_SUCCESS on success, an Uwac error otherwise

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API void* UwacWindowGetDrawingBuffer ( UwacWindow *  window)

retrieves a pointer on the current window content to draw a frame

Parameters
windowthe UwacWindow
Returns
a pointer on the current window content

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API UwacReturnCode UwacWindowGetGeometry ( UwacWindow *  window,
UwacSize *  geometry 
)

returns the geometry of the given UwacWindows

Parameters
windowthe UwacWindow
geometrythe geometry to fill
Returns
UWAC_SUCCESS on success, an Uwac error otherwise

Here is the call graph for this function:

UWAC_API UwacReturnCode UwacWindowSetFullscreenState ( UwacWindow *  window,
UwacOutput *  output,
bool  isFullscreen 
)

Sets or unset the fact that the window is set fullscreen. After this call the application should get prepared to receive a configure event. The output is used only when going fullscreen, it is optional and not used when exiting fullscreen.

Parameters
windowthe UwacWindow
outputan optional UwacOutput to put the window fullscreen on
isFullscreenset or unset fullscreen
Returns
UWAC_SUCCESS if the operation was a success

Here is the caller graph for this function:

UWAC_API UwacReturnCode UwacWindowSetInputRegion ( UwacWindow *  window,
uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)

Sets the region of the window that can trigger input events

Parameters
windowthe UwacWindow
x
y
width
height
Returns

Here is the call graph for this function:

UWAC_API UwacReturnCode UwacWindowSetOpaqueRegion ( UwacWindow *  window,
uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)

Sets the region that should be considered opaque to the compositor.

Parameters
windowthe UwacWindow
x
y
width
height
Returns
UWAC_SUCCESS on success, an error otherwise

Here is the call graph for this function:

Here is the caller graph for this function:

UWAC_API void UwacWindowSetTitle ( UwacWindow *  window,
const char *  name 
)

When possible (depending on the shell) sets the title of the UwacWindow

Parameters
windowthe UwacWindow
nametitle

Here is the caller graph for this function:

UWAC_API UwacReturnCode UwacWindowSubmitBuffer ( UwacWindow *  window,
bool  copyContentForNextFrame 
)

Sends a frame to the compositor with the content of the drawing buffer

Parameters
windowthe UwacWindow to refresh
copyContentForNextFrameif true the content to display is copied in the next drawing buffer
Returns
UWAC_SUCCESS if the operation was successful

Here is the call graph for this function:

Here is the caller graph for this function: