|
GnuCash 2.3.0
|
Data Structures | |
| struct | GncEmbeddedWindow |
| struct | GncEmbeddedWindowClass |
Files | |
| file | gnc-embedded-window.h |
Functions that are supported by all types of windows. | |
Defines | |
| #define | GNC_TYPE_EMBEDDED_WINDOW (gnc_embedded_window_get_type ()) |
| #define | GNC_EMBEDDED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindow)) |
| #define | GNC_EMBEDDED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowClass)) |
| #define | GNC_IS_EMBEDDED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_EMBEDDED_WINDOW)) |
| #define | GNC_IS_EMBEDDED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_EMBEDDED_WINDOW)) |
| #define | GNC_EMBEDDED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowClass)) |
Functions | |
| GType | gnc_embedded_window_get_type (void) |
| GncEmbeddedWindow * | gnc_embedded_window_new (const gchar *action_group_name, GtkActionEntry *action_entries, gint n_action_entries, const gchar *ui_filename, GtkWidget *enclosing_win, gboolean add_accelerators, gpointer user_data) |
| void | gnc_embedded_window_open_page (GncEmbeddedWindow *window, GncPluginPage *page) |
| void | gnc_embedded_window_close_page (GncEmbeddedWindow *window, GncPluginPage *page) |
| GncPluginPage * | gnc_embedded_window_get_page (GncEmbeddedWindow *window) |
| void gnc_embedded_window_close_page | ( | GncEmbeddedWindow * | window, |
| GncPluginPage * | page | ||
| ) |
Remove a data plugin page from a window.
| window | The window whose plugin is to be removed. |
| page | The page of data to be removed. |
Definition at line 160 of file gnc-embedded-window.c.
{
GncEmbeddedWindowPrivate *priv;
g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (window));
g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
g_return_if_fail (priv->page == page);
ENTER("window %p, page %p", window, page);
if (!page->notebook_page)
{
LEAVE("no displayed widget");
return;
}
gtk_container_remove (GTK_CONTAINER(window), GTK_WIDGET(page->notebook_page));
priv->page = NULL;
gnc_plugin_page_removed (page);
gnc_plugin_page_unmerge_actions (page, window->ui_merge);
gtk_ui_manager_ensure_update (window->ui_merge);
gnc_plugin_page_destroy_widget (page);
g_object_unref(page);
LEAVE(" ");
}
| GncPluginPage* gnc_embedded_window_get_page | ( | GncEmbeddedWindow * | window | ) |
Retrieve the plugin that is embedded in the specified window.
| window | The window whose plugin is desired. |
Definition at line 193 of file gnc-embedded-window.c.
{
GncEmbeddedWindowPrivate *priv;
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
return priv->page;
}
| GType gnc_embedded_window_get_type | ( | void | ) |
Get the type of a gnc embedded window.
Definition at line 95 of file gnc-embedded-window.c.
{
static GType gnc_embedded_window_type = 0;
if (gnc_embedded_window_type == 0)
{
static const GTypeInfo our_info =
{
sizeof (GncEmbeddedWindowClass),
NULL,
NULL,
(GClassInitFunc) gnc_embedded_window_class_init,
NULL,
NULL,
sizeof (GncEmbeddedWindow),
0,
(GInstanceInitFunc) gnc_embedded_window_init
};
static const GInterfaceInfo plugin_info =
{
(GInterfaceInitFunc) gnc_window_embedded_window_init,
NULL,
NULL
};
gnc_embedded_window_type = g_type_register_static (GTK_TYPE_VBOX,
"GncEmbeddedWindow",
&our_info, 0);
g_type_add_interface_static (gnc_embedded_window_type,
GNC_TYPE_WINDOW,
&plugin_info);
}
return gnc_embedded_window_type;
}
| GncEmbeddedWindow* gnc_embedded_window_new | ( | const gchar * | action_group_name, |
| GtkActionEntry * | action_entries, | ||
| gint | n_action_entries, | ||
| const gchar * | ui_filename, | ||
| GtkWidget * | enclosing_win, | ||
| gboolean | add_accelerators, | ||
| gpointer | user_data | ||
| ) |
Create a new gnc embedded window plugin.
Create a new gnc embedded window plugin.
Definition at line 352 of file gnc-embedded-window.c.
{
GncEmbeddedWindowPrivate *priv;
GncEmbeddedWindow *window;
gchar *ui_fullname;
GError *error = NULL;
guint merge_id;
ENTER("group %s, first %p, num %d, ui file %s, parent %p, add accelerators %d, user data %p",
action_group_name, action_entries, n_action_entries, ui_filename,
enclosing_win, add_accelerators, user_data);
window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL);
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
/* Determine the full pathname of the ui file */
ui_fullname = gnc_gnome_locate_ui_file(ui_filename);
priv->parent_window = enclosing_win;
/* Create menu and toolbar information */
priv->action_group = gtk_action_group_new (action_group_name);
gnc_gtk_action_group_set_translation_domain(priv->action_group, GETTEXT_PACKAGE);
gtk_action_group_add_actions (priv->action_group, action_entries,
n_action_entries, user_data);
gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, ui_fullname,
&error);
/* Error checking */
g_assert(merge_id || error);
if (error)
{
g_critical("Failed to load ui file.\n Filename %s\n Error %s",
ui_fullname, error->message);
g_error_free(error);
g_free(ui_fullname);
LEAVE("window %p", window);
return window;
}
/* Add accelerators (if wanted) */
if (add_accelerators)
gtk_window_add_accel_group (GTK_WINDOW(enclosing_win),
gtk_ui_manager_get_accel_group(window->ui_merge));
gtk_ui_manager_ensure_update (window->ui_merge);
g_free(ui_fullname);
LEAVE("window %p", window);
return window;
}
| void gnc_embedded_window_open_page | ( | GncEmbeddedWindow * | window, |
| GncPluginPage * | page | ||
| ) |
Display a data plugin page in a window.
| window | The window to display a new page in. |
| page | The new page of data to be displayed. |
Definition at line 135 of file gnc-embedded-window.c.
{
GncEmbeddedWindowPrivate *priv;
g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (window));
g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window);
g_return_if_fail (priv->page == NULL);
ENTER("window %p, page %p", window, page);
priv->page = page;
page->window = GTK_WIDGET(window);
page->notebook_page = gnc_plugin_page_create_widget (page);
gtk_box_pack_end(GTK_BOX(window), page->notebook_page, TRUE, TRUE, 2);
gnc_plugin_page_inserted (page);
gnc_plugin_page_merge_actions (page, window->ui_merge);
LEAVE(" ");
}
1.7.4