-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinux_main.cpp
35 lines (26 loc) · 940 Bytes
/
linux_main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <locale.h>
#include "Application.h"
#include "WindowClient.h"
int main(int argc, char** argv) {
setlocale(LC_ALL, "");
CefMainArgs main_args(argc, argv);
CefRefPtr<CefCommandLine> commandLine(CefCommandLine::CreateCommandLine());
commandLine->InitFromArgv(main_args.argc, main_args.argv);
CefRefPtr<CefApp> app(new Application());
// Execute the secondary process, if any.
int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
if (exit_code >= 0) {
return exit_code;
}
printf("CefCommandLine %S\n", commandLine->GetCommandLineString().ToWString().c_str());
if (argc < 2) {
printf("Syntax: %s filename.js [args for js]\n", argv[0]);
return 1;
}
CefSettings appSettings;
appSettings.remote_debugging_port = 24042;
CefInitialize(main_args, appSettings, app, NULL);
CefRunMessageLoop();
CefShutdown();
return s_result;
}