XrdClient

XrdClient

Functions

Signals

Types and Values

Object Hierarchy

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

Includes

#include <xrd.h>

Description

Functions

xrd_client_new ()

XrdClient *
xrd_client_new (void);

xrd_client_new_with_mode ()

XrdClient *
xrd_client_new_with_mode (XrdClientMode mode);

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_remove_container ()

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

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_lookup_window ()

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

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_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_button_new_from_icon ()

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

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_gulkan ()

GulkanClient *
xrd_client_get_gulkan (XrdClient *self);

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_get_manager ()

XrdWindowManager *
xrd_client_get_manager (XrdClient *self);

xrd_client_set_pin ()

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

xrd_client_show_pinned_only ()

void
xrd_client_show_pinned_only (XrdClient *self,
                             gboolean pinned_only);

xrd_client_get_input_synth ()

XrdInputSynth *
xrd_client_get_input_synth (XrdClient *self);

xrd_client_poll_runtime_events ()

gboolean
xrd_client_poll_runtime_events (XrdClient *self);

xrd_client_poll_input_events ()

gboolean
xrd_client_poll_input_events (XrdClient *self);

xrd_client_get_desktop_cursor ()

XrdDesktopCursor *
xrd_client_get_desktop_cursor (XrdClient *self);

xrd_client_get_upload_layout ()

VkImageLayout
xrd_client_get_upload_layout (XrdClient *self);

xrd_client_get_controllers ()

GSList *
xrd_client_get_controllers (XrdClient *self);

xrd_client_get_windows ()

GSList *
xrd_client_get_windows (XrdClient *self);

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_get_gxr_context ()

GxrContext *
xrd_client_get_gxr_context (XrdClient *self);

Types and Values

XRD_TYPE_CLIENT

#define XRD_TYPE_CLIENT xrd_client_get_type()

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_gulkan) (XrdClient *self);

  void
  (*init_controller) (XrdClient     *self,
                      GxrController *controller);

  XrdWindow *
  (*window_new_from_meters) (XrdClient  *self,
                             const char *title,
                             float       width,
                             float       height,
                             float       ppm);

  XrdWindow *
  (*window_new_from_data) (XrdClient     *self,
                           XrdWindowData *data);

  XrdWindow *
  (*window_new_from_pixels) (XrdClient  *self,
                             const char *title,
                             uint32_t    width,
                             uint32_t    height,
                             float       ppm);

  XrdWindow *
  (*window_new_from_native) (XrdClient   *self,
                             const gchar *title,
                             gpointer     native,
                             uint32_t     width_pixels,
                             uint32_t     height_pixels,
                             float        ppm);
};

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_gulkan ()

Get a GulkanClient from the XrdClient.

 

init_controller ()

Initialize a XrdController.

 

window_new_from_meters ()

Initialize a XrdWindow.

 

window_new_from_data ()

Initialize a XrdWindow.

 

window_new_from_pixels ()

Initialize a XrdWindow.

 

window_new_from_native ()

Initialize a XrdWindow.

 

XrdClient

typedef struct _XrdClient XrdClient;

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