OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
header.h File Reference
#include <gtk/gtk.h>
#include "mape/forward.h"
Include dependency graph for header.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MapeHeader_
 

Functions

MapeHeadermape_header_new (void)
 
void mape_header_destroy (MapeHeader *header)
 

Class Documentation

struct MapeHeader_

Definition at line 22 of file header.h.

Class Members
GtkAccelGroup * accel_group
GtkAction * edit_preferences
GtkAction * edit_redo
GtkAction * edit_undo
GtkAction * file_new
GtkAction * file_open
GtkAction * file_quit
GtkAction * file_save
GtkAction * file_save_as
GtkActionGroup * group_edit
GtkActionGroup * group_file
GtkActionGroup * group_help
GtkAction * help_about
GtkWidget * menubar
GtkWidget * toolbar
GtkUIManager * ui_manager

Function Documentation

void mape_header_destroy ( MapeHeader header)

Definition at line 274 of file header.c.

References MapeHeader_::ui_manager.

Referenced by mape_window_destroy(), and mape_window_new().

275 {
276  g_object_unref(G_OBJECT(header->ui_manager) );
277  free(header);
278 }
GtkUIManager * ui_manager
Definition: header.h:23

Here is the caller graph for this function:

MapeHeader* mape_header_new ( void  )

Definition at line 148 of file header.c.

References MapeHeader_::accel_group, MapeHeader_::edit_preferences, MapeHeader_::edit_redo, MapeHeader_::edit_undo, MapeHeader_::file_new, MapeHeader_::file_open, MapeHeader_::file_quit, MapeHeader_::file_save, MapeHeader_::file_save_as, MapeHeader_::group_edit, MapeHeader_::group_file, MapeHeader_::group_help, MapeHeader_::help_about, MapeHeader_::menubar, MapeHeader_::toolbar, and MapeHeader_::ui_manager.

Referenced by mape_window_new().

149 {
150  MapeHeader* header;
151  gint result;
152 
153  header = malloc(sizeof(MapeHeader) );
154 
155  header->group_file = gtk_action_group_new("FileActions");
156  gtk_action_group_add_actions(
157  header->group_file,
158  mape_header_file_entries,
159  G_N_ELEMENTS(mape_header_file_entries),
160  header
161  );
162 
163  header->group_edit = gtk_action_group_new("EditActions");
164  gtk_action_group_add_actions(
165  header->group_edit,
166  mape_header_edit_entries,
167  G_N_ELEMENTS(mape_header_edit_entries),
168  header
169  );
170 
171  header->group_help = gtk_action_group_new("HelpActions");
172  gtk_action_group_add_actions(
173  header->group_help,
174  mape_header_help_entries,
175  G_N_ELEMENTS(mape_header_help_entries),
176  header
177  );
178 
179  header->ui_manager = gtk_ui_manager_new();
180  gtk_ui_manager_insert_action_group(
181  header->ui_manager,
182  header->group_file,
183  0
184  );
185 
186  gtk_ui_manager_insert_action_group(
187  header->ui_manager,
188  header->group_edit,
189  0
190  );
191 
192  gtk_ui_manager_insert_action_group(
193  header->ui_manager,
194  header->group_help,
195  0
196  );
197 
198  result = gtk_ui_manager_add_ui_from_string(
199  header->ui_manager,
200  mape_header_ui_desc,
201  -1,
202  NULL
203  );
204 
205  g_assert(result != 0);
206 
207  header->menubar = gtk_ui_manager_get_widget(
208  header->ui_manager,
209  "/MenuBar"
210  );
211 
212  header->toolbar = gtk_ui_manager_get_widget(
213  header->ui_manager,
214  "/ToolBar"
215  );
216 
217  g_assert(header->menubar != NULL);
218  g_assert(header->toolbar != NULL);
219 
220  header->accel_group = gtk_ui_manager_get_accel_group(
221  header->ui_manager
222  );
223 
224  g_assert(header->accel_group != NULL);
225 
226  header->file_new = gtk_action_group_get_action(
227  header->group_file,
228  "FileNew"
229  );
230 
231  header->file_open = gtk_action_group_get_action(
232  header->group_file,
233  "FileOpen"
234  );
235 
236  header->file_save = gtk_action_group_get_action(
237  header->group_file,
238  "FileSave"
239  );
240 
241  header->file_save_as = gtk_action_group_get_action(
242  header->group_file,
243  "FileSaveAs"
244  );
245 
246  header->file_quit = gtk_action_group_get_action(
247  header->group_file,
248  "FileQuit"
249  );
250 
251  header->edit_undo = gtk_action_group_get_action(
252  header->group_edit,
253  "EditUndo"
254  );
255 
256  header->edit_redo = gtk_action_group_get_action(
257  header->group_edit,
258  "EditRedo"
259  );
260 
261  header->edit_preferences = gtk_action_group_get_action(
262  header->group_edit,
263  "EditPreferences"
264  );
265 
266  header->help_about = gtk_action_group_get_action(
267  header->group_help,
268  "HelpAbout"
269  );
270 
271  return header;
272 }
GtkAction * file_save
Definition: header.h:32
GtkAction * edit_preferences
Definition: header.h:39
GtkAction * file_open
Definition: header.h:31
GtkWidget * toolbar
Definition: header.h:27
GtkAction * file_quit
Definition: header.h:34
GtkActionGroup * group_help
Definition: header.h:41
GtkActionGroup * group_edit
Definition: header.h:36
GtkAction * file_save_as
Definition: header.h:33
GtkActionGroup * group_file
Definition: header.h:29
GtkAction * edit_undo
Definition: header.h:37
GtkUIManager * ui_manager
Definition: header.h:23
GtkAccelGroup * accel_group
Definition: header.h:24
GtkWidget * menubar
Definition: header.h:26
GtkAction * file_new
Definition: header.h:30
GtkAction * edit_redo
Definition: header.h:38
GtkAction * help_about
Definition: header.h:42

Here is the caller graph for this function: