Files
test2/source/blender/blenkernel/BKE_text_suggestions.h
Brecht Van Lommel 4786fbe774 Refactor: Remove extern "C" from most headers
The only remaining code in source/blender that must be compiled as C
is now datatoc generated code and the DNA defaults that use designated
initializers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134469
2025-02-13 18:58:08 +01:00

55 lines
1.4 KiB
C

/* SPDX-FileCopyrightText: 2008 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bke
*/
struct Text;
typedef struct SuggItem {
struct SuggItem *prev, *next;
char type;
char name[0];
} SuggItem;
/**
* Suggestions should be added in sorted order although a linear sorting method is implemented.
* The list is then divided up based on the prefix provided by update_suggestions:
*
* Example:
* Prefix: `ab`
* `aaa` <- #SuggList::first
* `aab`
* `aba` <- #SuggList::firstmatch
* `abb` <- #SuggList::lastmatch
* `baa`
* `bab` <- #SuggList::last
*/
typedef struct SuggList {
SuggItem *first, *last;
SuggItem *firstmatch, *lastmatch;
SuggItem *selected;
int top;
} SuggList;
/* Free all text tool memory */
void free_texttools(void);
/* Used to identify which Text object the current tools should appear against */
void texttool_text_set_active(struct Text *text);
void texttool_text_clear(void);
short texttool_text_is_active(struct Text *text);
/* Suggestions */
void texttool_suggest_add(const char *name, char type);
void texttool_suggest_prefix(const char *prefix, int prefix_len);
void texttool_suggest_clear(void);
SuggItem *texttool_suggest_first(void);
SuggItem *texttool_suggest_last(void);
void texttool_suggest_select(SuggItem *sel);
SuggItem *texttool_suggest_selected(void);
int *texttool_suggest_top(void);