2015-02-14 15:14:06 -08:00
|
|
|
#ifndef ELM_CODE_LINE_H_
|
|
|
|
# define ELM_CODE_LINE_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief These routines are used for interacting with lines of content using Elm Code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _Elm_Code_Token
|
|
|
|
{
|
|
|
|
int start, end;
|
2015-02-21 10:24:17 -08:00
|
|
|
unsigned int end_line;
|
2015-02-14 15:14:06 -08:00
|
|
|
|
|
|
|
Elm_Code_Token_Type type;
|
|
|
|
|
|
|
|
} Elm_Code_Token;
|
|
|
|
|
|
|
|
typedef struct _Elm_Code_Line
|
|
|
|
{
|
2015-02-21 10:24:17 -08:00
|
|
|
Elm_Code_File *file;
|
|
|
|
|
2015-02-14 15:14:06 -08:00
|
|
|
const char *content;
|
2015-03-07 11:48:02 -08:00
|
|
|
unsigned int length, unicode_length;
|
2015-02-14 15:14:06 -08:00
|
|
|
unsigned int number;
|
|
|
|
char *modified;
|
|
|
|
|
|
|
|
Elm_Code_Status_Type status;
|
|
|
|
Eina_List *tokens;
|
|
|
|
|
|
|
|
void *data;
|
2015-03-27 16:54:28 -07:00
|
|
|
const char *status_text;
|
2015-02-14 15:14:06 -08:00
|
|
|
} Elm_Code_Line;
|
|
|
|
|
2015-03-08 03:15:31 -07:00
|
|
|
EAPI void elm_code_line_free(Elm_Code_Line *line);
|
|
|
|
|
2015-03-07 11:48:02 -08:00
|
|
|
EAPI unsigned int elm_code_line_utf8_length_get(Elm_Code_Line *line);
|
|
|
|
|
2015-02-14 15:14:06 -08:00
|
|
|
/**
|
2015-02-22 12:07:08 -08:00
|
|
|
* @brief Line markup functions.
|
|
|
|
* @defgroup Line highlighting and status manipulation
|
2015-02-14 15:14:06 -08:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
2015-02-22 12:07:08 -08:00
|
|
|
* Functions for handling styling and marking up lines within elm code.
|
2015-02-14 15:14:06 -08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
EAPI void elm_code_line_status_set(Elm_Code_Line *line, Elm_Code_Status_Type status);
|
|
|
|
|
2015-02-21 10:24:17 -08:00
|
|
|
EAPI void elm_code_line_token_add(Elm_Code_Line *line, int start, int end, int lines, Elm_Code_Token_Type type);
|
2015-02-14 15:14:06 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* ELM_CODE_LINE_H_ */
|