26#if defined (HAVE_CONFIG_H)
35#if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
40# include <versionhelpers.h>
47#include "liboctgui-build-info.h"
49#include "liboctmex-build-info.h"
55#include "qt-application.h"
72 std::string liboctgui_id = liboctgui_hg_id ();
73 std::string liboctmex_id = liboctmex_hg_id ();
75 if (octave_id != liboctave_id)
77 std::cerr <<
"octave hg id ("
79 <<
") does not match liboctave hg id ("
85 if (octave_id != liboctinterp_id)
87 std::cerr <<
"octave hg id ("
89 <<
") does not match liboctinterp hg id ("
95 if (octave_id != liboctgui_id)
97 std::cerr <<
"octave hg id ("
99 <<
") does not match liboctgui hg id ("
105 if (octave_id != liboctmex_id)
107 std::cerr <<
"octave hg id ("
109 <<
") does not match liboctmex hg id ("
119#if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
122wmain (
int argc,
wchar_t **wargv)
124 static char **argv =
new char * [argc + 1];
125 std::vector<std::string> argv_str;
128 std::wstring_convert<std::codecvt_utf8<wchar_t>,
wchar_t> wchar_conv;
129 for (
int i_arg = 0; i_arg < argc; i_arg++)
130 argv_str.push_back (wchar_conv.to_bytes (wargv[i_arg]));
133 for (
int i_arg = 0; i_arg < argc; i_arg++)
134 argv[i_arg] = &argv_str[i_arg][0];
135 argv[argc] =
nullptr;
137 unsigned int old_console_codepage = 0;
138 unsigned int old_console_output_codepage = 0;
140 if (IsWindows7OrGreater ())
143 old_console_codepage = GetConsoleCP ();
144 old_console_output_codepage = GetConsoleOutputCP ();
147 SetConsoleCP (65001);
148 SetConsoleOutputCP (65001);
156 check_hg_versions ();
158 octave::sys::env::set_program_name (argv[0]);
160 std::string app_name (
"octave-gui");
161 std::string settings_file = octave::sys::env::getenv (
"OCTAVE_GUI_SETTINGS");
162 if (! settings_file.empty ())
163 app_name = settings_file;
168 int ret = app.execute ();
170#if defined (OCTAVE_USE_WINDOWS_API) && defined (_UNICODE)
171 if (IsWindows7OrGreater ())
174 if (old_console_codepage)
175 SetConsoleCP (old_console_codepage);
176 if (old_console_output_codepage)
177 SetConsoleOutputCP (old_console_output_codepage);
std::string liboctave_hg_id()
std::string liboctinterp_hg_id()
std::string octave_hg_id()