![]()  | 
  
    Sorting Network Verify and Draw
    
   Check Whether Comparator Networks Sort and Draw Them 
   | 
 
Interface for some helpful Windows-specific functions. More...
Go to the source code of this file.
Macros | |
| #define | IDM_FILE_OPEN 1 | 
| Menu id for Generate.  More... | |
| #define | IDM_FILE_VERIFY 2 | 
| Menu id for Verify.  More... | |
| #define | IDM_FILE_EXPORT_PNG 3 | 
| Menu id for Export PNG.  More... | |
| #define | IDM_FILE_EXPORT_TEX 4 | 
| Menu id for Export TeX.  More... | |
| #define | IDM_FILE_EXPORT_SVG 5 | 
| Menu id for Export SVG.  More... | |
| #define | IDM_FILE_QUIT 6 | 
| Menu id for Quit.  More... | |
| #define | IDM_GENERATE_MINBUBBLE 7 | 
| Menu id for Generate min-bubblesort.  More... | |
| #define | IDM_GENERATE_MAXBUBBLE 8 | 
| Menu id for Generate max-bubblesort.  More... | |
| #define | IDM_GENERATE_BUBBLE 9 | 
| Menu id for Generate min-bubblesort.  More... | |
| #define | IDM_GENERATE_ODDEVEN 10 | 
| Menu id for Generate odd-even.  More... | |
| #define | IDM_GENERATE_BITONIC 11 | 
| Menu id for Generate bitonic.  More... | |
| #define | IDM_GENERATE_PAIRWISE 12 | 
| Menu id for Generate pairwise.  More... | |
| #define | IDM_VIEW_VERTICAL 13 | 
| Menu id for vertical view.  More... | |
| #define | IDM_VIEW_HORIZONTAL 14 | 
| Menu id for horizontal view.  More... | |
| #define | IDM_HELP_HELP 15 | 
| Menu id for display help.  More... | |
| #define | IDM_HELP_ABOUT 16 | 
| Menu id for display About info.  More... | |
Functions | |
| void | InitWindow (HINSTANCE, INT, WNDPROC) | 
| Initialize window.  More... | |
| ULONG_PTR | InitGDIPlus () | 
| Initialize GDI+.  More... | |
| HRESULT | GetEncoderClsid (const WCHAR *, CLSID *) | 
| Get encoder CLSID.  More... | |
| HRESULT | Load (HWND, CComparatorNetwork *, std::wstring &) | 
| Load comparator network.  More... | |
| HRESULT | ExportImage (const eExport, HWND, CRenderableComparatorNet *, std::wstring &) | 
| Export.  More... | |
| void | MinDragRect (HWND, WPARAM, RECT *, int, int) | 
| Enforce minimum drag rectangle.  More... | |
| void | CreateFileMenu (HMENU hParent) | 
Create File menu.  More... | |
| void | CreateExportMenu (HMENU hParent) | 
Create File menu.  More... | |
| void | CreateGenerateMenu (HMENU hParent) | 
Create Generate menu.  More... | |
| void | CreateViewMenu (HMENU hParent) | 
Create View menu.  More... | |
| void | CreateHelpMenu (HMENU hParent) | 
Create Help menu.  More... | |
These platform-dependent functions are hidden away so that the faint-of-heart don't have to see them if they're offended by them. 
 
Definition in file WindowsHelpers.h.
| #define IDM_FILE_EXPORT_PNG 3 | 
Definition at line 42 of file WindowsHelpers.h.
| #define IDM_FILE_EXPORT_SVG 5 | 
Definition at line 44 of file WindowsHelpers.h.
| #define IDM_FILE_EXPORT_TEX 4 | 
Definition at line 43 of file WindowsHelpers.h.
| #define IDM_FILE_OPEN 1 | 
Definition at line 40 of file WindowsHelpers.h.
| #define IDM_FILE_QUIT 6 | 
Definition at line 45 of file WindowsHelpers.h.
| #define IDM_FILE_VERIFY 2 | 
Definition at line 41 of file WindowsHelpers.h.
| #define IDM_GENERATE_BITONIC 11 | 
Definition at line 51 of file WindowsHelpers.h.
| #define IDM_GENERATE_BUBBLE 9 | 
Definition at line 49 of file WindowsHelpers.h.
| #define IDM_GENERATE_MAXBUBBLE 8 | 
Definition at line 48 of file WindowsHelpers.h.
| #define IDM_GENERATE_MINBUBBLE 7 | 
Definition at line 47 of file WindowsHelpers.h.
| #define IDM_GENERATE_ODDEVEN 10 | 
Definition at line 50 of file WindowsHelpers.h.
| #define IDM_GENERATE_PAIRWISE 12 | 
Definition at line 52 of file WindowsHelpers.h.
| #define IDM_HELP_ABOUT 16 | 
Definition at line 58 of file WindowsHelpers.h.
| #define IDM_HELP_HELP 15 | 
Definition at line 57 of file WindowsHelpers.h.
| #define IDM_VIEW_HORIZONTAL 14 | 
Definition at line 55 of file WindowsHelpers.h.
| #define IDM_VIEW_VERTICAL 13 | 
Definition at line 54 of file WindowsHelpers.h.
| void CreateExportMenu | ( | HMENU | hParent | ) | 
Create the Export menu. 
| hParent | Handle to the parent menu. | 
Definition at line 374 of file WindowsHelpers.cpp.
| void CreateFileMenu | ( | HMENU | hParent | ) | 
Create the File menu. 
| hParent | Handle to the parent menu. | 
Definition at line 354 of file WindowsHelpers.cpp.
| void CreateGenerateMenu | ( | HMENU | hParent | ) | 
Create the Generate menu. 
| hParent | Handle to the parent menu. | 
Definition at line 387 of file WindowsHelpers.cpp.
| void CreateHelpMenu | ( | HMENU | hParent | ) | 
Create the Help menu. 
| hParent | Handle to the parent menu. | 
Definition at line 417 of file WindowsHelpers.cpp.
| void CreateViewMenu | ( | HMENU | hParent | ) | 
Create the View menu. 
| hParent | Handle to the parent menu. | 
Definition at line 405 of file WindowsHelpers.cpp.
| HRESULT ExportImage | ( | const eExport | t, | 
| HWND | hwnd, | ||
| CRenderableComparatorNet * | pNet, | ||
| std::wstring & | wstrName | ||
| ) | 
Display a Save dialog box save an image of a comparator network to the file that the user selects. Export an image to a file. 
| t | Export file type. | 
| hwnd | Window handle. | 
| pNet | Pointer to a renderable comparator network. | 
| wstrName | Default file name. | 
Definition at line 225 of file WindowsHelpers.cpp.
| HRESULT GetEncoderClsid | ( | const WCHAR * | format, | 
| CLSID * | pClsid | ||
| ) | 
Get an encoder clsid for an image file format.
| format | File format using wide characters. | 
| pClsid | [OUT] Pointer to clsid. | 
S_OK for success, E_FAIL for failure. Definition at line 193 of file WindowsHelpers.cpp.
| ULONG_PTR InitGDIPlus | ( | ) | 
Initialize GDI+ and get a GDI+ token.
Definition at line 174 of file WindowsHelpers.cpp.
| void InitWindow | ( | HINSTANCE | hInst, | 
| INT | nShow, | ||
| WNDPROC | WndProc | ||
| ) | 
Create and initialize a window.
| hInst | Instance handle. | 
| nShow | 1 to show window, 0 to hide. | 
| WndProc | Window procedure. | 
Definition at line 131 of file WindowsHelpers.cpp.
| HRESULT Load | ( | HWND | hwnd, | 
| CComparatorNetwork * | pNet, | ||
| std::wstring & | wstrName | ||
| ) | 
Pop up a Windows Open dialog box for the user to pick a text file and read the comparator network from there into a comparator network. 
| hwnd | Window handle. | 
| pNet | [OUT] Pointer to a renderable comparator network. | 
| wstrName | [IN, OUT] File name without extension. | 
S_OK for success, E_FAIL for failure. Definition at line 303 of file WindowsHelpers.cpp.
| void MinDragRect | ( | HWND | hwnd, | 
| WPARAM | wParam, | ||
| RECT * | pRect, | ||
| int | w, | ||
| int | h | ||
| ) | 
Resize the drag rectangle provided by a WM_SIZING message to ensure a minimum client area width and height.
| hwnd | Window handle. | 
| wParam | WMSZ message telling us which edge is being dragged on. | 
| pRect | [IN, OUT] Pointer to drag rectangle. | 
| w | Minimum width of client area. | 
| h | Minimum height of client area. | 
Definition at line 63 of file WindowsHelpers.cpp.