Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"
#include "lib/sysdep/sysdep.h"
#include "lib/alignment.h"
#include "lib/sysdep/os/win/win.h"
#include <SDL_clipboard.h>
#include <shlobj.h>
#include <shellapi.h>
#include <Wincrypt.h>
#include <WindowsX.h>
#include <winhttp.h>
#include "lib/sysdep/os/win/error_dialog.h"
#include "lib/sysdep/os/win/wutil.h"
#include <string_view>
Classes | |
struct | DialogParams |
Functions | |
bool | sys_IsDebuggerPresent () |
std::wstring | sys_WideFromArgv (const char *argv_i) |
void | sys_display_msg (const wchar_t *caption, const wchar_t *msg) |
display a message. More... | |
static void | dlg_OnMove (HWND hDlg, int x, int y) |
static void | dlg_ResizeControl (HWND hDlg, int dlgItem, int dx, int dy, size_t anchors) |
static void | dlg_OnSize (HWND hDlg, UINT state, int clientSizeX, int clientSizeY) |
static void | dlg_OnGetMinMaxInfo (HWND hDlg, LPMINMAXINFO mmi) |
static BOOL | dlg_OnInitDialog (HWND hDlg, HWND hWndFocus, LPARAM lParam) |
static void | dlg_OnCommand (HWND hDlg, int id, HWND hWndCtl, UINT codeNotify) |
static void | dlg_OnClose (HWND hDlg) |
static void | dlg_OnSysCommand (HWND hDlg, UINT cmd, int x, int y) |
static INT_PTR CALLBACK | dlg_OnMessage (HWND hDlg, unsigned int msg, WPARAM wParam, LPARAM lParam) |
ErrorReactionInternal | sys_display_error (const wchar_t *text, size_t flags) |
show the error dialog. More... | |
Status | sys_StatusDescription (int user_err, wchar_t *buf, size_t max_chars) |
describe the current OS error state. More... | |
static Status | GetModulePathname (HMODULE hModule, OsPath &pathname) |
Status | sys_get_module_filename (void *addr, OsPath &pathname) |
determine filename of the module to whom an address belongs. More... | |
OsPath | sys_ExecutablePathname () |
std::wstring | sys_get_user_name () |
Get the current user's login name. More... | |
static int CALLBACK | BrowseCallback (HWND hWnd, unsigned int msg, LPARAM lParam, LPARAM lpData) |
Status | sys_pick_directory (OsPath &path) |
Have the user choose a directory via OS dialog. More... | |
Status | sys_open_url (const std::string &url) |
Open the user's default web browser to the given URL. More... | |
Status | sys_generate_random_bytes (u8 *buffer, size_t size) |
generate high-quality random bytes. More... | |
FILE * | sys_OpenFile (const OsPath &pathname, const char *mode) |
open a file like with fopen (but taking an OsPath argument). More... | |
Variables | |
static POINTS | dlg_clientOrigin |
static POINTS | dlg_prevClientSize |
static const size_t | ANCHOR_LEFT = 0x01 |
static const size_t | ANCHOR_RIGHT = 0x02 |
static const size_t | ANCHOR_TOP = 0x04 |
static const size_t | ANCHOR_BOTTOM = 0x08 |
static const size_t | ANCHOR_ALL = 0x0F |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
ErrorReactionInternal sys_display_error | ( | const wchar_t * | text, |
size_t | flags | ||
) |
show the error dialog.
text | to display (practically unlimited length) |
flags | see DebugDisplayErrorFlags. |
called from debug_DisplayError unless overridden by means of ah_display_error.
void sys_display_msg | ( | const wchar_t * | caption, |
const wchar_t * | msg | ||
) |
display a message.
caption | title message |
msg | message contents |
implemented as a MessageBox on Win32 and printf on Unix. called from debug_DisplayMessage.
OsPath sys_ExecutablePathname | ( | ) |
this is useful for determining installation directory, e.g. for VFS.
generate high-quality random bytes.
this should only be used with small numbers of bytes, to avoid hogging the system's entropy.
determine filename of the module to whom an address belongs.
addr | |
pathname | Full path to module (unchanged unless INFO::OK is returned). |
note: this is useful for handling exceptions in other modules.
std::wstring sys_get_user_name | ( | ) |
Get the current user's login name.
bool sys_IsDebuggerPresent | ( | ) |
Status sys_open_url | ( | const std::string & | url | ) |
Open the user's default web browser to the given URL.
FILE * sys_OpenFile | ( | const OsPath & | pathname, |
const char * | mode | ||
) |
open a file like with fopen (but taking an OsPath argument).
Status sys_StatusDescription | ( | int | err, |
wchar_t * | buf, | ||
size_t | max_chars | ||
) |
describe the current OS error state.
err | if not 0, use that as the error code to translate; otherwise, uses GetLastError or similar. |
buf | output buffer |
max_chars |
rationale: it is expected to be rare that OS return/error codes are actually seen by user code, but we leave the possibility open.
std::wstring sys_WideFromArgv | ( | const char * | argv_i | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |