gnc-embedded-window.c (gnucash-5.0.tar.bz2) | : | gnc-embedded-window.c (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 87 | skipping to change at line 87 | |||
/** The menubar_model */ | /** The menubar_model */ | |||
GMenuModel *menubar_model; | GMenuModel *menubar_model; | |||
/** The toolbar. This pointer provides easy access for | /** The toolbar. This pointer provides easy access for | |||
* showing/hiding the toolbar. */ | * showing/hiding the toolbar. */ | |||
GtkWidget *toolbar; | GtkWidget *toolbar; | |||
/** A pointer to the status bar at the bottom edge of the window. | /** A pointer to the status bar at the bottom edge of the window. | |||
* This pointer provides easy access for updating/showing/hiding | * This pointer provides easy access for updating/showing/hiding | |||
* the status bar. */ | * the status bar. */ | |||
GtkWidget *statusbar; | GtkWidget *statusbar; | |||
/** The group of all actions provided by the main window itself. | /** The group of all actions provided by the embedded window itself. | |||
* This does not include any action provided by menu or content | * This does not include any action provided by menu or content | |||
* plugins. */ | * plugins. */ | |||
GSimpleActionGroup *simple_action_group; | GSimpleActionGroup *simple_action_group; | |||
/** The accelerator group of all actions provided by the embedded | ||||
* window. */ | ||||
GtkAccelGroup *accel_group; | ||||
/** The currently selected page. */ | /** The currently selected page. */ | |||
GncPluginPage *page; | GncPluginPage *page; | |||
/** The parent of this embedded "window". This points to a real | /** The parent of this embedded "window". This points to a real | |||
* GtkWindow widget. */ | * GtkWindow widget. */ | |||
GtkWidget *parent_window; | GtkWidget *parent_window; | |||
} GncEmbeddedWindowPrivate; | } GncEmbeddedWindowPrivate; | |||
GNC_DEFINE_TYPE_WITH_CODE(GncEmbeddedWindow, gnc_embedded_window, GTK_TYPE_BOX, | GNC_DEFINE_TYPE_WITH_CODE(GncEmbeddedWindow, gnc_embedded_window, GTK_TYPE_BOX, | |||
G_ADD_PRIVATE(GncEmbeddedWindow) | G_ADD_PRIVATE(GncEmbeddedWindow) | |||
GNC_IMPLEMENT_INTERFACE(GNC_TYPE_WINDOW, | GNC_IMPLEMENT_INTERFACE(GNC_TYPE_WINDOW, | |||
skipping to change at line 325 | skipping to change at line 329 | |||
const gchar *ui_filename, | const gchar *ui_filename, | |||
GtkWidget *enclosing_win, | GtkWidget *enclosing_win, | |||
gboolean add_accelerators, | gboolean add_accelerators, | |||
gpointer user_data) | gpointer user_data) | |||
{ | { | |||
GncEmbeddedWindowPrivate *priv; | GncEmbeddedWindowPrivate *priv; | |||
GncEmbeddedWindow *window; | GncEmbeddedWindow *window; | |||
gchar *ui_fullname; | gchar *ui_fullname; | |||
GError *error = NULL; | GError *error = NULL; | |||
GtkBuilder *builder; | GtkBuilder *builder; | |||
GtkAccelGroup *accel_group; | ||||
ENTER("group %s, first %p, num %d, ui file %s, parent %p, add accelerators % d, user data %p", | 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, | action_group_name, action_entries, n_action_entries, ui_filename, | |||
enclosing_win, add_accelerators, user_data); | enclosing_win, add_accelerators, user_data); | |||
window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL); | window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL); | |||
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | |||
builder = gtk_builder_new (); | builder = gtk_builder_new (); | |||
gtk_builder_set_translation_domain (builder, PROJECT_NAME); | gtk_builder_set_translation_domain (builder, PROJECT_NAME); | |||
skipping to change at line 374 | skipping to change at line 377 | |||
action_entries, | action_entries, | |||
n_action_entries, | n_action_entries, | |||
user_data); | user_data); | |||
gtk_widget_insert_action_group (GTK_WIDGET(window), "embeddedwin", | gtk_widget_insert_action_group (GTK_WIDGET(window), "embeddedwin", | |||
G_ACTION_GROUP(priv->simple_action_group)); | G_ACTION_GROUP(priv->simple_action_group)); | |||
priv->parent_window = enclosing_win; | priv->parent_window = enclosing_win; | |||
// need to add the accelerator keys | // need to add the accelerator keys | |||
accel_group = gtk_accel_group_new (); | priv->accel_group = gtk_accel_group_new (); | |||
gtk_window_add_accel_group (GTK_WINDOW(enclosing_win), accel_group); | gtk_window_add_accel_group (GTK_WINDOW(enclosing_win), priv->accel_group); | |||
gnc_add_accelerator_keys_for_menu (GTK_WIDGET(priv->menubar), priv->menubar_ | gnc_add_accelerator_keys_for_menu (GTK_WIDGET(priv->menubar), priv->menubar_ | |||
model, accel_group); | model, priv->accel_group); | |||
g_free (ui_fullname); | g_free (ui_fullname); | |||
LEAVE("window %p", window); | LEAVE("window %p", window); | |||
return window; | return window; | |||
} | } | |||
/** Retrieve the gtk window associated with an embedded window object. | /** Retrieve the gtk window associated with an embedded window object. | |||
* This function is called via a vector off a generic window | * This function is called via a vector off a generic window | |||
* interface. | * interface. | |||
* | * | |||
skipping to change at line 453 | skipping to change at line 456 | |||
{ | { | |||
GncEmbeddedWindowPrivate *priv; | GncEmbeddedWindowPrivate *priv; | |||
g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL); | g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL); | |||
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | |||
return priv->toolbar; | return priv->toolbar; | |||
} | } | |||
/** Retrieve the display hash table associated with an embedded window object. | /** Retrieve the menubar model associated with an embedded window object. | |||
* This function is called via a vector off a generic window | * This function is called via a vector off a generic window | |||
* interface. | * interface. | |||
* | * | |||
* @param window_in A pointer to a generic window. */ | * @param window_in A pointer to a generic window. */ | |||
static GMenuModel * | static GMenuModel * | |||
gnc_embedded_window_get_menubar_model (GncWindow *window) | gnc_embedded_window_get_menubar_model (GncWindow *window) | |||
{ | { | |||
GncEmbeddedWindowPrivate *priv; | GncEmbeddedWindowPrivate *priv; | |||
g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL); | g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL); | |||
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | |||
return priv->menubar_model; | return priv->menubar_model; | |||
} | } | |||
/** Retrieve the accelerator group associated with an embedded window object. | ||||
* This function is called via a vector off a generic window | ||||
* interface. | ||||
* | ||||
* @param window_in A pointer to a generic window. */ | ||||
static GtkAccelGroup * | ||||
gnc_embedded_window_get_accel_group (GncWindow *window) | ||||
{ | ||||
GncEmbeddedWindowPrivate *priv; | ||||
g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW(window), NULL); | ||||
priv = GNC_EMBEDDED_WINDOW_GET_PRIVATE(window); | ||||
return priv->accel_group; | ||||
} | ||||
/** Initialize the generic window interface for an embedded window. | /** Initialize the generic window interface for an embedded window. | |||
* | * | |||
* @param iface A pointer to the interface data structure to | * @param iface A pointer to the interface data structure to | |||
* populate. */ | * populate. */ | |||
static void | static void | |||
gnc_window_embedded_window_init (GncWindowIface *iface) | gnc_window_embedded_window_init (GncWindowIface *iface) | |||
{ | { | |||
iface->get_gtk_window = gnc_embedded_window_get_gtk_window; | iface->get_gtk_window = gnc_embedded_window_get_gtk_window; | |||
iface->get_statusbar = gnc_embedded_window_get_statusbar; | iface->get_statusbar = gnc_embedded_window_get_statusbar; | |||
iface->get_menubar = gnc_embedded_window_get_menubar; | iface->get_menubar = gnc_embedded_window_get_menubar; | |||
iface->get_toolbar = gnc_embedded_window_get_toolbar; | iface->get_toolbar = gnc_embedded_window_get_toolbar; | |||
iface->get_menubar_model = gnc_embedded_window_get_menubar_model; | iface->get_menubar_model = gnc_embedded_window_get_menubar_model; | |||
iface->get_accel_group = gnc_embedded_window_get_accel_group; | ||||
} | } | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 28 lines changed or added |