Fix #1248: Crash when hiding file list
[geeqie.git] / src / ui-misc.h
index 50a5fb6..881585c 100644 (file)
 #ifndef UI_MISC_H
 #define UI_MISC_H
 
+#include <ctime>
 
-#include <sys/time.h>
-#include <sys/types.h>
-#include <time.h>
-
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <glib-object.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
 /* these values are per GNOME HIG */
 
@@ -110,9 +112,8 @@ GtkWidget *pref_label_new(GtkWidget *parent_box, const gchar *text);
 GtkWidget *pref_label_new_mnemonic(GtkWidget *parent_box, const gchar *text, GtkWidget *widget);
 void pref_label_bold(GtkWidget *label, gboolean bold, gboolean increase_size);
 
-GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *stock_id,
-                          const gchar *text, gboolean hide_stock_text,
-                          GCallback func, gpointer data);
+GtkWidget *pref_button_new(GtkWidget *parent_box, const gchar *icon_name,
+                          const gchar *text, GCallback func, gpointer data);
 
 GtkWidget *pref_checkbox_new(GtkWidget *parent_box, const gchar *text, gboolean active,
                             GCallback func, gpointer data);
@@ -156,17 +157,16 @@ void pref_signal_block_data(GtkWidget *widget, gpointer data);
 void pref_signal_unblock_data(GtkWidget *widget, gpointer data);
 
 
-GtkWidget *pref_table_new(GtkWidget *parent_box, gint columns, gint rows,
-                         gboolean homogeneous, gboolean fill);
+GtkWidget *pref_table_new(GtkWidget *parent_box, gint, gint, gboolean, gboolean);
 
 GtkWidget *pref_table_box(GtkWidget *table, gint column, gint row,
                          GtkOrientation orientation, const gchar *text);
 
 GtkWidget *pref_table_label(GtkWidget *table, gint column, gint row,
-                           const gchar *text, gfloat alignment);
+                           const gchar *text, GtkAlign alignment);
 
 GtkWidget *pref_table_button(GtkWidget *table, gint column, gint row,
-                            const gchar *stock_id, const gchar *text, gboolean hide_stock_text,
+                            const gchar *stock_id, const gchar *text,
                             GCallback func, gpointer data);
 
 GtkWidget *pref_table_spin(GtkWidget *table, gint column, gint row,
@@ -181,9 +181,9 @@ GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
                                   gint value, gint *value_var);
 
 
-GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style);
+GtkWidget *pref_toolbar_new(GtkWidget *parent_box);
 GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
-                              const gchar *stock_id, const gchar *label, gboolean toggle,
+                              const gchar *icon_name, const gchar *label, gboolean toggle,
                               const gchar *description,
                               GCallback func, gpointer data);
 void pref_toolbar_button_set_icon(GtkWidget *button, GtkWidget *widget, const gchar *stock_id);
@@ -193,7 +193,7 @@ GtkWidget *pref_toolbar_spacer(GtkWidget *toolbar);
 GtkWidget *date_selection_new();
 
 void date_selection_set(GtkWidget *widget, gint day, gint month, gint year);
-void date_selection_get(GtkWidget *widget, gint *day, gint *month, gint *year);
+GDateTime *date_selection_get(GtkWidget *widget);
 
 void date_selection_time_set(GtkWidget *widget, time_t t);
 time_t date_selection_time_get(GtkWidget *widget);
@@ -223,12 +223,25 @@ gboolean pref_list_string_get(const gchar *group, const gchar *key, const gchar
 
 void pref_color_button_set_cb(GtkWidget *widget, gpointer data);
 GtkWidget *pref_color_button_new(GtkWidget *parent_box,
-                                const gchar *title, const GdkColor *color,
+                                const gchar *title, GdkRGBA *color,
                                 GCallback func, gpointer data);
 
 gchar *text_widget_text_pull(GtkWidget *text_widget);
 gchar *text_widget_text_pull_selected(GtkWidget *text_widget);
 
+struct ActionItem
+{
+       const gchar *name; /* GtkActionEntry terminology */
+       const gchar *label;
+       const gchar *icon_name;
+};
+
+GList* get_action_items();
+void action_items_free(GList *list);
+
 gboolean defined_mouse_buttons(GtkWidget *widget, GdkEventButton *event, gpointer data);
+
+// Copy pixbuf returned by gtk_icon_theme_load_icon() to avoid GTK+ keeping the old icon theme loaded
+GdkPixbuf *gq_gtk_icon_theme_load_icon_copy(GtkIconTheme *icon_theme, const gchar *icon_name, gint size, GtkIconLookupFlags flags);
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */