XrdWindow

XrdWindow

Functions

XrdWindow * xrd_window_new_from_data ()
XrdWindow * xrd_window_new_from_meters ()
XrdWindow * xrd_window_new_from_pixels ()
XrdWindow * xrd_window_new_from_native ()
gboolean xrd_window_set_transformation ()
gboolean xrd_window_get_transformation ()
gboolean xrd_window_get_transformation_no_scale ()
void xrd_window_submit_texture ()
void xrd_window_set_and_submit_texture ()
GulkanTexture * xrd_window_get_texture ()
void xrd_window_poll_event ()
void xrd_window_get_intersection_2d_pixels ()
void xrd_window_get_intersection_2d ()
void xrd_window_emit_grab_start ()
void xrd_window_emit_grab ()
void xrd_window_emit_release ()
void xrd_window_emit_hover_end ()
void xrd_window_emit_hover ()
void xrd_window_emit_hover_start ()
void xrd_window_add_child ()
void xrd_window_select ()
void xrd_window_deselect ()
gboolean xrd_window_is_selected ()
void xrd_window_end_selection ()
void xrd_window_set_flip_y ()
float xrd_window_get_current_ppm ()
float xrd_window_get_initial_ppm ()
void xrd_window_show ()
void xrd_window_hide ()
gboolean xrd_window_is_visible ()
float xrd_window_get_current_width_meters ()
float xrd_window_get_current_height_meters ()
XrdWindowData * xrd_window_get_data ()
void xrd_window_update_child ()
void xrd_window_get_normal ()
void xrd_window_get_plane ()
float xrd_window_get_aspect_ratio ()
void xrd_window_set_color ()
void xrd_window_save_reset_transformation ()
void xrd_window_set_reset_transformation ()
void xrd_window_get_reset_transformation ()
void xrd_window_set_pin ()
gboolean xrd_window_is_pinned ()
void xrd_window_close ()

Properties

float initial-height-meters Read / Write / Construct
float initial-width-meters Read / Write / Construct
gpointer native Read / Write / Construct
float scale Read / Write / Construct
guint texture-height Read / Write / Construct
guint texture-width Read / Write / Construct
char * title Read / Write / Construct Only

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── XrdWindow

Prerequisites

XrdWindow requires GObject.

Known Implementations

XrdWindow is implemented by XrdOverlayWindow, XrdSceneDesktopCursor and XrdSceneWindow.

Includes

#include <xrd.h>

Description

Functions

xrd_window_new_from_data ()

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

xrd_window_new_from_meters ()

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

xrd_window_new_from_pixels ()

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

xrd_window_new_from_native ()

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

xrd_window_set_transformation ()

gboolean
xrd_window_set_transformation (XrdWindow *self,
                               graphene_matrix_t *mat);

xrd_window_get_transformation ()

gboolean
xrd_window_get_transformation (XrdWindow *self,
                               graphene_matrix_t *mat);

xrd_window_get_transformation_no_scale ()

gboolean
xrd_window_get_transformation_no_scale
                               (XrdWindow *self,
                                graphene_matrix_t *mat);

xrd_window_submit_texture ()

void
xrd_window_submit_texture (XrdWindow *self);

Parameters

self

The XrdWindow After new content has been rendered into a texture, this function must be called to reflect the changed texture on screen.

 

xrd_window_set_and_submit_texture ()

void
xrd_window_set_and_submit_texture (XrdWindow *self,
                                   GulkanTexture *texture);

For performance reason it is a good idea to not set a new texture every time the window content changes. Instead the the cached texture should be acquired with xrd_window_get_texture() and resubmitted with xrd_window_submit_texture().. If the window/texture size changes, a new texture should be submitted (the previous submitted texture does not need to be unref'ed).

This function also submits the texture .

Parameters

self

The XrdWindow

 

texture

A GulkanTexture that is created by the caller. Ownership of this texture is transferred to the XrdWindow.

 

xrd_window_get_texture ()

GulkanTexture *
xrd_window_get_texture (XrdWindow *self);

Parameters

self

The XrdWindow

 

Returns

The last GulkanTexture submitted with xrd_window_submit_texture(), or NULL if none has been submitted so far.

xrd_window_poll_event ()

void
xrd_window_poll_event (XrdWindow *self);

Must be called periodically to receive events from this window.

Parameters

self

The XrdWindow

 

xrd_window_get_intersection_2d_pixels ()

void
xrd_window_get_intersection_2d_pixels (XrdWindow *self,
                                       graphene_point3d_t *intersection_3d,
                                       graphene_point_t *intersection_pixels);

Parameters

self

The XrdWindow

 

intersection_3d

A graphene_point3d_t intersection point in meters.

 

intersection_pixels

Intersection in window coordinates with the origin at top/left in pixels.

 

xrd_window_get_intersection_2d ()

void
xrd_window_get_intersection_2d (XrdWindow *self,
                                graphene_point3d_t *intersection_3d,
                                graphene_point_t *intersection_2d);

Calculates the offset of the intersection relative to the overlay's center, in overlay-relative coordinates, in meters

Parameters

self

The XrdWindow

 

intersection_3d

A graphene_point3d_t intersection point in meters.

 

intersection_2d

Intersection in window coordinates with origin at center in meters.

 

xrd_window_emit_grab_start ()

void
xrd_window_emit_grab_start (XrdWindow *self,
                            GxrController *controller);

xrd_window_emit_grab ()

void
xrd_window_emit_grab (XrdWindow *self,
                      XrdGrabEvent *event);

xrd_window_emit_release ()

void
xrd_window_emit_release (XrdWindow *self,
                         GxrController *controller);

xrd_window_emit_hover_end ()

void
xrd_window_emit_hover_end (XrdWindow *self,
                           GxrController *controller);

xrd_window_emit_hover ()

void
xrd_window_emit_hover (XrdWindow *self,
                       XrdHoverEvent *event);

xrd_window_emit_hover_start ()

void
xrd_window_emit_hover_start (XrdWindow *self,
                             GxrController *controller);

xrd_window_add_child ()

void
xrd_window_add_child (XrdWindow *self,
                      XrdWindow *child,
                      graphene_point_t *offset_center);

x axis points right, y axis points up.

Parameters

self

The XrdWindow

 

child

An already existing window.

 

offset_center

The offset of the child window's center to the parent window's center in pixels.

 

xrd_window_select ()

void
xrd_window_select (XrdWindow *self);

xrd_window_deselect ()

void
xrd_window_deselect (XrdWindow *self);

xrd_window_is_selected ()

gboolean
xrd_window_is_selected (XrdWindow *self);

xrd_window_end_selection ()

void
xrd_window_end_selection (XrdWindow *self);

xrd_window_set_flip_y ()

void
xrd_window_set_flip_y (XrdWindow *self,
                       gboolean flip_y);

xrd_window_get_current_ppm ()

float
xrd_window_get_current_ppm (XrdWindow *self);

xrd_window_get_initial_ppm ()

float
xrd_window_get_initial_ppm (XrdWindow *self);

xrd_window_show ()

void
xrd_window_show (XrdWindow *self);

xrd_window_hide ()

void
xrd_window_hide (XrdWindow *self);

xrd_window_is_visible ()

gboolean
xrd_window_is_visible (XrdWindow *self);

xrd_window_get_current_width_meters ()

float
xrd_window_get_current_width_meters (XrdWindow *self);

Parameters

self

The XrdWindow

 

Returns

The current world space width of the window in meters.

xrd_window_get_current_height_meters ()

float
xrd_window_get_current_height_meters (XrdWindow *self);

Parameters

self

The XrdWindow

 

Returns

The current world space height of the window in meters.

xrd_window_get_data ()

XrdWindowData *
xrd_window_get_data (XrdWindow *self);

xrd_window_update_child ()

void
xrd_window_update_child (XrdWindow *self);

xrd_window_get_normal ()

void
xrd_window_get_normal (XrdWindow *self,
                       graphene_vec3_t *normal);

xrd_window_get_plane ()

void
xrd_window_get_plane (XrdWindow *self,
                      graphene_plane_t *res);

xrd_window_get_aspect_ratio ()

float
xrd_window_get_aspect_ratio (XrdWindow *self);

xrd_window_set_color ()

void
xrd_window_set_color (XrdWindow *self,
                      const graphene_vec3_t *color);

xrd_window_save_reset_transformation ()

void
xrd_window_save_reset_transformation (XrdWindow *self);

Parameters

self

The XrdWindow Saves the current transformation as the reset transformation.

 

xrd_window_set_reset_transformation ()

void
xrd_window_set_reset_transformation (XrdWindow *self,
                                     graphene_matrix_t *transform);

Parameters

self

The XrdWindow

 

transform

A transformation matrix to save as reset transform.

 

xrd_window_get_reset_transformation ()

void
xrd_window_get_reset_transformation (XrdWindow *self,
                                     graphene_matrix_t *transform);

xrd_window_set_pin ()

void
xrd_window_set_pin (XrdWindow *self,
                    gboolean pinned,
                    gboolean hide_unpinned);

Parameters

self

The XrdWindow

 

pinned

The pin status to set this window to

 

hide_unpinned

If TRUE, the window will be hidden if it is unpinned, and shown if it is pinned. This corresponds to the "show only pinned windows" mode set up in XrdClient. If FALSE, windows are always shown. Note that hide_unpinned only determines initial visibility, and does not keep track of further mode changes.

 

xrd_window_is_pinned ()

gboolean
xrd_window_is_pinned (XrdWindow *self);

xrd_window_close ()

void
xrd_window_close (XrdWindow *self);

Parameters

self

The XrdWindow MUST be called when destroying a window to free its resources.

 

Types and Values

XRD_TYPE_WINDOW

#define XRD_TYPE_WINDOW xrd_window_get_type()

XrdWindowData

typedef struct {
  gpointer native;

  uint32_t texture_width;
  uint32_t texture_height;
  GString *title;

  graphene_point_t initial_size_meters;

  float scale;
  graphene_matrix_t transform;

  struct XrdWindowData *child_window;
  struct XrdWindowData *parent_window;

  graphene_point_t child_offset_center;

  graphene_matrix_t reset_transform;

  gboolean pinned;

  GulkanTexture *texture;

  XrdWindow *xrd_window;

  gboolean owned_by_window;
} XrdWindowData;

Common struct for scene and overlay windows.

Members

gpointer native;

A native pointer to a window struct from a window manager.

 

uint32_t texture_width;

The width of the last submitted texture in pixels.

 

uint32_t texture_height;

The height of the last submitted texture in pixels.

 

GString *title;

A window title.

 

graphene_point_t initial_size_meters;

The window dimensions in meters without scale.

 

float scale;

A user applied scale.

 

graphene_matrix_t transform;

The transformation graphene_matrix_t of the window.

 

struct XrdWindowData *child_window;

A window that is pinned on top of this window and follows this window's position and scaling.

 

struct XrdWindowData *parent_window;

The parent window, NULL if the window does not have a parent.

 

graphene_point_t child_offset_center;

If the window is a child, this stores the 2D offset to the parent in meters.

 

graphene_matrix_t reset_transform;

The transformation that the window will be reset to.

 

gboolean pinned;

Whether the window will be visible in pinned only mode.

 

GulkanTexture *texture;

Cache of the currently rendered texture.

 

XrdWindow *xrd_window;

A pointer to the XrdWindow this XrdWindowData belongs to.

 

gboolean owned_by_window;

If TRUE, Xrd*Window finalization must free this XrdWindowData After switching the overlay/scene mode, it will point to a new XrdWindow.

 

struct XrdWindowInterface

struct XrdWindowInterface {
  GTypeInterface parent;

  gboolean
  (*set_transformation) (XrdWindow         *self,
                         graphene_matrix_t *mat);

  gboolean
  (*get_transformation) (XrdWindow         *self,
                         graphene_matrix_t *mat);

  gboolean
  (*get_transformation_no_scale) (XrdWindow         *self,
                                  graphene_matrix_t *mat);

  void
  (*submit_texture) (XrdWindow *self);

  void
  (*set_and_submit_texture) (XrdWindow     *self,
                             GulkanTexture *texture);

  GulkanTexture *
  (*get_texture) (XrdWindow *self);

  void
  (*poll_event) (XrdWindow *self);

  void
  (*emit_grab_start) (XrdWindow *self, GxrController *controller);

  void
  (*emit_grab) (XrdWindow *self, XrdGrabEvent *event);

  void
  (*emit_release) (XrdWindow *self, GxrController *controller);

  void
  (*emit_hover_end) (XrdWindow *self, GxrController *controller);

  void
  (*emit_hover) (XrdWindow *self, XrdHoverEvent *event);

  void
  (*emit_hover_start) (XrdWindow *self, GxrController *controller);

  void
  (*add_child) (XrdWindow *self, XrdWindow *child,
                graphene_point_t *offset_center);

  void
  (*set_color) (XrdWindow *self, const graphene_vec3_t *color);

  void
  (*set_flip_y) (XrdWindow *self,
                 gboolean flip_y);

  void
  (*show) (XrdWindow *self);

  void
  (*hide) (XrdWindow *self);

  gboolean
  (*is_visible) (XrdWindow *self);

  void
  (*constructed) (GObject *object);

  XrdWindowData*
  (*get_data) (XrdWindow *self);

  guint windows_created;
};

Members

GTypeInterface parent;

parent

 

set_transformation ()

Set a graphene_matrix_t transformation.

 

get_transformation ()

Get a graphene_matrix_t transformation including scale.

 

get_transformation_no_scale ()

Get a graphene_matrix_t transformation without scale.

 

submit_texture ()

Submits current texture to the rendering backend.

 

set_and_submit_texture ()

Sets and submits a new texture to the window.

 

get_texture ()

Returns current window texture.

 

poll_event ()

Poll events on the window.

 

emit_grab_start ()

Emit an event when the grab action was started.

 

emit_grab ()

Emit a continous event during the grab action.

 

emit_release ()

Emit an event when the grab action was finished.

 

emit_hover_end ()

Emit an event when hovering the window was finished.

 

emit_hover ()

Emit a continous event when the window is hovered.

 

emit_hover_start ()

Emit an event when hovering the window started.

 

add_child ()

Add a child window.

 

set_color ()

Set a color that is multiplied to the texture.

 

set_flip_y ()

Flip the y axis of the texture.

 

show ()

Show the window.

 

hide ()

Hide the window.

 

is_visible ()

Check if the window is currently visible.

 

constructed ()

Common constructor.

 

get_data ()

Get common data struct.

 

guint windows_created;

Static counter how many windows were created, used for creating automatic overlay names.

 

XrdWindow

typedef struct _XrdWindow XrdWindow;

Property Details

The “initial-height-meters” property

  “initial-height-meters”    float

Initial window height in meters.texture-height / initial-window-height determines the ppm the window was originally created with. The current height is initial-window-height * scale.

Owner: XrdWindow

Flags: Read / Write / Construct

Allowed values: [0.01,1000]

Default value: 1

The “initial-width-meters” property

  “initial-width-meters”     float

Initial window width in meters. texture-width / initial-window-width determines the ppm the window was originally created with. The current width is initial-window-width * scale.

Owner: XrdWindow

Flags: Read / Write / Construct

Allowed values: [0.01,1000]

Default value: 1

The “native” property

  “native”                   gpointer

A pointer to an (opaque) native window struct.

Owner: XrdWindow

Flags: Read / Write / Construct

The “scale” property

  “scale”                    float

Scaling Factor of this Window.

Owner: XrdWindow

Flags: Read / Write / Construct

Allowed values: [0.05,15]

Default value: 1

The “texture-height” property

  “texture-height”           guint

The height of the set texture.

Owner: XrdWindow

Flags: Read / Write / Construct

Allowed values: <= 32768

Default value: 0

The “texture-width” property

  “texture-width”            guint

The width of the set texture.

Owner: XrdWindow

Flags: Read / Write / Construct

Allowed values: <= 32768

Default value: 0

The “title” property

  “title”                    char *

Title of the Window.

Owner: XrdWindow

Flags: Read / Write / Construct Only

Default value: "Untitled"

Signal Details

The “button-press-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “button-release-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “destroy” signal

void
user_function (XrdWindow *xrdwindow,
               gpointer   user_data)

Flags: No Hooks

The “grab-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run First

The “grab-start-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run First

The “hover-end-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “hover-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “hover-start-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “keyboard-close-event” signal

void
user_function (XrdWindow *xrdwindow,
               gpointer   user_data)

Flags: Run First

The “keyboard-press-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “motion-notify-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “release-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run First

The “scroll-event” signal

void
user_function (XrdWindow *xrdwindow,
               GdkEvent  *arg1,
               gpointer   user_data)

Flags: Run Last

The “show” signal

void
user_function (XrdWindow *xrdwindow,
               gpointer   user_data)

Flags: Run First