mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
Remove deprecated GtkEntry functions
This commit is contained in:
parent
2fafb74105
commit
90d514a8a5
@ -1156,14 +1156,6 @@ gtk_entry_set_visibility
|
||||
gtk_entry_set_width_chars
|
||||
gtk_entry_text_index_to_layout_index
|
||||
gtk_entry_unset_invisible_char
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
gtk_entry_append_text
|
||||
gtk_entry_new_with_max_length
|
||||
gtk_entry_prepend_text
|
||||
gtk_entry_select_region
|
||||
gtk_entry_set_editable
|
||||
gtk_entry_set_position
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
137
gtk/gtkentry.c
137
gtk/gtkentry.c
@ -6591,32 +6591,6 @@ gtk_entry_new_with_buffer (GtkEntryBuffer *buffer)
|
||||
return g_object_new (GTK_TYPE_ENTRY, "buffer", buffer, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_new_with_max_length:
|
||||
* @max: the maximum length of the entry, or 0 for no maximum.
|
||||
* (other than the maximum length of entries.) The value passed in will
|
||||
* be clamped to the range 0-65536.
|
||||
*
|
||||
* Creates a new #GtkEntry widget with the given maximum length.
|
||||
*
|
||||
* Return value: a new #GtkEntry
|
||||
*
|
||||
* Deprecated: 2.0: Use gtk_entry_set_max_length() instead.
|
||||
**/
|
||||
GtkWidget*
|
||||
gtk_entry_new_with_max_length (gint max)
|
||||
{
|
||||
GtkEntry *entry;
|
||||
|
||||
max = CLAMP (max, 0, GTK_ENTRY_BUFFER_MAX_SIZE);
|
||||
|
||||
entry = g_object_new (GTK_TYPE_ENTRY, NULL);
|
||||
gtk_entry_buffer_set_max_length (get_buffer (entry), max);
|
||||
|
||||
return GTK_WIDGET (entry);
|
||||
}
|
||||
|
||||
|
||||
static GtkEntryBuffer*
|
||||
get_buffer (GtkEntry *entry)
|
||||
{
|
||||
@ -6784,75 +6758,6 @@ gtk_entry_set_text (GtkEntry *entry,
|
||||
g_signal_handler_unblock (entry, completion->priv->changed_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_append_text:
|
||||
* @entry: a #GtkEntry
|
||||
* @text: the text to append
|
||||
*
|
||||
* Appends the given text to the contents of the widget.
|
||||
*
|
||||
* Deprecated: 2.0: Use gtk_editable_insert_text() instead.
|
||||
*/
|
||||
void
|
||||
gtk_entry_append_text (GtkEntry *entry,
|
||||
const gchar *text)
|
||||
{
|
||||
GtkEntryPrivate *priv;
|
||||
gint tmp_pos;
|
||||
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
g_return_if_fail (text != NULL);
|
||||
priv = GTK_ENTRY_GET_PRIVATE (entry);
|
||||
|
||||
tmp_pos = gtk_entry_buffer_get_length (get_buffer (entry));
|
||||
gtk_editable_insert_text (GTK_EDITABLE (entry), text, -1, &tmp_pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_prepend_text:
|
||||
* @entry: a #GtkEntry
|
||||
* @text: the text to prepend
|
||||
*
|
||||
* Prepends the given text to the contents of the widget.
|
||||
*
|
||||
* Deprecated: 2.0: Use gtk_editable_insert_text() instead.
|
||||
*/
|
||||
void
|
||||
gtk_entry_prepend_text (GtkEntry *entry,
|
||||
const gchar *text)
|
||||
{
|
||||
gint tmp_pos;
|
||||
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
g_return_if_fail (text != NULL);
|
||||
|
||||
tmp_pos = 0;
|
||||
gtk_editable_insert_text (GTK_EDITABLE (entry), text, -1, &tmp_pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_set_position:
|
||||
* @entry: a #GtkEntry
|
||||
* @position: the position of the cursor. The cursor is displayed
|
||||
* before the character with the given (base 0) index in the widget.
|
||||
* The value must be less than or equal to the number of characters
|
||||
* in the widget. A value of -1 indicates that the position should
|
||||
* be set after the last character in the entry. Note that this
|
||||
* position is in characters, not in bytes.
|
||||
*
|
||||
* Sets the cursor position in an entry to the given value.
|
||||
*
|
||||
* Deprecated: 2.0: Use gtk_editable_set_position() instead.
|
||||
*/
|
||||
void
|
||||
gtk_entry_set_position (GtkEntry *entry,
|
||||
gint position)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
|
||||
gtk_editable_set_position (GTK_EDITABLE (entry), position);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_set_visibility:
|
||||
* @entry: a #GtkEntry
|
||||
@ -6993,26 +6898,6 @@ gtk_entry_unset_invisible_char (GtkEntry *entry)
|
||||
gtk_entry_recompute (entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_set_editable:
|
||||
* @entry: a #GtkEntry
|
||||
* @editable: %TRUE if the user is allowed to edit the text
|
||||
* in the widget
|
||||
*
|
||||
* Determines if the user can edit the text in the editable
|
||||
* widget or not.
|
||||
*
|
||||
* Deprecated: 2.0: Use gtk_editable_set_editable() instead.
|
||||
*/
|
||||
void
|
||||
gtk_entry_set_editable (GtkEntry *entry,
|
||||
gboolean editable)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
|
||||
gtk_editable_set_editable (GTK_EDITABLE (entry), editable);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_set_overwrite_mode:
|
||||
* @entry: a #GtkEntry
|
||||
@ -7079,28 +6964,6 @@ gtk_entry_get_text (GtkEntry *entry)
|
||||
return gtk_entry_buffer_get_text (get_buffer (entry));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_select_region:
|
||||
* @entry: a #GtkEntry
|
||||
* @start: the starting position
|
||||
* @end: the end position
|
||||
*
|
||||
* Selects a region of text. The characters that are selected are
|
||||
* those characters at positions from @start_pos up to, but not
|
||||
* including @end_pos. If @end_pos is negative, then the the characters
|
||||
* selected will be those characters from @start_pos to the end of
|
||||
* the text.
|
||||
*
|
||||
* Deprecated: 2.0: Use gtk_editable_select_region() instead.
|
||||
*/
|
||||
void
|
||||
gtk_entry_select_region (GtkEntry *entry,
|
||||
gint start,
|
||||
gint end)
|
||||
{
|
||||
gtk_editable_select_region (GTK_EDITABLE (entry), start, end);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_entry_set_max_length:
|
||||
* @entry: a #GtkEntry
|
||||
|
@ -303,28 +303,6 @@ void gtk_entry_set_icon_drag_source (GtkEntry *
|
||||
GdkDragAction actions);
|
||||
gint gtk_entry_get_current_icon_drag_source (GtkEntry *entry);
|
||||
|
||||
GdkWindow * gtk_entry_get_icon_window (GtkEntry *entry,
|
||||
GtkEntryIconPosition icon_pos);
|
||||
|
||||
|
||||
/* Deprecated compatibility functions
|
||||
*/
|
||||
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
GtkWidget* gtk_entry_new_with_max_length (gint max);
|
||||
void gtk_entry_append_text (GtkEntry *entry,
|
||||
const gchar *text);
|
||||
void gtk_entry_prepend_text (GtkEntry *entry,
|
||||
const gchar *text);
|
||||
void gtk_entry_set_position (GtkEntry *entry,
|
||||
gint position);
|
||||
void gtk_entry_select_region (GtkEntry *entry,
|
||||
gint start,
|
||||
gint end);
|
||||
void gtk_entry_set_editable (GtkEntry *entry,
|
||||
gboolean editable);
|
||||
#endif /* GTK_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_ENTRY_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user