Sorting Network Verify and Draw
Check Whether Comparator Networks Sort and Draw Them
WindowsHelpers.h
Go to the documentation of this file.
1
6
7// MIT License
8//
9// Copyright (c) 2022 Ian Parberry
10//
11// Permission is hereby granted, free of charge, to any person obtaining a copy
12// of this software and associated documentation files (the "Software"), to
13// deal in the Software without restriction, including without limitation the
14// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15// sell copies of the Software, and to permit persons to whom the Software is
16// furnished to do so, subject to the following conditions:
17//
18// The above copyright notice and this permission notice shall be included in
19// all copies or substantial portions of the Software.
20//
21// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27// IN THE SOFTWARE.
28
29#ifndef __WINDOWSHELPERS_H__
30#define __WINDOWSHELPERS_H__
31
32#include "Includes.h"
34
36// Menu IDs
37
38#pragma region Menu IDs
39
40#define IDM_FILE_OPEN 1
41#define IDM_FILE_VERIFY 2
42#define IDM_FILE_EXPORT_PNG 3
43#define IDM_FILE_EXPORT_TEX 4
44#define IDM_FILE_EXPORT_SVG 5
45#define IDM_FILE_QUIT 6
46
47#define IDM_GENERATE_MINBUBBLE 7
48#define IDM_GENERATE_MAXBUBBLE 8
49#define IDM_GENERATE_BUBBLE 9
50#define IDM_GENERATE_ODDEVEN 10
51#define IDM_GENERATE_BITONIC 11
52#define IDM_GENERATE_PAIRWISE 12
53
54#define IDM_VIEW_VERTICAL 13
55#define IDM_VIEW_HORIZONTAL 14
56
57#define IDM_HELP_HELP 15
58#define IDM_HELP_ABOUT 16
59
60#pragma endregion Menu IDs
61
63// Helper functions
64
65#pragma region Helper functions
66
67//initialization functions
68
69void InitWindow(HINSTANCE, INT, WNDPROC);
70ULONG_PTR InitGDIPlus();
71
72//others
73
74HRESULT GetEncoderClsid(const WCHAR*, CLSID*);
75
76HRESULT Load(HWND, CComparatorNetwork*, std::wstring&);
77HRESULT ExportImage(const eExport, HWND, CRenderableComparatorNet*, std::wstring&);
78
79void MinDragRect(HWND, WPARAM, RECT*, int, int);
80
81#pragma endregion Helper functions
82
84// Menu functions
85
86#pragma region Menu functions
87
88void CreateFileMenu(HMENU hParent);
89void CreateExportMenu(HMENU hParent);
90void CreateGenerateMenu(HMENU hParent);
91void CreateViewMenu(HMENU hParent);
92void CreateHelpMenu(HMENU hParent);
93
94#pragma endregion Menu functions
95
96#endif //__WINDOWSHELPERS_H__
eExport
Export type.
Definition: Defines.h:42
Useful includes.
Interface for the renderable comparator network CRenderableComparatorNet.
void CreateFileMenu(HMENU hParent)
Create File menu.
void CreateExportMenu(HMENU hParent)
Create File menu.
HRESULT GetEncoderClsid(const WCHAR *, CLSID *)
Get encoder CLSID.
HRESULT Load(HWND, CComparatorNetwork *, std::wstring &)
Load comparator network.
void MinDragRect(HWND, WPARAM, RECT *, int, int)
Enforce minimum drag rectangle.
void CreateGenerateMenu(HMENU hParent)
Create Generate menu.
ULONG_PTR InitGDIPlus()
Initialize GDI+.
void CreateHelpMenu(HMENU hParent)
Create Help menu.
HRESULT ExportImage(const eExport, HWND, CRenderableComparatorNet *, std::wstring &)
Export.
void CreateViewMenu(HMENU hParent)
Create View menu.
void InitWindow(HINSTANCE, INT, WNDPROC)
Initialize window.
Comparator network.
Renderable comparator network.