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
Otowa Kotori
Tales of MajEyal
Commits
9ddf3076
Commit
9ddf3076
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
test
parent
aa89689d
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
build/te4core.lua
+20
-0
20 additions, 0 deletions
build/te4core.lua
src/web-cef3/spawn.cpp
+48
-0
48 additions, 0 deletions
src/web-cef3/spawn.cpp
src/web-cef3/web.cpp
+4
-13
4 additions, 13 deletions
src/web-cef3/web.cpp
src/web.c
+20
-3
20 additions, 3 deletions
src/web.c
with
92 additions
and
16 deletions
build/te4core.lua
+
20
−
0
View file @
9ddf3076
...
...
@@ -565,6 +565,26 @@ project "te4-web"
includedirs
{
"/opt/cef3/1547/include/"
,
"/opt/cef3/1547/"
}
links
{
"cef"
,
"cef_dll_wrapper"
}
defines
{
'SELFEXE_LINUX'
}
project
"cef3spawn"
kind
"WindowedApp"
language
"C++"
targetname
"cef3spawn"
includedirs
{
"../src/web-cef3/"
,
}
files
{
"../src/web-cef3/spawn.cpp"
,
}
configuration
"linux"
buildoptions
{
"-pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm"
}
libdirs
{
"/opt/cef3/1547/out/Release/obj.target/"
}
libdirs
{
"/opt/cef3/1547/Release/"
}
links
{
"cef_dll_wrapper"
}
includedirs
{
"/opt/cef3/1547/include/"
,
"/opt/cef3/1547/"
,
}
links
{
"cef"
}
end
if
_OPTIONS
.
steam
then
...
...
This diff is collapsed.
Click to expand it.
src/web-cef3/spawn.cpp
0 → 100644
+
48
−
0
View file @
9ddf3076
/*
TE4 - T-Engine 4
Copyright (C) 2009 - 2014 Nicolas Casalini
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Nicolas Casalini "DarkGod"
darkgod@te4.org
*/
extern
"C"
{
#include
"web-external.h"
#include
<stdio.h>
#include
<stdlib.h>
}
#include
"web.h"
#include
"web-internal.h"
class
ClientApp
:
public
CefApp
{
public:
IMPLEMENT_REFCOUNTING
(
ClientApp
);
};
int
main
(
int
argc
,
char
*
argv
[])
{
#ifdef _WIN32
CefMainArgs
args
(
GetModuleHandle
(
NULL
));
#else
CefMainArgs
args
(
argc
,
argv
);
#endif
CefRefPtr
<
ClientApp
>
app
(
new
ClientApp
);
int
ret
=
CefExecuteProcess
(
args
,
app
.
get
());
return
ret
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/web-cef3/web.cpp
+
4
−
13
View file @
9ddf3076
...
...
@@ -797,6 +797,7 @@ void te4_web_do_update(void (*cb)(WebEvent*)) {
static
int
g_argc
;
static
char
**
g_argv
;
static
char
*
spawnname
;
CefRefPtr
<
ClientApp
>
app
(
new
ClientApp
);
void
te4_web_setup
(
...
...
@@ -829,21 +830,9 @@ void te4_web_setup(
web_key_mods
=
key_mods
;
web_instant_js
=
instant_js
;
spawnname
=
spawnc
;
g_argc
=
argc
;
g_argv
=
gargv
;
#ifdef _WIN32
CefMainArgs
args
(
GetModuleHandle
(
NULL
));
#else
char
**
cargv
=
(
char
**
)
calloc
(
argc
,
sizeof
(
char
*
));
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
cargv
[
i
]
=
strdup
(
gargv
[
i
]);
CefMainArgs
args
(
argc
,
cargv
);
#endif
int
exit_code
=
CefExecuteProcess
(
args
,
app
.
get
());
if
(
exit_code
>=
0
)
{
exit
(
exit_code
);
}
}
void
te4_web_initialize
(
const
char
*
locales
,
const
char
*
pak
)
{
...
...
@@ -859,6 +848,8 @@ void te4_web_initialize(const char *locales, const char *pak) {
CefSettings
settings
;
settings
.
multi_threaded_message_loop
=
false
;
CefString
spawn
(
spawnname
);
CefString
(
&
settings
.
browser_subprocess_path
)
=
spawn
;
CefString
clocales
(
locales
);
CefString
(
&
settings
.
locales_dir_path
)
=
clocales
;
CefString
resources
(
pak
);
...
...
This diff is collapsed.
Click to expand it.
src/web.c
+
20
−
3
View file @
9ddf3076
...
...
@@ -508,18 +508,35 @@ static void web_instant_js(int handlers, const char *fct, int nb_args, WebJsValu
}
void
te4_web_load
()
{
const
char
*
self
=
get_self_executable
(
g_argc
,
g_argv
);
#if defined(SELFEXE_LINUX) || defined(SELFEXE_BSD)
#if defined(TE4_RELPATH64)
const
char
*
spawnbname
=
"cef3spawn64"
;
char
*
spawnname
=
malloc
(
strlen
(
self
)
+
strlen
(
spawnbname
)
+
1
);
strcpy
(
spawnname
,
self
);
strcpy
(
strrchr
(
spawnname
,
'/'
)
+
1
,
spawnbname
);
void
*
web
=
SDL_LoadObject
(
"lib64/libte4-web.so"
);
#elif defined(TE4_RELPATH64)
#elif defined(TE4_RELPATH32)
const
char
*
spawnbname
=
"cef3spawn32"
;
char
*
spawnname
=
malloc
(
strlen
(
self
)
+
strlen
(
spawnbname
)
+
1
);
strcpy
(
spawnname
,
self
);
strcpy
(
strrchr
(
spawnname
,
'/'
)
+
1
,
spawnbname
);
void
*
web
=
SDL_LoadObject
(
"lib/libte4-web.so"
);
#else
const
char
*
spawnbname
=
"cef3spawn"
;
char
*
spawnname
=
malloc
(
strlen
(
self
)
+
strlen
(
spawnbname
)
+
1
);
strcpy
(
spawnname
,
self
);
strcpy
(
strrchr
(
spawnname
,
'/'
)
+
1
,
spawnbname
);
void
*
web
=
SDL_LoadObject
(
"libte4-web.so"
);
#endif
#elif defined(SELFEXE_WINDOWS)
const
char
*
spawnbname
=
"cef3spawn.exe"
;
char
*
spawnname
=
malloc
(
strlen
(
self
)
+
strlen
(
spawnbname
)
+
1
);
strcpy
(
spawnname
,
self
);
strcpy
(
strrchr
(
spawnname
,
'\\'
)
+
1
,
spawnbname
);
void
*
web
=
SDL_LoadObject
(
"te4-web.dll"
);
#elif defined(SELFEXE_MACOSX)
c
onst
char
*
self
=
get_self_executable
(
g_argc
,
g_argv
)
;
c
har
*
spawnname
=
NULL
;
const
char
*
name
=
"libte4-web.dylib"
;
char
*
lib
=
malloc
(
strlen
(
self
)
+
strlen
(
name
)
+
1
);
strcpy
(
lib
,
self
);
...
...
@@ -557,7 +574,7 @@ void te4_web_load() {
te4_web_set_js_call
=
(
void
(
*
)(
web_view_type
*
view
,
const
char
*
name
))
SDL_LoadFunction
(
web
,
"te4_web_set_js_call"
);
te4_web_setup
(
g_argc
,
g_argv
,
NULL
,
g_argc
,
g_argv
,
spawnname
,
web_mutex_create
,
web_mutex_destroy
,
web_mutex_lock
,
web_mutex_unlock
,
web_make_texture
,
web_del_texture
,
web_texture_update
,
web_key_mods
,
...
...
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