Merge pull request #3334 from eht16/show_d_python_global_class_calltips
[geany-mirror.git] / src / sciwrappers.h
blob0f3cf2da65a8dbce4d698dadde6a5b416447b040
1 /*
2 * sciwrappers.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005 The Geany contributors
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef GEANY_SCI_WRAPPERS_H
22 #define GEANY_SCI_WRAPPERS_H 1
24 #include "geany.h" /* for GEANY_DEPRECATED */
25 #include "gtkcompat.h" /* Needed by ScintillaWidget.h */
26 #include "Scintilla.h" /* Needed by ScintillaWidget.h */
27 #include "ScintillaWidget.h" /* for ScintillaObject */
30 G_BEGIN_DECLS
32 #ifdef GEANY_PRIVATE
33 # ifndef NDEBUG
34 # define SSM(s, m, w, l) sci_send_message_internal(__FILE__, __LINE__, s, m, w, l)
35 sptr_t sci_send_message_internal (const gchar *file, guint line, ScintillaObject *sci,
36 guint msg, uptr_t wparam, sptr_t lparam);
37 # else
38 # define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
39 # endif
40 #endif
42 void sci_set_text (ScintillaObject *sci, const gchar *text);
43 gboolean sci_has_selection (ScintillaObject *sci);
44 void sci_end_undo_action (ScintillaObject *sci);
45 void sci_start_undo_action (ScintillaObject *sci);
47 void sci_set_marker_at_line (ScintillaObject *sci, gint line_number, gint marker);
48 void sci_delete_marker_at_line (ScintillaObject *sci, gint line_number, gint marker);
49 gboolean sci_is_marker_set_at_line (ScintillaObject *sci, gint line, gint marker);
51 gint sci_get_col_from_position (ScintillaObject *sci, gint position);
52 gint sci_get_line_from_position (ScintillaObject *sci, gint position);
53 gint sci_get_position_from_line (ScintillaObject *sci, gint line);
54 gint sci_get_current_position (ScintillaObject *sci);
55 void sci_set_current_position (ScintillaObject *sci, gint position, gboolean scroll_to_caret);
57 gint sci_get_selection_start (ScintillaObject *sci);
58 gint sci_get_selection_end (ScintillaObject *sci);
59 void sci_replace_sel (ScintillaObject *sci, const gchar *text);
60 gint sci_get_selection_mode (ScintillaObject *sci);
61 void sci_set_selection_mode (ScintillaObject *sci, gint mode);
62 void sci_set_selection_start (ScintillaObject *sci, gint position);
63 void sci_set_selection_end (ScintillaObject *sci, gint position);
65 gint sci_get_length (ScintillaObject *sci);
66 gchar* sci_get_contents (ScintillaObject *sci, gint buffer_len);
67 gint sci_get_selected_text_length2(ScintillaObject *sci);
68 gchar* sci_get_selection_contents (ScintillaObject *sci);
69 gchar* sci_get_line (ScintillaObject *sci, gint line_num);
70 gint sci_get_line_length (ScintillaObject *sci, gint line);
71 gint sci_get_line_count (ScintillaObject *sci);
73 gint sci_get_line_end_position (ScintillaObject *sci, gint line);
75 gboolean sci_get_line_is_visible (ScintillaObject *sci, gint line);
76 void sci_ensure_line_is_visible (ScintillaObject *sci, gint line);
78 gint sci_get_tab_width (ScintillaObject *sci);
79 gchar sci_get_char_at (ScintillaObject *sci, gint pos);
81 void sci_scroll_caret (ScintillaObject *sci);
82 gint sci_find_text (ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf);
83 void sci_set_font (ScintillaObject *sci, gint style, const gchar *font, gint size);
84 void sci_goto_line (ScintillaObject *sci, gint line, gboolean unfold);
85 gint sci_get_style_at (ScintillaObject *sci, gint position);
86 gchar* sci_get_contents_range (ScintillaObject *sci, gint start, gint end);
87 void sci_insert_text (ScintillaObject *sci, gint pos, const gchar *text);
89 void sci_set_target_start (ScintillaObject *sci, gint start);
90 void sci_set_target_end (ScintillaObject *sci, gint end);
91 gint sci_replace_target (ScintillaObject *sci, const gchar *text, gboolean regex);
93 gint sci_get_lexer (ScintillaObject *sci);
94 void sci_send_command (ScintillaObject *sci, gint cmd);
96 gint sci_get_current_line (ScintillaObject *sci);
98 void sci_indicator_set (ScintillaObject *sci, gint indic);
99 void sci_indicator_clear (ScintillaObject *sci, gint pos, gint len);
101 void sci_set_line_indentation (ScintillaObject *sci, gint line, gint indent);
102 gint sci_get_line_indentation (ScintillaObject *sci, gint line);
103 gint sci_find_matching_brace (ScintillaObject *sci, gint pos);
105 #ifndef GEANY_DISABLE_DEPRECATED
106 void sci_get_text (ScintillaObject *sci, gint len, gchar *text) GEANY_DEPRECATED_FOR(sci_get_contents);
107 void sci_get_selected_text (ScintillaObject *sci, gchar *text) GEANY_DEPRECATED_FOR(sci_get_selection_contents);
108 void sci_get_text_range (ScintillaObject *sci, gint start, gint end, gchar *text) GEANY_DEPRECATED_FOR(sci_get_contents_range);
109 gint sci_get_selected_text_length(ScintillaObject *sci) GEANY_DEPRECATED_FOR(sci_get_selected_text_length2);
110 #endif /* GEANY_DISABLE_DEPRECATED */
112 #ifdef GEANY_PRIVATE
114 gchar* sci_get_string (ScintillaObject *sci, guint msg, gulong wParam);
116 void sci_set_line_numbers (ScintillaObject *sci, gboolean set);
117 void sci_set_mark_long_lines (ScintillaObject *sci, gint type, gint column, const gchar *color);
119 void sci_add_text (ScintillaObject *sci, const gchar *text);
120 gboolean sci_can_redo (ScintillaObject *sci);
121 gboolean sci_can_undo (ScintillaObject *sci);
122 void sci_undo (ScintillaObject *sci);
123 void sci_redo (ScintillaObject *sci);
124 void sci_empty_undo_buffer (ScintillaObject *sci);
125 gboolean sci_is_modified (ScintillaObject *sci);
127 void sci_set_visible_eols (ScintillaObject *sci, gboolean set);
128 void sci_set_lines_wrapped (ScintillaObject *sci, gboolean set);
129 void sci_set_visible_white_spaces(ScintillaObject *sci, gboolean set);
130 void sci_convert_eols (ScintillaObject *sci, gint eolmode);
131 gint sci_get_eol_mode (ScintillaObject *sci);
132 void sci_set_eol_mode (ScintillaObject *sci, gint eolmode);
133 void sci_set_eol_representation_characters(ScintillaObject *sci, gint new_eolmode);
134 void sci_zoom_in (ScintillaObject *sci);
135 void sci_zoom_out (ScintillaObject *sci);
136 void sci_zoom_off (ScintillaObject *sci);
137 void sci_toggle_marker_at_line (ScintillaObject *sci, gint line, gint marker);
138 gint sci_marker_next (ScintillaObject *sci, gint line, gint marker_mask, gboolean wrap);
139 gint sci_marker_previous (ScintillaObject *sci, gint line, gint marker_mask, gboolean wrap);
141 gint sci_get_position_from_col (ScintillaObject *sci, gint line, gint col);
142 void sci_set_current_line (ScintillaObject *sci, gint line);
143 gint sci_get_cursor_virtual_space(ScintillaObject *sci);
145 void sci_cut (ScintillaObject *sci);
146 void sci_copy (ScintillaObject *sci);
147 void sci_paste (ScintillaObject *sci);
148 void sci_clear (ScintillaObject *sci);
150 gint sci_get_pos_at_line_sel_start(ScintillaObject*sci, gint line);
151 gint sci_get_pos_at_line_sel_end (ScintillaObject *sci, gint line);
152 void sci_set_selection (ScintillaObject *sci, gint anchorPos, gint currentPos);
154 gint sci_get_position_from_xy (ScintillaObject *sci, gint x, gint y, gboolean nearby);
156 void sci_set_undo_collection (ScintillaObject *sci, gboolean set);
158 void sci_toggle_fold (ScintillaObject *sci, gint line);
159 gint sci_get_fold_level (ScintillaObject *sci, gint line);
160 gint sci_get_fold_parent (ScintillaObject *sci, gint start_line);
162 void sci_set_folding_margin_visible (ScintillaObject *sci, gboolean set);
163 gboolean sci_get_fold_expanded (ScintillaObject *sci, gint line);
165 void sci_colourise (ScintillaObject *sci, gint start, gint end);
166 void sci_clear_all (ScintillaObject *sci);
167 gint sci_get_end_styled (ScintillaObject *sci);
168 void sci_set_tab_width (ScintillaObject *sci, gint width);
169 void sci_set_savepoint (ScintillaObject *sci);
170 void sci_set_indentation_guides (ScintillaObject *sci, gint mode);
171 void sci_use_popup (ScintillaObject *sci, gboolean enable);
172 void sci_goto_pos (ScintillaObject *sci, gint pos, gboolean unfold);
173 void sci_set_search_anchor (ScintillaObject *sci);
174 void sci_set_anchor (ScintillaObject *sci, gint pos);
175 void sci_scroll_columns (ScintillaObject *sci, gint columns);
176 gint sci_search_next (ScintillaObject *sci, gint flags, const gchar *text);
177 gint sci_search_prev (ScintillaObject *sci, gint flags, const gchar *text);
178 void sci_marker_delete_all (ScintillaObject *sci, gint marker);
179 void sci_set_symbol_margin (ScintillaObject *sci, gboolean set);
180 void sci_set_codepage (ScintillaObject *sci, gint cp);
181 void sci_clear_cmdkey (ScintillaObject *sci, gint key);
182 void sci_assign_cmdkey (ScintillaObject *sci, gint key, gint command);
183 void sci_selection_duplicate (ScintillaObject *sci);
184 void sci_line_duplicate (ScintillaObject *sci);
186 void sci_set_keywords (ScintillaObject *sci, guint k, const gchar *text);
187 void sci_set_lexer (ScintillaObject *sci, guint lexer_id);
188 void sci_set_readonly (ScintillaObject *sci, gboolean readonly);
190 gint sci_get_lines_selected (ScintillaObject *sci);
191 gint sci_get_first_visible_line (ScintillaObject *sci);
193 void sci_indicator_fill (ScintillaObject *sci, gint pos, gint len);
195 void sci_select_all (ScintillaObject *sci);
196 gint sci_get_line_indent_position(ScintillaObject *sci, gint line);
197 void sci_set_autoc_max_height (ScintillaObject *sci, gint val);
199 gint sci_get_overtype (ScintillaObject *sci);
200 void sci_set_tab_indents (ScintillaObject *sci, gboolean set);
201 void sci_set_use_tabs (ScintillaObject *sci, gboolean set);
203 void sci_set_scrollbar_mode (ScintillaObject *sci, gboolean visible);
204 void sci_set_caret_policy_x (ScintillaObject *sci, gint policy, gint slop);
205 void sci_set_caret_policy_y (ScintillaObject *sci, gint policy, gint slop);
207 void sci_set_scroll_stop_at_last_line (ScintillaObject *sci, gboolean set);
209 void sci_cancel (ScintillaObject *sci);
211 gint sci_get_position_after (ScintillaObject *sci, gint start);
212 gint sci_word_start_position (ScintillaObject *sci, gint position, gboolean onlyWordCharacters);
213 gint sci_word_end_position (ScintillaObject *sci, gint position, gboolean onlyWordCharacters);
215 void sci_lines_join (ScintillaObject *sci);
216 gint sci_text_width (ScintillaObject *sci, gint styleNumber, const gchar *text);
218 void sci_move_selected_lines_down (ScintillaObject *sci);
219 void sci_move_selected_lines_up (ScintillaObject *sci);
221 void sci_set_font_fractional (ScintillaObject *sci, gint style, const gchar *font, gdouble size);
223 #endif /* GEANY_PRIVATE */
225 G_END_DECLS
227 #endif /* GEANY_SCI_WRAPPERS_H */