Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InexorSettings.hpp
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <string>
5 #include <stdio.h> /* defines FILENAME_MAX */
6 
7 #ifdef WINDOWS
8 #include <direct.h>
9 #define GetCurrentDir _getcwd
10 #else
11 #include <unistd.h>
12 #define GetCurrentDir getcwd
13 #endif
14 
15 #include "inexor/io/Logging.hpp"
16 
17 #include "include/cef_app.h"
18 
19 namespace inexor {
20 namespace ui {
21 
22 class InexorSettings : public CefSettings
23 {
24  public:
25 
26  InexorSettings(std::string executable_path)
27  {
28 #ifdef CEF_USE_SANDBOX
29  no_sandbox = false;
30 #else
31  no_sandbox = true;
32 #endif
33  ignore_certificate_errors = false;
34  multi_threaded_message_loop = false;
35  windowless_rendering_enabled = true;
36  command_line_args_disabled = true;
37  log_severity = LOGSEVERITY_INFO;
38  single_process = false;
39  remote_debugging_port = 9222;
40 
41  char base_path[FILENAME_MAX];
42  GetCurrentDir(base_path, sizeof(base_path));
43  CefString(&resources_dir_path).FromString(executable_path);
44  CefString(&locales_dir_path).FromString(executable_path + "/locales");
45  CefString(&log_file).FromString(std::string(base_path) + "inexorcef.log"); // TODO: make adaptable.
46  Log.ui->info("init: cef: setting subprocess executable_path: {}", executable_path);
47  CefString(&browser_subprocess_path).FromString(executable_path + "/cef_subprocess.exe");
48  }
49 
50 };
51 
52 }
53 }
54 
55 
Definition: InexorSettings.hpp:22
InexorSettings(std::string executable_path)
Definition: InexorSettings.hpp:26
static Logger ui
Logger for the user interface rendering (CEF bindings).
Definition: Logging.hpp:110
Logging stuff including the ingame console logging functionality.
inexor::util::log_manager Log
Definition: Logging.cpp:241
#define GetCurrentDir
Definition: InexorSettings.hpp:12
char string[MAXSTRLEN]
cube-strings (char arrays of fixed size).
Definition: cube_types.hpp:18