Skip to content

Commit

Permalink
Merge pull request #29 from knocknote/feature/remove-undefined-symbol…
Browse files Browse the repository at this point in the history
…-warning

More easily to use libhtml5 library
  • Loading branch information
goccy authored Jul 12, 2019
2 parents e4cf556 + b973695 commit 75f2c83
Show file tree
Hide file tree
Showing 89 changed files with 582 additions and 601 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ set(SOURCES src/application_cache.cc

if ($ENV{ENABLE_EMSCRIPTEN})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Oz -g -std=c++11 --memory-init-file 0 --llvm-lto 1 --bind -s DEMANGLE_SUPPORT=1 -s WASM=0 -s NO_FILESYSTEM=1 -DENABLE_EMSCRIPTEN=1 -DPROPERTY_TRACE=1")
add_library(html5 STATIC bind.cc ${SOURCES})
add_library(html5 STATIC ${SOURCES})
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -std=c++11")
add_library(html5 STATIC ${SOURCES})
Expand Down
24 changes: 0 additions & 24 deletions bind.cc

This file was deleted.

3 changes: 0 additions & 3 deletions examples/array.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#include "libhtml5.h"
#include "class.h"
#include <math.h>

static void arrayTest()
{
HTML5_INIT();

html5::array subarray;
html5::array array = {
1, M_PI, "hello", subarray, html5::Object::create(),
Expand Down
4 changes: 1 addition & 3 deletions examples/image.cc
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#include "libhtml5.h"
#include "class.h"
#include <iostream>

static void createImage(std::string url)
{
HTML5_INIT();
for (html5::StyleSheet *sheet : *html5::window->document->styleSheets) {
html5::window->console->log(sheet);
}
html5::HTMLImageElement *image = html5::HTMLImageElement::create();
static html5::EventHandler onload = [image](html5::Event *e){
html5::window->console->trace();
std::cout << "callback. onload" << std::endl;
html5::window->console->trace();
std::cout << "width = " << image->width << std::endl;
std::cout << "height = " << image->height << std::endl;
std::cout << "naturalWidth = " << image->naturalWidth << std::endl;
Expand Down
4 changes: 0 additions & 4 deletions examples/promise.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#include "libhtml5.h"
#include "class.h"

static void promiseTest()
{
HTML5_INIT();

auto promise = html5::Promise::create([](std::function<void(const std::string &)> resolve, std::function<void()> reject) {
html5::window->setTimeout([resolve](){ resolve("foo"); }, 300);
});
Expand All @@ -20,7 +17,6 @@ static void promiseTest()

static void fetchImageTest(const std::string &imageURL)
{
HTML5_INIT();
html5::fetch(imageURL)->then<html5::Response *>([](html5::Response *response) {
return response->blob();
})->then<html5::Blob *>([](html5::Blob *blob) {
Expand Down
3 changes: 0 additions & 3 deletions examples/string.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#include "libhtml5.h"
#include "class.h"

static void stringTest()
{
HTML5_INIT();

{
html5::string s = "hello world";
std::cout << s << std::endl;
Expand Down
3 changes: 0 additions & 3 deletions examples/style_sheet.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#include "libhtml5.h"
#include "class.h"
#include <iostream>

using namespace html5;

static void addStyleSheet() {
HTML5_INIT();

auto document = window->document;
auto sheets = window->document->styleSheets;
if (sheets->length == 0) {
Expand Down
1 change: 0 additions & 1 deletion examples/test_exec.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "libhtml5.h"
#include "class.h"

#include "image.cc"
#include "style_sheet.cc"
Expand Down
2 changes: 0 additions & 2 deletions examples/video.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "libhtml5.h"
#include "class.h"
#include <iostream>

static void createVideo(std::string url)
{
HTML5_INIT();
html5::HTMLVideoElement *video = html5::HTMLVideoElement::create();
html5::HTMLSourceElement *source = html5::HTMLSourceElement::create();
source->src = url;
Expand Down
2 changes: 1 addition & 1 deletion include/array_buffer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/array_buffer_view.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/attr.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/audio_track.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/auto_release_pool.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"
#include <vector>

NAMESPACE_HTML5_BEGIN;
Expand Down
2 changes: 1 addition & 1 deletion include/bar_prop.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/blob.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/canvas_gradient.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/canvas_pattern.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/console.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"
#include "html5_string.h"
#include "array.h"

Expand Down
2 changes: 1 addition & 1 deletion include/css_rule.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/css_rule_list.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/css_style_declaration.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/date.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/document.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"
#include "node.h"

NAMESPACE_HTML5_BEGIN;
Expand Down
2 changes: 1 addition & 1 deletion include/document_type.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/dom_error.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/dom_implementation.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/dom_token_list.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"
#include <vector>

NAMESPACE_HTML5_BEGIN;
Expand Down
2 changes: 1 addition & 1 deletion include/event.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"
#include <time.h>

NAMESPACE_HTML5_BEGIN;
Expand Down
2 changes: 1 addition & 1 deletion include/event_target.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

#include <functional>
#include <map>
Expand Down
4 changes: 0 additions & 4 deletions include/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class Performance;
class WindowProxy;
class Console;

extern Window *window;

extern void alert(std::string message);
extern std::string atob(std::string atob);
extern void blur();
Expand Down Expand Up @@ -65,5 +63,3 @@ extern long setTimeout(std::function<void(void)> *handler, long timeout);
extern void stop();

NAMESPACE_HTML5_END;

extern void HTML5_INIT();
2 changes: 1 addition & 1 deletion include/external.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/history.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"

NAMESPACE_HTML5_BEGIN;

Expand Down
2 changes: 1 addition & 1 deletion include/hit_region_options.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "libhtml5.h"
#include "html5.h"
#include "canvas_fill_rule.h"

NAMESPACE_HTML5_BEGIN;
Expand Down
Loading

0 comments on commit 75f2c83

Please sign in to comment.