Blame gtk/gtkeditable.c

Packit Service fb6fa5
/* GTK - The GIMP Toolkit
Packit Service fb6fa5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
/*
Packit Service fb6fa5
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit Service fb6fa5
 * file for a list of people on the GTK+ Team.  See the ChangeLog
Packit Service fb6fa5
 * files for a list of changes.  These files are distributed with
Packit Service fb6fa5
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#include "config.h"
Packit Service fb6fa5
#include <string.h>
Packit Service fb6fa5
Packit Service fb6fa5
#include "gtkeditable.h"
Packit Service fb6fa5
#include "gtkmarshalers.h"
Packit Service fb6fa5
#include "gtkintl.h"
Packit Service fb6fa5
#include "gtkalias.h"
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
static void gtk_editable_base_init (gpointer g_class);
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
GType
Packit Service fb6fa5
gtk_editable_get_type (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  static GType editable_type = 0;
Packit Service fb6fa5
Packit Service fb6fa5
  if (!editable_type)
Packit Service fb6fa5
    {
Packit Service fb6fa5
      const GTypeInfo editable_info =
Packit Service fb6fa5
      {
Packit Service fb6fa5
	sizeof (GtkEditableClass),  /* class_size */
Packit Service fb6fa5
	gtk_editable_base_init,	    /* base_init */
Packit Service fb6fa5
	NULL,			    /* base_finalize */
Packit Service fb6fa5
      };
Packit Service fb6fa5
Packit Service fb6fa5
      editable_type = g_type_register_static (G_TYPE_INTERFACE, I_("GtkEditable"),
Packit Service fb6fa5
					      &editable_info, 0);
Packit Service fb6fa5
    }
Packit Service fb6fa5
Packit Service fb6fa5
  return editable_type;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
static void
Packit Service fb6fa5
gtk_editable_base_init (gpointer g_class)
Packit Service fb6fa5
{
Packit Service fb6fa5
  static gboolean initialized = FALSE;
Packit Service fb6fa5
Packit Service fb6fa5
  if (! initialized)
Packit Service fb6fa5
    {
Packit Service fb6fa5
      /**
Packit Service fb6fa5
       * GtkEditable::insert-text:
Packit Service fb6fa5
       * @editable: the object which received the signal
Packit Service fb6fa5
       * @new_text: the new text to insert
Packit Service fb6fa5
       * @new_text_length: the length of the new text, in bytes,
Packit Service fb6fa5
       *     or -1 if new_text is nul-terminated
Packit Service fb6fa5
       * @position: (inout) (type int): the position, in characters,
Packit Service fb6fa5
       *     at which to insert the new text. this is an in-out
Packit Service fb6fa5
       *     parameter.  After the signal emission is finished, it
Packit Service fb6fa5
       *     should point after the newly inserted text.
Packit Service fb6fa5
       *
Packit Service fb6fa5
       * This signal is emitted when text is inserted into
Packit Service fb6fa5
       * the widget by the user. The default handler for
Packit Service fb6fa5
       * this signal will normally be responsible for inserting
Packit Service fb6fa5
       * the text, so by connecting to this signal and then
Packit Service fb6fa5
       * stopping the signal with g_signal_stop_emission(), it
Packit Service fb6fa5
       * is possible to modify the inserted text, or prevent
Packit Service fb6fa5
       * it from being inserted entirely.
Packit Service fb6fa5
       */
Packit Service fb6fa5
      g_signal_new (I_("insert-text"),
Packit Service fb6fa5
		    GTK_TYPE_EDITABLE,
Packit Service fb6fa5
		    G_SIGNAL_RUN_LAST,
Packit Service fb6fa5
		    G_STRUCT_OFFSET (GtkEditableClass, insert_text),
Packit Service fb6fa5
		    NULL, NULL,
Packit Service fb6fa5
		    _gtk_marshal_VOID__STRING_INT_POINTER,
Packit Service fb6fa5
		    G_TYPE_NONE, 3,
Packit Service fb6fa5
		    G_TYPE_STRING,
Packit Service fb6fa5
		    G_TYPE_INT,
Packit Service fb6fa5
		    G_TYPE_POINTER);
Packit Service fb6fa5
Packit Service fb6fa5
      /**
Packit Service fb6fa5
       * GtkEditable::delete-text:
Packit Service fb6fa5
       * @editable: the object which received the signal
Packit Service fb6fa5
       * @start_pos: the starting position
Packit Service fb6fa5
       * @end_pos: the end position
Packit Service fb6fa5
       * 
Packit Service fb6fa5
       * This signal is emitted when text is deleted from
Packit Service fb6fa5
       * the widget by the user. The default handler for
Packit Service fb6fa5
       * this signal will normally be responsible for deleting
Packit Service fb6fa5
       * the text, so by connecting to this signal and then
Packit Service fb6fa5
       * stopping the signal with g_signal_stop_emission(), it
Packit Service fb6fa5
       * is possible to modify the range of deleted text, or
Packit Service fb6fa5
       * prevent it from being deleted entirely. The @start_pos
Packit Service fb6fa5
       * and @end_pos parameters are interpreted as for
Packit Service fb6fa5
       * gtk_editable_delete_text().
Packit Service fb6fa5
       */
Packit Service fb6fa5
      g_signal_new (I_("delete-text"),
Packit Service fb6fa5
		    GTK_TYPE_EDITABLE,
Packit Service fb6fa5
		    G_SIGNAL_RUN_LAST,
Packit Service fb6fa5
		    G_STRUCT_OFFSET (GtkEditableClass, delete_text),
Packit Service fb6fa5
		    NULL, NULL,
Packit Service fb6fa5
		    _gtk_marshal_VOID__INT_INT,
Packit Service fb6fa5
		    G_TYPE_NONE, 2,
Packit Service fb6fa5
		    G_TYPE_INT,
Packit Service fb6fa5
		    G_TYPE_INT);
Packit Service fb6fa5
      /**
Packit Service fb6fa5
       * GtkEditable::changed:
Packit Service fb6fa5
       * @editable: the object which received the signal
Packit Service fb6fa5
       *
Packit Service fb6fa5
       * The ::changed signal is emitted at the end of a single
Packit Service fb6fa5
       * user-visible operation on the contents of the #GtkEditable.
Packit Service fb6fa5
       *
Packit Service fb6fa5
       * E.g., a paste operation that replaces the contents of the
Packit Service fb6fa5
       * selection will cause only one signal emission (even though it
Packit Service fb6fa5
       * is implemented by first deleting the selection, then inserting
Packit Service fb6fa5
       * the new content, and may cause multiple ::notify::text signals
Packit Service fb6fa5
       * to be emitted).
Packit Service fb6fa5
       */ 
Packit Service fb6fa5
      g_signal_new (I_("changed"),
Packit Service fb6fa5
		    GTK_TYPE_EDITABLE,
Packit Service fb6fa5
		    G_SIGNAL_RUN_LAST,
Packit Service fb6fa5
		    G_STRUCT_OFFSET (GtkEditableClass, changed),
Packit Service fb6fa5
		    NULL, NULL,
Packit Service fb6fa5
		    _gtk_marshal_VOID__VOID,
Packit Service fb6fa5
		    G_TYPE_NONE, 0);
Packit Service fb6fa5
Packit Service fb6fa5
      initialized = TRUE;
Packit Service fb6fa5
    }
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_insert_text:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @new_text: the text to append
Packit Service fb6fa5
 * @new_text_length: the length of the text in bytes, or -1
Packit Service fb6fa5
 * @position: (inout): location of the position text will be inserted at
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Inserts @new_text_length bytes of @new_text into the contents of the
Packit Service fb6fa5
 * widget, at position @position.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Note that the position is in characters, not in bytes. 
Packit Service fb6fa5
 * The function updates @position to point after the newly inserted text.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_insert_text (GtkEditable *editable,
Packit Service fb6fa5
			  const gchar *new_text,
Packit Service fb6fa5
			  gint         new_text_length,
Packit Service fb6fa5
			  gint        *position)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
  g_return_if_fail (position != NULL);
Packit Service fb6fa5
Packit Service fb6fa5
  if (new_text_length < 0)
Packit Service fb6fa5
    new_text_length = strlen (new_text);
Packit Service fb6fa5
  
Packit Service fb6fa5
  GTK_EDITABLE_GET_CLASS (editable)->do_insert_text (editable, new_text, new_text_length, position);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_delete_text:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @start_pos: start position
Packit Service fb6fa5
 * @end_pos: end position
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Deletes a sequence of characters. The characters that are deleted are 
Packit Service fb6fa5
 * those characters at positions from @start_pos up to, but not including 
Packit Service fb6fa5
 * @end_pos. If @end_pos is negative, then the the characters deleted
Packit Service fb6fa5
 * are those from @start_pos to the end of the text.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Note that the positions are specified in characters, not bytes.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_delete_text (GtkEditable *editable,
Packit Service fb6fa5
			  gint         start_pos,
Packit Service fb6fa5
			  gint         end_pos)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
Packit Service fb6fa5
  GTK_EDITABLE_GET_CLASS (editable)->do_delete_text (editable, start_pos, end_pos);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_get_chars:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @start_pos: start of text
Packit Service fb6fa5
 * @end_pos: end of text
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves a sequence of characters. The characters that are retrieved 
Packit Service fb6fa5
 * are those characters at positions from @start_pos up to, but not 
Packit Service fb6fa5
 * including @end_pos. If @end_pos is negative, then the the characters 
Packit Service fb6fa5
 * retrieved are those characters from @start_pos to the end of the text.
Packit Service fb6fa5
 * 
Packit Service fb6fa5
 * Note that positions are specified in characters, not bytes.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Return value: a pointer to the contents of the widget as a
Packit Service fb6fa5
 *      string. This string is allocated by the #GtkEditable
Packit Service fb6fa5
 *      implementation and should be freed by the caller.
Packit Service fb6fa5
 */
Packit Service fb6fa5
gchar *    
Packit Service fb6fa5
gtk_editable_get_chars (GtkEditable *editable,
Packit Service fb6fa5
			gint         start_pos,
Packit Service fb6fa5
			gint         end_pos)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_val_if_fail (GTK_IS_EDITABLE (editable), NULL);
Packit Service fb6fa5
Packit Service fb6fa5
  return GTK_EDITABLE_GET_CLASS (editable)->get_chars (editable, start_pos, end_pos);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_set_position:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @position: the position of the cursor 
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Sets the cursor position in the editable to the given value.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * The cursor is displayed before the character with the given (base 0) 
Packit Service fb6fa5
 * index in the contents of the editable. The value must be less than or 
Packit Service fb6fa5
 * equal to the number of characters in the editable. A value of -1 
Packit Service fb6fa5
 * indicates that the position should be set after the last character 
Packit Service fb6fa5
 * of the editable. Note that @position is in characters, not in bytes.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_set_position (GtkEditable      *editable,
Packit Service fb6fa5
			   gint              position)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
Packit Service fb6fa5
  GTK_EDITABLE_GET_CLASS (editable)->set_position (editable, position);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_get_position:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves the current position of the cursor relative to the start
Packit Service fb6fa5
 * of the content of the editable. 
Packit Service fb6fa5
 * 
Packit Service fb6fa5
 * Note that this position is in characters, not in bytes.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Return value: the cursor position
Packit Service fb6fa5
 */
Packit Service fb6fa5
gint
Packit Service fb6fa5
gtk_editable_get_position (GtkEditable *editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_val_if_fail (GTK_IS_EDITABLE (editable), 0);
Packit Service fb6fa5
Packit Service fb6fa5
  return GTK_EDITABLE_GET_CLASS (editable)->get_position (editable);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_get_selection_bounds:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @start_pos: (out) (allow-none): location to store the starting position, or %NULL
Packit Service fb6fa5
 * @end_pos: (out) (allow-none): location to store the end position, or %NULL
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves the selection bound of the editable. start_pos will be filled
Packit Service fb6fa5
 * with the start of the selection and @end_pos with end. If no text was
Packit Service fb6fa5
 * selected both will be identical and %FALSE will be returned.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Note that positions are specified in characters, not bytes.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Return value: %TRUE if an area is selected, %FALSE otherwise
Packit Service fb6fa5
 */
Packit Service fb6fa5
gboolean
Packit Service fb6fa5
gtk_editable_get_selection_bounds (GtkEditable *editable,
Packit Service fb6fa5
				   gint        *start_pos,
Packit Service fb6fa5
				   gint        *end_pos)
Packit Service fb6fa5
{
Packit Service fb6fa5
  gint tmp_start, tmp_end;
Packit Service fb6fa5
  gboolean result;
Packit Service fb6fa5
  
Packit Service fb6fa5
  g_return_val_if_fail (GTK_IS_EDITABLE (editable), FALSE);
Packit Service fb6fa5
Packit Service fb6fa5
  result = GTK_EDITABLE_GET_CLASS (editable)->get_selection_bounds (editable, &tmp_start, &tmp_end);
Packit Service fb6fa5
Packit Service fb6fa5
  if (start_pos)
Packit Service fb6fa5
    *start_pos = MIN (tmp_start, tmp_end);
Packit Service fb6fa5
  if (end_pos)
Packit Service fb6fa5
    *end_pos = MAX (tmp_start, tmp_end);
Packit Service fb6fa5
Packit Service fb6fa5
  return result;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_delete_selection:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Deletes the currently selected text of the editable.
Packit Service fb6fa5
 * This call doesn't do anything if there is no selected text.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_delete_selection (GtkEditable *editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  gint start, end;
Packit Service fb6fa5
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
Packit Service fb6fa5
  if (gtk_editable_get_selection_bounds (editable, &start, &end))
Packit Service fb6fa5
    gtk_editable_delete_text (editable, start, end);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_select_region:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @start_pos: start of region
Packit Service fb6fa5
 * @end_pos: end of region
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Selects a region of text. The characters that are selected are 
Packit Service fb6fa5
 * those characters at positions from @start_pos up to, but not 
Packit Service fb6fa5
 * including @end_pos. If @end_pos is negative, then the the 
Packit Service fb6fa5
 * characters selected are those characters from @start_pos to 
Packit Service fb6fa5
 * the end of the text.
Packit Service fb6fa5
 * 
Packit Service fb6fa5
 * Note that positions are specified in characters, not bytes.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_select_region (GtkEditable *editable,
Packit Service fb6fa5
			    gint         start_pos,
Packit Service fb6fa5
			    gint         end_pos)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
  
Packit Service fb6fa5
  GTK_EDITABLE_GET_CLASS (editable)->set_selection_bounds (editable, start_pos, end_pos);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_cut_clipboard:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Removes the contents of the currently selected content in the editable and
Packit Service fb6fa5
 * puts it on the clipboard.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_cut_clipboard (GtkEditable *editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
  
Packit Service fb6fa5
  g_signal_emit_by_name (editable, "cut-clipboard");
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_copy_clipboard:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Copies the contents of the currently selected content in the editable and
Packit Service fb6fa5
 * puts it on the clipboard.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_copy_clipboard (GtkEditable *editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
  
Packit Service fb6fa5
  g_signal_emit_by_name (editable, "copy-clipboard");
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_paste_clipboard:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Pastes the content of the clipboard to the current position of the
Packit Service fb6fa5
 * cursor in the editable.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_paste_clipboard (GtkEditable *editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
  
Packit Service fb6fa5
  g_signal_emit_by_name (editable, "paste-clipboard");
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_set_editable:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 * @is_editable: %TRUE if the user is allowed to edit the text
Packit Service fb6fa5
 *   in the widget
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Determines if the user can edit the text in the editable
Packit Service fb6fa5
 * widget or not. 
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_editable_set_editable (GtkEditable    *editable,
Packit Service fb6fa5
			   gboolean        is_editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_EDITABLE (editable));
Packit Service fb6fa5
Packit Service fb6fa5
  g_object_set (editable,
Packit Service fb6fa5
		"editable", is_editable != FALSE,
Packit Service fb6fa5
		NULL);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_editable_get_editable:
Packit Service fb6fa5
 * @editable: a #GtkEditable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves whether @editable is editable. See
Packit Service fb6fa5
 * gtk_editable_set_editable().
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Return value: %TRUE if @editable is editable.
Packit Service fb6fa5
 */
Packit Service fb6fa5
gboolean
Packit Service fb6fa5
gtk_editable_get_editable (GtkEditable *editable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  gboolean value;
Packit Service fb6fa5
Packit Service fb6fa5
  g_return_val_if_fail (GTK_IS_EDITABLE (editable), FALSE);
Packit Service fb6fa5
Packit Service fb6fa5
  g_object_get (editable, "editable", &value, NULL);
Packit Service fb6fa5
Packit Service fb6fa5
  return value;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
#define __GTK_EDITABLE_C__
Packit Service fb6fa5
#include "gtkaliasdef.c"