elm_code: Move parser callbacks to private.

Don't expose the internal callback mechanics, just the addition of parsers
This commit is contained in:
Andy Williams 2015-02-26 13:54:46 +00:00
parent e329755283
commit b89e88accc
4 changed files with 16 additions and 11 deletions

View File

@ -44,7 +44,7 @@ static void _elm_code_file_line_append_data(Elm_Code_File *file, const char *con
if (file->parent)
{
elm_code_parse_line(file->parent, line);
_elm_code_parse_line(file->parent, line);
elm_code_callback_fire(file->parent, &ELM_CODE_EVENT_LINE_LOAD_DONE, line);
// this is called so we can refresh after any styling changes from LOAD_DONE
@ -100,7 +100,7 @@ EAPI Elm_Code_File *elm_code_file_open(Elm_Code *code, const char *path)
if (ret->parent)
{
elm_code_parse_file(ret->parent, ret);
_elm_code_parse_file(ret->parent, ret);
elm_code_callback_fire(ret->parent, &ELM_CODE_EVENT_FILE_LOAD_DONE, ret);
}
return ret;

View File

@ -6,7 +6,8 @@
#include "elm_code_private.h"
EAPI void elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line)
void
_elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line)
{
Elm_Code_Parser *parser;
Eina_List *item;
@ -17,7 +18,8 @@ EAPI void elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line)
}
}
EAPI void elm_code_parse_file(Elm_Code *code, Elm_Code_File *file)
void
_elm_code_parse_file(Elm_Code *code, Elm_Code_File *file)
{
Elm_Code_Parser *parser;
Eina_List *item;
@ -28,9 +30,10 @@ EAPI void elm_code_parse_file(Elm_Code *code, Elm_Code_File *file)
}
}
EAPI void elm_code_parser_add(Elm_Code *code,
void (*parse_line)(Elm_Code_Line *),
void (*parse_file)(Elm_Code_File *))
EAPI void
elm_code_parser_add(Elm_Code *code,
void (*parse_line)(Elm_Code_Line *),
void (*parse_file)(Elm_Code_File *))
{
Elm_Code_Parser *parser;

View File

@ -30,10 +30,6 @@ typedef struct _Elm_Code_Parser
EAPI void elm_code_parser_add(Elm_Code *code, void (*parse_line)(Elm_Code_Line *),
void (*parse_file)(Elm_Code_File *));
EAPI void elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line);
EAPI void elm_code_parse_file(Elm_Code *code, Elm_Code_File *file);
/**
* @}
*/

View File

@ -38,3 +38,9 @@ typedef struct
Eina_Bool editable, focussed;
Eina_Bool show_line_numbers;
} Elm_Code_Widget_Data;
/* Private parser callbacks */
void _elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line);
void _elm_code_parse_file(Elm_Code *code, Elm_Code_File *file);