NetkWindow
3
LIBXFCEGUI4 Library

# NetkWindow

Represents a window for the window manager

## Synopsis

    #include <libxfcegui4/libxfcegui4.h>

                        NetkWindow;
    enum                NetkWindowState;
    enum                NetkWindowActions;
    enum                NetkWindowType;
    GType               netk_window_get_type                (void);
    NetkWindow*         netk_window_get                     (gulong xwindow);
    NetkScreen*         netk_window_get_screen              (NetkWindow *window);
    const char*         netk_window_get_name                (NetkWindow *window);
    const char*         netk_window_get_icon_name           (NetkWindow *window);
    NetkApplication*    netk_window_get_application         (NetkWindow *window);
    gulong              netk_window_get_group_leader        (NetkWindow *window);
    gulong              netk_window_get_xid                 (NetkWindow *window);
    NetkClassGroup*     netk_window_get_class_group         (NetkWindow *window);
    const char*         netk_window_get_session_id          (NetkWindow *window);
    const char*         netk_window_get_session_id_utf8     (NetkWindow *window);
    int                 netk_window_get_pid                 (NetkWindow *window);
    NetkWindowType      netk_window_get_window_type         (NetkWindow *window);
    const char*         netk_window_get_resource_class      (NetkWindow *window);
    gboolean            netk_window_is_minimized            (NetkWindow *window);
    gboolean            netk_window_is_maximized_horizontally
                                                            (NetkWindow *window);
    gboolean            netk_window_is_maximized_vertically (NetkWindow *window);
    gboolean            netk_window_is_maximized            (NetkWindow *window);
    gboolean            netk_window_is_shaded               (NetkWindow *window);
    gboolean            netk_window_is_skip_pager           (NetkWindow *window);
    gboolean            netk_window_is_skip_tasklist        (NetkWindow *window);
    gboolean            netk_window_is_sticky               (NetkWindow *window);
    void                netk_window_set_skip_pager          (NetkWindow *window,
                                                             gboolean skip);
    void                netk_window_set_skip_tasklist       (NetkWindow *window,
                                                             gboolean skip);
    void                netk_window_close                   (NetkWindow *window);
    void                netk_window_minimize                (NetkWindow *window);
    void                netk_window_unminimize              (NetkWindow *window);
    void                netk_window_maximize                (NetkWindow *window);
    void                netk_window_unmaximize              (NetkWindow *window);
    void                netk_window_maximize_horizontally   (NetkWindow *window);
    void                netk_window_unmaximize_horizontally (NetkWindow *window);
    void                netk_window_maximize_vertically     (NetkWindow *window);
    void                netk_window_unmaximize_vertically   (NetkWindow *window);
    void                netk_window_shade                   (NetkWindow *window);
    void                netk_window_unshade                 (NetkWindow *window);
    void                netk_window_stick                   (NetkWindow *window);
    void                netk_window_unstick                 (NetkWindow *window);
    void                netk_window_keyboard_move           (NetkWindow *window);
    void                netk_window_keyboard_size           (NetkWindow *window);
    NetkWorkspace*      netk_window_get_workspace           (NetkWindow *window);
    void                netk_window_move_to_workspace       (NetkWindow *window,
                                                             NetkWorkspace *space);
    gboolean            netk_window_is_pinned               (NetkWindow *window);
    void                netk_window_pin                     (NetkWindow *window);
    void                netk_window_unpin                   (NetkWindow *window);
    void                netk_window_activate                (NetkWindow *window);
    gboolean            netk_window_is_active               (NetkWindow *window);
    void                netk_window_activate_transient      (NetkWindow *window);
    GdkPixbuf*          netk_window_get_icon                (NetkWindow *window);
    GdkPixbuf*          netk_window_get_mini_icon           (NetkWindow *window);
    gboolean            netk_window_get_icon_is_fallback    (NetkWindow *window);
    void                netk_window_set_icon_geometry       (NetkWindow *window,
                                                             int x,
                                                             int y,
                                                             int width,
                                                             int height);
    NetkWindowActions   netk_window_get_actions             (NetkWindow *window);
    NetkWindowState     netk_window_get_state               (NetkWindow *window);
    void                netk_window_get_geometry            (NetkWindow *window,
                                                             int *xp,
                                                             int *yp,
                                                             int *widthp,
                                                             int *heightp);
    gboolean            netk_window_is_visible_on_workspace (NetkWindow *window,
                                                             NetkWorkspace *workspace);
    gboolean            netk_window_is_on_workspace         (NetkWindow *window,
                                                             NetkWorkspace *workspace);
    gboolean            netk_window_is_in_viewport          (NetkWindow *window,
                                                             NetkWorkspace *workspace);

## Description

Represents a window for the window manager

## Details

### NetkWindow

    typedef struct {
        GObject parent_instance;

        NetkWindowPrivate *priv;
    } NetkWindow;

### enum NetkWindowState

    typedef enum
    {
        NETK_WINDOW_STATE_MINIMIZED = 1 << 0,
        NETK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY = 1 << 1,
        NETK_WINDOW_STATE_MAXIMIZED_VERTICALLY = 1 << 2,
        NETK_WINDOW_STATE_SHADED = 1 << 3,
        NETK_WINDOW_STATE_SKIP_PAGER = 1 << 4,
        NETK_WINDOW_STATE_SKIP_TASKLIST = 1 << 5,
        NETK_WINDOW_STATE_STICKY = 1 << 6,
        NETK_WINDOW_STATE_HIDDEN = 1 << 7,
        NETK_WINDOW_STATE_FULLSCREEN = 1 << 8,
        NETK_WINDOW_STATE_URGENT = 1 << 9,
        NETK_WINDOW_STATE_DEMANDS_ATTENTION = 1 << 10
    }
    NetkWindowState;

### enum NetkWindowActions

    typedef enum
    {
        NETK_WINDOW_ACTION_MOVE = 1 << 0,
        NETK_WINDOW_ACTION_RESIZE = 1 << 1,
        NETK_WINDOW_ACTION_SHADE = 1 << 2,
        NETK_WINDOW_ACTION_STICK = 1 << 3,
        NETK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY = 1 << 4,
        NETK_WINDOW_ACTION_MAXIMIZE_VERTICALLY = 1 << 5,
        NETK_WINDOW_ACTION_CHANGE_WORKSPACE = 1 << 6,       /* includes pin/unpin */
        NETK_WINDOW_ACTION_CLOSE = 1 << 7,
        NETK_WINDOW_ACTION_UNMAXIMIZE_HORIZONTALLY = 1 << 8,
        NETK_WINDOW_ACTION_UNMAXIMIZE_VERTICALLY = 1 << 9,
        NETK_WINDOW_ACTION_UNSHADE = 1 << 10,
        NETK_WINDOW_ACTION_UNSTICK = 1 << 11,
        NETK_WINDOW_ACTION_MINIMIZE = 1 << 12,
        NETK_WINDOW_ACTION_UNMINIMIZE = 1 << 13,
        NETK_WINDOW_ACTION_MAXIMIZE = 1 << 14,
        NETK_WINDOW_ACTION_UNMAXIMIZE = 1 << 15
    }
    NetkWindowActions;

### enum NetkWindowType

    typedef enum
    {
        NETK_WINDOW_NORMAL,         /* document/app window */
        NETK_WINDOW_DESKTOP,        /* desktop background */
        NETK_WINDOW_DOCK,           /* panel */
        NETK_WINDOW_DIALOG,         /* dialog */
        NETK_WINDOW_MODAL_DIALOG,   /* modal dialog */
        NETK_WINDOW_TOOLBAR,        /* tearoff toolbar */
        NETK_WINDOW_MENU,           /* tearoff menu */
        NETK_WINDOW_UTILITY,        /* palette/toolbox window */
        NETK_WINDOW_SPLASHSCREEN    /* splash screen */
    }
    NetkWindowType;

### netk_window_get_type ()

    GType               netk_window_get_type                (void);

Returns :

  the gtype of NetkWindow

### netk_window_get ()

    NetkWindow*         netk_window_get                     (gulong xwindow);

Gets a preexisting NetkWindow for the X window `xwindow`. Will not create a NetkWindow if none exists. Robust against bogus window IDs.

`xwindow` :

  an Xlib window ID

Returns :

  the NetkWindow for this X window

### netk_window_get_screen ()

    NetkScreen*         netk_window_get_screen              (NetkWindow *window);

Gets the screen this window is on.

`window` :

  a NetkWindow

Returns :

  a NetkScreen

### netk_window_get_name ()

    const char*         netk_window_get_name                (NetkWindow *window);

Gets the name of the window, as it should be displayed in a pager or tasklist. Always returns some value, even if the window hasn't set a name.

For icons titles, use `netk_window_get_icon_name()` instead.

`window` :

  a NetkWindow

Returns :

  name of the window

### netk_window_get_icon_name ()

    const char*         netk_window_get_icon_name           (NetkWindow *window);

Gets the name of the window, as it should be displayed for an icon. Always returns some value, even if the window hasn't set a name. Contrast with `netk_window_get_name()`, which returns the window title, not the icon title.

`window` :

  a NetkWindow

Returns :

  name of the window

### netk_window_get_application ()

    NetkApplication*    netk_window_get_application         (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the application that owns the window, or NULL. refcount is not incremented for the caller,

### netk_window_get_group_leader ()

    gulong              netk_window_get_group_leader        (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  group leader, or None on failure. XXX what is that gulong is that X ?

  Returns the group leader, or None.

### netk_window_get_xid ()

    gulong              netk_window_get_xid                 (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the X window id of the window, or None if the NetkWindow instance was invalid.

### netk_window_get_class_group ()

    NetkClassGroup*     netk_window_get_class_group         (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the class group, or NULL. it's reference count is not increased.

### netk_window_get_session_id ()

    const char*         netk_window_get_session_id          (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the session id, or NULL. do not free result.

### netk_window_get_session_id_utf8 ()

    const char*         netk_window_get_session_id_utf8     (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the session id in utf-8 format, or NULL

  XXX what does that implementation do

### netk_window_get_pid ()

    int                 netk_window_get_pid                 (NetkWindow *window);

Gets the process ID of `window`, if available.

`window` :

  a NetkWindow

Returns :

  PID of `window`, or 0 if none available

### netk_window_get_window_type ()

    NetkWindowType      netk_window_get_window_type         (NetkWindow *window);

Retrieves the semantic type of the window.

`window` :

  a NetkWindow

Returns :

  semantic type

### netk_window_get_resource_class ()

    const char*         netk_window_get_resource_class      (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the resource class name, or NULL. do not free result.

### netk_window_is_minimized ()

    gboolean            netk_window_is_minimized            (NetkWindow *window);

If the window is minimized returns `TRUE`. Minimization state may change anytime a state_changed signal gets emitted.

`window` :

  a NetkWindow

Returns :

  `TRUE` if window is minimized

### netk_window_is_maximized_horizontally ()

    gboolean            netk_window_is_maximized_horizontally
                                                            (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  if the window is maximized horizontally, FALSE on failure

### netk_window_is_maximized_vertically ()

    gboolean            netk_window_is_maximized_vertically (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  if the window is maximized vertically, FALSE on failure

### netk_window_is_maximized ()

    gboolean            netk_window_is_maximized            (NetkWindow *window);

As for GDK, "maximized" means both vertically and horizontally. If only one, then the window isn't considered maximized.

`window` :

  a NetkWindow

Returns :

  `TRUE` if the window is maximized in both directions

### netk_window_is_shaded ()

    gboolean            netk_window_is_shaded               (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  if the window is shaded, FALSE on failure

### netk_window_is_skip_pager ()

    gboolean            netk_window_is_skip_pager           (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  if the window has the skip pager hint set, FALSE on failure

### netk_window_is_skip_tasklist ()

    gboolean            netk_window_is_skip_tasklist        (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  if the window has the skip tasklist hint set, FALSE on failure

### netk_window_is_sticky ()

    gboolean            netk_window_is_sticky               (NetkWindow *window);

Sticky here means "stuck to the glass," i.e. does not scroll with the viewport. In GDK/GTK, e.g. `gdk_window_stick()`/`gtk_window_stick()`, sticky means stuck to the glass and _also_ that the window is on all workspaces. But here it only means the viewport aspect of it.

`window` :

  a NetkWindow

Returns :

  `TRUE` if the window is "stuck to the glass"

### netk_window_set_skip_pager ()

    void                netk_window_set_skip_pager          (NetkWindow *window,
                                                             gboolean skip);

`window` :

  the NetkWindow instance

`skip` :

  whether to enable the skip hint

  sets or unsets the skip pager hint.

### netk_window_set_skip_tasklist ()

    void                netk_window_set_skip_tasklist       (NetkWindow *window,
                                                             gboolean skip);

`window` :

  the NetkWindow instance

`skip` :

  whether to enable the skip hint

  sets or unsets the skip tasklist hint.

### netk_window_close ()

    void                netk_window_close                   (NetkWindow *window);

`window` :

  the NetkWindow instance

  Try to close the netk window

### netk_window_minimize ()

    void                netk_window_minimize                (NetkWindow *window);

`window` :

  the NetkWindow instance

  Iconifies the window

### netk_window_unminimize ()

    void                netk_window_unminimize              (NetkWindow *window);

`window` :

  the NetkWindow instance

  Deiconifies the window

### netk_window_maximize ()

    void                netk_window_maximize                (NetkWindow *window);

`window` :

  the NetkWindow instance

  Maximizes the window

### netk_window_unmaximize ()

    void                netk_window_unmaximize              (NetkWindow *window);

`window` :

  the NetkWindow instance

  Unmaximizes the window

### netk_window_maximize_horizontally ()

    void                netk_window_maximize_horizontally   (NetkWindow *window);

`window` :

  the NetkWindow instance

### netk_window_unmaximize_horizontally ()

    void                netk_window_unmaximize_horizontally (NetkWindow *window);

`window` :

  the NetkWindow instance

### netk_window_maximize_vertically ()

    void                netk_window_maximize_vertically     (NetkWindow *window);

`window` :

  the NetkWindow instance

### netk_window_unmaximize_vertically ()

    void                netk_window_unmaximize_vertically   (NetkWindow *window);

`window` :

  the NetkWindow instance

### netk_window_shade ()

    void                netk_window_shade                   (NetkWindow *window);

`window` :

  the NetkWindow instance

  Shades the window. A shaded window is "rolled up".

### netk_window_unshade ()

    void                netk_window_unshade                 (NetkWindow *window);

`window` :

  the NetkWindow instance

### netk_window_stick ()

    void                netk_window_stick                   (NetkWindow *window);

`window` :

  the NetkWindow instance

  Sets the sticky state. Sticky windows are XXX.

### netk_window_unstick ()

    void                netk_window_unstick                 (NetkWindow *window);

`window` :

  the NetkWindow instance

### netk_window_keyboard_move ()

    void                netk_window_keyboard_move           (NetkWindow *window);

`window` :

  the NetkWindow instance

  enters keyboard move mode for the window.

### netk_window_keyboard_size ()

    void                netk_window_keyboard_size           (NetkWindow *window);

`window` :

  the NetkWindow instance

  enters keyboard size mode for the window.

### netk_window_get_workspace ()

    NetkWorkspace*      netk_window_get_workspace           (NetkWindow *window);

Gets the window's current workspace. If the window is pinned (on all workspaces), or not on any workspaces, `NULL` may be returned.

`window` :

  a NetkWindow

Returns :

  single current workspace or `NULL`

### netk_window_move_to_workspace ()

    void                netk_window_move_to_workspace       (NetkWindow *window,
                                                             NetkWorkspace *space);

`window` :

  the NetkWindow instance

`space` :

  the workspace to move the window to

  moves the window to the given workspace

### netk_window_is_pinned ()

    gboolean            netk_window_is_pinned               (NetkWindow *window);

`TRUE` if the window is on all workspaces. Note that if this changes, it's signalled by a workspace_changed signal, not state_changed.

`window` :

  a NetkWindow

Returns :

  `TRUE` if on all workspaces

### netk_window_pin ()

    void                netk_window_pin                     (NetkWindow *window);

`window` :

  the NetkWindow instance

  Pins the window. A pinned window is on all workspaces.

### netk_window_unpin ()

    void                netk_window_unpin                   (NetkWindow *window);

Sets `window`'s workspace to only the currently active workspace, if the window was previously pinned. If the window wasn't pinned, doesn't change the window's workspace. If the active workspace isn't known for some reason (shouldn't happen much), sets the window's workspace to 0.

`window` :

  a NetkWindow

### netk_window_activate ()

    void                netk_window_activate                (NetkWindow *window);

Ask the window manager to make `window` the active window. The window manager may choose to raise `window` along with focusing it.

`window` :

  a NetkWindow

### netk_window_is_active ()

    gboolean            netk_window_is_active               (NetkWindow *window);

`window` :

  a NetkWindow

Returns :

  `TRUE` if the window is the active window

### netk_window_activate_transient ()

    void                netk_window_activate_transient      (NetkWindow *window);

If `window` has transients, activates the most likely transient instead of the window itself. Otherwise activates `window`.

FIXME the ideal behavior of this function is probably to activate the most recently active window among `window` and its transients. This is probably best implemented on the window manager side.

`window` :

  a NetkWindow

### netk_window_get_icon ()

    GdkPixbuf*          netk_window_get_icon                (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the pixbuf of the icon of the window, or NULL. result refcount is not touched.

### netk_window_get_mini_icon ()

    GdkPixbuf*          netk_window_get_mini_icon           (NetkWindow *window);

`window` :

  the NetkWindow instance

Returns :

  the pixbuf of the mini icon of the window, or NULL. result refcount is not touched.

### netk_window_get_icon_is_fallback ()

    gboolean            netk_window_get_icon_is_fallback    (NetkWindow *window);

Checks if we are using a default fallback icon because none was set on the window.

`window` :

  a NetkWindow

Returns :

  `TRUE` if icon is a fallback

### netk_window_set_icon_geometry ()

    void                netk_window_set_icon_geometry       (NetkWindow *window,
                                                             int x,
                                                             int y,
                                                             int width,
                                                             int height);

Set the icon geometry for a NetkWindow.

`window` :

  a NetkWindow

`x` :

  x coordinate in pixels

`y` :

  y coordinate in pixels

`width` :

  width in pixels

`height` :

  height in pixels

### netk_window_get_actions ()

    NetkWindowActions   netk_window_get_actions             (NetkWindow *window);

Gets the window operations that should be sensitive for `window`.

`window` :

  a NetkWindow

Returns :

  bitmask of actions the window supports

### netk_window_get_state ()

    NetkWindowState     netk_window_get_state               (NetkWindow *window);

Gets the state of a window as a bitmask.

`window` :

  a NetkWindow

Returns :

  bitmask of active state flags.

### netk_window_get_geometry ()

    void                netk_window_get_geometry            (NetkWindow *window,
                                                             int *xp,
                                                             int *yp,
                                                             int *widthp,
                                                             int *heightp);

Gets the size and position of the window, as last received in a configure notify (i.e. this call does not round-trip to the server, just gets the last size we were notified of). The X and Y coordinates are relative to the root window.

`window` :

  a NetkWindow

`xp` :

  return location for X coordinate of window

`yp` :

  return location for Y coordinate of window

`widthp` :

  return location for width of window

`heightp` :

  return location for height of window

### netk_window_is_visible_on_workspace ()

    gboolean            netk_window_is_visible_on_workspace (NetkWindow *window,
                                                             NetkWorkspace *workspace);

Like `netk_window_is_on_workspace()`, but also checks that the window is in a visible state (i.e. not minimized or shaded).

`window` :

  a NetkWindow

`workspace` :

  a NetkWorkspace

Returns :

  `TRUE` if `window` appears on `workspace` in normal state

### netk_window_is_on_workspace ()

    gboolean            netk_window_is_on_workspace         (NetkWindow *window,
                                                             NetkWorkspace *workspace);

`window` :

  a NetkWindow

`workspace` :

  a NetkWorkspace

Returns :

  `TRUE` if `window` appears on `workspace`

### netk_window_is_in_viewport ()

    gboolean            netk_window_is_in_viewport          (NetkWindow *window,
                                                             NetkWorkspace *workspace);

Returns TRUE if the window is inside the current viewport of the given workspace.

`window` :

  a NetkWindow

`workspace` :

  a NetkWorkspace

Returns :

  `TRUE` if `window` appears in current viewport