Blender V2.61 - r43446

BKE_suggestions.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2008, Blender Foundation
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 #ifndef BKE_SUGGESTIONS_H
00028 #define BKE_SUGGESTIONS_H
00029 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 /* ****************************************************************************
00039 Suggestions should be added in sorted order although a linear sorting method is
00040 implemented. The list is then divided up based on the prefix provided by
00041 update_suggestions:
00042 
00043 Example:
00044   Prefix: ab
00045   aaa <-- first
00046   aab
00047   aba <-- firstmatch
00048   abb <-- lastmatch
00049   baa
00050   bab <-- last
00051 **************************************************************************** */
00052 
00053 struct Text;
00054 
00055 typedef struct SuggItem {
00056     struct SuggItem *prev, *next;
00057     char *name;
00058     char type;
00059 } SuggItem;
00060 
00061 typedef struct SuggList {
00062     SuggItem *first, *last;
00063     SuggItem *firstmatch, *lastmatch;
00064     SuggItem *selected;
00065     int top;
00066 } SuggList;
00067 
00068 /* Free all text tool memory */
00069 void free_texttools(void);
00070 
00071 /* Used to identify which Text object the current tools should appear against */
00072 void texttool_text_set_active(Text *text);
00073 void texttool_text_clear(void);
00074 short texttool_text_is_active(Text *text);
00075 
00076 /* Suggestions */
00077 void texttool_suggest_add(const char *name, char type);
00078 void texttool_suggest_prefix(const char *prefix);
00079 void texttool_suggest_clear(void);
00080 SuggItem *texttool_suggest_first(void);
00081 SuggItem *texttool_suggest_last(void);
00082 void texttool_suggest_select(SuggItem *sel);
00083 SuggItem *texttool_suggest_selected(void);
00084 int *texttool_suggest_top(void);
00085 
00086 /* Documentation */
00087 void texttool_docs_show(const char *docs);
00088 char *texttool_docs_get(void);
00089 void texttool_docs_clear(void);
00090 
00091 #ifdef __cplusplus
00092 }
00093 #endif
00094 
00095 #endif