Header for frame menu items constructors and utilities. More...
#include <gtk/gtk.h>
#include "constants.h"
Go to the source code of this file.
Data Structures | |
struct | func_list_t |
A list of (display name, function) couples used to populate a menu. More... | |
Functions | |
void | func_list_add_new_func (GList **list, const char *name, void(*func)(GtkMenuItem *, gpointer)) |
Adds a function menu item to a func_list_t list. | |
void | func_list_add_new_submenu (GList **, const char *, GList *) |
Adds a submenu menu item to a func_list_t list. | |
void | func_list_add_new_separator (GList **) |
void | func_list_t_free (func_list_t *) |
Frees a func_list_t struct. | |
GtkWidget * | func_list_t_setup_submenu (func_list_t *, struct __frame_t *) |
Header for frame menu items constructors and utilities.
This header file contains the func_list_t structure that represents a frame menu item, as well as constructors for this struct.
Definition in file func-list.h.
void func_list_add_new_func | ( | GList ** | list, | |
const char * | name, | |||
void(*)(GtkMenuItem *, gpointer) | func | |||
) |
Adds a function menu item to a func_list_t list.
This function adds a menu item of type FUNCTION to a list of menu items, and updates the pointer to the list passed as a parameter.
[out] | list | a pointer to the list where to add the menu item |
[in] | name | the display name (must be unique in the list) of the menu item |
[in] | func | the function to call when this menu item is clicked |
Definition at line 32 of file func-list.c.
00033 { 00034 func_list_t *f = g_malloc (sizeof (func_list_t)); 00035 00036 f->type = FUNCTION; 00037 f->name = g_strdup (name); 00038 f->data.func = func; 00039 00040 *list = g_list_prepend (*list, f); 00041 }
void func_list_add_new_separator | ( | GList ** | ) |
Definition at line 58 of file func-list.c.
00059 { 00060 func_list_t *f = g_malloc (sizeof (func_list_t)); 00061 00062 f->type = SEPARATOR; 00063 f->name = NULL; 00064 00065 *list = g_list_prepend (*list, f); 00066 }
void func_list_add_new_submenu | ( | GList ** | list, | |
const char * | name, | |||
GList * | children | |||
) |
Adds a submenu menu item to a func_list_t list.
Adds a separator to a func_list_t list.
This function adds a menu item of type SUBMENU to a list of menu items, and updates the pointer to the list passed as a parameter.
[out] | list | a pointer to the list where to add the menu item |
[in] | name | the display name (must be unique in the list) of the menu item |
[in] | children | the list of menu items in the submenu of the newly created one |
This function adds a menu item of type SEPARATOR to a list of menu items, and updates the pointer to the list passed as a parameter.
[out] | list | a pointer to the list where to add the separator |
Definition at line 45 of file func-list.c.
00046 { 00047 func_list_t *f = g_malloc (sizeof (func_list_t)); 00048 00049 f->type = SUBMENU; 00050 f->name = g_strdup (name); 00051 f->data.children = children; 00052 00053 *list = g_list_prepend (*list, f); 00054 }
void func_list_t_free | ( | func_list_t * | fn | ) |
Frees a func_list_t struct.
This function frees the data in a func_list_t struct, and the struct itself.
[out] | fn | the func_list_t struct to free |
Definition at line 70 of file func-list.c.
GtkWidget* func_list_t_setup_submenu | ( | func_list_t * | , | |
struct __frame_t * | ||||
) |