gtkedit.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 Library 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. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library 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. #ifndef __GTK_EDIT_H__
  20. #define __GTK_EDIT_H__
  21. #include <gdk/gdk.h>
  22. #include <gtk/gtkadjustment.h>
  23. #include <gtk/gtkeditable.h>
  24. #include <gtkedit/mousemark.h>
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif /* __cplusplus */
  28. #define GTK_EDIT(obj) GTK_CHECK_CAST (obj, gtk_edit_get_type (), GtkEdit)
  29. #define GTK_EDIT_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_edit_get_type (), GtkEditClass)
  30. #define GTK_IS_EDIT(obj) GTK_CHECK_TYPE (obj, gtk_edit_get_type ())
  31. typedef struct _GtkEdit GtkEdit;
  32. typedef struct _GtkEditClass GtkEditClass;
  33. struct _GtkEdit
  34. {
  35. GtkEditable editable;
  36. GdkWindow *text_area;
  37. GtkWidget *menubar, *status;
  38. GtkAdjustment *hadj;
  39. gint last_hadj_value;
  40. GtkAdjustment *vadj;
  41. gint last_vadj_value;
  42. GdkGC *gc;
  43. GdkColor color[256];
  44. int color_last_pixel;
  45. void (*destroy_me) (void *);
  46. void *destroy_me_user_data;
  47. struct editor_widget *editor;
  48. gulong options;
  49. gint timer;
  50. };
  51. struct _GtkEditClass
  52. {
  53. GtkEditableClass parent_class;
  54. };
  55. guint gtk_edit_get_type (void);
  56. GtkWidget* gtk_edit_new (GtkAdjustment *hadj,
  57. GtkAdjustment *vadj);
  58. void gtk_edit_set_editable (GtkEdit *text,
  59. gint editable);
  60. void gtk_edit_set_word_wrap (GtkEdit *text,
  61. gint word_wrap);
  62. void gtk_edit_set_adjustments (GtkEdit *text,
  63. GtkAdjustment *hadj,
  64. GtkAdjustment *vadj);
  65. void gtk_edit_set_point (GtkEdit *text,
  66. guint index);
  67. guint gtk_edit_get_point (GtkEdit *text);
  68. guint gtk_edit_get_length (GtkEdit *text);
  69. void gtk_edit_freeze (GtkEdit *text);
  70. void gtk_edit_thaw (GtkEdit *text);
  71. void gtk_edit_insert (GtkEdit *text,
  72. GdkFont *font,
  73. GdkColor *fore,
  74. GdkColor *back,
  75. const char *chars,
  76. gint length);
  77. gint gtk_edit_backward_delete (GtkEdit *text,
  78. guint nchars);
  79. gint gtk_edit_forward_delete (GtkEdit *text,
  80. guint nchars);
  81. char *gtk_edit_dialog_get_load_file (guchar * directory, guchar * file, guchar * heading);
  82. char *gtk_edit_dialog_get_save_file (guchar * directory, guchar * file, guchar * heading);
  83. void gtk_edit_dialog_error (guchar * heading, char *fmt,...);
  84. void gtk_edit_dialog_message (guchar * heading, char *fmt,...);
  85. int gtk_edit_dialog_query (guchar * heading, guchar * first,...);
  86. #ifdef __cplusplus
  87. }
  88. #endif /* __cplusplus */
  89. #endif /* __GTK_EDIT_H__ */