1/* gtkentryprivate.h
2 * Copyright (C) 2019 Red Hat, Inc.
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, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_TEXT_PRIVATE_H__
19#define __GTK_TEXT_PRIVATE_H__
20
21#include "gtktext.h"
22
23#include "gtkeventcontroller.h"
24#include "gtkimcontext.h"
25
26G_BEGIN_DECLS
27
28#define GTK_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT, GtkTextClass))
29#define GTK_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT))
30#define GTK_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT, GtkTextClass))
31
32typedef struct _GtkTextClass GtkTextClass;
33
34/*<private>
35 * GtkTextClass:
36 * @parent_class: The parent class.
37 * @activate: Class handler for the `GtkText::activate` signal. The default
38 * implementation activates the gtk.activate-default action.
39 * @move_cursor: Class handler for the `GtkText::move-cursor` signal. The
40 * default implementation specifies the standard `GtkText` cursor movement
41 * behavior.
42 * @insert_at_cursor: Class handler for the `GtkText::insert-at-cursor` signal.
43 * The default implementation inserts text at the cursor.
44 * @delete_from_cursor: Class handler for the `GtkText::delete-from-cursor`
45 * signal. The default implementation deletes the selection or the specified
46 * number of characters or words.
47 * @backspace: Class handler for the `GtkText::backspace` signal. The default
48 * implementation deletes the selection or a single character or word.
49 * @cut_clipboard: Class handler for the `GtkText::cut-clipboard` signal. The
50 * default implementation cuts the selection, if one exists.
51 * @copy_clipboard: Class handler for the `GtkText::copy-clipboard` signal. The
52 * default implementation copies the selection, if one exists.
53 * @paste_clipboard: Class handler for the `GtkText::paste-clipboard` signal.
54 * The default implementation pastes at the current cursor position or over
55 * the current selection if one exists.
56 * @toggle_overwrite: Class handler for the `GtkText::toggle-overwrite` signal.
57 * The default implementation toggles overwrite mode and blinks the cursor.
58 * @insert_emoji: Class handler for the `GtkText::insert-emoji` signal.
59 *
60 * Class structure for `GtkText`. All virtual functions have a default
61 * implementation. Derived classes may set the virtual function pointers for the
62 * signal handlers to %NULL, but must keep @get_text_area_size and
63 * @get_frame_size non-%NULL; either use the default implementation, or provide
64 * a custom one.
65 */
66struct _GtkTextClass
67{
68 GtkWidgetClass parent_class;
69
70 /* Action signals
71 */
72 void (* activate) (GtkText *self);
73 void (* move_cursor) (GtkText *self,
74 GtkMovementStep step,
75 int count,
76 gboolean extend);
77 void (* insert_at_cursor) (GtkText *self,
78 const char *str);
79 void (* delete_from_cursor) (GtkText *self,
80 GtkDeleteType type,
81 int count);
82 void (* backspace) (GtkText *self);
83 void (* cut_clipboard) (GtkText *self);
84 void (* copy_clipboard) (GtkText *self);
85 void (* paste_clipboard) (GtkText *self);
86 void (* toggle_overwrite) (GtkText *self);
87 void (* insert_emoji) (GtkText *self);
88 void (* undo) (GtkText *self);
89 void (* redo) (GtkText *self);
90};
91
92char * gtk_text_get_display_text (GtkText *entry,
93 int start_pos,
94 int end_pos);
95void gtk_text_enter_text (GtkText *entry,
96 const char *text);
97void gtk_text_set_positions (GtkText *entry,
98 int current_pos,
99 int selection_bound);
100PangoLayout * gtk_text_get_layout (GtkText *entry);
101void gtk_text_get_layout_offsets (GtkText *entry,
102 int *x,
103 int *y);
104void gtk_text_reset_im_context (GtkText *entry);
105GtkEventController *gtk_text_get_key_controller (GtkText *entry);
106
107G_END_DECLS
108
109#endif /* __GTK_TEXT_PRIVATE_H__ */
110

source code of gtk/gtk/gtktextprivate.h