elm_code: refactor widget to seperate space.

Keeping the private files for elm_code cleaner
This commit is contained in:
Andy Williams 2015-04-04 18:17:01 +01:00
parent f50bff8e99
commit 4cf18aed40
15 changed files with 61 additions and 53 deletions

View File

@ -14,7 +14,6 @@
#include <Elementary.h>
#include <Elm_Code.h>
#include "elm_code_widget.eo.h"
#include "elm_code_test_private.h"

View File

@ -38,9 +38,9 @@
#include "elm_code_text.h"
#include "elm_code_file.h"
#include "elm_code_parse.h"
#include "elm_code_widget.eo.h"
#include "elm_code_widget_text.h"
#include "elm_code_widget_selection.h"
#include "widget/elm_code_widget.eo.h"
#include "widget/elm_code_widget_text.h"
#include "widget/elm_code_widget_selection.h"
#include "elm_code_diff_widget.h"
#ifdef __cplusplus

View File

@ -23,9 +23,9 @@ elm_code_line.h \
elm_code_text.h \
elm_code_file.h \
elm_code_parse.h \
elm_code_widget.eo.h \
elm_code_widget_text.h \
elm_code_widget_selection.h \
widget/elm_code_widget.eo.h \
widget/elm_code_widget_text.h \
widget/elm_code_widget_selection.h \
elm_code_diff_widget.h \
Elm_Code.h
includesdir = $(includedir)/edi-@VMAJ@
@ -35,19 +35,20 @@ elm_code_line.c \
elm_code_text.c \
elm_code_file.c \
elm_code_parse.c \
elm_code_widget_text.c \
elm_code_widget_tooltip.c \
elm_code_widget_selection.c \
elm_code_widget.c \
widget/elm_code_widget_text.c \
widget/elm_code_widget_tooltip.c \
widget/elm_code_widget_selection.c \
widget/elm_code_widget.c \
elm_code_diff_widget.c \
elm_code.c \
elm_code_private.h
elm_code_private.h \
elm_code_widget_private.h
libelm_code_la_LIBADD = @EFL_LIBS@ -lm
libelm_code_la_LDFLAGS = -no-undefined @EFL_LTLIBRARY_FLAGS@
elm_code_eolian_files = \
elm_code_widget.eo
widget/elm_code_widget.eo
elm_code_eolian_c = $(elm_code_eolian_files:%.eo=%.eo.c)
elm_code_eolian_h = $(elm_code_eolian_files:%.eo=%.eo.h)

View File

@ -24,35 +24,6 @@ extern int _elm_code_lib_log_dom;
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_elm_code_lib_log_dom, __VA_ARGS__)
#endif
/**
* Structure holding the info about a selected region.
*/
typedef struct
{
unsigned int start_line, end_line;
unsigned int start_col, end_col;
} Elm_Code_Widget_Selection_Data;
typedef struct
{
Elm_Code *code;
Evas_Object *grid, *scroller;
Evas_Font_Size font_size;
double gravity_x, gravity_y;
unsigned int cursor_line, cursor_col;
Eina_Bool editable, focussed;
Eina_Bool show_line_numbers;
unsigned int line_width_marker, tabstop;
Eina_Bool show_whitespace;
Elm_Code_Widget_Selection_Data *selection;
Evas_Object *tooltip;
} Elm_Code_Widget_Data;
/* Private parser callbacks */
void _elm_code_parse_setup();
@ -61,8 +32,5 @@ void _elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line);
void _elm_code_parse_file(Elm_Code *code, Elm_Code_File *file);
/* Private widget methods */
void _elm_code_widget_tooltip_text_set(Evas_Object *widget, const char *text);
void _elm_code_widget_tooltip_add(Evas_Object *widget);
#endif

View File

@ -4,6 +4,7 @@
#include "Elm_Code.h"
#include "elm_code_private.h"
#include "elm_code_widget_private.h"
typedef enum {
ELM_CODE_WIDGET_COLOR_GUTTER_BG = ELM_CODE_TOKEN_TYPE_COUNT,

View File

@ -0,0 +1,39 @@
#ifndef ELM_CODE_WIDGET_PRIVATE_H
# define ELM_CODE_WIDGET_PRIVATE_H
/**
* Structure holding the info about a selected region.
*/
typedef struct
{
unsigned int start_line, end_line;
unsigned int start_col, end_col;
} Elm_Code_Widget_Selection_Data;
typedef struct
{
Elm_Code *code;
Evas_Object *grid, *scroller;
Evas_Font_Size font_size;
double gravity_x, gravity_y;
unsigned int cursor_line, cursor_col;
Eina_Bool editable, focussed;
Eina_Bool show_line_numbers;
unsigned int line_width_marker, tabstop;
Eina_Bool show_whitespace;
Elm_Code_Widget_Selection_Data *selection;
Evas_Object *tooltip;
} Elm_Code_Widget_Data;
/* Private widget methods */
void _elm_code_widget_tooltip_text_set(Evas_Object *widget, const char *text);
void _elm_code_widget_tooltip_add(Evas_Object *widget);
#endif

View File

@ -4,7 +4,7 @@
#include "Elm_Code.h"
#include "elm_code_private.h"
#include "elm_code_widget_private.h"
static Elm_Code_Widget_Selection_Data *
_elm_code_widget_selection_new()

View File

@ -4,7 +4,7 @@
#include "Elm_Code.h"
#include "elm_code_private.h"
#include "elm_code_widget_private.h"
EAPI int
elm_code_widget_text_line_number_width_get(Elm_Code_Widget *widget)

View File

@ -4,7 +4,7 @@
#include "Elm_Code.h"
#include "elm_code_private.h"
#include "elm_code_widget_private.h"
void
_elm_code_widget_tooltip_text_set(Evas_Object *widget, const char *text)

View File

@ -11,8 +11,8 @@ elm_code_file_test_memory.c \
elm_code_test_basic.c \
elm_code_test_parse.c \
elm_code_test_text.c \
elm_code_test_widget.c \
elm_code_test_widget_selection.c \
widget/elm_code_test_widget.c \
widget/elm_code_test_widget_selection.c \
elm_code_suite.c
elm_code_suite_CPPFLAGS = -I$(top_builddir)/elm_code/src/lib/ \

View File

@ -4,7 +4,7 @@
#include "elm_code_suite.h"
#include "elm_code_widget.c"
#include "widget/elm_code_widget.c"
static void _assert_cell_type(Evas_Textgrid_Cell cell, Elm_Code_Token_Type type, int id)
{

View File

@ -4,7 +4,7 @@
#include "elm_code_suite.h"
#include "elm_code_widget_selection.h"
#include "widget/elm_code_widget_selection.h"
START_TEST (elm_code_test_widget_selection_set)
{