diff options
author | Cody Russell <bratsche@gnome.org> | 2008-12-19 17:44:56 +0000 |
---|---|---|
committer | Cody Russell <bratsche@src.gnome.org> | 2008-12-19 17:44:56 +0000 |
commit | d6ca973cab495f0ef71119fe2ae501dbf2b22efb (patch) | |
tree | 46fca6edfe2d3eadc59e974b155646f8674781cb /gtk/gtkentry.h | |
parent | 8ff5d4ffc4dba1ab870660250e2542d7c1a2dd40 (diff) | |
download | gtk+-d6ca973cab495f0ef71119fe2ae501dbf2b22efb.tar.gz |
Bug 85292 – add an icon to gtkentry
2008-12-19 Cody Russell <bratsche@gnome.org>
Bug 85292 – add an icon to gtkentry
* gtk/gtkmarshalers.list: Add VOID:INT,BOXED
* tests/testentryicons.c: Initial icon entry test
* tests/Makefile.am: Add testentryicons
* gtk/gtkentry.[ch]: Add API for setting primary/secondary icons
and other features related to them.
svn path=/trunk/; revision=21914
Diffstat (limited to 'gtk/gtkentry.h')
-rw-r--r-- | gtk/gtkentry.h | 95 |
1 files changed, 78 insertions, 17 deletions
diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h index b5781d4f1e..0df34b5829 100644 --- a/gtk/gtkentry.h +++ b/gtk/gtkentry.h @@ -1,6 +1,10 @@ /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * + * Copyright (C) 2004-2006 Christian Hammond + * Copyright (C) 2008 Cody Russell + * Copyright (C) 2008 Red Hat, Inc. + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -36,6 +40,8 @@ #include <gtk/gtkimcontext.h> #include <gtk/gtkmenu.h> #include <gtk/gtkentrycompletion.h> +#include <gtk/gtkimage.h> +#include <gtk/gtkselection.h> G_BEGIN_DECLS @@ -47,6 +53,11 @@ G_BEGIN_DECLS #define GTK_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY)) #define GTK_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY, GtkEntryClass)) +typedef enum +{ + GTK_ENTRY_ICON_PRIMARY, + GTK_ENTRY_ICON_SECONDARY +} GtkEntryIconPosition; typedef struct _GtkEntry GtkEntry; typedef struct _GtkEntryClass GtkEntryClass; @@ -123,21 +134,21 @@ struct _GtkEntryClass /* Action signals */ - void (* activate) (GtkEntry *entry); - void (* move_cursor) (GtkEntry *entry, - GtkMovementStep step, - gint count, - gboolean extend_selection); - void (* insert_at_cursor) (GtkEntry *entry, - const gchar *str); - void (* delete_from_cursor) (GtkEntry *entry, - GtkDeleteType type, - gint count); - void (* backspace) (GtkEntry *entry); - void (* cut_clipboard) (GtkEntry *entry); - void (* copy_clipboard) (GtkEntry *entry); - void (* paste_clipboard) (GtkEntry *entry); - void (* toggle_overwrite) (GtkEntry *entry); + void (* activate) (GtkEntry *entry); + void (* move_cursor) (GtkEntry *entry, + GtkMovementStep step, + gint count, + gboolean extend_selection); + void (* insert_at_cursor) (GtkEntry *entry, + const gchar *str); + void (* delete_from_cursor) (GtkEntry *entry, + GtkDeleteType type, + gint count); + void (* backspace) (GtkEntry *entry); + void (* cut_clipboard) (GtkEntry *entry); + void (* copy_clipboard) (GtkEntry *entry); + void (* paste_clipboard) (GtkEntry *entry); + void (* toggle_overwrite) (GtkEntry *entry); /* hook to add other objects beside the entry (like in GtkSpinButton) */ void (* get_text_area_size) (GtkEntry *entry, @@ -147,8 +158,8 @@ struct _GtkEntryClass gint *height); /* Padding for future expansion */ - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); }; GType gtk_entry_get_type (void) G_GNUC_CONST; @@ -224,6 +235,56 @@ gdouble gtk_entry_get_progress_pulse_step (GtkEntry *entry); void gtk_entry_progress_pulse (GtkEntry *entry); +/* Setting and managing icons + */ +void gtk_entry_set_icon_from_pixbuf (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + GdkPixbuf *pixbuf); +void gtk_entry_set_icon_from_stock (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + const gchar *stock_id); +void gtk_entry_set_icon_from_icon_name (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + const gchar *icon_name); +void gtk_entry_set_icon_from_gicon (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + GIcon *icon); +GtkImageType gtk_entry_get_storage_type (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +GdkPixbuf* gtk_entry_get_pixbuf (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +const gchar* gtk_entry_get_stock (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +const gchar* gtk_entry_get_icon_name (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +GIcon* gtk_entry_get_gicon (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +void gtk_entry_set_icon_activatable (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + gboolean activatable); +gboolean gtk_entry_get_icon_activatable (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +void gtk_entry_set_icon_sensitive (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + gboolean sensitive); +gboolean gtk_entry_get_icon_sensitive (GtkEntry *entry, + GtkEntryIconPosition icon_pos); +gint gtk_entry_get_icon_at_pos (GtkEntry *entry, + gint x, + gint y); +void gtk_entry_set_icon_tooltip_text (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + const gchar *tooltip); +void gtk_entry_set_icon_tooltip_markup (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + const gchar *tooltip); +void gtk_entry_set_icon_drag_source (GtkEntry *entry, + GtkEntryIconPosition icon_pos, + GtkTargetList *target_list, + GdkDragAction actions); +gint gtk_entry_get_current_icon_drag_source (GtkEntry *entry); + + /* Deprecated compatibility functions */ |