Skip to content

Functions

ItsZariep edited this page Sep 9, 2024 · 1 revision

This page contains every function available in sgxpos.h

sgxpos_set_edge

Set edge of a GtkWindow

Argument Type Description
*window GtkWindow Desired GTK Window
edge sgxposedge Desired Edge
redim gboolean Toggle Edge value

Example:

sgxpos_set_edge(GTK_WINDOW(window), SGX_POS_EDGE_TOP, TRUE)

sgxpos_set_padding

Set padding of a GtkWindow

Argument Type Description
*window GtkWindow Desired GTK Window
edge sgxposedge Desired Edge
N gint Number of px

Example:

sgxpos_set_padding(GTK_WINDOW(window), SGX_POS_EDGE_TOP, 16)

sgxpos_set_margin

Set margin of the strut of a GtkWindow

Argument Type Description
*window GtkWindow Desired GTK Window
edge sgxposedge Desired Edge
N gint Number of px

Example:

sgxpos_set_margin(GTK_WINDOW(window), SGX_POS_EDGE_TOP, 16)

sgx_set_layer

Set layer of a GtkWindow

Argument Type Description
*window GtkWindow Desired GTK Window
layer sgxlayer Desired Edge

Example:

sgx_set_layer(GTK_WINDOW(window), SGX_LAYER_DOCK)

sgx_set_exclusive_zone

Enable exclusive zone on a GtkWindow

Argument Type Description
*window GtkWindow Desired GTK Window

Example:

sgx_set_exclusive_zone(GTK_WINDOW(window))

Internal SGXPos Functions

These functions are intended for internal use only and are essential for the functionality of SGXPos.

sgxpos_get_screen_size

  • Get screen size
Argument Type Description
*width int Get screen width
*height int Get Screen height

Example:

//Passing variables as pointers, so the function will asign to that variables
int swidth, sheight;
sgxpos_get_screen_size(&swidth, &sheight)

SGXSetStrutPartial

  • Set X11 Strut (Set window exclusive zone)
Argument Type Description
*window GtkWindow Desired GTK Window

Note: There is no need to manually call this function because sgxpos_set_edge already makes a call

Example:

sgx_set_exclusive_zone(GTK_WINDOW(window));
sgxpos_set_edge(window, SGX_POS_EDGE_LEFT, TRUE)

SGXClearStrutPartial

Clean the X11 definitions about the exclusive zone, needed to change the strut

Argument Type Description
*window GtkWindow Desired GTK Window

Note: There is no need to manually call this function because sgxpos_set_edge already makes a call

Example:

sgxpos_set_edge(window, SGX_POS_EDGE_LEFT, FALSE)

wrapper_sgxpos_set_edge

Used to recall sgxpos_set_edge

Argument Type Description
*window GtkWindow Desired GTK Window

Note: There is no need to manually call this function because sgxpos_set_edge already makes a call

Example:

g_signal_connect(window, "realize", G_CALLBACK(wrapper_sgxpos_set_edge), window);

SGXSetLayer

Set X11 _NET_WM_WINDOW_TYPE of a window

Argument Type Description
*window GtkWindow Desired GTK Window
*windowtype char Desired window type

Example:

SGXSetLayer(window, "_NET_WM_WINDOW_TYPE_DOCK");

SGXSetWindowState

Set X11 _NET_WM_STATE of a window

Argument Type Description
*window GtkWindow Desired GTK Window
*state char Desired window state

Example:

SGXSetWindowState(window, "_NET_WM_STATE_BELOW");

wrapper_sgxpos_set_layer

Used to recall sgxpos_set_layer

Argument Type Description
*window GtkWindow Desired GTK Window

Note: There is no need to manually call this function because sgxpos_set_edge already makes a call

Example:

g_signal_connect(window, "realize", G_CALLBACK(wrapper_sgxpos_set_layer), window);