-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
443 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "event_target.h" | ||
|
||
class ApplicationCache : public EventTarget { | ||
public: | ||
enum { | ||
UNCACHED = 0, | ||
IDLE = 1, | ||
CHECKING = 2, | ||
DOWNLOADING = 3, | ||
UPDATEREADY = 4, | ||
OBSOLETE = 5, | ||
}; | ||
|
||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, oncached); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, onchecking); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, ondownloading); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, onerror); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, onnoupdate); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, onobsolete); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, onprogress); | ||
HTML5_EVENT_HANDLER_PROPERTY(ApplicationCache, EventHandler *, onupdateready); | ||
HTML5_PROPERTY(ApplicationCache, unsigned short, status); | ||
|
||
ApplicationCache(emscripten::val v); | ||
virtual ~ApplicationCache(); | ||
static ApplicationCache *create(emscripten::val v); | ||
void abort(); | ||
void swapCache(); | ||
void update(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include "libhtml5.h" | ||
|
||
class BarProp : public Object { | ||
public: | ||
emscripten::val v; | ||
HTML5_PROPERTY(BarProp, bool, visible); | ||
|
||
BarProp(emscripten::val v); | ||
virtual ~BarProp(); | ||
static BarProp *create(emscripten::val v); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include "libhtml5.h" | ||
|
||
class External : public Object { | ||
public: | ||
emscripten::val v; | ||
|
||
External(emscripten::val v); | ||
virtual ~External(); | ||
static External *create(emscripten::val v); | ||
void AddSearchProvider(std::string engineURL); | ||
unsigned long IsSearchProviderInstalled(std::string engineURL); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "libhtml5.h" | ||
|
||
class History : public Object { | ||
public: | ||
emscripten::val v; | ||
HTML5_READONLY_PROPERTY(History, long, length); | ||
//HTML5_PROPERTY(History, void *, state); | ||
|
||
History(emscripten::val v); | ||
virtual ~History(); | ||
static History *create(emscripten::val v); | ||
void back(); | ||
void forward(); | ||
void go(long delta = 0); | ||
void pushState(void *data, std::string title, std::string url); | ||
void replaceState(void *data, std::string title, std::string url); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "application_cache.h" | ||
|
||
ApplicationCache::ApplicationCache(emscripten::val v) : | ||
EventTarget(v) | ||
{ | ||
|
||
} | ||
|
||
ApplicationCache::~ApplicationCache() | ||
{ | ||
|
||
} | ||
|
||
ApplicationCache *ApplicationCache::create(emscripten::val v) | ||
{ | ||
auto cache = new ApplicationCache(v); | ||
cache->autorelease(); | ||
return cache; | ||
} | ||
|
||
void ApplicationCache::abort() | ||
{ | ||
HTML5_CALL(this->v, abort); | ||
} | ||
|
||
void ApplicationCache::swapCache() | ||
{ | ||
HTML5_CALL(this->v, swapCache); | ||
} | ||
|
||
void ApplicationCache::update() | ||
{ | ||
HTML5_CALL(this->v, update); | ||
} | ||
|
||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, oncached); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, onchecking); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, ondownloading); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, onerror); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, onnoupdate); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, onobsolete); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, onprogress); | ||
HTML5_EVENT_HANDLER_PROPERTY_IMPL(ApplicationCache, EventHandler *, onupdateready); | ||
HTML5_PROPERTY_IMPL(ApplicationCache, unsigned short, status); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "bar_prop.h" | ||
|
||
BarProp::BarProp(emscripten::val v) : | ||
Object(), | ||
v(v) | ||
{ | ||
|
||
} | ||
|
||
BarProp::~BarProp() | ||
{ | ||
|
||
} | ||
|
||
BarProp *BarProp::create(emscripten::val v) | ||
{ | ||
auto barProp = new BarProp(v); | ||
barProp->autorelease(); | ||
return barProp; | ||
} | ||
|
||
HTML5_PROPERTY_IMPL(BarProp, bool, visible); |
Oops, something went wrong.