NetSurf
|
Compatibility functions for older GTK versions (interface) More...
#include <stdint.h>
#include <gtk/gtk.h>
#include "gtk/sexy_icon_entry.h"
#include <gdk/gdkkeysyms.h>
Go to the source code of this file.
Macros | |
#define | NSGTK_STOCK_ADD GTK_STOCK_ADD |
#define | NSGTK_STOCK_CANCEL GTK_STOCK_CANCEL |
#define | NSGTK_STOCK_CLEAR GTK_STOCK_CLEAR |
#define | NSGTK_STOCK_CLOSE GTK_STOCK_CLOSE |
#define | NSGTK_STOCK_HOME GTK_STOCK_HOME |
#define | NSGTK_STOCK_INFO GTK_STOCK_INFO |
#define | NSGTK_STOCK_REFRESH GTK_STOCK_REFRESH |
#define | NSGTK_STOCK_SAVE GTK_STOCK_SAVE |
#define | NSGTK_STOCK_SAVE_AS GTK_STOCK_SAVE_AS |
#define | NSGTK_STOCK_STOP GTK_STOCK_STOP |
#define | NSGTK_STOCK_OK GTK_STOCK_OK |
#define | NSGTK_STOCK_OPEN GTK_STOCK_OPEN |
#define | NSGTK_STOCK_OPEN_MENU GTK_STOCK_JUSTIFY_FILL |
#define | G_VALUE_INIT { 0, { { 0 } } } |
#define | GDK_KEY(symbol) GDK_##symbol |
#define | GTK_STATE_FLAG_NORMAL GTK_STATE_NORMAL |
#define | gtk_widget_in_destruction(widget) (GTK_OBJECT_FLAGS(GTK_OBJECT(widget)) & GTK_IN_DESTRUCTION) |
Typedefs | |
typedef GtkStateType | GtkStateFlags |
typedef GtkStyle | GtkStyleContext |
Enumerations | |
enum | GtkAlign { GTK_ALIGN_FILL , GTK_ALIGN_START , GTK_ALIGN_END , GTK_ALIGN_CENTER , GTK_ALIGN_BASELINE } |
enum | GtkEntryIconPosition { GTK_ENTRY_ICON_PRIMARY = SEXY_ICON_ENTRY_PRIMARY , GTK_ENTRY_ICON_SECONDARY = SEXY_ICON_ENTRY_SECONDARY } |
Functions | |
void | nsgtk_widget_set_alignment (GtkWidget *widget, GtkAlign halign, GtkAlign valign) |
Set the alignment of a widget. More... | |
void | nsgtk_widget_set_margins (GtkWidget *widget, gint hmargin, gint vmargin) |
Set the margins of a widget. More... | |
void | nsgtk_widget_set_can_focus (GtkWidget *widget, gboolean can_focus) |
gboolean | nsgtk_widget_has_focus (GtkWidget *widget) |
gboolean | nsgtk_widget_get_visible (GtkWidget *widget) |
gboolean | nsgtk_widget_get_realized (GtkWidget *widget) |
gboolean | nsgtk_widget_get_mapped (GtkWidget *widget) |
gboolean | nsgtk_widget_is_drawable (GtkWidget *widget) |
void | nsgtk_dialog_set_has_separator (GtkDialog *dialog, gboolean setting) |
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) |
GtkWidget * | nsgtk_image_new_from_pixbuf_icon (GdkPixbuf *pixbuf, GtkIconSize size) |
creates a new image widget of an appropriate icon size from a pixbuf. More... | |
GtkStateType | nsgtk_widget_get_state (GtkWidget *widget) |
void | nsgtk_entry_set_icon_from_icon_name (GtkWidget *entry, GtkEntryIconPosition icon_pos, const gchar *stock_id) |
Sets the icon shown in the entry at the specified position from an icon name. More... | |
GtkWidget * | nsgtk_image_new_from_stock (const gchar *stock_id, GtkIconSize size) |
Creates a GtkImage displaying a stock icon. More... | |
GtkWidget * | nsgtk_button_new_from_stock (const gchar *stock_id) |
Creates a new GtkButton containing the image and text from a stock item. More... | |
gboolean | nsgtk_stock_lookup (const gchar *stock_id, GtkStockItem *item) |
Fills item with the registered values for stock_id. More... | |
void | nsgtk_button_set_focus_on_click (GtkButton *button, gboolean focus_on_click) |
Sets whether the button will grab focus when it is clicked with the mouse. More... | |
void | nsgtk_window_set_opacity (GtkWindow *window, gdouble opacity) |
void | nsgtk_scrolled_window_add_with_viewport (GtkScrolledWindow *window, GtkWidget *child) |
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) |
GtkStateFlags | nsgtk_widget_get_state_flags (GtkWidget *widget) |
GtkStyleContext * | nsgtk_widget_get_style_context (GtkWidget *widget) |
const PangoFontDescription * | nsgtk_style_context_get_font (GtkStyleContext *style, GtkStateFlags state) |
gulong | nsgtk_connect_draw_event (GtkWidget *widget, GCallback callback, gpointer g) |
void | nsgdk_cursor_unref (GdkCursor *cursor) |
void | nsgtk_widget_modify_font (GtkWidget *widget, PangoFontDescription *font_desc) |
GdkWindow * | nsgtk_widget_get_window (GtkWidget *widget) |
GtkWidget * | nsgtk_dialog_get_content_area (GtkDialog *dialog) |
gboolean | nsgtk_show_uri (GdkScreen *screen, const gchar *uri, guint32 timestamp, GError **error) |
GdkWindow * | nsgtk_layout_get_bin_window (GtkLayout *layout) |
void | nsgtk_widget_get_allocation (GtkWidget *widget, GtkAllocation *allocation) |
gboolean | nsgtk_icon_size_lookup_for_settings (GtkSettings *settings, GtkIconSize size, gint *width, gint *height) |
GtkAdjustment * | nsgtk_layout_get_vadjustment (GtkLayout *layout) |
GtkAdjustment * | nsgtk_layout_get_hadjustment (GtkLayout *layout) |
void | nsgtk_layout_set_hadjustment (GtkLayout *layout, GtkAdjustment *adj) |
void | nsgtk_layout_set_vadjustment (GtkLayout *layout, GtkAdjustment *adj) |
gdouble | nsgtk_adjustment_get_step_increment (GtkAdjustment *adjustment) |
gdouble | nsgtk_adjustment_get_upper (GtkAdjustment *adjustment) |
gdouble | nsgtk_adjustment_get_lower (GtkAdjustment *adjustment) |
gdouble | nsgtk_adjustment_get_page_increment (GtkAdjustment *adjustment) |
GtkWidget * | nsgtk_image_menu_item_new_with_mnemonic (const gchar *label) |
Creates a new GtkImageMenuItem containing a label. More... | |
void | nsgtk_image_menu_item_set_image (GtkWidget *image_menu_item, GtkWidget *image) |
Sets the image of image_menu_item to the given widget. More... | |
void | nsgtk_menu_popup_at_pointer (GtkMenu *menu, const GdkEvent *trigger_event) |
Displays menu and makes it available for selection. More... | |
guint | nsgtk_builder_add_from_resource (GtkBuilder *builder, const gchar *resource_path, GError **error) |
Parses a resource file containing a GtkBuilder UI definition and merges it with the current contents of builder. More... | |
Compatibility functions for older GTK versions (interface)
Definition in file compat.h.
#define gtk_widget_in_destruction | ( | widget | ) | (GTK_OBJECT_FLAGS(GTK_OBJECT(widget)) & GTK_IN_DESTRUCTION) |
typedef GtkStateType GtkStateFlags |
typedef GtkStyle GtkStyleContext |
enum GtkAlign |
enum GtkEntryIconPosition |
void nsgdk_cursor_unref | ( | GdkCursor * | cursor | ) |
Definition at line 384 of file compat.c.
Referenced by gui_window_set_pointer().
gdouble nsgtk_adjustment_get_lower | ( | GtkAdjustment * | adjustment | ) |
Definition at line 471 of file compat.c.
Referenced by nsgtk_cw_key(), nsgtk_window_keypress_event(), and nsgtk_window_scroll_event().
gdouble nsgtk_adjustment_get_page_increment | ( | GtkAdjustment * | adjustment | ) |
Definition at line 480 of file compat.c.
Referenced by nsgtk_cw_key(), and nsgtk_window_keypress_event().
gdouble nsgtk_adjustment_get_step_increment | ( | GtkAdjustment * | adjustment | ) |
Definition at line 453 of file compat.c.
Referenced by nsgtk_cw_key(), nsgtk_window_keypress_event(), and nsgtk_window_scroll_event().
gdouble nsgtk_adjustment_get_upper | ( | GtkAdjustment * | adjustment | ) |
Definition at line 462 of file compat.c.
Referenced by nsgtk_cw_key(), nsgtk_window_keypress_event(), and nsgtk_window_scroll_event().
guint nsgtk_builder_add_from_resource | ( | GtkBuilder * | builder, |
const gchar * | resource_path, | ||
GError ** | error | ||
) |
Parses a resource file containing a GtkBuilder UI definition and merges it with the current contents of builder.
Compatability interface as this did not exist prior to GTK 3.4
GTK prior to 3.4 can have the resources in a GResource but gtk_builder cannot directly instantiate from them
GTK 3.4 onwards can use gtk_builder_add_from_resource() to add directly from resources. The gtk_builder_new_ type operations cannot be used because they are only available post 3.10 and handle all errors by aborting the application
builder | a GtkBuilder |
resource_path | the path of the resource file to parse |
error | return location for an error, or NULL. |
Definition at line 646 of file compat.c.
References buffer.
Referenced by nsgtk_builder_new_from_resname().
GtkWidget * nsgtk_button_new_from_stock | ( | const gchar * | stock_id | ) |
void nsgtk_button_set_focus_on_click | ( | GtkButton * | button, |
gboolean | focus_on_click | ||
) |
Sets whether the button will grab focus when it is clicked with the mouse.
Compatability interface for original deprecated in GTK 3.20
button | The button alter |
focus_on_click | whether the button grabs focus when clicked with the mouse |
Definition at line 219 of file compat.c.
Referenced by nsgtk_tab_label_setup().
void nsgtk_combo_box_text_append_text | ( | GtkWidget * | combo_box, |
const gchar * | text | ||
) |
gchar * nsgtk_combo_box_text_get_active_text | ( | GtkWidget * | combo_box | ) |
gulong nsgtk_connect_draw_event | ( | GtkWidget * | widget, |
GCallback | callback, | ||
gpointer | g | ||
) |
Definition at line 373 of file compat.c.
Referenced by gui_window_create(), and nsgtk_corewindow_init().
GtkWidget * nsgtk_dialog_get_content_area | ( | GtkDialog * | dialog | ) |
Definition at line 413 of file compat.c.
References dialog.
Referenced by nsgtk_about_dialog_init(), and nsgtk_viewdata_file_save().
void nsgtk_dialog_set_has_separator | ( | GtkDialog * | dialog, |
gboolean | setting | ||
) |
Definition at line 105 of file compat.c.
References dialog.
Referenced by nsgtk_about_dialog_init().
GtkWidget * nsgtk_entry_new | ( | void | ) |
Definition at line 142 of file compat.c.
References sexy_icon_entry_new().
Referenced by make_toolbar_item_url_bar(), and make_toolbar_item_websearch().
void nsgtk_entry_set_icon_from_icon_name | ( | GtkWidget * | entry, |
GtkEntryIconPosition | icon_pos, | ||
const gchar * | stock_id | ||
) |
Sets the icon shown in the entry at the specified position from an icon name.
Compatability interface for original introduced in 2.16
entry | The entry widget to set the icon on. |
icon_pos | The position of the icon. |
stock_id | the name of the stock item. |
Definition at line 173 of file compat.c.
References SEXY_ICON_ENTRY, and sexy_icon_entry_set_icon().
Referenced by make_toolbar_item_url_bar(), make_toolbar_item_websearch(), nsgtk_toolbar_page_info_change(), and nsgtk_toolbar_set_websearch_image().
void nsgtk_entry_set_icon_from_pixbuf | ( | GtkWidget * | entry, |
GtkEntryIconPosition | icon_pos, | ||
GdkPixbuf * | pixbuf | ||
) |
Definition at line 151 of file compat.c.
References SEXY_ICON_ENTRY, and sexy_icon_entry_set_icon().
Referenced by make_toolbar_item_websearch(), and nsgtk_toolbar_set_websearch_image().
GtkWidget * nsgtk_hbox_new | ( | gboolean | homogeneous, |
gint | spacing | ||
) |
Definition at line 317 of file compat.c.
Referenced by nsgtk_tab_add_newtab(), and nsgtk_tab_label_setup().
gboolean nsgtk_icon_size_lookup_for_settings | ( | GtkSettings * | settings, |
GtkIconSize | size, | ||
gint * | width, | ||
gint * | height | ||
) |
GtkWidget * nsgtk_image_menu_item_new_with_mnemonic | ( | const gchar * | label | ) |
Creates a new GtkImageMenuItem containing a label.
Compatability interface for original deprecated in GTK 3.10.
label | The text of the button, with an underscore in front of the mnemonic character. |
Definition at line 543 of file compat.c.
Referenced by nsgtk_menu_add_image_item().
void nsgtk_image_menu_item_set_image | ( | GtkWidget * | image_menu_item, |
GtkWidget * | image | ||
) |
Sets the image of image_menu_item to the given widget.
Compatability interface for original deprecated in GTK 3.10.
image_menu_item | The image menu entry item. |
image | The image to set. |
Definition at line 553 of file compat.c.
Referenced by nsgtk_menu_set_icons().
GtkWidget * nsgtk_image_new_from_pixbuf_icon | ( | GdkPixbuf * | pixbuf, |
GtkIconSize | size | ||
) |
creates a new image widget of an appropriate icon size from a pixbuf.
pixbuf | The pixbuf to use as a source. |
size | The size of icon to create |
Definition at line 502 of file compat.c.
Referenced by nsgtk_about_dialog_init().
GtkWidget * nsgtk_image_new_from_stock | ( | const gchar * | stock_id, |
GtkIconSize | size | ||
) |
Creates a GtkImage displaying a stock icon.
Compatability interface for original deprecated in GTK 3.10
stock_id | the name of the stock item. |
size | The size of icon to create. |
Definition at line 198 of file compat.c.
Referenced by nsgtk_download_dialog_show(), nsgtk_tab_label_setup(), and sexy_icon_entry_add_clear_button().
GdkWindow * nsgtk_layout_get_bin_window | ( | GtkLayout * | layout | ) |
Definition at line 444 of file compat.c.
Referenced by gui_window_create(), and nsgtk_window_draw_event().
GtkAdjustment * nsgtk_layout_get_hadjustment | ( | GtkLayout * | layout | ) |
Definition at line 278 of file compat.c.
Referenced by gui_window_get_scroll(), gui_window_set_scroll(), nsgtk_window_keypress_event(), and nsgtk_window_scroll_event().
GtkAdjustment * nsgtk_layout_get_vadjustment | ( | GtkLayout * | layout | ) |
Definition at line 269 of file compat.c.
Referenced by gui_window_get_scroll(), gui_window_set_scroll(), nsgtk_window_keypress_event(), and nsgtk_window_scroll_event().
void nsgtk_layout_set_hadjustment | ( | GtkLayout * | layout, |
GtkAdjustment * | adj | ||
) |
Definition at line 297 of file compat.c.
References nsgtk_layout_set_adjustment_step_increment().
void nsgtk_layout_set_vadjustment | ( | GtkLayout * | layout, |
GtkAdjustment * | adj | ||
) |
Definition at line 307 of file compat.c.
References nsgtk_layout_set_adjustment_step_increment().
void nsgtk_menu_popup_at_pointer | ( | GtkMenu * | menu, |
const GdkEvent * | trigger_event | ||
) |
Displays menu and makes it available for selection.
Compatability interface for gtk_menu_popup deprecated in GTK 3.22.
image_menu_item | The image menu entry item. |
trigger_event | the GdkEvent that initiated this request or NULL if it's the current event. |
Definition at line 561 of file compat.c.
Referenced by gui_window_create_form_select_menu(), nsgtk_scaffolding_burger_menu(), nsgtk_scaffolding_context_menu(), and nsgtk_scaffolding_toolbar_context_menu().
void nsgtk_scrolled_window_add_with_viewport | ( | GtkScrolledWindow * | window, |
GtkWidget * | child | ||
) |
gboolean nsgtk_show_uri | ( | GdkScreen * | screen, |
const gchar * | uri, | ||
guint32 | timestamp, | ||
GError ** | error | ||
) |
Definition at line 426 of file compat.c.
References nsgtk_current_scaffolding(), nsgtk_scaffolding_window(), and parent.
Referenced by gui_launch_url().
gboolean nsgtk_stock_lookup | ( | const gchar * | stock_id, |
GtkStockItem * | item | ||
) |
const PangoFontDescription * nsgtk_style_context_get_font | ( | GtkStyleContext * | style, |
GtkStateFlags | state | ||
) |
Definition at line 357 of file compat.c.
Referenced by nsgtk_tab_update_size().
GtkWidget * nsgtk_vbox_new | ( | gboolean | homogeneous, |
gint | spacing | ||
) |
Definition at line 326 of file compat.c.
Referenced by nsgtk_about_dialog_init().
void nsgtk_widget_get_allocation | ( | GtkWidget * | widget, |
GtkAllocation * | allocation | ||
) |
Definition at line 489 of file compat.c.
Referenced by gui_window_get_dimensions(), nsgtk_toolbar_get_icon_window_position(), nsgtk_window_keypress_event(), and nsgtk_window_scroll_event().
gboolean nsgtk_widget_get_mapped | ( | GtkWidget * | widget | ) |
Definition at line 87 of file compat.c.
Referenced by sexy_icon_entry_map(), and sexy_icon_entry_unmap().
gboolean nsgtk_widget_get_realized | ( | GtkWidget * | widget | ) |
Definition at line 78 of file compat.c.
Referenced by draw_icon(), sexy_icon_entry_map(), and sexy_icon_entry_size_allocate().
GtkStateType nsgtk_widget_get_state | ( | GtkWidget * | widget | ) |
Referenced by sexy_icon_entry_expose(), and sexy_icon_entry_realize().
GtkStateFlags nsgtk_widget_get_state_flags | ( | GtkWidget * | widget | ) |
Definition at line 335 of file compat.c.
Referenced by nsgtk_tab_update_size().
GtkStyleContext * nsgtk_widget_get_style_context | ( | GtkWidget * | widget | ) |
Definition at line 348 of file compat.c.
Referenced by nsgtk_tab_update_size().
gboolean nsgtk_widget_get_visible | ( | GtkWidget * | widget | ) |
Definition at line 69 of file compat.c.
Referenced by nsgtk_download_update().
GdkWindow * nsgtk_widget_get_window | ( | GtkWidget * | widget | ) |
Definition at line 404 of file compat.c.
Referenced by gui_window_set_pointer(), and nsgtk_cw_draw_event().
gboolean nsgtk_widget_is_drawable | ( | GtkWidget * | widget | ) |
Definition at line 96 of file compat.c.
Referenced by sexy_icon_entry_expose().
void nsgtk_widget_modify_font | ( | GtkWidget * | widget, |
PangoFontDescription * | font_desc | ||
) |
Definition at line 393 of file compat.c.
Referenced by window_init().
void nsgtk_widget_override_background_color | ( | GtkWidget * | widget, |
GtkStateFlags | state, | ||
uint16_t | a, | ||
uint16_t | r, | ||
uint16_t | g, | ||
uint16_t | b | ||
) |
Definition at line 240 of file compat.c.
Referenced by gui_window_create(), and nsgtk_corewindow_init().
Set the alignment of a widget.
sets both the horizontal and vertical alignement of a widget
widget | The widget to set alignent on. |
halign | The horizontal alignment to set. |
valign | The vertical alignment to set |
Definition at line 585 of file compat.c.
References GTK_ALIGN_END, and GTK_ALIGN_START.
Referenced by make_toolbar_item_throbber(), and nsgtk_tab_label_setup().
void nsgtk_widget_set_can_focus | ( | GtkWidget * | widget, |
gboolean | can_focus | ||
) |
Definition at line 48 of file compat.c.
Referenced by gui_window_create().
void nsgtk_widget_set_margins | ( | GtkWidget * | widget, |
gint | hmargin, | ||
gint | vmargin | ||
) |
Set the margins of a widget.
Sets the margin all round a widget.
widget | The widget to set alignent on. |
hmargin | The horizontal margin. |
vmargin | The vertical margin. |
Definition at line 625 of file compat.c.
Referenced by make_toolbar_item_button(), make_toolbar_item_throbber(), and nsgtk_tab_label_setup().