Blender V4.3
BLI_winstuff.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#ifndef _WIN32
13# error "This include is for Windows only!"
14#endif
15
16#include "BLI_sys_types.h"
17
18#define WIN32_LEAN_AND_MEAN
19
20#ifndef NOMINMAX
21# define NOMINMAX
22# include <windows.h>
23# undef NOMINMAX
24#else
25# include <windows.h>
26#endif
27
28#undef rad
29#undef rad1
30#undef rad2
31#undef rad3
32#undef vec
33#undef rect
34#undef rct1
35#undef rct2
36
37#undef small
38
39/* These definitions are also in BLI_math for simplicity. */
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45#if !defined(_USE_MATH_DEFINES)
46# define _USE_MATH_DEFINES
47#endif
48
49#ifndef S_ISREG
50# define S_ISREG(x) (((x) & _S_IFREG) == _S_IFREG)
51#endif
52#ifndef S_ISDIR
53# define S_ISDIR(x) (((x) & _S_IFDIR) == _S_IFDIR)
54#endif
55
56#if defined(_MSC_VER)
57# define R_OK 4
58# define W_OK 2
59/* Not accepted by `access()` on windows. */
60// # define X_OK 1
61# define F_OK 0
62#endif
63
64typedef unsigned int mode_t;
65
67struct dirent {
68 int d_ino;
69 int d_off;
70 unsigned short d_reclen;
71 char *d_name;
72};
73
75typedef struct __dirstream DIR;
76
77DIR *opendir(const char *path);
78struct dirent *readdir(DIR *dp);
79int closedir(DIR *dp);
80const char *dirname(char *path);
81
82/* Windows utility functions. */
83
87bool BLI_windows_update_pinned_launcher(const char *launcher_path);
88
89/* Gets the version of the currently loaded DirectX driver for the first device that matches
90 * deviceString. This is required for Qualcomm devices which use Mesa's Gallium D2D12 layer for
91 * OpenGL functionality */
92bool BLI_windows_get_directx_driver_version(const wchar_t *deviceSubString,
93 long long *r_driverVersion);
94
100void BLI_windows_get_default_root_dir(char root_dir[4]);
101int BLI_windows_get_executable_dir(char r_dirpath[/*FILE_MAXDIR*/]);
102
103/* ShellExecute Helpers. */
104
105bool BLI_windows_external_operation_supported(const char *filepath, const char *operation);
106bool BLI_windows_external_operation_execute(const char *filepath, const char *operation);
107
117 const bool wait,
118 const bool elevated,
119 const bool silent);
120
121#ifdef __cplusplus
122}
123#endif
bool BLI_windows_external_operation_supported(const char *filepath, const char *operation)
bool BLI_windows_unregister_blend_extension(bool all_users)
struct __dirstream DIR
bool BLI_windows_execute_self(const char *parameters, const bool wait, const bool elevated, const bool silent)
struct dirent * readdir(DIR *dp)
bool BLI_windows_get_directx_driver_version(const wchar_t *deviceSubString, long long *r_driverVersion)
void BLI_windows_get_default_root_dir(char root_dir[4])
bool BLI_windows_update_pinned_launcher(const char *launcher_path)
int closedir(DIR *dp)
const char * dirname(char *path)
bool BLI_windows_external_operation_execute(const char *filepath, const char *operation)
int BLI_windows_get_executable_dir(char r_dirpath[])
DIR * opendir(const char *path)
unsigned int mode_t
bool BLI_windows_is_store_install(void)
bool BLI_windows_register_blend_extension(bool all_users)
double parameters[NUM_PARAMETERS]
unsigned short d_reclen
int d_off
char * d_name
int d_ino