Commit c4f4ee3b authored by Morten Welinder's avatar Morten Welinder

Wbcg: Use C99 syntax for action definition.

parent c6557361
2015-12-08 Morten Welinder <terra@gnome.org>
* src/wbc-gtk-actions.c (actions): Use GnmActionEntry and C99
syntax.
* src/gui-util.c (gnm_action_group_add_actions): New function,
currently quite dumb.
* configure.ac (CC): Insist on c99.
2015-12-05 Morten Welinder <terra@gnome.org>
......
......@@ -1279,3 +1279,19 @@ gnm_widget_measure_string (GtkWidget *w, const char *s)
return len;
}
void
gnm_action_group_add_actions (GtkActionGroup *group,
GnmActionEntry *permanent_actions,
size_t n,
gpointer user)
{
/* Realy dumb implementation for now. */
while (n > 0) {
GtkActionEntry *a = (GtkActionEntry *)permanent_actions;
gtk_action_group_add_actions (group, a, 1, user);
permanent_actions++;
n--;
}
}
......@@ -145,6 +145,8 @@ gnm_cell_renderer_text_copy_background_to_cairo (GtkCellRendererText *crt,
* in some other way. (So why do we have them in the first place? To ensure
* the user interface is as consistent as possible.)
*/
#define GNM_STOCK_LABEL_CONTEXT "Stock label"
#define GNM_STOCK_OPEN g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_OPEN)
#define GNM_N_STOCK_OPEN NC_("Stock label", "_Open")
......@@ -160,6 +162,26 @@ gnm_cell_renderer_text_copy_background_to_cairo (GtkCellRendererText *crt,
#define GNM_STOCK_OK g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_OK)
#define GNM_N_STOCK_OK NC_("Stock label", "_OK")
typedef struct
{
const gchar *name;
const gchar *icon;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
GCallback callback;
/* Members beyond GtkActionEntry. */
const gchar *label_context;
} GnmActionEntry;
void gnm_action_group_add_actions (GtkActionGroup *group,
GnmActionEntry *permanent_actions,
size_t n,
gpointer user);
G_END_DECLS
#endif /* _GNM_GUI_UTIL_H_ */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment