Move win32_browser over to ui_win32.c
This commit is contained in:
parent
77dc59e9d5
commit
407ae37aab
|
@ -30,10 +30,13 @@
|
||||||
#include "../video_thread_wrapper.h"
|
#include "../video_thread_wrapper.h"
|
||||||
#include "../drivers_wm/win32_shader_dlg.h"
|
#include "../drivers_wm/win32_shader_dlg.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
extern "C" bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
extern "C"
|
extern "C" bool win32_browser(
|
||||||
#endif
|
HWND owner,
|
||||||
bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam);
|
char *filename,
|
||||||
|
const char *extensions,
|
||||||
|
const char *title,
|
||||||
|
const char *initial_dir);
|
||||||
|
|
||||||
unsigned g_resize_width;
|
unsigned g_resize_width;
|
||||||
unsigned g_resize_height;
|
unsigned g_resize_height;
|
||||||
|
@ -280,33 +283,6 @@ bool win32_window_create(void *data, unsigned style,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool win32_browser(
|
|
||||||
HWND owner,
|
|
||||||
char *filename,
|
|
||||||
const char *extensions,
|
|
||||||
const char *title,
|
|
||||||
const char *initial_dir)
|
|
||||||
{
|
|
||||||
OPENFILENAME ofn;
|
|
||||||
|
|
||||||
memset((void*)&ofn, 0, sizeof(OPENFILENAME));
|
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
|
||||||
ofn.hwndOwner = owner;
|
|
||||||
ofn.lpstrFilter = extensions;
|
|
||||||
ofn.lpstrFile = filename;
|
|
||||||
ofn.lpstrTitle = title;
|
|
||||||
ofn.lpstrInitialDir = TEXT(initial_dir);
|
|
||||||
ofn.lpstrDefExt = "";
|
|
||||||
ofn.nMaxFile = PATH_MAX;
|
|
||||||
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
|
||||||
|
|
||||||
if (!GetOpenFileName(&ofn))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
||||||
{
|
{
|
||||||
WPARAM mode = wparam & 0xffff;
|
WPARAM mode = wparam & 0xffff;
|
||||||
|
|
|
@ -19,14 +19,54 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if !defined(_XBOX)
|
||||||
|
|
||||||
|
#define IDI_ICON 1
|
||||||
|
|
||||||
|
#ifndef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <commdlg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include "../ui_companion_driver.h"
|
#include "../ui_companion_driver.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct ui_companion_win32
|
typedef struct ui_companion_win32
|
||||||
{
|
{
|
||||||
void *empty;
|
void *empty;
|
||||||
} ui_companion_win32_t;
|
} ui_companion_win32_t;
|
||||||
|
|
||||||
|
bool win32_browser(
|
||||||
|
HWND owner,
|
||||||
|
char *filename,
|
||||||
|
const char *extensions,
|
||||||
|
const char *title,
|
||||||
|
const char *initial_dir)
|
||||||
|
{
|
||||||
|
OPENFILENAME ofn;
|
||||||
|
|
||||||
|
memset((void*)&ofn, 0, sizeof(OPENFILENAME));
|
||||||
|
|
||||||
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
|
ofn.hwndOwner = owner;
|
||||||
|
ofn.lpstrFilter = extensions;
|
||||||
|
ofn.lpstrFile = filename;
|
||||||
|
ofn.lpstrTitle = title;
|
||||||
|
ofn.lpstrInitialDir = TEXT(initial_dir);
|
||||||
|
ofn.lpstrDefExt = "";
|
||||||
|
ofn.nMaxFile = PATH_MAX;
|
||||||
|
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||||
|
|
||||||
|
if (!GetOpenFileName(&ofn))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void ui_companion_win32_deinit(void *data)
|
static void ui_companion_win32_deinit(void *data)
|
||||||
{
|
{
|
||||||
ui_companion_win32_t *handle = (ui_companion_win32_t*)data;
|
ui_companion_win32_t *handle = (ui_companion_win32_t*)data;
|
||||||
|
|
Loading…
Reference in New Issue