4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2008, Blender Foundation
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
29 #ifndef BKE_SUGGESTIONS_H
30 #define BKE_SUGGESTIONS_H
36 /* ****************************************************************************
37 Suggestions should be added in sorted order although a linear sorting method is
38 implemented. The list is then divided up based on the prefix provided by
49 **************************************************************************** */
53 typedef struct SuggItem {
54 struct SuggItem *prev, *next;
59 typedef struct SuggList {
60 SuggItem *first, *last;
61 SuggItem *firstmatch, *lastmatch;
65 /* Free all suggestion related memory */
66 void free_suggestions();
68 /* Used to identify which Text object the current tools should appear against */
69 void suggest_set_active(Text *text);
70 void suggest_clear_active();
71 short suggest_is_active(Text *text);
73 void suggest_add(const char *name, char type);
74 void suggest_prefix(const char *prefix);
75 void suggest_clear_list();
76 SuggItem *suggest_first();
77 SuggItem *suggest_last();
79 void suggest_set_selected(SuggItem *sel);
80 SuggItem *suggest_get_selected();
82 void suggest_documentation(const char *docs);
83 char *suggest_get_docs();
84 void suggest_clear_docs();