Test parser SVG
This commit is contained in:
parent
a85028f8d5
commit
55d6f48f0d
@ -3,7 +3,7 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE := ewolDrawer
|
LOCAL_MODULE := ewolDrawer
|
||||||
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng libfreetype
|
LOCAL_STATIC_LIBRARIES := ewol etk tinyxml libzip libpng libfreetype parsersvg agg
|
||||||
|
|
||||||
|
|
||||||
# load the common sources file of the platform
|
# load the common sources file of the platform
|
||||||
|
15
jni/Main.cpp
15
jni/Main.cpp
@ -41,6 +41,7 @@
|
|||||||
#include <ewol/widget/widgetE2D.h>
|
#include <ewol/widget/widgetE2D.h>
|
||||||
#include <ewol/widgetMeta/FileChooser.h>
|
#include <ewol/widgetMeta/FileChooser.h>
|
||||||
#include <ewol/WidgetManager.h>
|
#include <ewol/WidgetManager.h>
|
||||||
|
#include <parserSVG/parserSVG.h>
|
||||||
#include <globalMsg.h>
|
#include <globalMsg.h>
|
||||||
#include <widgetDrawer.h>
|
#include <widgetDrawer.h>
|
||||||
#include <elementManager.h>
|
#include <elementManager.h>
|
||||||
@ -284,10 +285,11 @@ class MainWindows :public ewol::Windows
|
|||||||
etk::UString tmpData = tmpWidget->GetCompleateFileName();
|
etk::UString tmpData = tmpWidget->GetCompleateFileName();
|
||||||
DRAW_DEBUG("Request opening the file : " << tmpData);
|
DRAW_DEBUG("Request opening the file : " << tmpData);
|
||||||
if (NULL != m_drawer) {
|
if (NULL != m_drawer) {
|
||||||
m_drawer->Load(tmpData);
|
//m_drawer->Load(tmpData);
|
||||||
}
|
}
|
||||||
} else if (eventId == drawMsgGuiSave) {
|
} else if (eventId == drawMsgGuiSave) {
|
||||||
if (NULL != m_drawer) {
|
if (NULL != m_drawer) {
|
||||||
|
/*
|
||||||
if (m_drawer->HasName()) {
|
if (m_drawer->HasName()) {
|
||||||
m_drawer->Save();
|
m_drawer->Save();
|
||||||
} else {
|
} else {
|
||||||
@ -297,6 +299,7 @@ class MainWindows :public ewol::Windows
|
|||||||
PopUpWidgetPush(tmpWidget);
|
PopUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, drawerEventRequestSaveFileSelected);
|
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, drawerEventRequestSaveFileSelected);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
} else if (eventId == drawerEventRequestSaveFileSelected) {
|
} else if (eventId == drawerEventRequestSaveFileSelected) {
|
||||||
// get widget:
|
// get widget:
|
||||||
@ -309,8 +312,10 @@ class MainWindows :public ewol::Windows
|
|||||||
etk::UString tmpData = tmpWidget->GetCompleateFileName();
|
etk::UString tmpData = tmpWidget->GetCompleateFileName();
|
||||||
DRAW_DEBUG("Request opening the file : " << tmpData);
|
DRAW_DEBUG("Request opening the file : " << tmpData);
|
||||||
if (NULL != m_drawer) {
|
if (NULL != m_drawer) {
|
||||||
|
/*
|
||||||
m_drawer->SetFilename(tmpData);
|
m_drawer->SetFilename(tmpData);
|
||||||
m_drawer->Save();
|
m_drawer->Save();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
} else if (eventId == drawerEventColorHasChange) {
|
} else if (eventId == drawerEventColorHasChange) {
|
||||||
// the button color has change ==> we really change the current color ...
|
// the button color has change ==> we really change the current color ...
|
||||||
@ -442,6 +447,14 @@ void APP_Init(void)
|
|||||||
// create the specific windows
|
// create the specific windows
|
||||||
ewol::DisplayWindows(basicWindows);
|
ewol::DisplayWindows(basicWindows);
|
||||||
DRAW_INFO("==> Init Ewol Drawer (END)");
|
DRAW_INFO("==> Init Ewol Drawer (END)");
|
||||||
|
etk::File svgFile("lion.svg", etk::FILE_TYPE_DATA);
|
||||||
|
svg::Parser *mySVGElement = new svg::Parser(svgFile);
|
||||||
|
|
||||||
|
mySVGElement->DisplayDebug();
|
||||||
|
mySVGElement->GenerateTestFile();
|
||||||
|
|
||||||
|
exit(-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,7 @@ namespace drawElement {
|
|||||||
coord2D_ts m_center;
|
coord2D_ts m_center;
|
||||||
int32_t m_nbRay;
|
int32_t m_nbRay;
|
||||||
etkFloat_t m_ratio;
|
etkFloat_t m_ratio;
|
||||||
bool m_fill
|
bool m_fill;
|
||||||
etkFloat_t m_thickness;
|
etkFloat_t m_thickness;
|
||||||
etkFloat_t m_shadowOutput;
|
etkFloat_t m_shadowOutput;
|
||||||
etkFloat_t m_shadowInput;
|
etkFloat_t m_shadowInput;
|
||||||
|
@ -170,6 +170,7 @@ bool drawElement::HasName(void)
|
|||||||
|
|
||||||
void drawElement::Load(etk::UString fileName)
|
void drawElement::Load(etk::UString fileName)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
drawElement::RemoveAll();
|
drawElement::RemoveAll();
|
||||||
SetFilename(newFileName);
|
SetFilename(newFileName);
|
||||||
|
|
||||||
@ -218,7 +219,7 @@ void drawElement::Load(etk::UString fileName)
|
|||||||
if (pNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
if (pNode->Type()==TiXmlNode::TINYXML_COMMENT) {
|
||||||
// nothing to do, just proceed to next step
|
// nothing to do, just proceed to next step
|
||||||
} else if (!strcmp(pNode->Value(), "element")) {
|
} else if (!strcmp(pNode->Value(), "element")) {
|
||||||
/*
|
#if 0
|
||||||
for(TiXmlNode * pGuiNode = pNode->FirstChild();
|
for(TiXmlNode * pGuiNode = pNode->FirstChild();
|
||||||
NULL != pGuiNode;
|
NULL != pGuiNode;
|
||||||
pGuiNode = pGuiNode->NextSibling()) {
|
pGuiNode = pGuiNode->NextSibling()) {
|
||||||
@ -280,7 +281,7 @@ void drawElement::Load(etk::UString fileName)
|
|||||||
DRAW_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [dot,link]");
|
DRAW_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [dot,link]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
#endif
|
||||||
} else {
|
} else {
|
||||||
DRAW_ERROR("(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [element]");
|
DRAW_ERROR("(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [element]");
|
||||||
}
|
}
|
||||||
@ -289,10 +290,12 @@ void drawElement::Load(etk::UString fileName)
|
|||||||
if (NULL != fileBuffer) {
|
if (NULL != fileBuffer) {
|
||||||
delete[] fileBuffer;
|
delete[] fileBuffer;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawElement::Save(void)
|
void drawElement::Save(void)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (l_fileName == "") {
|
if (l_fileName == "") {
|
||||||
DRAW_ERROR("No filename set ...");
|
DRAW_ERROR("No filename set ...");
|
||||||
return;
|
return;
|
||||||
@ -347,5 +350,6 @@ void drawElement::Save(void)
|
|||||||
}
|
}
|
||||||
//Save Document
|
//Save Document
|
||||||
doc.SaveFile( l_fileName.Utf8Data() );
|
doc.SaveFile( l_fileName.Utf8Data() );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace drawElement {
|
|||||||
color_ts m_colorInside;
|
color_ts m_colorInside;
|
||||||
coord2D_ts m_center;
|
coord2D_ts m_center;
|
||||||
coord2D_ts m_size;
|
coord2D_ts m_size;
|
||||||
bool m_fill
|
bool m_fill;
|
||||||
etkFloat_t m_thickness;
|
etkFloat_t m_thickness;
|
||||||
etkFloat_t m_shadowOutput;
|
etkFloat_t m_shadowOutput;
|
||||||
etkFloat_t m_shadowInput;
|
etkFloat_t m_shadowInput;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user