You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

127 lines
4.4 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #ifndef GTK_DISABLE_DEPRECATED
  26. #ifndef __GTK_OLD_EDITABLE_H__
  27. #define __GTK_OLD_EDITABLE_H__
  28. #include <gtk/gtk.h>
  29. G_BEGIN_DECLS
  30. #define GTK_TYPE_OLD_EDITABLE (gtk_old_editable_get_type ())
  31. #define GTK_OLD_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_OLD_EDITABLE, GtkOldEditable))
  32. #define GTK_OLD_EDITABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_OLD_EDITABLE, GtkOldEditableClass))
  33. #define GTK_IS_OLD_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_OLD_EDITABLE))
  34. #define GTK_IS_OLD_EDITABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OLD_EDITABLE))
  35. #define GTK_OLD_EDITABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_OLD_EDITABLE, GtkOldEditableClass))
  36. typedef struct _GtkOldEditable GtkOldEditable;
  37. typedef struct _GtkOldEditableClass GtkOldEditableClass;
  38. typedef void (*GtkTextFunction) (GtkOldEditable *editable, guint32 time_);
  39. struct _GtkOldEditable
  40. {
  41. GtkWidget widget;
  42. /*< public >*/
  43. guint current_pos;
  44. guint selection_start_pos;
  45. guint selection_end_pos;
  46. guint has_selection : 1;
  47. /*< private >*/
  48. guint editable : 1;
  49. guint visible : 1;
  50. gchar *clipboard_text;
  51. };
  52. struct _GtkOldEditableClass
  53. {
  54. GtkWidgetClass parent_class;
  55. /* Bindings actions */
  56. void (* activate) (GtkOldEditable *editable);
  57. void (* set_editable) (GtkOldEditable *editable,
  58. gboolean is_editable);
  59. void (* move_cursor) (GtkOldEditable *editable,
  60. gint x,
  61. gint y);
  62. void (* move_word) (GtkOldEditable *editable,
  63. gint n);
  64. void (* move_page) (GtkOldEditable *editable,
  65. gint x,
  66. gint y);
  67. void (* move_to_row) (GtkOldEditable *editable,
  68. gint row);
  69. void (* move_to_column) (GtkOldEditable *editable,
  70. gint row);
  71. void (* kill_char) (GtkOldEditable *editable,
  72. gint direction);
  73. void (* kill_word) (GtkOldEditable *editable,
  74. gint direction);
  75. void (* kill_line) (GtkOldEditable *editable,
  76. gint direction);
  77. void (* cut_clipboard) (GtkOldEditable *editable);
  78. void (* copy_clipboard) (GtkOldEditable *editable);
  79. void (* paste_clipboard) (GtkOldEditable *editable);
  80. /* Virtual functions. get_chars is in paricular not a signal because
  81. * it returns malloced memory. The others are not signals because
  82. * they would not be particularly useful as such. (All changes to
  83. * selection and position do not go through these functions)
  84. */
  85. void (* update_text) (GtkOldEditable *editable,
  86. gint start_pos,
  87. gint end_pos);
  88. gchar* (* get_chars) (GtkOldEditable *editable,
  89. gint start_pos,
  90. gint end_pos);
  91. void (* set_selection)(GtkOldEditable *editable,
  92. gint start_pos,
  93. gint end_pos);
  94. void (* set_position) (GtkOldEditable *editable,
  95. gint position);
  96. };
  97. GType gtk_old_editable_get_type (void) G_GNUC_CONST;
  98. void gtk_old_editable_claim_selection (GtkOldEditable *old_editable,
  99. gboolean claim,
  100. guint32 time_);
  101. void gtk_old_editable_changed (GtkOldEditable *old_editable);
  102. G_END_DECLS
  103. #endif /* __GTK_OLD_EDITABLE_H__ */
  104. #endif /* GTK_DISABLE_DEPRECATED */