1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
22 /** \file
23  * \ingroup bli
24  */
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 typedef enum eStrCursorJumpType {
31   STRCUR_JUMP_NONE,
32   STRCUR_JUMP_DELIM,
33   STRCUR_JUMP_ALL,
34 } eStrCursorJumpType;
35 
36 typedef enum eStrCursorJumpDirection {
37   STRCUR_DIR_PREV,
38   STRCUR_DIR_NEXT,
39 } eStrCursorJumpDirection;
40 
41 bool BLI_str_cursor_step_next_utf8(const char *str, size_t maxlen, int *pos);
42 bool BLI_str_cursor_step_prev_utf8(const char *str, size_t maxlen, int *pos);
43 
44 void BLI_str_cursor_step_utf8(const char *str,
45                               size_t maxlen,
46                               int *pos,
47                               eStrCursorJumpDirection direction,
48                               eStrCursorJumpType jump,
49                               bool use_init_step);
50 
51 void BLI_str_cursor_step_utf32(const char32_t *str,
52                                size_t maxlen,
53                                int *pos,
54                                eStrCursorJumpDirection direction,
55                                eStrCursorJumpType jump,
56                                bool use_init_step);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61