Macros | Functions
gnt.h File Reference

GNT API. More...

#include <glib.h>
#include "gntwidget.h"
#include "gntclipboard.h"
#include "gntcolors.h"
#include "gntkeys.h"

Go to the source code of this file.

Macros

#define G_PARAM_STATIC_NAME   G_PARAM_PRIVATE
 Get things to compile in Glib < 2.8.
 
#define G_PARAM_STATIC_NICK   G_PARAM_PRIVATE
 
#define G_PARAM_STATIC_BLURB   G_PARAM_PRIVATE
 
#define g_timeout_add_seconds(time, callback, data)   g_timeout_add(time * 1000, callback, data)
 

Functions

void gnt_init (void)
 Initialize GNT.
 
void gnt_main (void)
 Start running the mainloop for gnt.
 
gboolean gnt_ascii_only (void)
 Check whether the terminal is capable of UTF8 display. More...
 
void gnt_window_present (GntWidget *window)
 Present a window. More...
 
void gnt_screen_occupy (GntWidget *widget)
 
void gnt_screen_release (GntWidget *widget)
 
void gnt_screen_update (GntWidget *widget)
 
void gnt_screen_resize_widget (GntWidget *widget, int width, int height)
 Resize a widget. More...
 
void gnt_screen_move_widget (GntWidget *widget, int x, int y)
 Move a widget. More...
 
void gnt_screen_rename_widget (GntWidget *widget, const char *text)
 Rename a widget. More...
 
gboolean gnt_widget_has_focus (GntWidget *widget)
 Check whether a widget has focus. More...
 
void gnt_widget_set_urgent (GntWidget *widget)
 Set the URGENT hint for a widget. More...
 
void gnt_register_action (const char *label, void(*callback)(void))
 Register a global action. More...
 
gboolean gnt_screen_menu_show (gpointer menu)
 Show a menu. More...
 
void gnt_quit (void)
 Terminate the mainloop of gnt.
 
GntClipboardgnt_get_clipboard (void)
 Get the global clipboard. More...
 
gchar * gnt_get_clipboard_string (void)
 Get the string in the clipboard. More...
 
void gnt_set_clipboard_string (const gchar *string)
 Set the contents of the global clipboard. More...
 
gboolean gnt_giveup_console (const char *wd, char **argv, char **envp, gint *stin, gint *stout, gint *sterr, void(*callback)(int status, gpointer data), gpointer data)
 Spawn a different application that will consume the console. More...
 
gboolean gnt_is_refugee (void)
 Check whether a child process is in control of the current terminal. More...
 

Detailed Description

GNT API.

Definition in file gnt.h.

Function Documentation

gboolean gnt_ascii_only ( void  )

Check whether the terminal is capable of UTF8 display.

Returns
FALSE if the terminal is capable of drawing UTF-8, TRUE otherwise.
GntClipboard* gnt_get_clipboard ( void  )

Get the global clipboard.

Returns
The clipboard.
gchar* gnt_get_clipboard_string ( void  )

Get the string in the clipboard.

Returns
A copy of the string in the clipboard. The caller must g_free the string.
gboolean gnt_giveup_console ( const char *  wd,
char **  argv,
char **  envp,
gint *  stin,
gint *  stout,
gint *  sterr,
void(*)(int status, gpointer data)  callback,
gpointer  data 
)

Spawn a different application that will consume the console.

Parameters
wdThe working directory for the new application.
argvThe argument vector.
envpThe environment, or NULL.
stinLocation to store the child's stdin, or NULL.
stoutLocation to store the child's stdout, or NULL.
sterrLocation to store the child's stderr, or NULL.
callbackThe callback to call after the child exits.
dataThe data to pass to the callback.
Returns
TRUE if the child was successfully spawned, FALSE otherwise.
gboolean gnt_is_refugee ( void  )

Check whether a child process is in control of the current terminal.

Returns
TRUE if a child process (eg., PAGER) is occupying the current terminal, FALSE otherwise.
void gnt_register_action ( const char *  label,
void(*)(void)  callback 
)

Register a global action.

Parameters
labelThe user-visible label for the action.
callbackThe callback function for the action.
gboolean gnt_screen_menu_show ( gpointer  menu)

Show a menu.

Parameters
menuThe menu to display.
Returns
TRUE if the menu is displayed, FALSE otherwise (e.g., if another menu is currently displayed).
void gnt_screen_move_widget ( GntWidget widget,
int  x,
int  y 
)

Move a widget.

Parameters
widgetThe widget to move.
xThe desired x-coordinate.
yThe desired y-coordinate.
void gnt_screen_rename_widget ( GntWidget widget,
const char *  text 
)

Rename a widget.

Parameters
widgetThe widget to rename.
textThe new name for the widget.
void gnt_screen_resize_widget ( GntWidget widget,
int  width,
int  height 
)

Resize a widget.

Parameters
widgetThe widget to resize.
widthThe desired width.
heightThe desired height.
void gnt_set_clipboard_string ( const gchar *  string)

Set the contents of the global clipboard.

Parameters
stringThe new content of the new clipboard.
gboolean gnt_widget_has_focus ( GntWidget widget)

Check whether a widget has focus.

Parameters
widgetThe widget.
Returns
TRUE if the widget has the current focus, FALSE otherwise.
void gnt_widget_set_urgent ( GntWidget widget)

Set the URGENT hint for a widget.

Parameters
widgetThe widget to set the URGENT hint for.
void gnt_window_present ( GntWidget window)

Present a window.

If the event was triggered because of user interaction, the window is moved to the foreground. Otherwise, the Urgent hint is set.

Parameters
windowThe window the present.
Since
2.0.0 (gnt), 2.1.0 (pidgin)