comparison finch/libgnt/gnt.h @ 21161:e119edfc0fb0

applied changes from 172a59b41412c4630834d66f2e7ec3be970cc36b through 365b126365cc18309aea7f8eef0e9b2a19e6bda8 And others.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 07 Nov 2007 14:07:52 +0000
parents bddf964880cf
children
comparison
equal deleted inserted replaced
21160:45e550db32ab 21161:e119edfc0fb0
44 #define G_PARAM_STATIC_NICK G_PARAM_PRIVATE 44 #define G_PARAM_STATIC_NICK G_PARAM_PRIVATE
45 #define G_PARAM_STATIC_BLURB G_PARAM_PRIVATE 45 #define G_PARAM_STATIC_BLURB G_PARAM_PRIVATE
46 #endif 46 #endif
47 47
48 /** 48 /**
49 * 49 * Initialize GNT.
50 */ 50 */
51 void gnt_init(void); 51 void gnt_init(void);
52 52
53 /** 53 /**
54 * 54 * Start running the mainloop for gnt.
55 */ 55 */
56 void gnt_main(void); 56 void gnt_main(void);
57 57
58 /** 58 /**
59 * 59 * Check whether the terminal is capable of UTF8 display.
60 * 60 *
61 * @return 61 * @return @c FALSE if the terminal is capable of drawing UTF-8, @c TRUE otherwise.
62 */ 62 */
63 gboolean gnt_ascii_only(void); 63 gboolean gnt_ascii_only(void);
64 64
65 /** 65 /**
66 * Present a window. If the event was triggered because of user interaction, 66 * Present a window. If the event was triggered because of user interaction,
69 * @param window The window the present. 69 * @param window The window the present.
70 * 70 *
71 * @since 2.0.0 (gnt), 2.1.0 (pidgin) 71 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
72 */ 72 */
73 void gnt_window_present(GntWidget *window); 73 void gnt_window_present(GntWidget *window);
74 /** 74
75 * 75 /**
76 * @param widget 76 * @internal
77 * Use #gnt_widget_show instead.
77 */ 78 */
78 void gnt_screen_occupy(GntWidget *widget); 79 void gnt_screen_occupy(GntWidget *widget);
79 80
80 /** 81 /**
81 * 82 * @internal
82 * @param widget 83 * Use #gnt_widget_hide instead.
83 */ 84 */
84 void gnt_screen_release(GntWidget *widget); 85 void gnt_screen_release(GntWidget *widget);
85 86
86 /** 87 /**
87 * 88 * @internal
88 * @param widget 89 * Use #gnt_widget_draw instead.
89 */ 90 */
90 void gnt_screen_update(GntWidget *widget); 91 void gnt_screen_update(GntWidget *widget);
91 92
92 /** 93 /**
93 * 94 * Resize a widget.
94 * @param widget 95 *
95 * @param width 96 * @param widget The widget to resize.
96 * @param height 97 * @param width The desired width.
98 * @param height The desired height.
97 */ 99 */
98 void gnt_screen_resize_widget(GntWidget *widget, int width, int height); 100 void gnt_screen_resize_widget(GntWidget *widget, int width, int height);
99 101
100 /** 102 /**
101 * 103 * Move a widget.
102 * @param widget 104 *
103 * @param x 105 * @param widget The widget to move.
104 * @param y 106 * @param x The desired x-coordinate.
107 * @param y The desired y-coordinate.
105 */ 108 */
106 void gnt_screen_move_widget(GntWidget *widget, int x, int y); 109 void gnt_screen_move_widget(GntWidget *widget, int x, int y);
107 110
108 /** 111 /**
109 * 112 * Rename a widget.
110 * @param widget 113 *
111 * @param text 114 * @param widget The widget to rename.
115 * @param text The new name for the widget.
112 */ 116 */
113 void gnt_screen_rename_widget(GntWidget *widget, const char *text); 117 void gnt_screen_rename_widget(GntWidget *widget, const char *text);
114 118
115 /** 119 /**
116 * 120 * Check whether a widget has focus.
117 * @param widget 121 *
118 * 122 * @param widget The widget.
119 * @return 123 *
124 * @return @c TRUE if the widget has the current focus, @c FALSE otherwise.
120 */ 125 */
121 gboolean gnt_widget_has_focus(GntWidget *widget); 126 gboolean gnt_widget_has_focus(GntWidget *widget);
122 127
123 /** 128 /**
124 * 129 * Set the URGENT hint for a widget.
125 * @param widget 130 *
131 * @param widget The widget to set the URGENT hint for.
126 */ 132 */
127 void gnt_widget_set_urgent(GntWidget *widget); 133 void gnt_widget_set_urgent(GntWidget *widget);
128 134
129 /** 135 /**
130 * 136 * Register a global action.
131 * @param label 137 *
132 * @param callback 138 * @param label The user-visible label for the action.
139 * @param callback The callback function for the action.
133 */ 140 */
134 void gnt_register_action(const char *label, void (*callback)()); 141 void gnt_register_action(const char *label, void (*callback)());
135 142
136 /** 143 /**
137 * 144 * Show a menu.
138 * @param menu 145 *
139 * 146 * @param menu The menu to display.
140 * @return 147 *
148 * @return @c TRUE if the menu is displayed, @c FALSE otherwise (e.g., if another menu is currently displayed).
141 */ 149 */
142 gboolean gnt_screen_menu_show(gpointer menu); 150 gboolean gnt_screen_menu_show(gpointer menu);
143 151
144 /** 152 /**
145 * 153 * Terminate the mainloop of gnt.
146 */ 154 */
147 void gnt_quit(void); 155 void gnt_quit(void);
148 156
149 /** 157 /**
150 * 158 * Get the global clipboard.
151 * 159 *
152 * @return 160 * @return The clipboard.
153 */ 161 */
154 GntClipboard * gnt_get_clipboard(void); 162 GntClipboard * gnt_get_clipboard(void);
155 163
156 /** 164 /**
157 * 165 * Get the string in the clipboard.
158 * 166 *
159 * @return 167 * @return A copy of the string in the clipboard. The caller must @c g_free the string.
160 */ 168 */
161 gchar * gnt_get_clipboard_string(void); 169 gchar * gnt_get_clipboard_string(void);
162 170
163 /** 171 /**
164 * 172 * Set the contents of the global clipboard.
165 * @param string 173 *
166 */ 174 * @param string The new content of the new clipboard.
167 void gnt_set_clipboard_string(gchar *string); 175 */
176 void gnt_set_clipboard_string(const gchar *string);
168 177
169 /** 178 /**
170 * Spawn a different application that will consume the console. 179 * Spawn a different application that will consume the console.
180 *
181 * @param wd The working directory for the new application.
182 * @param argv The argument vector.
183 * @param envp The environment, or @c NULL.
184 * @param stin Location to store the child's stdin, or @c NULL.
185 * @param stout Location to store the child's stdout, or @c NULL.
186 * @param sterr Location to store the child's stderr, or @c NULL.
187 * @param callback The callback to call after the child exits.
188 * @param data The data to pass to the callback.
189 *
190 * @return @c TRUE if the child was successfully spawned, @c FALSE otherwise.
171 */ 191 */
172 gboolean gnt_giveup_console(const char *wd, char **argv, char **envp, 192 gboolean gnt_giveup_console(const char *wd, char **argv, char **envp,
173 gint *stin, gint *stout, gint *sterr, 193 gint *stin, gint *stout, gint *sterr,
174 void (*callback)(int status, gpointer data), gpointer data); 194 void (*callback)(int status, gpointer data), gpointer data);
175 195
196 /**
197 * Check whether a child process is in control of the current terminal.
198 *
199 * @return @c TRUE if a child process (eg., PAGER) is occupying the current
200 * terminal, @c FALSE otherwise.
201 */
176 gboolean gnt_is_refugee(void); 202 gboolean gnt_is_refugee(void);
203