Blender V4.3
text_format_osl.cc File Reference
#include <cstring>
#include "BLI_blenlib.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "BKE_text.h"
#include "text_format.hh"

Go to the source code of this file.

Functions

Local Functions (for #TextFormatType::format_line)
static int txtfmt_osl_find_builtinfunc (const char *string)
 
static int txtfmt_osl_find_reserved (const char *string)
 
static int txtfmt_osl_find_specialvar (const char *string)
 
static int txtfmt_osl_find_preprocessor (const char *string)
 
static char txtfmt_osl_format_identifier (const char *str)
 
Format Line Implementation (#TextFormatType::format_line)
static void txtfmt_osl_format_line (SpaceText *st, TextLine *line, const bool do_next)
 
Registration
void ED_text_format_register_osl ()
 

Local Literal Definitions

static const char * text_format_osl_literals_builtinfunc_data []
 
static const char * text_format_osl_literals_reserved_data []
 
static const char * text_format_osl_literals_specialvar_data []
 
static const Span< const char * > text_format_osl_literals_builtinfunc (text_format_osl_literals_builtinfunc_data, ARRAY_SIZE(text_format_osl_literals_builtinfunc_data))
 
static const Span< const char * > text_format_osl_literals_reserved (text_format_osl_literals_reserved_data, ARRAY_SIZE(text_format_osl_literals_reserved_data))
 
static const Span< const char * > text_format_osl_literals_specialvar (text_format_osl_literals_specialvar_data, ARRAY_SIZE(text_format_osl_literals_specialvar_data))
 

Detailed Description

Note that this formatter shares core logic with text_format_glsl.cc, improvements here may apply there too.

Definition in file text_format_osl.cc.

Function Documentation

◆ ED_text_format_register_osl()

◆ text_format_osl_literals_builtinfunc()

static const Span< const char * > text_format_osl_literals_builtinfunc ( text_format_osl_literals_builtinfunc_data ,
ARRAY_SIZE(text_format_osl_literals_builtinfunc_data)  )
static

◆ text_format_osl_literals_reserved()

static const Span< const char * > text_format_osl_literals_reserved ( text_format_osl_literals_reserved_data ,
ARRAY_SIZE(text_format_osl_literals_reserved_data)  )
static

◆ text_format_osl_literals_specialvar()

static const Span< const char * > text_format_osl_literals_specialvar ( text_format_osl_literals_specialvar_data ,
ARRAY_SIZE(text_format_osl_literals_specialvar_data)  )
static

◆ txtfmt_osl_find_builtinfunc()

static int txtfmt_osl_find_builtinfunc ( const char * string)
static

◆ txtfmt_osl_find_preprocessor()

static int txtfmt_osl_find_preprocessor ( const char * string)
static

◆ txtfmt_osl_find_reserved()

static int txtfmt_osl_find_reserved ( const char * string)
static

◆ txtfmt_osl_find_specialvar()

static int txtfmt_osl_find_specialvar ( const char * string)
static

◆ txtfmt_osl_format_identifier()

◆ txtfmt_osl_format_line()

Variable Documentation

◆ text_format_osl_literals_builtinfunc_data

const char* text_format_osl_literals_builtinfunc_data[]
static
Initial value:
= {
"break",
"closure",
"color",
"continue",
"do",
"else",
"emit",
"float",
"for",
"if",
"illuminance",
"illuminate",
"int",
"matrix",
"normal",
"output",
"point",
"public",
"return",
"string",
"struct",
"vector",
"void",
"while",
}

OSL builtin function. list is from https://github.com/imageworks/OpenShadingLanguage/raw/master/src/doc/osl-languagespec.pdf

Definition at line 32 of file text_format_osl.cc.

◆ text_format_osl_literals_reserved_data

const char* text_format_osl_literals_reserved_data[]
static

◆ text_format_osl_literals_specialvar_data

const char* text_format_osl_literals_specialvar_data[]
static
Initial value:
= {
"displacement",
"shader",
"surface",
"volume",
}

Definition at line 115 of file text_format_osl.cc.