Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

133 рядки
5.2 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 2000 Red Hat Software
  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. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_IM_CONTEXT_H__
  23. #define __GTK_IM_CONTEXT_H__
  24. #include <gdk/gdk.h>
  25. #include <gtk/gtkobject.h>
  26. G_BEGIN_DECLS
  27. #define GTK_TYPE_IM_CONTEXT (gtk_im_context_get_type ())
  28. #define GTK_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContext))
  29. #define GTK_IM_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
  30. #define GTK_IS_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IM_CONTEXT))
  31. #define GTK_IS_IM_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IM_CONTEXT))
  32. #define GTK_IM_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IM_CONTEXT, GtkIMContextClass))
  33. typedef struct _GtkIMContext GtkIMContext;
  34. typedef struct _GtkIMContextClass GtkIMContextClass;
  35. struct _GtkIMContext
  36. {
  37. GObject parent_instance;
  38. };
  39. struct _GtkIMContextClass
  40. {
  41. /*< private >*/
  42. /* Yes, this should be GObjectClass, be we can't fix it without breaking
  43. * binary compatibility - see bug #90935
  44. */
  45. GtkObjectClass parent_class;
  46. /*< public >*/
  47. /* Signals */
  48. void (*preedit_start) (GtkIMContext *context);
  49. void (*preedit_end) (GtkIMContext *context);
  50. void (*preedit_changed) (GtkIMContext *context);
  51. void (*commit) (GtkIMContext *context, const gchar *str);
  52. gboolean (*retrieve_surrounding) (GtkIMContext *context);
  53. gboolean (*delete_surrounding) (GtkIMContext *context,
  54. gint offset,
  55. gint n_chars);
  56. /* Virtual functions */
  57. void (*set_client_window) (GtkIMContext *context,
  58. GdkWindow *window);
  59. void (*get_preedit_string) (GtkIMContext *context,
  60. gchar **str,
  61. PangoAttrList **attrs,
  62. gint *cursor_pos);
  63. gboolean (*filter_keypress) (GtkIMContext *context,
  64. GdkEventKey *event);
  65. void (*focus_in) (GtkIMContext *context);
  66. void (*focus_out) (GtkIMContext *context);
  67. void (*reset) (GtkIMContext *context);
  68. void (*set_cursor_location) (GtkIMContext *context,
  69. GdkRectangle *area);
  70. void (*set_use_preedit) (GtkIMContext *context,
  71. gboolean use_preedit);
  72. void (*set_surrounding) (GtkIMContext *context,
  73. const gchar *text,
  74. gint len,
  75. gint cursor_index);
  76. gboolean (*get_surrounding) (GtkIMContext *context,
  77. gchar **text,
  78. gint *cursor_index);
  79. /*< private >*/
  80. /* Padding for future expansion */
  81. void (*_gtk_reserved1) (void);
  82. void (*_gtk_reserved2) (void);
  83. void (*_gtk_reserved3) (void);
  84. void (*_gtk_reserved4) (void);
  85. void (*_gtk_reserved5) (void);
  86. void (*_gtk_reserved6) (void);
  87. };
  88. GType gtk_im_context_get_type (void) G_GNUC_CONST;
  89. void gtk_im_context_set_client_window (GtkIMContext *context,
  90. GdkWindow *window);
  91. void gtk_im_context_get_preedit_string (GtkIMContext *context,
  92. gchar **str,
  93. PangoAttrList **attrs,
  94. gint *cursor_pos);
  95. gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
  96. GdkEventKey *event);
  97. void gtk_im_context_focus_in (GtkIMContext *context);
  98. void gtk_im_context_focus_out (GtkIMContext *context);
  99. void gtk_im_context_reset (GtkIMContext *context);
  100. void gtk_im_context_set_cursor_location (GtkIMContext *context,
  101. const GdkRectangle *area);
  102. void gtk_im_context_set_use_preedit (GtkIMContext *context,
  103. gboolean use_preedit);
  104. void gtk_im_context_set_surrounding (GtkIMContext *context,
  105. const gchar *text,
  106. gint len,
  107. gint cursor_index);
  108. gboolean gtk_im_context_get_surrounding (GtkIMContext *context,
  109. gchar **text,
  110. gint *cursor_index);
  111. gboolean gtk_im_context_delete_surrounding (GtkIMContext *context,
  112. gint offset,
  113. gint n_chars);
  114. G_END_DECLS
  115. #endif /* __GTK_IM_CONTEXT_H__ */