Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
K'van
Tales of MajEyal
Commits
ce8a0ed6
Commit
ce8a0ed6
authored
11 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
plop
parent
1dcb2f53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/web.c
+3
-0
3 additions, 0 deletions
src/web.c
src/web/web.cpp
+8
-23
8 additions, 23 deletions
src/web/web.cpp
with
11 additions
and
23 deletions
src/web.c
+
3
−
0
View file @
ce8a0ed6
...
...
@@ -299,6 +299,9 @@ void te4_web_init(lua_State *L) {
auxiliar_newclass
(
L
,
"web{view}"
,
view_reg
);
luaL_openlib
(
L
,
"core.webview"
,
weblib
,
0
);
lua_pushstring
(
L
,
"kind"
);
lua_pushstring
(
L
,
"aweseomium"
);
lua_settable
(
L
,
-
3
);
lua_settop
(
L
,
0
);
}
...
...
This diff is collapsed.
Click to expand it.
src/web/web.cpp
+
8
−
23
View file @
ce8a0ed6
...
...
@@ -31,17 +31,11 @@ static void (*web_key_mods)(bool *shift, bool *ctrl, bool *alt, bool *meta);
using
namespace
Awesomium
;
class
PhysfsDataSource
;
class
WebJShandler
;
static
WebCore
*
web_core
=
NULL
;
static
WebSession
*
web_session
=
NULL
;
static
PhysfsDataSource
*
web_data_source
=
NULL
;
typedef
struct
{
WebJShandler
*
listener
;
int
methods_ref
;
}
web_js_type
;
class
WebListener
;
static
char
*
webstring_to_buf
(
const
WebString
&
wstr
,
size_t
*
flen
)
{
...
...
@@ -55,20 +49,11 @@ static char *webstring_to_buf(const WebString &wstr, size_t *flen) {
return
buf
;
}
class
WebJShandler
:
public
JSMethodHandler
{
public:
web_js_type
*
js
;
virtual
void
OnMethodCall
(
WebView
*
caller
,
unsigned
int
remote_object_id
,
const
WebString
&
method_name
,
const
JSArray
&
args
)
{
}
virtual
JSValue
OnMethodCallWithReturnValue
(
WebView
*
caller
,
unsigned
int
remote_object_id
,
const
WebString
&
method_name
,
const
JSArray
&
args
)
{
}
};
class
WebListener
:
public
WebViewListener
::
View
,
public
WebViewListener
::
Download
,
public
WebViewListener
::
Load
public
WebViewListener
::
Load
,
public
JSMethodHandler
{
private:
int
handlers
;
...
...
@@ -200,6 +185,12 @@ public:
event
->
data
.
loading
.
status
=
1
;
push_event
(
event
);
}
virtual
void
OnMethodCall
(
WebView
*
caller
,
unsigned
int
remote_object_id
,
const
WebString
&
method_name
,
const
JSArray
&
args
)
{
}
virtual
JSValue
OnMethodCallWithReturnValue
(
WebView
*
caller
,
unsigned
int
remote_object_id
,
const
WebString
&
method_name
,
const
JSArray
&
args
)
{
}
};
class
PhysfsDataSource
:
public
DataSource
{
...
...
@@ -214,7 +205,6 @@ public:
WebView
*
view
;
WebListener
*
listener
;
JSObject
*
te4core
;
web_js_type
*
js
;
};
void
te4_web_new
(
web_view_type
*
view
,
const
char
*
url
,
int
w
,
int
h
)
{
...
...
@@ -229,7 +219,6 @@ void te4_web_new(web_view_type *view, const char *url, int w, int h) {
opaque
->
view
->
set_download_listener
(
opaque
->
listener
);
opaque
->
view
->
set_load_listener
(
opaque
->
listener
);
opaque
->
te4core
=
NULL
;
opaque
->
js
=
NULL
;
view
->
w
=
w
;
view
->
h
=
h
;
view
->
closed
=
false
;
...
...
@@ -246,10 +235,6 @@ bool te4_web_close(web_view_type *view) {
opaque
->
view
->
Destroy
();
delete
opaque
->
listener
;
view
->
closed
=
true
;
if
(
opaque
->
js
)
{
delete
opaque
->
js
->
listener
;
free
(
opaque
->
js
);
}
if
(
opaque
->
te4core
)
delete
opaque
->
te4core
;
printf
(
"Destroyed webview
\n
"
);
return
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment