Move win32_browser over to ui_win32.c

This commit is contained in:
twinaphex 2015-11-19 07:37:22 +01:00
parent 77dc59e9d5
commit 407ae37aab
2 changed files with 47 additions and 31 deletions

View File

@ -30,10 +30,13 @@
#include "../video_thread_wrapper.h"
#include "../drivers_wm/win32_shader_dlg.h"
#ifdef __cplusplus
extern "C"
#endif
bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam);
extern "C" bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam);
extern "C" bool win32_browser(
HWND owner,
char *filename,
const char *extensions,
const char *title,
const char *initial_dir);
unsigned g_resize_width;
unsigned g_resize_height;
@ -280,33 +283,6 @@ bool win32_window_create(void *data, unsigned style,
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)
{
WPARAM mode = wparam & 0xffff;

View File

@ -19,14 +19,54 @@
#include <stdlib.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 "../ui_companion_driver.h"
typedef struct ui_companion_win32
{
void *empty;
} 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)
{
ui_companion_win32_t *handle = (ui_companion_win32_t*)data;