]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkentry.h
GtkLabelAccessible: Sanity check _get_text() input values
[~andy/gtk] / gtk / gtkentry.h
index b540aed3d29fe11be31c17df28330147d93d94f3..db80b9e5a51ab5a698143524055d527384a6f343 100644 (file)
@@ -16,9 +16,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
 #ifndef __GTK_ENTRY_H__
 #define __GTK_ENTRY_H__
 
 
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
 #include <gtk/gtkeditable.h>
 #include <gtk/gtkimcontext.h>
 #include <gtk/gtkmenu.h>
@@ -69,64 +67,16 @@ typedef enum
   GTK_ENTRY_ICON_SECONDARY
 } GtkEntryIconPosition;
 
-typedef struct _GtkEntry       GtkEntry;
-typedef struct _GtkEntryClass  GtkEntryClass;
+typedef struct _GtkEntry              GtkEntry;
+typedef struct _GtkEntryPrivate       GtkEntryPrivate;
+typedef struct _GtkEntryClass         GtkEntryClass;
 
 struct _GtkEntry
 {
-  GtkWidget  widget;
-
-  guint        GSEAL (editable) : 1;
-  guint        GSEAL (visible)  : 1;
-  guint        GSEAL (overwrite_mode) : 1;
-  guint        GSEAL (in_drag) : 1;                /* FIXME: Should be private?
-                                                       Dragging within the selection */
-
   /*< private >*/
-  GdkWindow    *GSEAL (text_area);
-  GtkIMContext *GSEAL (im_context);
-  GtkWidget    *GSEAL (popup_menu);
-
-  gint          GSEAL (current_pos);
-  gint          GSEAL (selection_bound);
-
-  PangoLayout  *GSEAL (cached_layout);
-
-  guint         GSEAL (cache_includes_preedit) : 1;
-  guint         GSEAL (need_im_reset)          : 1;
-  guint         GSEAL (has_frame)              : 1;
-  guint         GSEAL (activates_default)      : 1;
-  guint         GSEAL (cursor_visible)         : 1;
-  guint         GSEAL (in_click)               : 1; /* Flag so we don't select all when clicking in entry to focus in */
-  guint         GSEAL (is_cell_renderer)       : 1;
-  guint         GSEAL (editing_canceled)       : 1; /* Only used by GtkCellRendererText */ 
-  guint         GSEAL (mouse_cursor_obscured)  : 1;
-  guint         GSEAL (select_words)           : 1;
-  guint         GSEAL (select_lines)           : 1;
-  guint         GSEAL (resolved_dir)           : 4; /* PangoDirection */
-  guint         GSEAL (truncate_multiline)     : 1;
-
-  guint         GSEAL (button);
-  guint         GSEAL (blink_timeout);
-  guint         GSEAL (recompute_idle);
-  gint          GSEAL (scroll_offset);
-  gint          GSEAL (ascent);                            /* font ascent in pango units  */
-  gint          GSEAL (descent);                   /* font descent in pango units */
-
-  guint16       GSEAL (x_text_size);               /* allocated size, in bytes */
-  guint16       GSEAL (x_n_bytes);                 /* length in use, in bytes */
-
-  guint16       GSEAL (preedit_length);                    /* length of preedit string, in bytes */
-  guint16       GSEAL (preedit_cursor);                    /* offset of cursor within preedit string, in chars */
-
-  gint          GSEAL (dnd_position);              /* In chars, -1 == no DND cursor */
-
-  gint          GSEAL (drag_start_x);
-  gint          GSEAL (drag_start_y);
-
-  gunichar      GSEAL (invisible_char);
-
-  gint          GSEAL (width_chars);
+  GtkWidget  parent_instance;
+
+  GtkEntryPrivate *priv;
 };
 
 struct _GtkEntryClass
@@ -135,7 +85,7 @@ struct _GtkEntryClass
 
   /* Hook to customize right-click popup */
   void (* populate_popup)   (GtkEntry       *entry,
-                             GtkMenu        *menu);
+                             GtkWidget      *popup);
 
   /* Action signals
    */
@@ -155,12 +105,17 @@ struct _GtkEntryClass
   void (* paste_clipboard)    (GtkEntry             *entry);
   void (* toggle_overwrite)   (GtkEntry             *entry);
 
-  /* hook to add other objects beside the entry (like in GtkSpinButton) */
+  /* hooks to add other objects beside the entry (like in GtkSpinButton) */
   void (* get_text_area_size) (GtkEntry       *entry,
                               gint           *x,
                               gint           *y,
                               gint           *width,
                               gint           *height);
+  void (* get_frame_size)     (GtkEntry       *entry,
+                               gint           *x,
+                               gint           *y,
+                              gint           *width,
+                              gint           *height);
 
   /* Padding for future expansion */
   void (*_gtk_reserved1)      (void);
@@ -170,7 +125,6 @@ struct _GtkEntryClass
   void (*_gtk_reserved5)      (void);
   void (*_gtk_reserved6)      (void);
   void (*_gtk_reserved7)      (void);
-  void (*_gtk_reserved8)      (void);
 };
 
 GType      gtk_entry_get_type                  (void) G_GNUC_CONST;
@@ -197,9 +151,11 @@ void       gtk_entry_set_has_frame              (GtkEntry      *entry,
                                                  gboolean       setting);
 gboolean   gtk_entry_get_has_frame              (GtkEntry      *entry);
 
-void       gtk_entry_set_inner_border                (GtkEntry        *entry,
-                                                      const GtkBorder *border);
-G_CONST_RETURN GtkBorder* gtk_entry_get_inner_border (GtkEntry        *entry);
+GDK_DEPRECATED_IN_3_4
+void             gtk_entry_set_inner_border     (GtkEntry        *entry,
+                                                 const GtkBorder *border);
+GDK_DEPRECATED_IN_3_4
+const GtkBorder* gtk_entry_get_inner_border     (GtkEntry        *entry);
 
 void       gtk_entry_set_overwrite_mode         (GtkEntry      *entry,
                                                  gboolean       overwrite);
@@ -224,7 +180,7 @@ gint       gtk_entry_get_width_chars            (GtkEntry      *entry);
 void       gtk_entry_set_text                   (GtkEntry      *entry,
                                                  const gchar   *text);
 /* returns a reference to the text */
-G_CONST_RETURN gchar* gtk_entry_get_text        (GtkEntry      *entry);
+const gchar* gtk_entry_get_text        (GtkEntry      *entry);
 
 PangoLayout* gtk_entry_get_layout               (GtkEntry      *entry);
 void         gtk_entry_get_layout_offsets       (GtkEntry      *entry,
@@ -260,7 +216,11 @@ void           gtk_entry_set_progress_pulse_step (GtkEntry     *entry,
 gdouble        gtk_entry_get_progress_pulse_step (GtkEntry     *entry);
 
 void           gtk_entry_progress_pulse          (GtkEntry     *entry);
-
+GDK_AVAILABLE_IN_3_2
+const gchar*   gtk_entry_get_placeholder_text    (GtkEntry             *entry);
+GDK_AVAILABLE_IN_3_2
+void           gtk_entry_set_placeholder_text    (GtkEntry             *entry,
+                                                  const gchar          *text);
 /* Setting and managing icons
  */
 void           gtk_entry_set_icon_from_pixbuf            (GtkEntry             *entry,
@@ -321,6 +281,23 @@ gboolean    gtk_entry_im_context_filter_keypress         (GtkEntry             *
                                                           GdkEventKey          *event);
 void        gtk_entry_reset_im_context                   (GtkEntry             *entry);
 
+GDK_AVAILABLE_IN_3_6
+void            gtk_entry_set_input_purpose                  (GtkEntry             *entry,
+                                                              GtkInputPurpose       purpose);
+GDK_AVAILABLE_IN_3_6
+GtkInputPurpose gtk_entry_get_input_purpose                  (GtkEntry             *entry);
+
+GDK_AVAILABLE_IN_3_6
+void            gtk_entry_set_input_hints                    (GtkEntry             *entry,
+                                                              GtkInputHints         hints);
+GDK_AVAILABLE_IN_3_6
+GtkInputHints   gtk_entry_get_input_hints                    (GtkEntry             *entry);
+
+GDK_AVAILABLE_IN_3_6
+void            gtk_entry_set_attributes                     (GtkEntry             *entry,
+                                                              PangoAttrList        *attrs);
+GDK_AVAILABLE_IN_3_6
+PangoAttrList  *gtk_entry_get_attributes                     (GtkEntry             *entry);
 
 G_END_DECLS