XrdClient

XrdClient

Functions

XrdClient * xrd_client_new ()
void xrd_client_add_window ()
void xrd_client_remove_window ()
void xrd_client_add_button ()
XrdWindow * xrd_client_get_keyboard_window ()
GulkanClient * xrd_client_get_uploader ()
void xrd_client_emit_keyboard_press ()
void xrd_client_emit_click ()
void xrd_client_emit_move_cursor ()
void xrd_client_emit_system_quit ()
XrdWindow * xrd_client_get_synth_hovered ()
void xrd_client_submit_cursor_texture ()
void xrd_client_add_button_callbacks ()
void xrd_client_add_container ()
void xrd_client_add_window_callbacks ()
XrdWindow * xrd_client_button_new_from_icon ()
XrdWindow * xrd_client_button_new_from_text ()
GHashTable * xrd_client_get_controllers ()
XrdDesktopCursor * xrd_client_get_cursor ()
XrdDesktopCursor * xrd_client_get_desktop_cursor ()
XrdInputSynth * xrd_client_get_input_synth ()
XrdWindowManager * xrd_client_get_manager ()
OpenVRContext * xrd_client_get_openvr_context ()
XrdPointer * xrd_client_get_pointer ()
XrdPointerTip * xrd_client_get_pointer_tip ()
VkImageLayout xrd_client_get_upload_layout ()
GSList * xrd_client_get_windows ()
OpenVRActionSet * xrd_client_get_wm_actions ()
XrdWindow * xrd_client_lookup_window ()
void xrd_client_init_controller ()
gboolean xrd_client_is_grabbed ()
gboolean xrd_client_is_grabbing ()
gboolean xrd_client_is_hovered ()
gboolean xrd_client_is_hovering ()
gboolean xrd_client_poll_input_events ()
gboolean xrd_client_poll_runtime_events ()
void xrd_client_post_openvr_init ()
void xrd_client_remove_container ()
void xrd_client_set_desktop_cursor ()
void xrd_client_set_pin ()
void xrd_client_set_pointer ()
void xrd_client_set_pointer_tip ()
void xrd_client_set_upload_layout ()
void xrd_client_show_pinned_only ()
struct _XrdClient * xrd_client_switch_mode ()
XrdWindow * xrd_client_window_new ()
XrdWindow * xrd_client_window_new_from_meters ()
XrdWindow * xrd_client_window_new_from_native ()
XrdWindow * xrd_client_window_new_from_pixels ()

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── XrdClient
        ├── XrdOverlayClient
        ╰── XrdSceneClient

Includes

#include <xrdesktop.h>

Description

Functions

xrd_client_new ()

XrdClient *
xrd_client_new (void);

xrd_client_add_window ()

void
xrd_client_add_window (XrdClient *self,
                       XrdWindow *window,
                       gboolean draggable,
                       gpointer lookup_key);

Parameters

self

The XrdClient

 

window

The XrdWindow to add

 

draggable

Desktop windows should set this to true. This will enable the expected interaction of being able to grab windows and drag them around. It should be set to false for example for

  • child windows

  • windows in a container that is attached to the FOV, a controller, etc.

 

lookup_key

If looking up the XrdWindow by a key with xrd_client_lookup_window() should be enabled, set to != NULL. Note that an XrdWindow can be replaced by the overlay-scene switch. Therefore the XrdWindow should always be looked up instead of cached.

 

xrd_client_remove_window ()

void
xrd_client_remove_window (XrdClient *self,
                          XrdWindow *window);

Removes an XrdWindow from the management of the XrdClient and the XrdWindowManager. Note that the XrdWindow will not be destroyed by this function.

Parameters

self

The XrdClient

 

window

The XrdWindow to remove.

 

xrd_client_add_button ()

void
xrd_client_add_button (XrdClient *self,
                       XrdWindow *button,
                       graphene_point3d_t *position,
                       GCallback press_callback,
                       gpointer press_callback_data);

Buttons are special windows that can not be grabbed and dragged around. Instead a button's press_callback is called on the grab action.

Parameters

self

The XrdClient

 

button

The button (XrdWindow) to add.

 

position

World space position of the button.

 

press_callback

A function that will be called when the button is grabbed.

 

press_callback_data

User pointer passed to press_callback .

 

xrd_client_get_keyboard_window ()

XrdWindow *
xrd_client_get_keyboard_window (XrdClient *self);

Parameters

self

The XrdClient

 

Returns

The window that is currently used for keyboard input. Can be NULL.


xrd_client_get_uploader ()

GulkanClient *
xrd_client_get_uploader (XrdClient *self);

xrd_client_emit_keyboard_press ()

void
xrd_client_emit_keyboard_press (XrdClient *self,
                                GdkEventKey *event);

xrd_client_emit_click ()

void
xrd_client_emit_click (XrdClient *self,
                       XrdClickEvent *event);

xrd_client_emit_move_cursor ()

void
xrd_client_emit_move_cursor (XrdClient *self,
                             XrdMoveCursorEvent *event);

xrd_client_emit_system_quit ()

void
xrd_client_emit_system_quit (XrdClient *self,
                             OpenVRQuitEvent *event);

xrd_client_get_synth_hovered ()

XrdWindow *
xrd_client_get_synth_hovered (XrdClient *self);

Parameters

self

The XrdClient

 

Returns

If the controller used for synthesizing input is hovering over an XrdWindow, return this window, else NULL.


xrd_client_submit_cursor_texture ()

void
xrd_client_submit_cursor_texture (XrdClient *self,
                                  GulkanClient *client,
                                  GulkanTexture *texture,
                                  int hotspot_x,
                                  int hotspot_y);

A hotspot of (x, y) means that the hotspot is at x pixels right, y pixels down from the top left corner of the texture.

Parameters

self

The XrdClient

 

client

A GulkanClient, for example an OpenVROverlayUploader.

 

texture

A GulkanTexture that is created and owned by the caller. For performance reasons it is a good idea for the caller to reuse this texture.

 

hotspot_x

The x component of the hotspot.

 

hotspot_y

The x component of the hotspot.

 

xrd_client_add_button_callbacks ()

void
xrd_client_add_button_callbacks (XrdClient *self,
                                 XrdWindow *button);

xrd_client_add_container ()

void
xrd_client_add_container (XrdClient *self,
                          XrdContainer *container);

For a container to start behaving according to its layout and attachment, it must be added to the client.

Note: windows in the container must be added to the client separately with xrd_client_add_window(), preferably with draggable set to false.

Parameters

self

The XrdClient

 

container

The XrdContainer to add

 

xrd_client_add_window_callbacks ()

void
xrd_client_add_window_callbacks (XrdClient *self,
                                 XrdWindow *window);

xrd_client_button_new_from_icon ()

XrdWindow *
xrd_client_button_new_from_icon (XrdClient *self,
                                 float width,
                                 float height,
                                 float ppm,
                                 const gchar *url);

xrd_client_button_new_from_text ()

XrdWindow *
xrd_client_button_new_from_text (XrdClient *self,
                                 float width,
                                 float height,
                                 float ppm,
                                 int label_count,
                                 gchar **label);

Creates a button and submits a Cairo rendered text label to it.

Parameters

self

The XrdClient

 

width

Width in meters.

 

height

Height in meters.

 

ppm

Density in pixels per meter

 

label_count

The number of text lines given in label

 

label

One or more lines of text that will be displayed on the button.

 

xrd_client_get_controllers ()

GHashTable *
xrd_client_get_controllers (XrdClient *self);

xrd_client_get_cursor ()

XrdDesktopCursor *
xrd_client_get_cursor (XrdClient *self);

xrd_client_get_desktop_cursor ()

XrdDesktopCursor *
xrd_client_get_desktop_cursor (XrdClient *self);

xrd_client_get_input_synth ()

XrdInputSynth *
xrd_client_get_input_synth (XrdClient *self);

xrd_client_get_manager ()

XrdWindowManager *
xrd_client_get_manager (XrdClient *self);

xrd_client_get_openvr_context ()

OpenVRContext *
xrd_client_get_openvr_context (XrdClient *self);

xrd_client_get_pointer ()

XrdPointer *
xrd_client_get_pointer (XrdClient *self,
                        uint32_t id);

xrd_client_get_pointer_tip ()

XrdPointerTip *
xrd_client_get_pointer_tip (XrdClient *self,
                            uint32_t id);

xrd_client_get_upload_layout ()

VkImageLayout
xrd_client_get_upload_layout (XrdClient *self);

xrd_client_get_windows ()

GSList *
xrd_client_get_windows (XrdClient *self);

xrd_client_get_wm_actions ()

OpenVRActionSet *
xrd_client_get_wm_actions (XrdClient *self);

xrd_client_lookup_window ()

XrdWindow *
xrd_client_lookup_window (XrdClient *self,
                          gpointer key);

xrd_client_init_controller ()

void
xrd_client_init_controller (XrdClient *self,
                            XrdController *controller);

xrd_client_is_grabbed ()

gboolean
xrd_client_is_grabbed (XrdClient *self,
                       XrdWindow *window);

xrd_client_is_grabbing ()

gboolean
xrd_client_is_grabbing (XrdClient *self);

xrd_client_is_hovered ()

gboolean
xrd_client_is_hovered (XrdClient *self,
                       XrdWindow *window);

xrd_client_is_hovering ()

gboolean
xrd_client_is_hovering (XrdClient *self);

xrd_client_poll_input_events ()

gboolean
xrd_client_poll_input_events (XrdClient *self);

xrd_client_poll_runtime_events ()

gboolean
xrd_client_poll_runtime_events (XrdClient *self);

xrd_client_post_openvr_init ()

void
xrd_client_post_openvr_init (XrdClient *self);

xrd_client_remove_container ()

void
xrd_client_remove_container (XrdClient *self,
                             XrdContainer *container);

xrd_client_set_desktop_cursor ()

void
xrd_client_set_desktop_cursor (XrdClient *self,
                               XrdDesktopCursor *cursor);

xrd_client_set_pin ()

void
xrd_client_set_pin (XrdClient *self,
                    XrdWindow *win,
                    gboolean pin);

xrd_client_set_pointer ()

void
xrd_client_set_pointer (XrdClient *self,
                        XrdPointer *pointer,
                        uint32_t id);

xrd_client_set_pointer_tip ()

void
xrd_client_set_pointer_tip (XrdClient *self,
                            XrdPointerTip *pointer,
                            uint32_t id);

xrd_client_set_upload_layout ()

void
xrd_client_set_upload_layout (XrdClient *self,
                              VkImageLayout layout);

xrd_client_show_pinned_only ()

void
xrd_client_show_pinned_only (XrdClient *self,
                             gboolean pinned_only);

xrd_client_switch_mode ()

struct _XrdClient *
xrd_client_switch_mode (XrdClient *self);

References to gulkan, gxr and xrdesktop objects (like XrdWindow) will be invalid after calling this function.

xrd_client_switch_mode() replaces each XrdWindow with an appropriate new one, preserving its transformation matrix, scaling, pinned status, etc.

The caller is responsible for reconnecting callbacks to XrdClient signals. The caller is responsible to not use references to any previous XrdWindow. Pointers to XrdWindowData will remain valid, however XrdWindowData->xrd_window will point to a new XrdWindow.

Parameters

self

current XrdClient to be destroyed.

 

Returns

A new XrdClient of the opposite mode than the passed one.


xrd_client_window_new ()

XrdWindow *
xrd_client_window_new (XrdClient *client);

xrd_client_window_new_from_meters ()

XrdWindow *
xrd_client_window_new_from_meters (XrdClient *client,
                                   const char *title,
                                   float width,
                                   float height,
                                   float ppm);

xrd_client_window_new_from_native ()

XrdWindow *
xrd_client_window_new_from_native (XrdClient *client,
                                   const gchar *title,
                                   gpointer native,
                                   uint32_t width_pixels,
                                   uint32_t height_pixels,
                                   float ppm);

xrd_client_window_new_from_pixels ()

XrdWindow *
xrd_client_window_new_from_pixels (XrdClient *client,
                                   const char *title,
                                   uint32_t width,
                                   uint32_t height,
                                   float ppm);

Types and Values

XrdClient

typedef struct _XrdClient XrdClient;

struct XrdClientClass

struct XrdClientClass {
  GObjectClass parent;

  gboolean
  (*add_button) (XrdClient          *self,
                 XrdWindow         **button,
                 int                 label_count,
                 gchar             **label,
                 graphene_point3d_t *position,
                 GCallback           press_callback,
                 gpointer            press_callback_data);

  GulkanClient *
  (*get_uploader) (XrdClient *self);

  void
  (*init_controller) (XrdClient *self,
                      XrdController *controller);
};

Members

GObjectClass parent;

The object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly. This allows a XrdClientClass pointer to be cast to a GObjectClass pointer.

 

add_button ()

Create a label button.

 

get_uploader ()

Get a GulkanClient from the XrdClient.

 

init_controller ()

Initialize a XrdController.

 

XRD_TYPE_CLIENT

#define XRD_TYPE_CLIENT xrd_client_get_type()

Signal Details

The “click-event” signal

void
user_function (XrdClient *xrdclient,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last


The “keyboard-press-event” signal

void
user_function (XrdClient *xrdclient,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last


The “move-cursor-event” signal

void
user_function (XrdClient *xrdclient,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last


The “request-quit-event” signal

void
user_function (XrdClient *xrdclient,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last