Initial commit
This commit is contained in:
41
main.cpp
Normal file
41
main.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include <iostream>
|
||||
#include <emscripten.h>
|
||||
#include <exception>
|
||||
|
||||
#include "src/class/Element.h"
|
||||
#include "src/proc/string.cpp"
|
||||
#include "src/class/EventBus.h"
|
||||
#include "src/proc/event.cpp"
|
||||
#include "src/proc/uuid.cpp"
|
||||
|
||||
extern "C" {
|
||||
char* itest();
|
||||
int str_pass_size();
|
||||
void fire_event_bus(int key_pass);
|
||||
}
|
||||
|
||||
void say_aye() {
|
||||
printf("Arrgh mates!\n");
|
||||
}
|
||||
|
||||
char* itest() {
|
||||
Element p_tag("#foo");
|
||||
p_tag.addEventListener("click", say_aye);
|
||||
|
||||
return "Hi, there";
|
||||
}
|
||||
|
||||
// These are REQUIRED.
|
||||
int str_pass_size() {
|
||||
return cjs::str::pass_size();
|
||||
}
|
||||
|
||||
void fire_event_bus(int string_pass) {
|
||||
return cjs::event::handle_bus_fire(string_pass);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
EM_ASM(InitWrappers());
|
||||
printf("C++.js has initialized!\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user