2 * sciwrappers.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef GEANY_SCI_WRAPPERS_H
23 #define GEANY_SCI_WRAPPERS_H 1
25 #include "geany.h" /* for GEANY_DEPRECATED */
26 #include "gtkcompat.h" /* Needed by ScintillaWidget.h */
27 #include "Scintilla.h" /* Needed by ScintillaWidget.h */
28 #include "ScintillaWidget.h" /* for ScintillaObject */
33 void sci_set_text (ScintillaObject
*sci
, const gchar
*text
);
34 gboolean
sci_has_selection (ScintillaObject
*sci
);
35 void sci_end_undo_action (ScintillaObject
*sci
);
36 void sci_start_undo_action (ScintillaObject
*sci
);
38 void sci_set_marker_at_line (ScintillaObject
*sci
, gint line_number
, gint marker
);
39 void sci_delete_marker_at_line (ScintillaObject
*sci
, gint line_number
, gint marker
);
40 gboolean
sci_is_marker_set_at_line (ScintillaObject
*sci
, gint line
, gint marker
);
42 gint
sci_get_col_from_position (ScintillaObject
*sci
, gint position
);
43 gint
sci_get_line_from_position (ScintillaObject
*sci
, gint position
);
44 gint
sci_get_position_from_line (ScintillaObject
*sci
, gint line
);
45 gint
sci_get_current_position (ScintillaObject
*sci
);
46 void sci_set_current_position (ScintillaObject
*sci
, gint position
, gboolean scroll_to_caret
);
48 gint
sci_get_selection_start (ScintillaObject
*sci
);
49 gint
sci_get_selection_end (ScintillaObject
*sci
);
50 void sci_replace_sel (ScintillaObject
*sci
, const gchar
*text
);
51 gint
sci_get_selection_mode (ScintillaObject
*sci
);
52 void sci_set_selection_mode (ScintillaObject
*sci
, gint mode
);
53 void sci_set_selection_start (ScintillaObject
*sci
, gint position
);
54 void sci_set_selection_end (ScintillaObject
*sci
, gint position
);
56 gint
sci_get_length (ScintillaObject
*sci
);
57 gchar
* sci_get_contents (ScintillaObject
*sci
, gint buffer_len
);
58 gint
sci_get_selected_text_length(ScintillaObject
*sci
);
59 gchar
* sci_get_selection_contents (ScintillaObject
*sci
);
60 gchar
* sci_get_line (ScintillaObject
*sci
, gint line_num
);
61 gint
sci_get_line_length (ScintillaObject
*sci
, gint line
);
62 gint
sci_get_line_count (ScintillaObject
*sci
);
64 gint
sci_get_line_end_position (ScintillaObject
*sci
, gint line
);
66 gboolean
sci_get_line_is_visible (ScintillaObject
*sci
, gint line
);
67 void sci_ensure_line_is_visible (ScintillaObject
*sci
, gint line
);
69 gint
sci_get_tab_width (ScintillaObject
*sci
);
70 gchar
sci_get_char_at (ScintillaObject
*sci
, gint pos
);
72 void sci_scroll_caret (ScintillaObject
*sci
);
73 gint
sci_find_text (ScintillaObject
*sci
, gint flags
, struct Sci_TextToFind
*ttf
);
74 void sci_set_font (ScintillaObject
*sci
, gint style
, const gchar
*font
, gint size
);
75 void sci_goto_line (ScintillaObject
*sci
, gint line
, gboolean unfold
);
76 gint
sci_get_style_at (ScintillaObject
*sci
, gint position
);
77 gchar
* sci_get_contents_range (ScintillaObject
*sci
, gint start
, gint end
);
78 void sci_insert_text (ScintillaObject
*sci
, gint pos
, const gchar
*text
);
80 void sci_set_target_start (ScintillaObject
*sci
, gint start
);
81 void sci_set_target_end (ScintillaObject
*sci
, gint end
);
82 gint
sci_replace_target (ScintillaObject
*sci
, const gchar
*text
, gboolean regex
);
84 gint
sci_get_lexer (ScintillaObject
*sci
);
85 void sci_send_command (ScintillaObject
*sci
, gint cmd
);
87 gint
sci_get_current_line (ScintillaObject
*sci
);
89 void sci_indicator_set (ScintillaObject
*sci
, gint indic
);
90 void sci_indicator_clear (ScintillaObject
*sci
, gint pos
, gint len
);
92 void sci_set_line_indentation (ScintillaObject
*sci
, gint line
, gint indent
);
93 gint
sci_get_line_indentation (ScintillaObject
*sci
, gint line
);
94 gint
sci_find_matching_brace (ScintillaObject
*sci
, gint pos
);
96 #ifndef GEANY_DISABLE_DEPRECATED
97 void sci_get_text (ScintillaObject
*sci
, gint len
, gchar
*text
) GEANY_DEPRECATED_FOR(sci_get_contents
);
98 void sci_get_selected_text (ScintillaObject
*sci
, gchar
*text
) GEANY_DEPRECATED_FOR(sci_get_selection_contents
);
99 void sci_get_text_range (ScintillaObject
*sci
, gint start
, gint end
, gchar
*text
) GEANY_DEPRECATED_FOR(sci_get_contents_range
);
100 #endif /* GEANY_DISABLE_DEPRECATED */
104 gchar
* sci_get_string (ScintillaObject
*sci
, guint msg
, gulong wParam
);
106 void sci_set_line_numbers (ScintillaObject
*sci
, gboolean set
);
107 void sci_set_mark_long_lines (ScintillaObject
*sci
, gint type
, gint column
, const gchar
*color
);
109 void sci_add_text (ScintillaObject
*sci
, const gchar
*text
);
110 gboolean
sci_can_redo (ScintillaObject
*sci
);
111 gboolean
sci_can_undo (ScintillaObject
*sci
);
112 void sci_undo (ScintillaObject
*sci
);
113 void sci_redo (ScintillaObject
*sci
);
114 void sci_empty_undo_buffer (ScintillaObject
*sci
);
115 gboolean
sci_is_modified (ScintillaObject
*sci
);
117 void sci_set_visible_eols (ScintillaObject
*sci
, gboolean set
);
118 void sci_set_lines_wrapped (ScintillaObject
*sci
, gboolean set
);
119 void sci_set_visible_white_spaces(ScintillaObject
*sci
, gboolean set
);
120 void sci_convert_eols (ScintillaObject
*sci
, gint eolmode
);
121 gint
sci_get_eol_mode (ScintillaObject
*sci
);
122 void sci_set_eol_mode (ScintillaObject
*sci
, gint eolmode
);
123 void sci_zoom_in (ScintillaObject
*sci
);
124 void sci_zoom_out (ScintillaObject
*sci
);
125 void sci_zoom_off (ScintillaObject
*sci
);
126 void sci_toggle_marker_at_line (ScintillaObject
*sci
, gint line
, gint marker
);
127 gint
sci_marker_next (ScintillaObject
*sci
, gint line
, gint marker_mask
, gboolean wrap
);
128 gint
sci_marker_previous (ScintillaObject
*sci
, gint line
, gint marker_mask
, gboolean wrap
);
130 gint
sci_get_position_from_col (ScintillaObject
*sci
, gint line
, gint col
);
131 void sci_set_current_line (ScintillaObject
*sci
, gint line
);
132 gint
sci_get_cursor_virtual_space(ScintillaObject
*sci
);
134 void sci_cut (ScintillaObject
*sci
);
135 void sci_copy (ScintillaObject
*sci
);
136 void sci_paste (ScintillaObject
*sci
);
137 void sci_clear (ScintillaObject
*sci
);
139 gint
sci_get_pos_at_line_sel_start(ScintillaObject
*sci
, gint line
);
140 gint
sci_get_pos_at_line_sel_end (ScintillaObject
*sci
, gint line
);
141 void sci_set_selection (ScintillaObject
*sci
, gint anchorPos
, gint currentPos
);
143 gint
sci_get_position_from_xy (ScintillaObject
*sci
, gint x
, gint y
, gboolean nearby
);
145 void sci_set_undo_collection (ScintillaObject
*sci
, gboolean set
);
147 void sci_toggle_fold (ScintillaObject
*sci
, gint line
);
148 gint
sci_get_fold_level (ScintillaObject
*sci
, gint line
);
149 gint
sci_get_fold_parent (ScintillaObject
*sci
, gint start_line
);
151 void sci_set_folding_margin_visible (ScintillaObject
*sci
, gboolean set
);
152 gboolean
sci_get_fold_expanded (ScintillaObject
*sci
, gint line
);
154 void sci_colourise (ScintillaObject
*sci
, gint start
, gint end
);
155 void sci_clear_all (ScintillaObject
*sci
);
156 gint
sci_get_end_styled (ScintillaObject
*sci
);
157 void sci_set_tab_width (ScintillaObject
*sci
, gint width
);
158 void sci_set_savepoint (ScintillaObject
*sci
);
159 void sci_set_indentation_guides (ScintillaObject
*sci
, gint mode
);
160 void sci_use_popup (ScintillaObject
*sci
, gboolean enable
);
161 void sci_goto_pos (ScintillaObject
*sci
, gint pos
, gboolean unfold
);
162 void sci_set_search_anchor (ScintillaObject
*sci
);
163 void sci_set_anchor (ScintillaObject
*sci
, gint pos
);
164 void sci_scroll_columns (ScintillaObject
*sci
, gint columns
);
165 gint
sci_search_next (ScintillaObject
*sci
, gint flags
, const gchar
*text
);
166 gint
sci_search_prev (ScintillaObject
*sci
, gint flags
, const gchar
*text
);
167 void sci_marker_delete_all (ScintillaObject
*sci
, gint marker
);
168 void sci_set_symbol_margin (ScintillaObject
*sci
, gboolean set
);
169 void sci_set_codepage (ScintillaObject
*sci
, gint cp
);
170 void sci_clear_cmdkey (ScintillaObject
*sci
, gint key
);
171 void sci_assign_cmdkey (ScintillaObject
*sci
, gint key
, gint command
);
172 void sci_selection_duplicate (ScintillaObject
*sci
);
173 void sci_line_duplicate (ScintillaObject
*sci
);
175 void sci_set_keywords (ScintillaObject
*sci
, guint k
, const gchar
*text
);
176 void sci_set_lexer (ScintillaObject
*sci
, guint lexer_id
);
177 void sci_set_readonly (ScintillaObject
*sci
, gboolean readonly
);
179 gint
sci_get_lines_selected (ScintillaObject
*sci
);
180 gint
sci_get_first_visible_line (ScintillaObject
*sci
);
182 void sci_indicator_fill (ScintillaObject
*sci
, gint pos
, gint len
);
184 void sci_select_all (ScintillaObject
*sci
);
185 gint
sci_get_line_indent_position(ScintillaObject
*sci
, gint line
);
186 void sci_set_autoc_max_height (ScintillaObject
*sci
, gint val
);
188 gint
sci_get_overtype (ScintillaObject
*sci
);
189 void sci_set_tab_indents (ScintillaObject
*sci
, gboolean set
);
190 void sci_set_use_tabs (ScintillaObject
*sci
, gboolean set
);
192 void sci_set_scrollbar_mode (ScintillaObject
*sci
, gboolean visible
);
193 void sci_set_caret_policy_x (ScintillaObject
*sci
, gint policy
, gint slop
);
194 void sci_set_caret_policy_y (ScintillaObject
*sci
, gint policy
, gint slop
);
196 void sci_set_scroll_stop_at_last_line (ScintillaObject
*sci
, gboolean set
);
198 void sci_cancel (ScintillaObject
*sci
);
200 gint
sci_get_position_after (ScintillaObject
*sci
, gint start
);
201 gint
sci_word_start_position (ScintillaObject
*sci
, gint position
, gboolean onlyWordCharacters
);
202 gint
sci_word_end_position (ScintillaObject
*sci
, gint position
, gboolean onlyWordCharacters
);
204 void sci_lines_join (ScintillaObject
*sci
);
205 gint
sci_text_width (ScintillaObject
*sci
, gint styleNumber
, const gchar
*text
);
207 void sci_move_selected_lines_down (ScintillaObject
*sci
);
208 void sci_move_selected_lines_up (ScintillaObject
*sci
);
210 #endif /* GEANY_PRIVATE */
214 #endif /* GEANY_SCI_WRAPPERS_H */