* 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/.
*/
+/**
+ * SECTION:gtkeditable
+ * @Short_description: Interface for text-editing widgets
+ * @Title: GtkEditable
+ *
+ * The #GtkEditable interface is an interface which should be implemented by
+ * text editing widgets, such as #GtkEntry and #GtkSpinButton. It contains functions
+ * for generically manipulating an editable widget, a large number of action
+ * signals used for key bindings, and several signals that an application can
+ * connect to to modify the behavior of a widget.
+ *
+ * As an example of the latter usage, by connecting
+ * the following handler to #GtkEditable::insert-text, an application
+ * can convert all entry into a widget into uppercase.
+ *
+ * <example>
+ * <title>Forcing entry to uppercase.</title>
+ * <programlisting>
+ * #include <ctype.h>
+ *
+ * void
+ * insert_text_handler (GtkEditable *editable,
+ * const gchar *text,
+ * gint length,
+ * gint *position,
+ * gpointer data)
+ * {
+ * gchar *result = g_utf8_strup (text, length);
+ *
+ * g_signal_handlers_block_by_func (editable,
+ * (gpointer) insert_text_handler, data);
+ * gtk_editable_insert_text (editable, result, length, position);
+ * g_signal_handlers_unblock_by_func (editable,
+ * (gpointer) insert_text_handler, data);
+ *
+ * g_signal_stop_emission_by_name (editable, "insert_text");
+ *
+ * g_free (result);
+ * }
+ * </programlisting>
+ * </example>
+ */
+
#include "config.h"
#include <string.h>
* @new_text: the new text to insert
* @new_text_length: the length of the new text, in bytes,
* or -1 if new_text is nul-terminated
- * @position: the position, in characters, at which to insert
- * the new text. this is an in-out parameter.
- * After the signal emission is finished, it should
- * point after the newly inserted text.
+ * @position: (inout) (type int): the position, in characters,
+ * at which to insert the new text. this is an in-out
+ * parameter. After the signal emission is finished, it
+ * should point after the newly inserted text.
*
* This signal is emitted when text is inserted into
* the widget by the user. The default handler for
*
* Note that the position is in characters, not in bytes.
* The function updates @position to point after the newly inserted text.
+ *
+ * Virtual: do_insert_text
*/
void
gtk_editable_insert_text (GtkEditable *editable,
*
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from @start_pos up to, but not including
- * @end_pos. If @end_pos is negative, then the the characters deleted
+ * @end_pos. If @end_pos is negative, then the characters deleted
* are those from @start_pos to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
+ *
+ * Virtual: do_delete_text
*/
void
gtk_editable_delete_text (GtkEditable *editable,
*
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from @start_pos up to, but not
- * including @end_pos. If @end_pos is negative, then the the characters
+ * including @end_pos. If @end_pos is negative, then the characters
* retrieved are those characters from @start_pos to the end of the text.
*
* Note that positions are specified in characters, not bytes.
*
* 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
+ * including @end_pos. If @end_pos is negative, then the
* characters selected are those characters from @start_pos to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
+ *
+ * Virtual: set_selection_bounds
*/
void
gtk_editable_select_region (GtkEditable *editable,