diff --git a/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj b/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj index 1119cbbe94..01acc3edef 100644 --- a/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj +++ b/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj @@ -650,14 +650,6 @@ - - - - @@ -666,38 +658,6 @@ RelativePath=".\Src\EmuWindow.h" > - - - - - - - - - - - - - - - - -#include -#include "DialogManager.h" - -typedef std::vector WindowList; -WindowList dialogs; - -void DialogManager::AddDlg(HWND hDialog) -{ - dialogs.push_back(hDialog); -} - -bool DialogManager::IsDialogMessage(LPMSG message) -{ - WindowList::iterator iter; - for (iter=dialogs.begin(); iter!=dialogs.end(); iter++) - { - if (::IsDialogMessage(*iter,message)) - return true; - } - return false; -} - -void DialogManager::EnableAll(BOOL enable) -{ - WindowList::iterator iter; - for (iter=dialogs.begin(); iter!=dialogs.end(); iter++) - EnableWindow(*iter,enable); -} diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/DialogManager.h b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/DialogManager.h deleted file mode 100644 index 1ce828a640..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/DialogManager.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include - -class DialogManager -{ -public: - static void AddDlg(HWND hDialog); - static bool IsDialogMessage(LPMSG message); - static void EnableAll(BOOL enable); -}; - diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Misc.cpp b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Misc.cpp deleted file mode 100644 index 6470d23cfb..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Misc.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include - -#include "Misc.h" - -namespace W32Util -{ - void CenterWindow(HWND hwnd) - { - HWND hwndParent; - RECT rect, rectP; - int width, height; - int screenwidth, screenheight; - int x, y; - - // make the window relative to its parent - hwndParent = GetParent(hwnd); - if (!hwndParent) - return; - - GetWindowRect(hwnd, &rect); - GetWindowRect(hwndParent, &rectP); - - width = rect.right - rect.left; - height = rect.bottom - rect.top; - - x = ((rectP.right-rectP.left) - width) / 2 + rectP.left; - y = ((rectP.bottom-rectP.top) - height) / 2 + rectP.top; - - screenwidth = GetSystemMetrics(SM_CXSCREEN); - screenheight = GetSystemMetrics(SM_CYSCREEN); - - // make sure that the dialog box never moves outside of - // the screen - if (x < 0) x = 0; - if (y < 0) y = 0; - if (x + width > screenwidth) x = screenwidth - width; - if (y + height > screenheight) y = screenheight - height; - - MoveWindow(hwnd, x, y, width, height, FALSE); - } -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Misc.h b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Misc.h deleted file mode 100644 index 2ea70fedd8..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Misc.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -namespace W32Util -{ - void CenterWindow(HWND hwnd); -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/PropertySheet.cpp b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/PropertySheet.cpp deleted file mode 100644 index b25a516adb..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/PropertySheet.cpp +++ /dev/null @@ -1,223 +0,0 @@ -#include "Misc.h" -#include "PropertySheet.h" - -#include - -namespace W32Util -{ - bool centered; - - PropSheet::PropSheet() - { - watermark = 0; - header = 0; - icon = 0; - } - - int CALLBACK PropSheet::Callback(HWND hwndDlg, UINT uMsg, LPARAM lParam) - { - switch (uMsg) { - case PSCB_PRECREATE: - { - if (uMsg == PSCB_PRECREATE) - { - /* - if (lParam) - { - DLGTEMPLATE* pDlgTemplate; - DLGTEMPLATEEX* pDlgTemplateEx; - - pDlgTemplateEx = (DLGTEMPLATEEX*)lParam; - if (pDlgTemplateEx->signature == 0xFFFF) - { - // pDlgTemplateEx points to an extended - // dialog template structure. - - //pDlgTemplate->style |= DS_SETFONT; - u8* tmp1 = (u8*)&pDlgTemplateEx + sizeof(DLGTEMPLATEEX); - u16* tmp = (u16*)tmp1; - tmp++; //skip menu - tmp++; //skip dlg class - //Crash(); - //Here we should bash in Segoe UI - //It turns out to be way complicated though - //Not worth it - } - else - { - // This is a standard dialog template - // structure. - pDlgTemplate = (DLGTEMPLATE*)lParam; - } - } */ - } - - } - break; - case PSCB_INITIALIZED: - { - } - return 0; - } - return 0; - } - - void PropSheet::Show(HINSTANCE hInstance, HWND hParent, LPCTSTR title, int startpage, bool floating, bool wizard) - { - HPROPSHEETPAGE* pages = new HPROPSHEETPAGE[list.size()]; - PROPSHEETPAGE page; - //common settings - memset((void*)&page,0,sizeof(PROPSHEETPAGE)); - page.dwSize = sizeof(PROPSHEETPAGE); - page.hInstance = hInstance; - - int i=0; - for (DlgList::iterator iter = list.begin(); iter != list.end(); iter++, i++) - { - if (wizard) - { - if (i == 0 || i == list.size()-1) - page.dwFlags = PSP_HIDEHEADER; - else - page.dwFlags = PSP_USEHEADERTITLE|PSP_USEHEADERSUBTITLE; - } - else - { - page.dwFlags = PSP_USETITLE; - } - page.pszTemplate = iter->resource; - page.pfnDlgProc = Tab::TabDlgProc; - page.pszTitle = iter->title; - page.pszHeaderTitle = wizard?iter->title:0; - page.pszHeaderSubTitle = wizard?iter->hdrSubTitle:0; - page.lParam = (LPARAM)iter->tab; - pages[i] = CreatePropertySheetPage(&page); - } - - PROPSHEETHEADER sheet; - memset(&sheet,0,sizeof(sheet)); - sheet.dwSize = sizeof(PROPSHEETHEADER); - sheet.hInstance = hInstance; - sheet.hwndParent = hParent; - sheet.pszbmWatermark = watermark; - sheet.pszbmHeader = header; - sheet.pszCaption = title; - sheet.nPages = (UINT)list.size(); - sheet.phpage = pages; - sheet.nStartPage = startpage; - sheet.pfnCallback = (PFNPROPSHEETCALLBACK)Callback; - - NONCLIENTMETRICS ncm = {0}; - ncm.cbSize = sizeof(ncm); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); - hDialogFont = CreateFontIndirect(&ncm.lfMessageFont); - - if (wizard) - { - sheet.dwFlags = PSH_USECALLBACK | PSH_WIZARD97 | (watermark?PSH_WATERMARK:0) | (header?PSH_HEADER:0); - - //Create the intro/end title font - LOGFONT TitleLogFont = ncm.lfMessageFont; - TitleLogFont.lfWeight = FW_BOLD; - lstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold")); - //StringCchCopy(TitleLogFont.lfFaceName, 32, TEXT("Verdana Bold")); - - HDC hdc = GetDC(NULL); //gets the screen DC - int FontSize = 12; - TitleLogFont.lfHeight = 0 - GetDeviceCaps(hdc, LOGPIXELSY) * FontSize / 72; - hTitleFont = CreateFontIndirect(&TitleLogFont); - ReleaseDC(NULL, hdc); - } else { - sheet.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE; - hTitleFont = 0; - } - - if (icon) { - sheet.dwFlags |= PSH_USEHICON; - sheet.hIcon = icon; - } - - sheet.dwFlags |= PSH_NOCONTEXTHELP; - - if (floating) - sheet.dwFlags |= PSH_MODELESS; - //else - // sheet.dwFlags |= PSH_NOAPPLYNOW; - - centered=false; - PropertySheet(&sheet); - if (!floating) - { - for (DlgList::iterator iter = list.begin(); iter != list.end(); iter++) - { - delete iter->tab; - } - DeleteObject(hTitleFont); - } - DeleteObject(hDialogFont); - delete [] pages; - } - void PropSheet::Add(Tab* tab, LPCTSTR resource, LPCTSTR title, LPCTSTR subtitle) - { - tab->sheet = this; - list.push_back(Page(tab,resource,title,subtitle)); - } - - - void WizExteriorPage::Init(HWND hDlg) - { - HWND hwndControl = GetDlgItem(hDlg, captionID); - //SetWindowFont(hwndControl, sheet->GetTitleFont(), TRUE); - SendMessage(hwndControl,WM_SETFONT,(WPARAM)sheet->GetTitleFont(),0); - } - - INT_PTR Tab::TabDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - Tab* tab = (Tab*)GetWindowLongPtr(hDlg, GWLP_USERDATA); - switch(message) - { - case WM_INITDIALOG: - { - if (!centered) //HACK - { - CenterWindow(GetParent(hDlg)); - centered=true; - } - LPARAM l = ((LPPROPSHEETPAGE)lParam)->lParam; - tab = (Tab*)l; - SetWindowLongPtr(hDlg, GWLP_USERDATA, (DWORD_PTR)l); - tab->Init(hDlg); - } - break; - - case WM_COMMAND: - tab->Command(hDlg,wParam); - PropSheet_Changed(GetParent(hDlg), hDlg); - break; - case WM_NOTIFY: - { - LPPSHNOTIFY lppsn = (LPPSHNOTIFY) lParam; - HWND sheet = lppsn->hdr.hwndFrom; - switch(lppsn->hdr.code) { - case PSN_APPLY: - tab->Apply(hDlg); - break; - case PSN_SETACTIVE: - PropSheet_SetWizButtons(GetParent(hDlg), - (tab->HasPrev()?PSWIZB_BACK:0) | - (tab->HasNext()?PSWIZB_NEXT:0) | - (tab->HasFinish()?PSWIZB_FINISH:0)); - break; - case PSN_WIZNEXT: - tab->Apply(hDlg); //maybe not always good - break; - case PSN_WIZBACK: - case PSN_RESET: //cancel - break; - } - } - break; - } - return 0; - } -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/PropertySheet.h b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/PropertySheet.h deleted file mode 100644 index 83646790f1..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/PropertySheet.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include -#include - -namespace W32Util -{ - class PropSheet; - - class Tab - { - public: - PropSheet* sheet; //back pointer .. - virtual void Init(HWND hDlg) {} - virtual void Command(HWND hDlg, WPARAM wParam) {} - virtual void Apply(HWND hDlg) {} - virtual bool HasPrev() {return true;} - virtual bool HasFinish() {return false;} - virtual bool HasNext() {return true;} - static INT_PTR __stdcall TabDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); - }; - - - class WizExteriorPage : public Tab - { - int captionID; - public: - WizExteriorPage(int caption) {captionID = caption;} - void Init(HWND hDlg); - }; - - - class WizFirstPage : public WizExteriorPage - { - public: - WizFirstPage(int caption) : WizExteriorPage(caption) {} - bool HasPrev() {return false;} - }; - - - class WizLastPage : public WizExteriorPage - { - public: - WizLastPage(int caption) : WizExteriorPage(caption) {} - bool HasNext() {return false;} - bool HasFinish() {return true;} - }; - - - class WizInteriorPage : public Tab - { - public: - }; - - class PropSheet - { - LPCTSTR watermark; - LPCTSTR header; - HFONT hTitleFont; - HFONT hDialogFont; - HICON icon; - struct Page - { - Page(Tab* _tab, LPCTSTR _resource, LPCTSTR _title, LPCTSTR _subtitle = 0) - : tab(_tab), resource(_resource), title(_title), hdrSubTitle(_subtitle) {} - Tab* tab; - LPCTSTR resource; - LPCTSTR title; - LPCTSTR hdrSubTitle; - }; - public: - PropSheet(); - typedef std::vector DlgList; - DlgList list; - void SetWaterMark(LPCTSTR _watermark) {watermark=_watermark;} - void SetHeader(LPCTSTR _header) {header=_header;} - void SetIcon(HICON _icon) {icon = _icon;} - void Add(Tab* tab, LPCTSTR resource, LPCTSTR title, LPCTSTR subtitle = 0); - void Show(HINSTANCE hInstance, HWND hParent, LPCTSTR title, int startpage=0, bool floating = false, bool wizard = false); - HFONT GetTitleFont() {return hTitleFont;} - HFONT GetFont() {return hDialogFont;} - static int CALLBACK Callback(HWND hwndDlg, UINT uMsg, LPARAM lParam); - }; - - - -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/TabControl.cpp b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/TabControl.cpp deleted file mode 100644 index 5fc1d7554c..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/TabControl.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include -#include - -#include "TabControl.h" - -namespace W32Util -{ - // __________________________________________________________________________________________________ - // constructor - // - TabControl::TabControl(HINSTANCE _hInstance, HWND _hTabCtrl,DLGPROC _lpDialogFunc) : - m_hInstance(_hInstance), - m_hTabCtrl(_hTabCtrl), - m_numDialogs(0) - { - for (int i=0; ihwndFrom == m_hTabCtrl) - { - int iPage = TabCtrl_GetCurSel (m_hTabCtrl); - SelectDialog (iPage); - } - } - } - -} - diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/TabControl.h b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/TabControl.h deleted file mode 100644 index 1e51b53017..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/TabControl.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -namespace W32Util -{ -#define MAX_WIN_DIALOGS 32 - - - class TabControl - { - private: - - HINSTANCE m_hInstance; - HWND m_hWndParent; - HWND m_hTabCtrl; - - HWND m_WinDialogs[MAX_WIN_DIALOGS]; - int m_numDialogs; - - public: - - TabControl(HINSTANCE _hInstance, HWND _hTabCtrl,DLGPROC _lpDialogFunc); - - ~TabControl(void); - - // - // --- tools --- - // - - HWND AddItem (char* _szText,int _iResource,DLGPROC _lpDialogFunc); - - void SelectDialog (int _nDialogId); - - void MessageHandler(UINT message, WPARAM wParam, LPARAM lParam); - }; - -} diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Thread.cpp b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Thread.cpp deleted file mode 100644 index 51177f9c18..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Thread.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "Thread.h" - -namespace W32Util -{ - // __________________________________________________________________________________________________ - // Constructor - // - Thread::Thread ( DWORD (WINAPI * pFun) (void* arg), void* pArg) - { - _handle = CreateThread ( - 0, // Security attributes - 0, // Stack size - pFun, - pArg, - CREATE_SUSPENDED, - &_tid); - } - // __________________________________________________________________________________________________ - // Destructor - // - Thread::~Thread (void) - { - if (_handle != NULL) - { - if (CloseHandle (_handle) == FALSE) - { - Terminate(); - } - } - } - - // __________________________________________________________________________________________________ - // Resume - // - void - Thread::Resume (void) - { - if (_handle != NULL) - ResumeThread (_handle); - } - - // __________________________________________________________________________________________________ - // WaitForDeath - // - void - Thread::WaitForDeath (void) - { - if (_handle != NULL) - WaitForSingleObject (_handle, 100); - } - - // __________________________________________________________________________________________________ - // Terminate - // - void - Thread::Terminate (void) - { - if (_handle != NULL) - TerminateThread (_handle, 0); - _handle = NULL; - } - - // __________________________________________________________________________________________________ - // SetPriority - // - void - Thread::SetPriority (int _nPriority) - { - if (_handle != NULL) - SetThreadPriority(_handle, _nPriority); - } - - // __________________________________________________________________________________________________ - // Suspend - // - void - Thread::Suspend (void) - { - if (_handle != NULL) - SuspendThread(_handle); - } -} \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Thread.h b/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Thread.h deleted file mode 100644 index ab583fb5bd..0000000000 --- a/Source/Plugins/Plugin_VideoDX11/Src/W32Util/Thread.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include - -namespace W32Util -{ - class Thread - { - private: - HANDLE _handle; - DWORD _tid; // thread id - - public: - Thread ( DWORD (WINAPI * pFun) (void* arg), void* pArg); - ~Thread () ; - - // - // --- tools --- - // - - void Resume(void); - - void Suspend(void); - - void WaitForDeath(void); - - void Terminate(void); - - void SetPriority(int _nPriority); - - bool IsActive (void); - - HANDLE GetHandle(void) {return _handle;} - - }; - -} - diff --git a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp index bda6f82a9f..bea3c75f7b 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/main.cpp @@ -50,7 +50,6 @@ #include "PixelShaderCache.h" #include "D3DTexture.h" #include "D3DUtil.h" -#include "W32Util/Misc.h" #include "EmuWindow.h" #include "FramebufferManager.h" #include "DLCache.h"