FreeRDP
uwac-window.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <sys/mman.h>
#include "uwac-priv.h"
#include "uwac-utils.h"
#include "uwac-os.h"

Macros

#define UWAC_INITIAL_BUFFERS   3
 

Functions

static int bppFromShmFormat (enum wl_shm_format format)
 
static void buffer_release (void *data, struct wl_buffer *buffer)
 
void UwacWindowDestroyBuffers (UwacWindow *w)
 
int UwacWindowShmAllocBuffers (UwacWindow *w, int nbuffers, int allocSize, uint32_t width, uint32_t height, enum wl_shm_format format)
 
static void xdg_handle_configure (void *data, struct xdg_surface *surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial)
 
static void xdg_handle_close (void *data, struct xdg_surface *xdg_surface)
 
void shell_ping (void *data, struct wl_shell_surface *surface, uint32_t serial)
 
void shell_configure (void *data, struct wl_shell_surface *surface, uint32_t edges, int32_t width, int32_t height)
 
void shell_popup_done (void *data, struct wl_shell_surface *surface)
 
UwacBuffer * UwacWindowFindFreeBuffer (UwacWindow *w)
 
UwacWindow * UwacCreateWindowShm (UwacDisplay *display, uint32_t width, uint32_t height, enum wl_shm_format format)
 
UwacReturnCode UwacDestroyWindow (UwacWindow **pwindow)
 
UwacReturnCode UwacWindowSetOpaqueRegion (UwacWindow *window, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 
UwacReturnCode UwacWindowSetInputRegion (UwacWindow *window, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 
voidUwacWindowGetDrawingBuffer (UwacWindow *window)
 
static void frame_done_cb (void *data, struct wl_callback *callback, uint32_t time)
 
static void UwacSubmitBufferPtr (UwacWindow *window, UwacBuffer *buffer)
 
UwacReturnCode UwacWindowAddDamage (UwacWindow *window, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 
UwacReturnCode UwacWindowSubmitBuffer (UwacWindow *window, bool copyContentForNextFrame)
 
UwacReturnCode UwacWindowGetGeometry (UwacWindow *window, UwacSize *geometry)
 
UwacReturnCode UwacWindowSetFullscreenState (UwacWindow *window, UwacOutput *output, bool isFullscreen)
 
void UwacWindowSetTitle (UwacWindow *window, const char *name)
 

Variables

static const struct wl_buffer_listener buffer_listener
 
static const struct xdg_surface_listener xdg_surface_listener
 
static const struct wl_shell_surface_listener shell_listener
 
static const struct wl_callback_listener frame_listener
 

Macro Definition Documentation

#define UWAC_INITIAL_BUFFERS   3

Function Documentation

static int bppFromShmFormat ( enum wl_shm_format  format)
static

Here is the caller graph for this function:

static void buffer_release ( void data,
struct wl_buffer *  buffer 
)
static
static void frame_done_cb ( void data,
struct wl_callback *  callback,
uint32_t  time 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void shell_configure ( void data,
struct wl_shell_surface *  surface,
uint32_t  edges,
int32_t  width,
int32_t  height 
)

Here is the call graph for this function:

void shell_ping ( void data,
struct wl_shell_surface *  surface,
uint32_t  serial 
)
void shell_popup_done ( void data,
struct wl_shell_surface *  surface 
)
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:

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:

static void UwacSubmitBufferPtr ( UwacWindow *  window,
UwacBuffer *  buffer 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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:

void UwacWindowDestroyBuffers ( UwacWindow *  w)

Here is the call graph for this function:

Here is the caller graph for this function:

UwacBuffer* UwacWindowFindFreeBuffer ( UwacWindow *  w)

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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:

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:

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:

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:

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:

int UwacWindowShmAllocBuffers ( UwacWindow *  w,
int  nbuffers,
int  allocSize,
uint32_t  width,
uint32_t  height,
enum wl_shm_format  format 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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:

static void xdg_handle_close ( void data,
struct xdg_surface *  xdg_surface 
)
static

Here is the call graph for this function:

static void xdg_handle_configure ( void data,
struct xdg_surface *  surface,
int32_t  width,
int32_t  height,
struct wl_array *  states,
uint32_t  serial 
)
static

Here is the call graph for this function:

Variable Documentation

const struct wl_buffer_listener buffer_listener
static
Initial value:
=
{
}
static void buffer_release(void *data, struct wl_buffer *buffer)
Definition: uwac-window.c:50
const struct wl_callback_listener frame_listener
static
Initial value:
=
{
}
static void frame_done_cb(void *data, struct wl_callback *callback, uint32_t time)
Definition: uwac-window.c:602
const struct wl_shell_surface_listener shell_listener
static
Initial value:
=
{
}
void shell_popup_done(void *data, struct wl_shell_surface *surface)
Definition: uwac-window.c:287
void shell_configure(void *data, struct wl_shell_surface *surface, uint32_t edges, int32_t width, int32_t height)
Definition: uwac-window.c:241
void shell_ping(void *data, struct wl_shell_surface *surface, uint32_t serial)
Definition: uwac-window.c:236
const struct xdg_surface_listener xdg_surface_listener
static
Initial value:
=
{
}
static void xdg_handle_configure(void *data, struct xdg_surface *surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial)
Definition: uwac-window.c:85
static void xdg_handle_close(void *data, struct xdg_surface *xdg_surface)
Definition: uwac-window.c:161