Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
tome
Tales of MajEyal
Commits
fc1cc7d9
Commit
fc1cc7d9
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
test
parent
404ef263
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/te4web.h
+1
-0
1 addition, 0 deletions
src/te4web.h
src/web-cef3/web.cpp
+10
-0
10 additions, 0 deletions
src/web-cef3/web.cpp
src/web-external.h
+2
-0
2 additions, 0 deletions
src/web-external.h
src/web.c
+5
-0
5 additions, 0 deletions
src/web.c
with
18 additions
and
0 deletions
src/te4web.h
+
1
−
0
View file @
fc1cc7d9
...
...
@@ -25,6 +25,7 @@ extern void te4_web_load();
extern
void
te4_web_init
(
lua_State
*
L
);
extern
void
te4_web_update
(
lua_State
*
L
);
extern
void
te4_web_terminate
();
extern
int
browsers_count
;
#endif
This diff is collapsed.
Click to expand it.
src/web-cef3/web.cpp
+
10
−
0
View file @
fc1cc7d9
...
...
@@ -134,6 +134,11 @@ public:
this
->
first_load
=
true
;
all_browsers
[
this
]
=
true
;
all_browsers_nb
++
;
WebEvent
*
event
=
new
WebEvent
();
event
->
kind
=
TE4_WEB_EVENT_BROWSER_COUNT
;
event
->
data
.
count
=
all_browsers_nb
;
push_event
(
event
);
}
~
BrowserClient
()
{
fprintf
(
logfile
,
"[WEBCORE] Destroyed client
\n
"
);
...
...
@@ -142,6 +147,11 @@ public:
}
all_browsers
.
erase
(
this
);
all_browsers_nb
--
;
WebEvent
*
event
=
new
WebEvent
();
event
->
kind
=
TE4_WEB_EVENT_BROWSER_COUNT
;
event
->
data
.
count
=
all_browsers_nb
;
push_event
(
event
);
}
virtual
CefRefPtr
<
CefRenderHandler
>
GetRenderHandler
()
{
...
...
This diff is collapsed.
Click to expand it.
src/web-external.h
+
2
−
0
View file @
fc1cc7d9
...
...
@@ -36,6 +36,7 @@ enum web_event_kind {
TE4_WEB_EVENT_LOCAL_REQUEST
,
TE4_WEB_EVENT_RUN_LUA
,
TE4_WEB_EVENT_END_BROWSER
,
TE4_WEB_EVENT_BROWSER_COUNT
,
};
typedef
struct
{
...
...
@@ -73,6 +74,7 @@ typedef struct {
const
char
*
code
;
}
run_lua
;
void
*
texture
;
int
count
;
}
data
;
}
WebEvent
;
...
...
This diff is collapsed.
Click to expand it.
src/web.c
+
5
−
0
View file @
fc1cc7d9
...
...
@@ -269,6 +269,7 @@ static const struct luaL_Reg weblib[] =
{
NULL
,
NULL
},
};
int
browsers_count
=
0
;
static
lua_State
*
he_L
;
static
void
handle_event
(
WebEvent
*
event
)
{
switch
(
event
->
kind
)
{
...
...
@@ -384,6 +385,10 @@ static void handle_event(WebEvent *event) {
break
;
case
TE4_WEB_EVENT_DELETE_TEXTURE
:
break
;
case
TE4_WEB_EVENT_BROWSER_COUNT
:
browsers_count
=
event
->
data
.
count
;
printf
(
"[WEBCORE] Browser count %d
\n
"
,
browsers_count
);
break
;
}
}
...
...
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