Data Structures | Macros | Typedefs | Enumerations | Functions
gntwm.h File Reference
GNT (GLib Ncurses Toolkit)

Window-manager API. More...

`#include "gntwidget.h"`
`#include "gntmenu.h"`
`#include "gntws.h"`
`#include <panel.h>`
`#include <time.h>`

Go to the source code of this file.

## Data Structures
struct | _GntNode
struct | _GntPosition
struct | _GntAction
| An application can register actions which will show up in a 'start-menu' like popup. More...
struct | _GntWM
struct | _GntWMClass

## Macros
#define | GNT_TYPE_WM (gnt_wm_get_gtype())
#define | GNT_WM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WM, GntWM))
#define | GNT_WM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_WM, GntWMClass))
#define | GNT_IS_WM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WM))
#define | GNT_IS_WM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WM))
#define | GNT_WM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WM, GntWMClass))

## Typedefs
typedef enum _GntKeyPressMode | GntKeyPressMode
typedef struct _GntNode | GntNode
typedef struct _GntWM | GntWM
typedef struct _GntPosition | GntPosition
typedef struct _GntAction | GntAction
| An application can register actions which will show up in a 'start-menu' like popup.
typedef struct _GntWMClass | GntWMClass

## Enumerations
enum | _GntKeyPressMode { GNT_KP_MODE_NORMAL, GNT_KP_MODE_RESIZE, GNT_KP_MODE_MOVE, GNT_KP_MODE_WAIT_ON_CHILD }

## Functions
G_BEGIN_DECLS GType | gnt_wm_get_gtype (void)
void | gnt_wm_add_workspace (GntWM *wm, GntWS *ws)
| Add a workspace. More...
gboolean | gnt_wm_switch_workspace (GntWM *wm, gint n)
| Switch to a workspace. More...
gboolean | gnt_wm_switch_workspace_prev (GntWM *wm)
| Switch to the previous workspace from the current one. More...
gboolean | gnt_wm_switch_workspace_next (GntWM *wm)
| Switch to the next workspace from the current one. More...
void | gnt_wm_widget_move_workspace (GntWM *wm, GntWS *neww, GntWidget *widget)
| Move a window to a specific workspace. More...
void | gnt_wm_set_workspaces (GntWM *wm, GList *workspaces)
| Set the list of workspaces . More...
GntWS * | gnt_wm_widget_find_workspace (GntWM *wm, GntWidget *widget)
| Find the workspace that contains a specific widget. More...
void | gnt_wm_new_window (GntWM *wm, GntWidget *widget)
| Process a new window. More...
void | gnt_wm_window_decorate (GntWM *wm, GntWidget *widget)
| Decorate a window. More...
void | gnt_wm_window_close (GntWM *wm, GntWidget *widget)
| Close a window. More...
gboolean | gnt_wm_process_input (GntWM *wm, const char *string)
| Process input. More...
gboolean | gnt_wm_process_click (GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget)
| Process a click event. More...
void | gnt_wm_resize_window (GntWM *wm, GntWidget *widget, int width, int height)
| Resize a window. More...
void | gnt_wm_move_window (GntWM *wm, GntWidget *widget, int x, int y)
| Move a window. More...
void | gnt_wm_update_window (GntWM *wm, GntWidget *widget)
| Update a window. More...
void | gnt_wm_raise_window (GntWM *wm, GntWidget *widget)
| Raise a window. More...
void | gnt_wm_set_event_stack (GntWM *wm, gboolean set)
void | gnt_wm_copy_win (GntWidget *widget, GntNode *node)
time_t | gnt_wm_get_idle_time (void)

## Detailed Description

Window-manager API.

Definition in file gntwm.h.

## Function Documentation

## ◆ gnt_wm_add_workspace()

void gnt_wm_add_workspace | ( | GntWM * | wm,
|  | GntWS * | ws
| ) |  |

Add a workspace.

Parameters

  wm | The window-manager.
  ws | The workspace to add.

## ◆ gnt_wm_get_gtype()

G_BEGIN_DECLS GType gnt_wm_get_gtype | ( | void |  | ) |

Returns
  GType for GntWM.

## ◆ gnt_wm_get_idle_time()

time_t gnt_wm_get_idle_time | ( | void |  | ) |

Returns
  The idle time of the user.

## ◆ gnt_wm_move_window()

void gnt_wm_move_window | ( | GntWM * | wm,
|  | GntWidget * | widget,
|  | int | x,
|  | int | y
| ) |  |

Move a window.

Parameters

  wm | The window manager.
  widget | The window to move.
  x | The desired x-coordinate of the window.
  y | The desired y-coordinate of the window.

## ◆ gnt_wm_new_window()

void gnt_wm_new_window | ( | GntWM * | wm,
|  | GntWidget * | widget
| ) |  |

Process a new window.

Parameters

  wm | The window-manager.
  widget | The new window.

## ◆ gnt_wm_process_click()

gboolean gnt_wm_process_click | ( | GntWM * | wm,
|  | GntMouseEvent | event,
|  | int | x,
|  | int | y,
|  | GntWidget * | widget
| ) |  |

Process a click event.

Parameters

  wm | The window manager.
  event | The mouse event.
  x | The x-coordinate of the mouse.
  y | The y-coordinate of the mouse.
  widget | The widget under the mouse.

Returns
  `TRUE` if the event was handled, `FALSE` otherwise.

## ◆ gnt_wm_process_input()

gboolean gnt_wm_process_input | ( | GntWM * | wm,
|  | const char * | string
| ) |  |

Process input.

Parameters

  wm | The window-manager.
  string | The input string to process.

Returns
  `TRUE` of the string was processed, `FALSE` otherwise.

## ◆ gnt_wm_raise_window()

void gnt_wm_raise_window | ( | GntWM * | wm,
|  | GntWidget * | widget
| ) |  |

Raise a window.

Parameters

  wm | The window-manager.
  widget | The window to raise.

## ◆ gnt_wm_resize_window()

void gnt_wm_resize_window | ( | GntWM * | wm,
|  | GntWidget * | widget,
|  | int | width,
|  | int | height
| ) |  |

Resize a window.

Parameters

  wm | The window manager.
  widget | The window to resize.
  width | The desired width of the window.
  height | The desired height of the window.

## ◆ gnt_wm_set_workspaces()

void gnt_wm_set_workspaces | ( | GntWM * | wm,
|  | GList * | workspaces
| ) |  |

Set the list of workspaces .

Parameters

  wm | The window manager.
  workspaces | The list of workspaces.

## ◆ gnt_wm_switch_workspace()

gboolean gnt_wm_switch_workspace | ( | GntWM * | wm,
|  | gint | n
| ) |  |

Switch to a workspace.

Parameters

  wm | The window-manager.
  n | Index of the workspace to switch to.

Returns
  `TRUE` if the switch was successful.

## ◆ gnt_wm_switch_workspace_next()

gboolean gnt_wm_switch_workspace_next | ( | GntWM * | wm | ) |

Switch to the next workspace from the current one.

Parameters

  wm | The window-manager.

## ◆ gnt_wm_switch_workspace_prev()

gboolean gnt_wm_switch_workspace_prev | ( | GntWM * | wm | ) |

Switch to the previous workspace from the current one.

Parameters

  wm | The window-manager.

## ◆ gnt_wm_update_window()

void gnt_wm_update_window | ( | GntWM * | wm,
|  | GntWidget * | widget
| ) |  |

Update a window.

Parameters

  wm | The window-manager.
  widget | The window to update.

## ◆ gnt_wm_widget_find_workspace()

GntWS* gnt_wm_widget_find_workspace | ( | GntWM * | wm,
|  | GntWidget * | widget
| ) |  |

Find the workspace that contains a specific widget.

Parameters

  wm | The window-manager.
  widget | The widget to find.

Returns
  The workspace that has the widget.

## ◆ gnt_wm_widget_move_workspace()

void gnt_wm_widget_move_workspace | ( | GntWM * | wm,
|  | GntWS * | neww,
|  | GntWidget * | widget
| ) |  |

Move a window to a specific workspace.

Parameters

  wm | The window manager.
  neww | The new workspace.
  widget | The widget to move.

## ◆ gnt_wm_window_close()

void gnt_wm_window_close | ( | GntWM * | wm,
|  | GntWidget * | widget
| ) |  |

Close a window.

Parameters

  wm | The window-manager.
  widget | The window to close.

## ◆ gnt_wm_window_decorate()

void gnt_wm_window_decorate | ( | GntWM * | wm,
|  | GntWidget * | widget
| ) |  |

Decorate a window.

Parameters

  wm | The window-manager.
  widget | The widget to decorate.