build-basic-autotools:bgo#688293 - build-basic-autotools: Fix invalid read
[anjuta.git] / libanjuta / anjuta-shell.h
bloba93eb66faac3b713ec3e33fed0de933eaeb26412
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta-shell.h
4 * Copyright (C) Naba Kumar <naba@gnome.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _ANJUTA_SHELL_H
21 #define _ANJUTA_SHELL_H
23 #include <glib-object.h>
24 #include <gtk/gtk.h>
26 #include <libanjuta/anjuta-shell.h>
27 #include <libanjuta/anjuta-status.h>
28 #include <libanjuta/anjuta-ui.h>
29 #include <libanjuta/anjuta-preferences.h>
30 #include <libanjuta/anjuta-plugin-manager.h>
31 #include <libanjuta/anjuta-profile-manager.h>
32 #include <libanjuta/anjuta-session.h>
33 #include <libanjuta/anjuta-save-prompt.h>
35 G_BEGIN_DECLS
37 #define ANJUTA_TYPE_SHELL (anjuta_shell_get_type ())
38 #define ANJUTA_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_SHELL, AnjutaShell))
39 #define ANJUTA_IS_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_SHELL))
40 #define ANJUTA_SHELL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ANJUTA_TYPE_SHELL, AnjutaShellIface))
42 #define ANJUTA_SHELL_ERROR anjuta_shell_error_quark()
44 typedef struct _AnjutaShell AnjutaShell;
45 typedef struct _AnjutaShellIface AnjutaShellIface;
47 /**
48 * AnjutaShellError_
49 * @ANJUTA_SHELL_ERROR_DOESNT_EXIST:
51 typedef enum
53 ANJUTA_SHELL_ERROR_DOESNT_EXIST,
54 } AnjutaShellError;
56 typedef enum
58 ANJUTA_SHELL_PLACEMENT_NONE = 0,
59 ANJUTA_SHELL_PLACEMENT_TOP,
60 ANJUTA_SHELL_PLACEMENT_BOTTOM,
61 ANJUTA_SHELL_PLACEMENT_RIGHT,
62 ANJUTA_SHELL_PLACEMENT_LEFT,
63 ANJUTA_SHELL_PLACEMENT_CENTER,
64 ANJUTA_SHELL_PLACEMENT_FLOATING
65 } AnjutaShellPlacement;
67 struct _AnjutaShellIface {
68 GTypeInterface g_iface;
70 /* Signals */
71 void (*value_added) (AnjutaShell *shell, char *name, GValue *value);
72 void (*value_removed) (AnjutaShell *shell, char *name);
73 void (*save_session) (AnjutaShell *shell, AnjutaSessionPhase phase,
74 AnjutaSession *session);
75 void (*load_session) (AnjutaShell *shell, AnjutaSessionPhase phase,
76 AnjutaSession *session);
77 void (*save_prompt) (AnjutaShell *shell, AnjutaSavePrompt *save_prompt);
78 void (*exiting) (AnjutaShell *shell);
80 /* Virtual Table */
81 AnjutaStatus* (*get_status) (AnjutaShell *shell, GError **err);
82 AnjutaUI* (*get_ui) (AnjutaShell *shell, GError **err);
83 AnjutaPreferences* (*get_preferences) (AnjutaShell *shell, GError **err);
84 AnjutaPluginManager* (*get_plugin_manager) (AnjutaShell *shell,
85 GError **err);
86 AnjutaProfileManager* (*get_profile_manager) (AnjutaShell *shell,
87 GError **err);
89 void (*add_widget_full) (AnjutaShell *shell,
90 GtkWidget *widget,
91 const char *name,
92 const char *title,
93 const char *stock_id,
94 AnjutaShellPlacement placement,
95 gboolean locked,
96 GError **error);
97 void (*add_widget_custom) (AnjutaShell *shell,
98 GtkWidget *widget,
99 const char *name,
100 const char *title,
101 const char *stock_id,
102 GtkWidget *label,
103 AnjutaShellPlacement placement,
104 GError **error);
106 void (*remove_widget) (AnjutaShell *shell,
107 GtkWidget *widget,
108 GError **error);
109 void (*present_widget) (AnjutaShell *shell,
110 GtkWidget *widget,
111 GError **error);
113 void (*iconify_dockable_widget) (AnjutaShell *shell,
114 GtkWidget *widget,
115 GError **error);
116 void (*hide_dockable_widget) (AnjutaShell *shell,
117 GtkWidget *widget,
118 GError **error);
119 void (*show_dockable_widget) (AnjutaShell *shell,
120 GtkWidget *widget,
121 GError **error);
122 void (*maximize_widget) (AnjutaShell *shell,
123 const char *widget_name,
124 GError **error);
125 void (*unmaximize) (AnjutaShell *shell,
126 GError **error);
127 void (*add_value) (AnjutaShell *shell,
128 const char *name,
129 const GValue *value,
130 GError **error);
131 void (*get_value) (AnjutaShell *shell,
132 const char *name,
133 GValue *value,
134 GError **error);
135 void (*remove_value) (AnjutaShell *shell,
136 const char *name,
137 GError **error);
138 void (*saving_push) (AnjutaShell* shell);
139 void (*saving_pop) (AnjutaShell* shell);
140 GObject* (*get_object) (AnjutaShell *shell,
141 const char *iface_name,
142 GError **error);
143 AnjutaShell * (*create_window) (AnjutaShell *shell,
144 GError **error);
147 GQuark anjuta_shell_error_quark (void);
148 GType anjuta_shell_get_type (void);
150 AnjutaStatus* anjuta_shell_get_status (AnjutaShell *shell, GError **error);
152 AnjutaUI* anjuta_shell_get_ui (AnjutaShell *shell, GError **error);
154 AnjutaPreferences* anjuta_shell_get_preferences (AnjutaShell *shell,
155 GError **error);
157 AnjutaPluginManager* anjuta_shell_get_plugin_manager (AnjutaShell *shell,
158 GError **error);
160 AnjutaProfileManager* anjuta_shell_get_profile_manager (AnjutaShell *shell,
161 GError **error);
163 void anjuta_shell_freeze (AnjutaShell *shell, GError **error);
164 void anjuta_shell_thaw (AnjutaShell *shell, GError **error);
166 void anjuta_shell_add_widget (AnjutaShell *shell,
167 GtkWidget *widget,
168 const char *name,
169 const char *title,
170 const char *stock_id,
171 AnjutaShellPlacement placement,
172 GError **error);
174 void anjuta_shell_add_widget_custom (AnjutaShell *shell,
175 GtkWidget *widget,
176 const char *name,
177 const char *title,
178 const char *stock_id,
179 GtkWidget *label,
180 AnjutaShellPlacement placement,
181 GError **error);
183 void anjuta_shell_add_widget_full (AnjutaShell *shell,
184 GtkWidget *widget,
185 const char *name,
186 const char *title,
187 const char *stock_id,
188 AnjutaShellPlacement placement,
189 gboolean locked,
190 GError **error);
192 void anjuta_shell_remove_widget (AnjutaShell *shell,
193 GtkWidget *widget,
194 GError **error);
195 void anjuta_shell_present_widget (AnjutaShell *shell,
196 GtkWidget *widget,
197 GError **error);
198 void anjuta_shell_iconify_dockable_widget (AnjutaShell *shell,
199 GtkWidget *widget,
200 GError **error);
201 void anjuta_shell_hide_dockable_widget (AnjutaShell *shell,
202 GtkWidget *widget,
203 GError **error);
204 void anjuta_shell_show_dockable_widget (AnjutaShell *shell,
205 GtkWidget *widget,
206 GError **error);
207 void anjuta_shell_maximize_widget (AnjutaShell *shell,
208 const char *widget_name,
209 GError **error);
210 void anjuta_shell_unmaximize (AnjutaShell *shell,
211 GError **error);
212 AnjutaShell* anjuta_shell_create_window (AnjutaShell* shell,
213 GError **error);
214 void anjuta_shell_add_value (AnjutaShell *shell,
215 const char *name,
216 const GValue *value,
217 GError **error);
218 void anjuta_shell_add_valist (AnjutaShell *shell,
219 const char *first_name,
220 GType first_type,
221 va_list var_args);
222 void anjuta_shell_add (AnjutaShell *shell,
223 const char *first_name,
224 GType first_type,
225 ...);
226 void anjuta_shell_get_value (AnjutaShell *shell,
227 const char *name,
228 GValue *value,
229 GError **error);
230 void anjuta_shell_get_valist (AnjutaShell *shell,
231 const char *first_name,
232 GType first_type,
233 va_list var_args);
234 void anjuta_shell_get (AnjutaShell *shell,
235 const char *first_name,
236 GType first_type,
237 ...);
238 void anjuta_shell_remove_value (AnjutaShell *shell,
239 const char *name,
240 GError **error);
242 GObject *anjuta_shell_get_object (AnjutaShell *shell,
243 const gchar *iface_name,
244 GError **error);
245 void anjuta_shell_session_save (AnjutaShell *shell,
246 const gchar *session_directory,
247 GError **error);
248 void anjuta_shell_session_load (AnjutaShell *shell,
249 const gchar *session_directory,
250 GError **error);
251 void anjuta_shell_save_prompt (AnjutaShell *shell,
252 AnjutaSavePrompt *prompt,
253 GError **error);
254 void anjuta_shell_notify_exit (AnjutaShell *shell, GError **error);
255 void anjuta_shell_saving_push (AnjutaShell* shell);
256 void anjuta_shell_saving_pop (AnjutaShell* shell);
260 * anjuta_shell_get_interface:
261 * @shell: A #AnjutaShell object
262 * @iface_type: The interface type implemented by the object to be found
263 * @error: Error propagation object.
265 * Equivalent to anjuta_shell_get_object(), but additionally typecasts returned
266 * object to the interface type. It also takes interface type directly. A
267 * usage of this function is:
268 * <programlisting>
269 * IAnjutaDocumentManager *docman =
270 * anjuta_shell_get_interface (shell, IAnjutaDocumentManager, error);
271 * </programlisting>
273 #define anjuta_shell_get_interface(shell, iface_type, error) \
274 ((iface_type*) anjuta_shell_get_object((shell), #iface_type, (error)))
276 G_END_DECLS
278 #endif