Experimental eo commit - structure in place and it's resizing but won't render

This commit is contained in:
Andy Williams 2015-01-23 22:55:13 +00:00
parent 1b1242a430
commit 3fb3564d05
8 changed files with 246 additions and 0 deletions

View File

@ -84,6 +84,14 @@ EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
# Check edje_cc
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
EFL_WITH_BIN([eolian], [eolian-gen], [eolian_gen])
# Force the helper to try external eolian generators
AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true])
# Needs to be moved into a macro, and also, needs a way to automatically fetch
# from all the dependencies using the Requires.
DEPS_EOLIAN_FLAGS=`${PKG_CONFIG} --variable=eolian_flags eo evas edje ecore efl`
AC_SUBST([DEPS_EOLIAN_FLAGS])
# Checks for library functions.
AC_CHECK_FUNCS([setlocale])
@ -127,6 +135,8 @@ echo " CFLAGS.................: $CFLAGS"
echo " edje_cc................: ${edje_cc}"
echo " highlighting (libclang): ${build_clang}"
echo
echo "eolian_gen...............: ${eolian_gen}"
echo
echo "Building documentation...: ${build_doc}"
echo "Building tests...........: ${have_tests}"
echo "Generate coverage .......: ${have_lcov}"

View File

@ -12,6 +12,7 @@
#include "gettext.h"
#include <Elm_Code.h>
#include "elm_code_widget2.eo.h"
#include "elm_code_test_private.h"
@ -50,6 +51,16 @@ _elm_code_test_welcome_setup(Evas_Object *parent)
Evas_Object *widget;
code = elm_code_create();
Elm_Code_Widget2 *obj = eo_add(ELM_CODE_WIDGET2_CLASS, parent);
eo_do(obj,
elm_code_widget2_font_size_set(14));
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(obj);
return obj;
// TODO - add all this good stuff into the eo api
widget = elm_code_widget_add(parent, code);
elm_code_widget_font_size_set(widget, 14);
elm_code_widget_editable_set(widget, EINA_TRUE);

View File

@ -3,6 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_srcdir)/elm_code/lib \
-DEFL_BETA_API_SUPPORT \
-DEFL_EO_API_SUPPORT \
@EFL_CFLAGS@ \
-DEFL_ELM_CODE_BUILD
@ -20,8 +21,10 @@ libelm_code_la_SOURCES = \
elm_code_file.c \
elm_code_parse.c \
elm_code_widget.c \
elm_code_widget2.c \
elm_code_diff_widget.c \
elm_code.c \
elm_code_private.h
libelm_code_la_LIBADD = @EFL_LIBS@ -lm
libelm_code_la_LDFLAGS = -no-undefined @EFL_LTLIBRARY_FLAGS@

View File

@ -0,0 +1,82 @@
#ifdef HAVE_CONFIG
# include "config.h"
#endif
#include <Eo.h>
#include <Evas.h>
#include <Elementary.h>
#include <Elm_Code.h>
#include "elm_code_widget2.eo.h"
typedef struct
{
Elm_Code *code;
Evas_Font_Size font_size;
unsigned int cursor_line, cursor_col;
Eina_Bool editable;
} Elm_Code_Widget2_Data;
EOLIAN static void
_elm_code_widget2_eo_base_constructor(Eo *obj, Elm_Code_Widget2_Data *pd)
{
eo_do_super(obj, ELM_CODE_WIDGET2_CLASS, eo_constructor());
printf("constr\n");
}
EOLIAN static void
_elm_code_widget2_evas_object_smart_resize(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Coord w, Evas_Coord h)
{
printf("size %d, %d\n", w, h);
}
EOLIAN static void
_elm_code_widget2_class_constructor(Eo_Class *klass)
{
}
EOLIAN static void
_elm_code_widget2_elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Coord x, Evas_Coord y, Eina_Bool sig)
{
}
EOLIAN static void
_elm_code_widget2_evas_object_smart_add(Eo *obj, Elm_Code_Widget2_Data *pd)
{
Evas_Object *text;
printf("add\n");
eo_do_super(obj, ELM_CODE_WIDGET2_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
// elm_widget_can_focus_set(obj, EINA_TRUE);
text = elm_label_add(obj);
elm_object_text_set(text, "HELLO");
elm_widget_sub_object_add(obj, text);
evas_object_size_hint_weight_set(text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(text, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(text);
eo_do(obj, elm_obj_widget_theme_apply());
elm_layout_sizing_eval(obj);
}
EOLIAN static void
_elm_code_widget2_font_size_set(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Font_Size font_size)
{
printf("set\n");
pd->font_size = font_size;
}
EOLIAN static Evas_Font_Size
_elm_code_widget2_font_size_get(Eo *obj, Elm_Code_Widget2_Data *pd)
{
return pd->font_size;
}
#include "elm_code_widget2.eo.c"

View File

@ -0,0 +1,30 @@
class Elm_Code_Widget2 (Elm_Layout, Elm_Interface_Scrollable,
Elm_Interface_Atspi_Text)
{
eo_prefix: elm_code_widget2;
properties {
font_size {
set {
}
get {
}
values {
Evas_Font_Size font_size;
}
}
}
methods {
}
implements {
class.constructor;
Eo.Base.constructor;
Evas.Object_Smart.add;
Evas.Object_Smart.resize;
Elm_Interface_Scrollable.content_pos_set;
}
events {
focused;
unfocused;
}
}

View File

@ -0,0 +1,53 @@
EOAPI const Eo_Event_Description _ELM_CODE_WIDGET2_EVENT_FOCUSED =
EO_EVENT_DESCRIPTION("focused", "");
EOAPI const Eo_Event_Description _ELM_CODE_WIDGET2_EVENT_UNFOCUSED =
EO_EVENT_DESCRIPTION("unfocused", "");
void _elm_code_widget2_font_size_set(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Font_Size font_size);
EOAPI EO_VOID_FUNC_BODYV(elm_code_widget2_font_size_set, EO_FUNC_CALL(font_size), Evas_Font_Size font_size);
Evas_Font_Size _elm_code_widget2_font_size_get(Eo *obj, Elm_Code_Widget2_Data *pd);
EOAPI EO_FUNC_BODY(elm_code_widget2_font_size_get, Evas_Font_Size, 0);
void _elm_code_widget2_eo_base_constructor(Eo *obj, Elm_Code_Widget2_Data *pd);
void _elm_code_widget2_evas_object_smart_add(Eo *obj, Elm_Code_Widget2_Data *pd);
void _elm_code_widget2_evas_object_smart_resize(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Coord w, Evas_Coord h);
void _elm_code_widget2_elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Code_Widget2_Data *pd, Evas_Coord x, Evas_Coord y, Eina_Bool sig);
static Eo_Op_Description _elm_code_widget2_op_desc[] = {
EO_OP_FUNC_OVERRIDE(eo_constructor, _elm_code_widget2_eo_base_constructor),
EO_OP_FUNC_OVERRIDE(evas_obj_smart_add, _elm_code_widget2_evas_object_smart_add),
EO_OP_FUNC_OVERRIDE(evas_obj_smart_resize, _elm_code_widget2_evas_object_smart_resize),
EO_OP_FUNC_OVERRIDE(elm_interface_scrollable_content_pos_set, _elm_code_widget2_elm_interface_scrollable_content_pos_set),
EO_OP_FUNC(elm_code_widget2_font_size_set, _elm_code_widget2_font_size_set, ""),
EO_OP_FUNC(elm_code_widget2_font_size_get, _elm_code_widget2_font_size_get, ""),
EO_OP_SENTINEL
};
static const Eo_Event_Description *_elm_code_widget2_event_desc[] = {
ELM_CODE_WIDGET2_EVENT_FOCUSED,
ELM_CODE_WIDGET2_EVENT_UNFOCUSED,
NULL
};
static const Eo_Class_Description _elm_code_widget2_class_desc = {
EO_VERSION,
"Elm_Code_Widget2",
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(_elm_code_widget2_op_desc),
_elm_code_widget2_event_desc,
sizeof(Elm_Code_Widget2_Data),
_elm_code_widget2_class_constructor,
NULL
};
EO_DEFINE_CLASS(elm_code_widget2_class_get, &_elm_code_widget2_class_desc, ELM_LAYOUT_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, ELM_INTERFACE_ATSPI_TEXT_INTERFACE, NULL);

View File

@ -0,0 +1,50 @@
#ifndef _ELM_CODE_WIDGET2_EO_H_
#define _ELM_CODE_WIDGET2_EO_H_
#ifndef _ELM_CODE_WIDGET2_EO_CLASS_TYPE
#define _ELM_CODE_WIDGET2_EO_CLASS_TYPE
typedef Eo Elm_Code_Widget2;
#endif
#ifndef _ELM_CODE_WIDGET2_EO_TYPES
#define _ELM_CODE_WIDGET2_EO_TYPES
#endif
#define ELM_CODE_WIDGET2_CLASS elm_code_widget2_class_get()
const Eo_Class *elm_code_widget2_class_get(void) EINA_CONST;
/**
*
* No description supplied.
*
* @param[in] font_size No description supplied.
*
*/
EOAPI void elm_code_widget2_font_size_set(Evas_Font_Size font_size);
/**
*
* No description supplied.
*
*
*/
EOAPI Evas_Font_Size elm_code_widget2_font_size_get(void);
EOAPI extern const Eo_Event_Description _ELM_CODE_WIDGET2_EVENT_FOCUSED;
EOAPI extern const Eo_Event_Description _ELM_CODE_WIDGET2_EVENT_UNFOCUSED;
/**
* No description
*/
#define ELM_CODE_WIDGET2_EVENT_FOCUSED (&(_ELM_CODE_WIDGET2_EVENT_FOCUSED))
/**
* No description
*/
#define ELM_CODE_WIDGET2_EVENT_UNFOCUSED (&(_ELM_CODE_WIDGET2_EVENT_UNFOCUSED))
#endif

7
elm_code/lib/regen.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
INCLUDE="-I /usr/local/share/eolian/include/eo-1 -I /usr/local/share/eolian/include/elementary-1 -I /usr/local/share/eolian/include/evas-1 -I /usr/local/share/eolian/include/efl-1"
eolian_gen $INCLUDE --gh --eo -o elm_code_widget2.eo.h elm_code_widget2.eo
eolian_gen $INCLUDE --gc --eo -o elm_code_widget2.eo.c elm_code_widget2.eo
eolian_gen $INCLUDE --gi --eo -o elm_code_widget2.c elm_code_widget2.eo