diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-04-09 23:25:05 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-04-09 23:25:05 +0100 |
commit | 23ae8ccf110f94019c745ebc4959c06b842a626d (patch) | |
tree | d1f5dbacaeebca363808cc4e73f3ed640f1ef433 /gtk/compat.h | |
parent | d0b56d660f1018741f0aabd5f5e02dc69db2e479 (diff) | |
download | netsurf-23ae8ccf110f94019c745ebc4959c06b842a626d.tar.gz netsurf-23ae8ccf110f94019c745ebc4959c06b842a626d.tar.bz2 |
Extend gtk compatability to fix more items depricated in GTK 3.10
Diffstat (limited to 'gtk/compat.h')
-rw-r--r-- | gtk/compat.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/gtk/compat.h b/gtk/compat.h index 4f83aac46..42deab2ac 100644 --- a/gtk/compat.h +++ b/gtk/compat.h @@ -73,6 +73,14 @@ GtkWidget *nsgtk_combo_box_text_new(void); void nsgtk_combo_box_text_append_text(GtkWidget *combo_box, const gchar *text); gchar *nsgtk_combo_box_text_get_active_text(GtkWidget *combo_box); +/** + * creates a new image widget of an appropriate icon size from a pixbuf. + * + * \param pixbuf The pixbuf to use as a source. + * \param size The size of icon to create + * \return An image widget. + */ +GtkWidget *nsgtk_image_new_from_pixbuf_icon(GdkPixbuf *pixbuf, GtkIconSize size); /* GTK prior to 2.16 needs the sexy interface for icons */ #if !GTK_CHECK_VERSION(2,16,0) @@ -111,23 +119,39 @@ enum { #endif -GtkWidget *nsgtk_entry_new(void); -void nsgtk_entry_set_icon_from_pixbuf(GtkWidget *entry, GtkEntryIconPosition icon_pos, GdkPixbuf *pixbuf); /** - * Sets the icon shown in the entry at the specified position from a stock image. + * Sets the icon shown in the entry at the specified position from a + * stock image. + * + * Compatability interface for original deprecated in GTK 3.10 * - * Compatability interface for interface deprecated in 3.10 + * \param stock_id the name of the stock item */ void nsgtk_entry_set_icon_from_stock(GtkWidget *entry, GtkEntryIconPosition icon_pos, const gchar *stock_id); /** * Creates a GtkImage displaying a stock icon. * - * Compatability interface for interface deprecated in 3.10 + * Compatability interface for original deprecated in GTK 3.10 + * + * \param stock_id the name of the stock item */ GtkWidget *nsgtk_image_new_from_stock(const gchar *stock_id, GtkIconSize size); +/** + * Creates a new GtkButton containing the image and text from a stock item. + * + * Compatability interface for original deprecated in GTK 3.10 + * + * \param stock_id the name of the stock item + */ +GtkWidget *nsgtk_button_new_from_stock(const gchar *stock_id); + +GtkWidget *nsgtk_entry_new(void); + +void nsgtk_entry_set_icon_from_pixbuf(GtkWidget *entry, GtkEntryIconPosition icon_pos, GdkPixbuf *pixbuf); + void nsgtk_widget_override_background_color(GtkWidget *widget, GtkStateFlags state, uint16_t a, uint16_t r, uint16_t g, uint16_t b); GtkWidget* nsgtk_hbox_new(gboolean homogeneous, gint spacing); GtkWidget* nsgtk_vbox_new(gboolean homogeneous, gint spacing); |