NetkScreen
3
LIBXFCEGUI4 Library

# NetkScreen

Represents a screen

## Synopsis

    #include <libxfcegui4/libxfcegui4.h>

                        NetkScreen;
    GType               netk_screen_get_type                (void);
    NetkScreen*         netk_screen_get_default             (void);
    NetkScreen*         netk_screen_get                     (int index);
    NetkScreen*         netk_screen_get_for_root            (gulong root_window_id);
    NetkWorkspace*      netk_screen_get_workspace           (NetkScreen *screen,
                                                             int workspace);
    NetkWorkspace*      netk_screen_get_active_workspace    (NetkScreen *screen);
    GList*              netk_screen_get_windows             (NetkScreen *screen);
    GList*              netk_screen_get_windows_stacked     (NetkScreen *screen);
    void                netk_screen_force_update            (NetkScreen *screen);
    int                 netk_screen_get_workspace_count     (NetkScreen *screen);
    void                netk_screen_change_workspace_count  (NetkScreen *screen,
                                                             int count);
    gboolean            netk_screen_net_wm_supports         (NetkScreen *screen,
                                                             const char *atom);
    gulong              netk_screen_get_background_pixmap   (NetkScreen *screen);
    int                 netk_screen_get_width               (NetkScreen *screen);
    int                 netk_screen_get_height              (NetkScreen *screen);
    gboolean            netk_screen_get_showing_desktop     (NetkScreen *screen);
    void                netk_screen_toggle_showing_desktop  (NetkScreen *screen,
                                                             gboolean show);
    void                netk_screen_move_viewport           (NetkScreen *screen,
                                                             int x,
                                                             int y);
    void                netk_screen_release_workspace_layout
                                                            (NetkScreen *screen,
                                                             int current_token);

## Description

NetkScreen represents a screen

## Details

### NetkScreen

    typedef struct {
        GObject parent_instance;

        NetkScreenPrivate *priv;
    } NetkScreen;

### netk_screen_get_type ()

    GType               netk_screen_get_type                (void);

Returns :

  the gtype for the NetkScreen class

### netk_screen_get_default ()

    NetkScreen*         netk_screen_get_default             (void);

Returns :

  the default screen. refcount NOT touched. beware.

### netk_screen_get ()

    NetkScreen*         netk_screen_get                     (int index);

Gets the NetkScreen for a given screen on the default display. Creates the NetkScreen if necessary.

`index` :

  screen number, starting from 0, as for Xlib

Returns :

  the NetkScreen for screen `index`

### netk_screen_get_for_root ()

    NetkScreen*         netk_screen_get_for_root            (gulong root_window_id);

Gets the NetkScreen for the root window at `root_window_id`, or returns `NULL` if no NetkScreen exists for this root window. Never creates a new NetkScreen, unlike `netk_screen_get()`.

`root_window_id` :

  an Xlib window ID

Returns :

  NetkScreen or `NULL`

### netk_screen_get_workspace ()

    NetkWorkspace*      netk_screen_get_workspace           (NetkScreen *screen,
                                                             int workspace);

Gets the workspace numbered `number` for screen `screen`, or returns `NULL` if no such workspace exists.

`screen` :

  a NetkScreen

`workspace` :

  the workspace number. starting with 0. XXX

Returns :

  the workspace, or `NULL`

### netk_screen_get_active_workspace ()

    NetkWorkspace*      netk_screen_get_active_workspace    (NetkScreen *screen);

Gets the active workspace. May return `NULL` sometimes, if we are in a weird state due to the asynchronous nature of our interaction with the window manager.

`screen` :

  a NetkScreen

Returns :

  active workspace or `NULL`

### netk_screen_get_windows ()

    GList*              netk_screen_get_windows             (NetkScreen *screen);

Gets the screen's list of windows. The list is not copied and should not be freed. The list is not in a defined order, but should be "stable" (windows shouldn't reorder themselves in it). (However, the stability of the list is established by the window manager, so don't blame libnetk if it breaks down.)

`screen` :

  a NetkScreen

Returns :

  reference to list of windows

### netk_screen_get_windows_stacked ()

    GList*              netk_screen_get_windows_stacked     (NetkScreen *screen);

Gets the screen's list of windows in bottom-to-top order. The list is not copied and should not be freed.

`screen` :

  a NetkScreen

Returns :

  reference to list of windows in stacking order

### netk_screen_force_update ()

    void                netk_screen_force_update            (NetkScreen *screen);

Synchronously and immediately update the window list. This is usually a bad idea for both performance and correctness reasons (to get things right, you need to write model-view code that tracks changes, not get a static list of open windows).

`screen` :

  a NetkScreen

### netk_screen_get_workspace_count ()

    int                 netk_screen_get_workspace_count     (NetkScreen *screen);

Gets the number of workspaces.

`screen` :

  a NetkScreen

Returns :

  number of workspaces

### netk_screen_change_workspace_count ()

    void                netk_screen_change_workspace_count  (NetkScreen *screen,
                                                             int count);

Asks the window manager to change the number of workspaces.

`screen` :

  a NetkScreen

`count` :

  requested count

### netk_screen_net_wm_supports ()

    gboolean            netk_screen_net_wm_supports         (NetkScreen *screen,
                                                             const char *atom);

`screen` :

  The NetkScreen instance

`atom` :

  the atom of the capability to check for

Returns :

  if it is supported

### netk_screen_get_background_pixmap ()

    gulong              netk_screen_get_background_pixmap   (NetkScreen *screen);

`screen` :

  The NetkScreen instance

Returns :

  a gulong XXX

### netk_screen_get_width ()

    int                 netk_screen_get_width               (NetkScreen *screen);

`screen` :

  The NetkScreen instance

Returns :

  width of the screen, XXX border? XXX fail condition?

### netk_screen_get_height ()

    int                 netk_screen_get_height              (NetkScreen *screen);

`screen` :

  The NetkScreen instance

Returns :

  height of the screen, XXX border? XXX fail condition?

### netk_screen_get_showing_desktop ()

    gboolean            netk_screen_get_showing_desktop     (NetkScreen *screen);

`screen` :

  The NetkScreen instance

Returns :

  if showing the desktop, or FALSE on failure

### netk_screen_toggle_showing_desktop ()

    void                netk_screen_toggle_showing_desktop  (NetkScreen *screen,
                                                             gboolean show);

`screen` :

  The NetkScreen instance

`show` :

  if wanting to show desktop

### netk_screen_move_viewport ()

    void                netk_screen_move_viewport           (NetkScreen *screen,
                                                             int x,
                                                             int y);

Ask window manager to move the viewport of the current workspace.

`screen` :

  a NetkScreen

`x` :

  X offset of viewport

`y` :

  Y offset of viewport

### netk_screen_release_workspace_layout ()

    void                netk_screen_release_workspace_layout
                                                            (NetkScreen *screen,
                                                             int current_token);

`screen` :

  The NetkScreen instance

`current_token` :

  the token XXX

  releases the layout with the given token