Blender  V2.93
BKE_text_suggestions.h
Go to the documentation of this file.
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) 2008, Blender Foundation
17  * All rights reserved.
18  */
19 #pragma once
20 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /* ****************************************************************************
30  * Suggestions should be added in sorted order although a linear sorting method is
31  * implemented. The list is then divided up based on the prefix provided by
32  * update_suggestions:
33  *
34  * Example:
35  * Prefix: ab
36  * aaa <-- first
37  * aab
38  * aba <-- firstmatch
39  * abb <-- lastmatch
40  * baa
41  * bab <-- last
42  **************************************************************************** */
43 
44 struct Text;
45 
46 typedef struct SuggItem {
47  struct SuggItem *prev, *next;
48  char type;
49  char name[0];
51 
52 typedef struct SuggList {
56  int top;
58 
59 /* Free all text tool memory */
60 void free_texttools(void);
61 
62 /* Used to identify which Text object the current tools should appear against */
63 void texttool_text_set_active(struct Text *text);
64 void texttool_text_clear(void);
65 short texttool_text_is_active(struct Text *text);
66 
67 /* Suggestions */
68 void texttool_suggest_add(const char *name, char type);
69 void texttool_suggest_prefix(const char *prefix, const int prefix_len);
70 void texttool_suggest_clear(void);
75 int *texttool_suggest_top(void);
76 
77 /* Documentation */
78 void texttool_docs_show(const char *docs);
79 char *texttool_docs_get(void);
80 void texttool_docs_clear(void);
81 
82 #ifdef __cplusplus
83 }
84 #endif
void texttool_docs_show(const char *docs)
short texttool_text_is_active(struct Text *text)
void texttool_text_clear(void)
SuggItem * texttool_suggest_last(void)
char * texttool_docs_get(void)
void texttool_suggest_select(SuggItem *sel)
void texttool_docs_clear(void)
void texttool_suggest_prefix(const char *prefix, const int prefix_len)
struct SuggItem SuggItem
void texttool_suggest_add(const char *name, char type)
void texttool_text_set_active(struct Text *text)
struct SuggList SuggList
SuggItem * texttool_suggest_selected(void)
void texttool_suggest_clear(void)
SuggItem * texttool_suggest_first(void)
int * texttool_suggest_top(void)
void free_texttools(void)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
struct SuggItem * prev
struct SuggItem * next
SuggItem * first
SuggItem * firstmatch
SuggItem * selected
SuggItem * lastmatch
SuggItem * last