![]() |
![]() |
![]() |
![]() |
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 |
XrdWindow is implemented by XrdOverlayWindow, XrdSceneDesktopCursor and XrdSceneWindow.
XrdWindow * xrd_window_new_from_data (XrdClient *self
,XrdWindowData *data
);
XrdWindow * xrd_window_new_from_meters (XrdClient *client
,const char *title
,float width
,float height
,float ppm
);
XrdWindow * xrd_window_new_from_pixels (XrdClient *client
,const char *title
,uint32_t width
,uint32_t height
,float ppm
);
XrdWindow * xrd_window_new_from_native (XrdClient *client
,const gchar *title
,gpointer native
,uint32_t width_pixels
,uint32_t height_pixels
,float ppm
);
gboolean xrd_window_set_transformation (XrdWindow *self
,graphene_matrix_t *mat
);
gboolean xrd_window_get_transformation (XrdWindow *self
,graphene_matrix_t *mat
);
gboolean xrd_window_get_transformation_no_scale (XrdWindow *self
,graphene_matrix_t *mat
);
void
xrd_window_submit_texture (XrdWindow *self
);
self |
The XrdWindow After new content has been rendered into a texture, this function must be called to reflect the changed texture on screen. |
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
.
self |
The XrdWindow |
|
texture |
A GulkanTexture that is created by the caller. Ownership of this texture is transferred to the XrdWindow. |
GulkanTexture *
xrd_window_get_texture (XrdWindow *self
);
The last GulkanTexture submitted with xrd_window_submit_texture()
,
or NULL
if none has been submitted so far.
void
xrd_window_poll_event (XrdWindow *self
);
Must be called periodically to receive events from this window.
void xrd_window_get_intersection_2d_pixels (XrdWindow *self
,graphene_point3d_t *intersection_3d
,graphene_point_t *intersection_pixels
);
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. |
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
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. |
void xrd_window_emit_grab_start (XrdWindow *self
,GxrController *controller
);
void xrd_window_emit_release (XrdWindow *self
,GxrController *controller
);
void xrd_window_emit_hover_end (XrdWindow *self
,GxrController *controller
);
void xrd_window_emit_hover_start (XrdWindow *self
,GxrController *controller
);
void xrd_window_add_child (XrdWindow *self
,XrdWindow *child
,graphene_point_t *offset_center
);
x axis points right, y axis points up.
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. |
float
xrd_window_get_current_height_meters (XrdWindow *self
);
void
xrd_window_save_reset_transformation (XrdWindow *self
);
void xrd_window_set_reset_transformation (XrdWindow *self
,graphene_matrix_t *transform
);
void xrd_window_get_reset_transformation (XrdWindow *self
,graphene_matrix_t *transform
);
void xrd_window_set_pin (XrdWindow *self
,gboolean pinned
,gboolean hide_unpinned
);
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 |
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.
gpointer |
A native pointer to a window struct from a window manager. |
|
uint32_t |
The width of the last submitted texture in pixels. |
|
uint32_t |
The height of the last submitted texture in pixels. |
|
GString * |
A window title. |
|
graphene_point_t |
The window dimensions in meters without scale. |
|
float |
A user applied scale. |
|
graphene_matrix_t |
The transformation graphene_matrix_t of the window. |
|
struct XrdWindowData * |
A window that is pinned on top of this window and follows this window's position and scaling. |
|
struct XrdWindowData * |
The parent window, |
|
graphene_point_t |
If the window is a child, this stores the 2D offset to the parent in meters. |
|
graphene_matrix_t |
The transformation that the window will be reset to. |
|
gboolean |
Whether the window will be visible in pinned only mode. |
|
GulkanTexture * |
Cache of the currently rendered texture. |
|
XrdWindow * |
A pointer to the XrdWindow this XrdWindowData belongs to. |
|
gboolean |
If TRUE, Xrd*Window finalization must free this XrdWindowData After switching the overlay/scene mode, it will point to a new XrdWindow. |
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; };
GTypeInterface |
parent |
|
Set a graphene_matrix_t transformation. |
||
Get a graphene_matrix_t transformation including scale. |
||
Get a graphene_matrix_t transformation without scale. |
||
Submits current texture to the rendering backend. |
||
Sets and submits a new texture to the window. |
||
Returns current window texture. |
||
Poll events on the window. |
||
Emit an event when the grab action was started. |
||
Emit a continous event during the grab action. |
||
Emit an event when the grab action was finished. |
||
Emit an event when hovering the window was finished. |
||
Emit a continous event when the window is hovered. |
||
Emit an event when hovering the window started. |
||
Add a child window. |
||
Set a color that is multiplied to the texture. |
||
Flip the y axis of the texture. |
||
Show the window. |
||
Hide the window. |
||
Check if the window is currently visible. |
||
Common constructor. |
||
Get common data struct. |
||
guint |
Static counter how many windows were created, used for creating automatic overlay names. |
“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
“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
“native”
property“native” gpointer
A pointer to an (opaque) native window struct.
Owner: XrdWindow
Flags: Read / Write / Construct
“scale”
property“scale” float
Scaling Factor of this Window.
Owner: XrdWindow
Flags: Read / Write / Construct
Allowed values: [0.05,15]
Default value: 1
“texture-height”
property“texture-height” guint
The height of the set texture.
Owner: XrdWindow
Flags: Read / Write / Construct
Allowed values: <= 32768
Default value: 0
“texture-width”
property“texture-width” guint
The width of the set texture.
Owner: XrdWindow
Flags: Read / Write / Construct
Allowed values: <= 32768
Default value: 0
“title”
property“title” char *
Title of the Window.
Owner: XrdWindow
Flags: Read / Write / Construct Only
Default value: "Untitled"
“button-press-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“button-release-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“grab-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run First
“grab-start-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run First
“hover-end-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“hover-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“hover-start-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“keyboard-close-event”
signalvoid user_function (XrdWindow *xrdwindow, gpointer user_data)
Flags: Run First
“keyboard-press-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“motion-notify-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run Last
“release-event”
signalvoid user_function (XrdWindow *xrdwindow, GdkEvent *arg1, gpointer user_data)
Flags: Run First