ReactOS  0.4.13-dev-241-g63286c6
mainwnd.c File Reference
#include <precomp.h>
Include dependency graph for mainwnd.c:

Go to the source code of this file.

Macros

#define ID_MDI_FIRSTCHILD   50000
 
#define ID_MDI_WINDOWMENU   5
 
#define NUM_FLT_WND   3
 
#define ID_TOOLBAR_STANDARD   0
 
#define ID_TOOLBAR_TEXT   1
 
#define ID_TOOLBAR_TEST   5
 

Functions

static BOOL CALLBACK MainWndCreateToolbarClient (struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hParent, HWND *hwnd)
 
static BOOL CALLBACK MainWndDestroyToolbarClient (struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hwnd)
 
static BOOL CALLBACK MainWndToolbarInsertBand (struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, UINT *Index, LPREBARBANDINFO rbi)
 
static VOID TbCustomControlChange (HWND hWndToolbar, HWND hWndControl, BOOL Vert)
 
static VOID CALLBACK MainWndToolbarDockBand (struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, DOCK_POSITION DockFrom, DOCK_POSITION DockTo, LPREBARBANDINFO rbi)
 
static VOID CALLBACK MainWndToolbarChevronPushed (struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hwndChild, LPNMREBARCHEVRON lpnm)
 
static VOID MainWndMoveFloatingWindows (PMAIN_WND_INFO Info, PRECT wndOldPos)
 
static VOID MainWndResetFloatingWindows (PMAIN_WND_INFO Info)
 
static VOID MainWndCreateFloatWindows (PMAIN_WND_INFO Info)
 
static VOID MainWndDestroyFloatWindows (PMAIN_WND_INFO Info)
 
static VOID CreateToolbars (PMAIN_WND_INFO Info)
 
static VOID CALLBACK MainWndResize (PVOID Context, LONG cx, LONG cy)
 
static VOID InitMainWnd (PMAIN_WND_INFO Info)
 
static VOID MainWndCommand (PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
 
static VOID DestroyMainWnd (PMAIN_WND_INFO Info)
 
static VOID UpdateMainStatusBar (PMAIN_WND_INFO Info)
 
static BOOL MainWndMenuHint (PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
 
static LRESULT CALLBACK MainWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
MDI_EDITOR_TYPE MainWndGetCurrentEditor (PMAIN_WND_INFO MainWnd, PVOID *Info)
 
VOID MainWndSwitchEditorContext (PMAIN_WND_INFO Info, HWND hDeactivate, HWND hActivate)
 
HWND CreateMainWindow (LPCTSTR lpCaption, int nCmdShow)
 
BOOL MainWndTranslateMDISysAccel (HWND hwnd, LPMSG lpMsg)
 
BOOL InitMainWindowImpl (VOID)
 
VOID UninitMainWindowImpl (VOID)
 

Variables

static const TCHAR szMainWndClass [] = TEXT("ImageSoftWndClass")
 
TBBUTTON StdButtons []
 
TBBUTTON TextButtons []
 
static const MENU_HINT MainMenuHintTable []
 
static const MENU_HINT SystemMenuHintTable []
 
static const TCHAR szToolbarStandard [] = TEXT("STANDARD")
 
static const TCHAR szToolbarText [] = TEXT("TEXT")
 
static const TCHAR szToolbarTest [] = TEXT("TEST")
 
static const DOCKBAR MainDockBars []
 
static const DOCKBAR_ITEM_CALLBACKS MainWndDockBarCallbacks
 

Macro Definition Documentation

◆ ID_MDI_FIRSTCHILD

#define ID_MDI_FIRSTCHILD   50000

Definition at line 5 of file mainwnd.c.

◆ ID_MDI_WINDOWMENU

#define ID_MDI_WINDOWMENU   5

Definition at line 6 of file mainwnd.c.

◆ ID_TOOLBAR_STANDARD

#define ID_TOOLBAR_STANDARD   0

Definition at line 94 of file mainwnd.c.

◆ ID_TOOLBAR_TEST

#define ID_TOOLBAR_TEST   5

Definition at line 101 of file mainwnd.c.

◆ ID_TOOLBAR_TEXT

#define ID_TOOLBAR_TEXT   1

Definition at line 95 of file mainwnd.c.

◆ NUM_FLT_WND

#define NUM_FLT_WND   3

Definition at line 7 of file mainwnd.c.

Function Documentation

◆ CreateMainWindow()

HWND CreateMainWindow ( LPCTSTR  lpCaption,
int  nCmdShow 
)

Definition at line 1366 of file mainwnd.c.

1368 {
1370  HWND hMainWnd = NULL;
1371 
1373  0,
1374  sizeof(MAIN_WND_INFO));
1375  if (Info != NULL)
1376  {
1377  ZeroMemory(Info,
1378  sizeof(MAIN_WND_INFO));
1379  Info->nCmdShow = nCmdShow;
1380 
1381  /* FIXME - load the window position from the registry */
1382 
1385  lpCaption,
1387  CW_USEDEFAULT,
1388  CW_USEDEFAULT,
1389  CW_USEDEFAULT,
1390  CW_USEDEFAULT,
1391  NULL,
1392  NULL,
1393  hInstance,
1394  Info);
1395  if (hMainWnd == NULL)
1396  {
1398  0,
1399  Info);
1400  }
1401  }
1402 
1403  return hMainWnd;
1404 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define ZeroMemory
Definition: winbase.h:1635
#define WS_CLIPCHILDREN
Definition: pedump.c:619
struct TraceInfo Info
static const TCHAR szMainWndClass[]
Definition: mainwnd.c:3
#define CreateWindowEx
Definition: winuser.h:5621
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND hMainWnd
Definition: magnifier.c:34
HANDLE ProcessHeap
Definition: servman.c:15
HINSTANCE hInstance
Definition: mainwnd.c:15
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CreateToolbars()

static VOID CreateToolbars ( PMAIN_WND_INFO  Info)
static

Definition at line 662 of file mainwnd.c.

663 {
664  UINT i;
665 
666  for (i = 0; i < sizeof(MainDockBars) / sizeof(MainDockBars[0]); i++)
667  {
668  /* FIXME - lookup whether to display the toolbar */
669  TbdAddToolbar(&Info->ToolDocks,
670  &MainDockBars[i],
671  Info,
673  }
674 
676 }
static VOID MainWndCreateFloatWindows(PMAIN_WND_INFO Info)
Definition: mainwnd.c:535
struct TraceInfo Info
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const DOCKBAR MainDockBars[]
Definition: mainwnd.c:105
static const DOCKBAR_ITEM_CALLBACKS MainWndDockBarCallbacks
Definition: mainwnd.c:653
unsigned int UINT
Definition: ndis.h:50
BOOL TbdAddToolbar(PTOOLBAR_DOCKS TbDocks, const DOCKBAR *Dockbar, PVOID Context, const DOCKBAR_ITEM_CALLBACKS *Callbacks)
Definition: tooldock.c:585

Referenced by InitMainWnd().

◆ DestroyMainWnd()

static VOID DestroyMainWnd ( PMAIN_WND_INFO  Info)
static

Definition at line 1011 of file mainwnd.c.

1012 {
1013  /* FIXME - cleanup allocated resources */
1014 
1016 }
struct TraceInfo Info
static VOID MainWndDestroyFloatWindows(PMAIN_WND_INFO Info)
Definition: mainwnd.c:639

Referenced by MainWndProc().

◆ InitMainWindowImpl()

BOOL InitMainWindowImpl ( VOID  )

Definition at line 1425 of file mainwnd.c.

1426 {
1427  WNDCLASSEX wc = {0};
1428 
1429  wc.cbSize = sizeof(WNDCLASSEX);
1430  wc.lpfnWndProc = MainWndProc;
1431  wc.hInstance = hInstance;
1432  wc.hIcon = LoadIcon(hInstance,
1434  wc.hCursor = LoadCursor(NULL,
1435  IDC_ARROW);
1436  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1441  IMAGE_ICON,
1442  16,
1443  16,
1444  LR_SHARED);
1445 
1446  return RegisterClassEx(&wc) != (ATOM)0;
1447 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDR_MAINMENU
Definition: resource.h:40
static HICON
Definition: imagelist.c:84
LPCSTR lpszMenuName
Definition: winuser.h:3163
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define RegisterClassEx
Definition: winuser.h:5703
HCURSOR hCursor
Definition: winuser.h:3161
WNDPROC lpfnWndProc
Definition: winuser.h:3156
LPCSTR lpszClassName
Definition: winuser.h:3164
WORD ATOM
Definition: dimm.idl:113
HICON hIconSm
Definition: winuser.h:3165
static const TCHAR szMainWndClass[]
Definition: mainwnd.c:3
HINSTANCE hInstance
Definition: winuser.h:3159
#define IDI_IMAGESOFTICON
Definition: resource.h:13
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3154
HBRUSH hbrBackground
Definition: winuser.h:3162
HICON hIcon
Definition: winuser.h:3160
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5678
HINSTANCE hInstance
Definition: mainwnd.c:15
#define IDC_ARROW
Definition: winuser.h:682
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:1063
#define LoadImage
Definition: winuser.h:5681
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5585
#define LoadIcon
Definition: winuser.h:5679

◆ InitMainWnd()

static VOID InitMainWnd ( PMAIN_WND_INFO  Info)
static

Definition at line 751 of file mainwnd.c.

752 {
753  CLIENTCREATESTRUCT ccs;
754  INT statwidths[] = {110, -1};
755 
756  /* FIXME - create controls and initialize the application */
757 
758  /* create the status bar */
759  Info->hStatus = CreateWindowEx(0,
761  NULL,
763  0,
764  0,
765  0,
766  0,
767  Info->hSelf,
769  hInstance,
770  NULL);
771 
772  if (Info->hStatus != NULL)
773  SendMessage(Info->hStatus,
774  SB_SETPARTS,
775  sizeof(statwidths)/sizeof(int),
776  (LPARAM)statwidths);
777 
778  /* create the MDI client window */
779  ccs.hWindowMenu = GetSubMenu(GetMenu(Info->hSelf),
783  TEXT("MDICLIENT"),
784  NULL,
786  0,
787  0,
788  0,
789  0,
790  Info->hSelf,
791  NULL,
792  hInstance,
793  &ccs);
794 
795  TbdInitializeDocks(&Info->ToolDocks,
796  Info->hSelf,
797  Info,
798  MainWndResize);
799 
801 
802  /* initialize file open/save structure */
803  FileInitialize(Info->hSelf);
804 }
#define ID_MDI_WINDOWMENU
Definition: mainwnd.c:6
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define IDC_STATUSBAR
Definition: resource.h:14
static VOID CALLBACK MainWndResize(PVOID Context, LONG cx, LONG cy)
Definition: mainwnd.c:679
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define STATUSCLASSNAME
Definition: commctrl.h:1911
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
VOID FileInitialize(IN HWND hwnd)
Definition: opensave.c:13
#define CreateWindowEx
Definition: winuser.h:5621
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2218
VOID TbdInitializeDocks(PTOOLBAR_DOCKS TbDocks, HWND hWndParent, PVOID Context, PDOCKBAR_PARENTRESIZE ParentResizeProc)
Definition: tooldock.c:1064
#define SBARS_SIZEGRIP
Definition: commctrl.h:1895
#define WS_HSCROLL
Definition: pedump.c:628
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define TEXT(s)
Definition: k32.h:26
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
HINSTANCE hInstance
Definition: mainwnd.c:15
#define WS_VSCROLL
Definition: pedump.c:627
#define SB_SETPARTS
Definition: commctrl.h:1926
static VOID CreateToolbars(PMAIN_WND_INFO Info)
Definition: mainwnd.c:662
#define SendMessage
Definition: winuser.h:5709
#define ID_MDI_FIRSTCHILD
Definition: mainwnd.c:5
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
#define WS_VISIBLE
Definition: pedump.c:620
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by MainWndProc().

◆ MainWndCommand()

static VOID MainWndCommand ( PMAIN_WND_INFO  Info,
WORD  CmdId,
HWND  hControl 
)
static

Definition at line 807 of file mainwnd.c.

810 {
811  static TCHAR szFileName[MAX_PATH];
812  static TCHAR szImageName[MAX_PATH];
813 
814  UNREFERENCED_PARAMETER(hControl);
815 
816  switch (CmdId)
817  {
818  case ID_NEW:
819  {
820  MessageBox(NULL, _T("Not yet implemented"), NULL, 0);
821  }
822  break;
823 
824  case ID_OPEN:
825  {
826  OPEN_IMAGE_EDIT_INFO OpenInfo;
827 
828  if (DoOpenFile(Info->hSelf,
829  szFileName, /* full file path */
830  szImageName)) /* file name */
831  {
832  OpenInfo.CreateNew = FALSE;
833 
834  OpenInfo.Open.lpImagePath = szFileName;
835  OpenInfo.lpImageName = szImageName;
836 
838  &OpenInfo);
839 
840  /* FIXME: move flt wnd's if scroll bars show
841  MainWndResetFloatingWindows(Info->hMdiClient); */
842  }
843 
844  }
845  break;
846 
847  case ID_TOOLS:
848  {
849  HMENU hMenu = GetMenu(Info->hSelf);
850 
851  if (hMenu != NULL)
852  {
853  UINT uCheck = MF_CHECKED;
854 
855  if (ShowHideWindow(Info->fltTools->hSelf))
856  uCheck = MF_UNCHECKED;
857 
858  CheckMenuItem(hMenu,
859  ID_TOOLS,
860  uCheck);
861  }
862  }
863  break;
864 
865  case ID_COLOR:
866  {
867  HMENU hMenu = GetMenu(Info->hSelf);
868 
869  if (hMenu != NULL)
870  {
871  UINT uCheck = MF_CHECKED;
872 
873  if (ShowHideWindow(Info->fltColors->hSelf))
874  uCheck = MF_UNCHECKED;
875 
876  CheckMenuItem(hMenu,
877  ID_COLOR,
878  uCheck);
879  }
880  }
881  break;
882 
883  case ID_HISTORY:
884  {
885  HMENU hMenu = GetMenu(Info->hSelf);
886 
887  if (hMenu != NULL)
888  {
889  UINT uCheck = MF_CHECKED;
890 
891  if (ShowHideWindow(Info->fltHistory->hSelf))
892  uCheck = MF_UNCHECKED;
893 
894  CheckMenuItem(hMenu,
895  ID_HISTORY,
896  uCheck);
897  }
898  }
899  break;
900 
901  case ID_BRIGHTNESS:
904  Info->hSelf,
906  (LPARAM)Info);
907  break;
908 
909  case ID_CONTRAST:
910  /* FIXME : Create a window for contrast */
911  break;
912 
913  case ID_BLACKANDWHITE:
914  {
915  if (Info->ImageEditors)
916  {
917  DisplayBlackAndWhite(Info->ImageEditors->hSelf,
918  Info->ImageEditors->hDCMem,
919  Info->ImageEditors->hBitmap);
920  }
921  }
922  break;
923 
924  case ID_INVERTCOLORS:
925  {
926  if (Info->ImageEditors)
927  {
928  DisplayInvertedColors(Info->ImageEditors->hSelf,
929  Info->ImageEditors->hDCMem,
930  Info->ImageEditors->hBitmap);
931  }
932  }
933  break;
934 
935  case ID_BLUR:
936  {
937  if (Info->ImageEditors)
938  {
939  DisplayBlur(Info->ImageEditors->hSelf,
940  Info->ImageEditors->hDCMem,
941  Info->ImageEditors->hBitmap);
942  }
943  }
944  break;
945 
946  case ID_SHARPEN:
947  {
948  if (Info->ImageEditors)
949  {
950  DisplaySharpness(Info->ImageEditors->hSelf,
951  Info->ImageEditors->hDCMem,
952  Info->ImageEditors->hBitmap);
953  }
954  }
955  break;
956 
957  case ID_EXIT:
958  SendMessage(Info->hSelf,
959  WM_CLOSE,
960  0,
961  0);
962  break;
963 
964  /* Window Menu */
965  case ID_WINDOW_TILE_HORZ:
966  SendMessage(Info->hMdiClient,
967  WM_MDITILE,
969  0);
970  break;
971 
972  case ID_WINDOW_TILE_VERT:
973  SendMessage(Info->hMdiClient,
974  WM_MDITILE,
976  0);
977  break;
978 
979  case ID_WINDOW_CASCADE:
980  SendMessage(Info->hMdiClient,
982  0,
983  0);
984  break;
985 
986  case ID_WINDOW_ARRANGE:
987  SendMessage(Info->hMdiClient,
989  0,
990  0);
991  break;
992 
993  case ID_WINDOW_NEXT:
994  SendMessage(Info->hMdiClient,
995  WM_MDINEXT,
996  0,
997  0);
998  break;
999 
1000  /* Help Menu */
1001  case ID_ABOUT:
1004  Info->hSelf,
1005  AboutDialogProc);
1006  break;
1007  }
1008 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_BRIGHTNESS
Definition: resource.h:254
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define ID_BLACKANDWHITE
Definition: resource.h:84
#define WM_MDICASCADE
Definition: winuser.h:1795
#define ID_WINDOW_TILE_VERT
Definition: resource.h:49
BOOL DisplayBlur(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:196
struct TraceInfo Info
#define DialogBox
Definition: winuser.h:5627
#define WM_MDIICONARRANGE
Definition: winuser.h:1796
#define ID_SHARPEN
Definition: resource.h:87
static VOID DoOpenFile(PINFO pInfo)
Definition: connectdialog.c:34
#define IDD_ABOUTBOX
Definition: resource.h:8
#define MDITILE_HORIZONTAL
Definition: winuser.h:2142
smooth NULL
Definition: ftsmooth.c:416
#define WM_MDINEXT
Definition: winuser.h:1792
LONG_PTR LPARAM
Definition: windef.h:208
#define ID_ABOUT
Definition: charmap.c:18
static INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:15
BOOL CreateImageEditWindow(PMAIN_WND_INFO MainWnd, POPEN_IMAGE_EDIT_INFO OpenInfo)
Definition: imgedwnd.c:459
#define ID_WINDOW_CASCADE
Definition: resource.h:78
#define MF_CHECKED
Definition: winuser.h:132
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
INT_PTR CALLBACK BrightnessProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: brightness.c:313
#define MDITILE_VERTICAL
Definition: winuser.h:2143
#define ID_OPEN
Definition: resource.h:22
#define WM_CLOSE
Definition: winuser.h:1603
#define ID_HISTORY
Definition: resource.h:41
#define MAX_PATH
Definition: compat.h:26
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ID_COLOR
Definition: definitions.h:121
#define ID_CONTRAST
Definition: resource.h:83
BOOL DisplayInvertedColors(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:102
#define DialogBoxParam
Definition: winuser.h:5630
#define ID_WINDOW_TILE_HORZ
Definition: resource.h:48
#define ID_NEW
Definition: resource.h:21
#define MessageBox
Definition: winuser.h:5688
BOOL ShowHideWindow(HWND hwnd)
Definition: floatwindow.c:45
#define MF_UNCHECKED
Definition: winuser.h:204
#define ID_WINDOW_ARRANGE
Definition: resource.h:52
#define ID_EXIT
Definition: resource.h:10
#define ID_TOOLS
Definition: resource.h:39
#define ID_BLUR
Definition: resource.h:86
struct _OPEN_IMAGE_EDIT_INFO::@1496::@1499 Open
#define ID_BRIGHTNESS
Definition: resource.h:82
#define ID_WINDOW_NEXT
Definition: resource.h:51
HINSTANCE hInstance
Definition: mainwnd.c:15
unsigned int UINT
Definition: ndis.h:50
#define SendMessage
Definition: winuser.h:5709
#define ID_INVERTCOLORS
Definition: resource.h:85
BOOL DisplaySharpness(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:357
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_MDITILE
Definition: winuser.h:1794
BOOL DisplayBlackAndWhite(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:5

Referenced by MainWndProc().

◆ MainWndCreateFloatWindows()

static VOID MainWndCreateFloatWindows ( PMAIN_WND_INFO  Info)
static

Definition at line 535 of file mainwnd.c.

536 {
537  RECT rect;
538  HMENU hMenu;
539  UINT Res;
540  PFLT_WND WndArr[NUM_FLT_WND]; /* temp array for looping */
541  INT i;
542 
543  Info->fltTools = HeapAlloc(ProcessHeap,
545  sizeof(FLT_WND));
546  Info->fltColors = HeapAlloc(ProcessHeap,
548  sizeof(FLT_WND));
549  Info->fltHistory = HeapAlloc(ProcessHeap,
551  sizeof(FLT_WND));
552 
553  /* set window dimensions */
554  Info->fltTools->Width = 53;
555  Info->fltTools->Height = 300;
556  Info->fltColors->Width = 200;
557  Info->fltColors->Height = 200;
558  Info->fltHistory->Width = 150;
559  Info->fltHistory->Height = 150;
560 
561  if (! GetWindowRect(Info->hMdiClient,
562  &rect))
563  {
564  return;
565  }
566 
567  /* Set window datums */
568  Info->fltTools->x = rect.left + 5;
569  Info->fltTools->y = rect.top + 5;
570 
571  Info->fltColors->x = rect.left + 5;
572  Info->fltColors->y = rect.bottom - Info->fltColors->Height - 5;
573 
574  Info->fltHistory->x = rect.right - Info->fltHistory->Width - 5;
575  Info->fltHistory->y = rect.top + 5;
576 
577  /* save pointers into array incrementing within the loop*/
578  WndArr[0] = Info->fltTools;
579  WndArr[1] = Info->fltColors;
580  WndArr[2] = Info->fltHistory;
581 
582  for (i = 0, Res = IDS_FLT_TOOLS; Res < IDS_FLT_TOOLS + NUM_FLT_WND; Res++, i++)
583  {
584  if (! AllocAndLoadString(&WndArr[i]->lpName,
585  hInstance,
586  Res))
587  {
588  WndArr[i]->lpName = NULL;
589  }
590 
592  TEXT("ImageSoftFloatWndClass"),
593  WndArr[i]->lpName,
595  WndArr[i]->x,
596  WndArr[i]->y,
597  WndArr[i]->Width,
598  WndArr[i]->Height,
599  Info->hSelf,
600  NULL,
601  hInstance,
602  WndArr[i]);
603  ShowWindow(WndArr[i]->hSelf, SW_HIDE);
604  }
605 
606  hMenu = GetMenu(Info->hSelf);
607 
608  if (Info->fltTools->hSelf != NULL)
609  {
611  {
612  CheckMenuItem(hMenu,
613  ID_TOOLS,
614  MF_CHECKED);
615 
616  ShowHideWindow(Info->fltTools->hSelf);
617  }
618  }
619 
620  if (Info->fltColors->hSelf != NULL)
621  {
623  {
624 
625  }
626  }
627 
628  if (Info->fltHistory->hSelf != NULL)
629  {
631  {
632 
633  }
634  }
635 
636 }
#define WS_POPUPWINDOW
Definition: pedump.c:638
HWND hSelf
Definition: precomp.h:46
BOOL FloatToolbarCreateHistoryGui(PMAIN_WND_INFO Info)
Definition: floatwindow.c:278
#define SW_HIDE
Definition: winuser.h:762
_In_ LPCSTR lpName
Definition: winbase.h:2729
#define WS_DLGFRAME
Definition: pedump.c:626
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
BOOL FloatToolbarCreateColorsGui(PMAIN_WND_INFO Info)
Definition: floatwindow.c:170
struct TraceInfo Info
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define CreateWindowEx
Definition: winuser.h:5621
smooth NULL
Definition: ftsmooth.c:416
#define MF_CHECKED
Definition: winuser.h:132
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL FloatToolbarCreateToolsGui(PMAIN_WND_INFO Info)
Definition: floatwindow.c:55
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define NUM_FLT_WND
Definition: mainwnd.c:7
BOOL ShowHideWindow(HWND hwnd)
Definition: floatwindow.c:45
#define ID_TOOLS
Definition: resource.h:39
HANDLE ProcessHeap
Definition: servman.c:15
#define IDS_FLT_TOOLS
Definition: resource.h:8
#define TEXT(s)
Definition: k32.h:26
HINSTANCE hInstance
Definition: mainwnd.c:15
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WS_VISIBLE
Definition: pedump.c:620
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPTSTR lpName
Definition: precomp.h:47

Referenced by CreateToolbars().

◆ MainWndCreateToolbarClient()

static BOOL CALLBACK MainWndCreateToolbarClient ( struct _TOOLBAR_DOCKS TbDocks,
const DOCKBAR Dockbar,
PVOID  Context,
HWND  hParent,
HWND hwnd 
)
static

Definition at line 113 of file mainwnd.c.

118 {
119  const TBBUTTON *Buttons = NULL;
120  UINT NumButtons = 0;
121  UINT StartImageRes = 0;
122  HWND hWndClient = NULL;
123 
125 
126  switch (Dockbar->BarId)
127  {
128  case ID_TOOLBAR_STANDARD:
129  {
131  NumButtons = sizeof(StdButtons) / sizeof(StdButtons[0]);
132  StartImageRes = IDB_MAINNEWICON;
133  break;
134  }
135 
136  case ID_TOOLBAR_TEXT:
137  {
139  NumButtons = sizeof(TextButtons) / sizeof(TextButtons[0]);
140  StartImageRes = IDB_TEXTBOLD;
141  break;
142  }
143 
144  case ID_TOOLBAR_TEST:
145  {/*
146  hWndClient = CreateWindowEx(WS_EX_TOOLWINDOW,
147  TEXT("BUTTON"),
148  TEXT("Test Button"),
149  WS_CHILD | WS_VISIBLE,
150  0,
151  0,
152  150,
153  25,
154  hParent,
155  NULL,
156  hInstance,
157  NULL);*/
158  break;
159  }
160  }
161 
162  if (Buttons != NULL)
163  {
164  hWndClient = CreateWindowEx(0,
166  NULL,
170  0,
171  0,
172  0,
173  0,
174  hParent,
175  NULL,
176  hInstance,
177  NULL);
178  if (hWndClient != NULL)
179  {
180  HIMAGELIST hImageList;
181 
182  SendMessage(hWndClient,
184  0,
186 
187  SendMessage(hWndClient,
189  sizeof(Buttons[0]),
190  0);
191 
192  SendMessage(hWndClient,
194  0,
196 
197  hImageList = InitImageList(NumButtons,
198  StartImageRes);
199 
202  0,
203  (LPARAM)hImageList));
204 
205  SendMessage(hWndClient,
207  NumButtons,
208  (LPARAM)Buttons);
209 
210  }
211  }
212 
213  switch (Dockbar->BarId)
214  {
215  case ID_TOOLBAR_TEXT:
216  {
217  HWND hFontType;
218  HWND hFontSize;
219 
220  /* font selection combo */
221  hFontType = CreateWindowEx(0,
222  WC_COMBOBOX,
223  NULL,
225  CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS, //| CBS_OWNERDRAWFIXED,
226  0, 0, 120, 0,
227  hParent,
228  NULL,
229  hInstance,
230  NULL);
231 
232  if (hFontType != NULL)
233  {
234  MakeFlatCombo(hFontType);
235 
236  SetParent(hFontType,
237  hWndClient);
238 
239  if (!ToolbarInsertSpaceForControl(hWndClient,
240  hFontType,
241  0,
243  TRUE))
244  {
245  DestroyWindow(hFontType);
246  }
247 
248  /* Create the list of fonts */
249  FillFontStyleComboList(hFontType);
250  }
251 
252  /* font size combo */
253  hFontSize = CreateWindowEx(0,
254  WC_COMBOBOX,
255  NULL,
257  0, 0, 50, 0,
258  hParent,
259  NULL,
260  hInstance,
261  NULL);
262  if (hFontSize != NULL)
263  {
264  MakeFlatCombo(hFontSize);
265 
266  SetParent(hFontSize,
267  hWndClient);
268 
269  if (!ToolbarInsertSpaceForControl(hWndClient,
270  hFontSize,
271  1,
273  TRUE))
274  {
275  DestroyWindow(hFontSize);
276  }
277 
278  /* Update the font-size-list */
279  FillFontSizeComboList(hFontSize);
280  }
281  break;
282  }
283  }
284 
285  if (hWndClient != NULL)
286  {
287  *hwnd = hWndClient;
288  return TRUE;
289  }
290 
291  return FALSE;
292 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define ID_TOOLBAR_TEST
Definition: mainwnd.c:101
#define CBS_SORT
Definition: winuser.h:292
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
#define TRUE
Definition: types.h:120
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:985
#define ID_TXTFONTSIZE
Definition: resource.h:57
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
TBBUTTON TextButtons[]
Definition: mainwnd.c:35
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
BOOL ToolbarInsertSpaceForControl(HWND hWndToolbar, HWND hWndControl, INT Index, INT iCmd, BOOL HideVertical)
Definition: misc.c:297
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:893
static VOID FillFontStyleComboList(HWND hwndCombo)
Definition: charmap.c:77
#define CCS_NODIVIDER
Definition: commctrl.h:2220
#define CreateWindowEx
Definition: winuser.h:5621
#define IDB_MAINNEWICON
Definition: resource.h:136
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2218
#define WC_COMBOBOX
Definition: commctrl.h:4689
#define CBS_HASSTRINGS
Definition: winuser.h:285
UINT BarId
Definition: tooldock.h:13
#define TB_SETIMAGELIST
Definition: commctrl.h:1122
#define TB_BMP_WIDTH
Definition: precomp.h:20
TBBUTTON StdButtons[]
Definition: mainwnd.c:10
VOID FillFontSizeComboList(HWND hwndCombo)
Definition: font.c:83
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:961
#define TB_BMP_HEIGHT
Definition: precomp.h:21
#define CCS_NORESIZE
Definition: commctrl.h:2217
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
#define TB_ADDBUTTONS
Definition: commctrl.h:1243
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1108
#define IDB_TEXTBOLD
Definition: resource.h:147
VOID MakeFlatCombo(HWND hwndCombo)
Definition: custcombo.c:199
#define ID_TXTFONTNAME
Definition: resource.h:56
HINSTANCE hInstance
Definition: mainwnd.c:15
#define CBS_DROPDOWN
Definition: winuser.h:283
unsigned int UINT
Definition: ndis.h:50
#define WS_VSCROLL
Definition: pedump.c:627
#define ID_TOOLBAR_STANDARD
Definition: mainwnd.c:94
#define SendMessage
Definition: winuser.h:5709
#define CCS_NOMOVEY
Definition: commctrl.h:2215
#define ID_TOOLBAR_TEXT
Definition: mainwnd.c:95
#define WS_VISIBLE
Definition: pedump.c:620
static const TBBUTTON Buttons[]
Definition: mainwnd.c:17
#define TBSTYLE_FLAT
Definition: commctrl.h:964
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1162

◆ MainWndDestroyFloatWindows()

static VOID MainWndDestroyFloatWindows ( PMAIN_WND_INFO  Info)
static

Definition at line 639 of file mainwnd.c.

640 {
641  if (Info->fltTools != NULL)
642  HeapFree(ProcessHeap, 0, Info->fltTools);
643 
644  if (Info->fltColors != NULL)
645  HeapFree(ProcessHeap, 0, Info->fltColors);
646 
647  if (Info->fltHistory != NULL)
648  HeapFree(ProcessHeap, 0, Info->fltHistory);
649 }
struct TraceInfo Info
smooth NULL
Definition: ftsmooth.c:416
HANDLE ProcessHeap
Definition: servman.c:15
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by DestroyMainWnd().

◆ MainWndDestroyToolbarClient()

static BOOL CALLBACK MainWndDestroyToolbarClient ( struct _TOOLBAR_DOCKS TbDocks,
const DOCKBAR Dockbar,
PVOID  Context,
HWND  hwnd 
)
static

Definition at line 295 of file mainwnd.c.

299 {
300  UNREFERENCED_PARAMETER(TbDocks);
303 
305  return TRUE;
306 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ MainWndGetCurrentEditor()

MDI_EDITOR_TYPE MainWndGetCurrentEditor ( PMAIN_WND_INFO  MainWnd,
PVOID Info 
)

Definition at line 1293 of file mainwnd.c.

1295 {
1296  MDI_EDITOR_TYPE EditorType;
1297 
1298  if (MainWnd->ActiveEditor != NULL)
1299  {
1300  EditorType = *((PMDI_EDITOR_TYPE)MainWnd->ActiveEditor);
1301  *Info = MainWnd->ActiveEditor;
1302  }
1303  else
1304  {
1305  EditorType = metUnknown;
1306  *Info = NULL;
1307  }
1308 
1309  return EditorType;
1310 }
PVOID ActiveEditor
Definition: mainwnd.h:25
struct TraceInfo Info
smooth NULL
Definition: ftsmooth.c:416
enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE

◆ MainWndMenuHint()

static BOOL MainWndMenuHint ( PMAIN_WND_INFO  Info,
WORD  CmdId,
const MENU_HINT HintArray,
DWORD  HintsCount,
UINT  DefHintId 
)
static

Definition at line 1032 of file mainwnd.c.

1037 {
1038  BOOL Found = FALSE;
1039  const MENU_HINT *LastHint;
1040  UINT HintId = DefHintId;
1041 
1042  LastHint = HintArray + HintsCount;
1043  while (HintArray != LastHint)
1044  {
1045  if (HintArray->CmdId == CmdId)
1046  {
1047  HintId = HintArray->HintId;
1048  Found = TRUE;
1049  break;
1050  }
1051  HintArray++;
1052  }
1053 
1054  StatusBarLoadString(Info->hStatus,
1055  SB_SIMPLEID,
1056  hInstance,
1057  HintId);
1058 
1059  return Found;
1060 }
#define TRUE
Definition: types.h:120
UINT HintId
Definition: precomp.h:87
struct TraceInfo Info
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SB_SIMPLEID
Definition: precomp.h:15
WORD CmdId
Definition: precomp.h:86
return Found
Definition: dirsup.c:1270
HINSTANCE hInstance
Definition: mainwnd.c:15
unsigned int UINT
Definition: ndis.h:50
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150

Referenced by MainWndProc().

◆ MainWndMoveFloatingWindows()

static VOID MainWndMoveFloatingWindows ( PMAIN_WND_INFO  Info,
PRECT  wndOldPos 
)
static

Definition at line 457 of file mainwnd.c.

459 {
460  RECT wndNewPos, TbRect;
461  INT i, xMoved, yMoved;
462  PFLT_WND WndArr[NUM_FLT_WND];
463 
464  if (GetWindowRect(Info->hSelf,
465  &wndNewPos))
466  {
467 
468  xMoved = wndNewPos.left - wndOldPos->left;
469  yMoved = wndNewPos.top - wndOldPos->top;
470 
471  /* store the pointers in an array */
472  WndArr[0] = Info->fltTools;
473  WndArr[1] = Info->fltColors;
474  WndArr[2] = Info->fltHistory;
475 
476  for (i = 0; i < NUM_FLT_WND; i++)
477  {
478  GetWindowRect(WndArr[i]->hSelf,
479  &TbRect);
480 
481  WndArr[i]->x = TbRect.left + xMoved;
482  WndArr[i]->y = TbRect.top + yMoved;
483 
484  MoveWindow(WndArr[i]->hSelf,
485  WndArr[i]->x,
486  WndArr[i]->y,
487  WndArr[i]->Width,
488  WndArr[i]->Height,
489  TRUE);
490  }
491 
492  CopyMemory(wndOldPos,
493  &wndNewPos,
494  sizeof(RECT));
495  }
496 }
#define TRUE
Definition: types.h:120
INT y
Definition: precomp.h:49
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG left
Definition: windef.h:291
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define CopyMemory
Definition: winbase.h:1633
#define NUM_FLT_WND
Definition: mainwnd.c:7
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
INT x
Definition: precomp.h:48

Referenced by MainWndProc().

◆ MainWndProc()

static LRESULT CALLBACK MainWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1063 of file mainwnd.c.

1067 {
1069  LRESULT Ret = 0;
1070  static BOOL bLBMouseDown = FALSE;
1071  static RECT wndOldPos;
1072 
1073  /* Get the window context */
1075  GWLP_USERDATA);
1076  if (Info == NULL && uMsg != WM_CREATE)
1077  {
1078  goto HandleDefaultMessage;
1079  }
1080 
1081  switch (uMsg)
1082  {
1083  case WM_SIZE:
1084  {
1086  LOWORD(lParam),
1087  HIWORD(lParam));
1088  /* NOTE - do *not* forward this message to DefFrameProc! Otherwise the MDI client
1089  will attempt to resize itself */
1090 
1091  /* reposition the floating toolbars */
1092  if ((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_RESTORED))
1094 
1095  break;
1096  }
1097 
1098  case WM_NCLBUTTONDOWN:
1099  bLBMouseDown = TRUE;
1101  uMsg,
1102  wParam,
1103  lParam);
1104  break;
1105 
1106  case WM_NCLBUTTONUP:
1107 
1108  bLBMouseDown = FALSE;
1110  uMsg,
1111  wParam,
1112  lParam);
1113  break;
1114 
1115  case WM_MOVE:
1116  {
1117  /* if the main window is moved, move the toolbars too */
1118  if (bLBMouseDown)
1119  MainWndMoveFloatingWindows(Info, &wndOldPos);
1120  }
1121  break;
1122 
1123  case WM_NOTIFY:
1124  {
1125  UINT BarId;
1126  LPNMHDR pnmhdr = (LPNMHDR)lParam;
1127  if (!TbdHandleNotifications(&Info->ToolDocks,
1128  pnmhdr,
1129  &Ret))
1130  {
1131  if (TbdDockBarIdFromClientWindow(&Info->ToolDocks,
1132  pnmhdr->hwndFrom,
1133  &BarId))
1134  {
1135  switch (BarId)
1136  {
1137  case ID_TOOLBAR_TEXT:
1138  switch (pnmhdr->code)
1139  {
1140  case TBN_DELETINGBUTTON:
1141  {
1142  LPNMTOOLBAR lpnmtb = (LPNMTOOLBAR)lParam;
1143 
1145  &lpnmtb->tbButton);
1146  break;
1147  }
1148  }
1149  break;
1150  }
1151  }
1152  }
1153  break;
1154  }
1155 
1156  case WM_COMMAND:
1157  {
1159  LOWORD(wParam),
1160  (HWND)lParam);
1161  goto HandleDefaultMessage;
1162  }
1163 
1164  case WM_MENUSELECT:
1165  {
1166  if (Info->hStatus != NULL)
1167  {
1168  if (!MainWndMenuHint(Info,
1169  LOWORD(wParam),
1171  sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
1172  IDS_HINT_BLANK))
1173  {
1175  LOWORD(wParam),
1177  sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
1178  IDS_HINT_BLANK);
1179  }
1180  }
1181  break;
1182  }
1183 
1184  case WM_ENTERMENULOOP:
1185  {
1186  Info->InMenuLoop = TRUE;
1188  break;
1189  }
1190 
1191  case WM_EXITMENULOOP:
1192  {
1193  Info->InMenuLoop = FALSE;
1195  break;
1196  }
1197 
1198  case WM_CLOSE:
1199  {
1201  break;
1202  }
1203 
1204  case WM_ENABLE:
1205  {
1206  TbdHandleEnabling(&Info->ToolDocks,
1207  hwnd,
1208  (BOOL)wParam);
1209  goto HandleDefaultMessage;
1210  }
1211 
1212  case WM_NCACTIVATE:
1213  {
1214  TbdHandleActivation(&Info->ToolDocks,
1215  hwnd,
1216  &wParam,
1217  &lParam);
1218  goto HandleDefaultMessage;
1219  }
1220 
1221  case WM_ACTIVATEAPP:
1222  {
1223  //TbdShowFloatingToolbars(&Info->ToolDocks,
1224  // (BOOL)wParam);
1225  goto HandleDefaultMessage;
1226  }
1227 
1228  case WM_CREATE:
1229  {
1230  Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams);
1231 
1232  /* Initialize the main window context */
1233  Info->hSelf = hwnd;
1234 
1236  GWLP_USERDATA,
1237  (LONG_PTR)Info);
1238 
1239  InitMainWnd(Info);
1240 
1241  /* Show the window */
1242  ShowWindow(hwnd,
1243  Info->nCmdShow);
1244  /* get the windows position */
1246  &wndOldPos);
1247 
1248  break;
1249  }
1250 
1251  case WM_DESTROY:
1252  {
1254 
1256  0,
1257  Info);
1259  GWLP_USERDATA,
1260  0);
1261 
1262  /* Break the message queue loop */
1263  PostQuitMessage(0);
1264  break;
1265  }
1266 
1267  default:
1268  {
1269 HandleDefaultMessage:
1270  if (Info != NULL && Info->hMdiClient != NULL)
1271  {
1272  Ret = DefFrameProc(hwnd,
1273  Info->hMdiClient,
1274  uMsg,
1275  wParam,
1276  lParam);
1277  }
1278  else
1279  {
1280  Ret = DefWindowProc(hwnd,
1281  uMsg,
1282  wParam,
1283  lParam);
1284  }
1285  break;
1286  }
1287  }
1288 
1289  return Ret;
1290 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
#define IDS_HINT_BLANK
Definition: resource.h:94
#define LPNMTOOLBAR
Definition: commctrl.h:1429
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static VOID CALLBACK MainWndResize(PVOID Context, LONG cx, LONG cy)
Definition: mainwnd.c:679
#define SIZE_MAXIMIZED
Definition: winuser.h:2461
#define SIZE_RESTORED
Definition: winuser.h:2459
#define WM_MOVE
Definition: winuser.h:1592
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
struct tagNMHDR * LPNMHDR
#define WM_ENABLE
Definition: winuser.h:1597
#define DefFrameProc
Definition: ros2win.h:32
UINT code
Definition: winuser.h:3112
static VOID MainWndCommand(PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
Definition: mainwnd.c:807
#define WM_NCACTIVATE
Definition: winuser.h:1670
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define WM_MENUSELECT
Definition: winuser.h:1723
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_EXITMENULOOP
Definition: winuser.h:1781
smooth NULL
Definition: ftsmooth.c:416
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
static VOID MainWndMoveFloatingWindows(PMAIN_WND_INFO Info, PRECT wndOldPos)
Definition: mainwnd.c:457
#define WM_SIZE
Definition: winuser.h:1593
#define WM_CLOSE
Definition: winuser.h:1603
struct _MAIN_WND_INFO * PMAIN_WND_INFO
static VOID InitMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:751
static VOID DestroyMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:1011
VOID TbdHandleActivation(PTOOLBAR_DOCKS TbDocks, HWND hWnd, WPARAM *wParam, LPARAM *lParam)
Definition: tooldock.c:992
#define WM_COMMAND
Definition: winuser.h:1716
static const MENU_HINT MainMenuHintTable[]
Definition: mainwnd.c:54
HWND hwndFrom
Definition: winuser.h:3110
HANDLE ProcessHeap
Definition: servman.c:15
#define WM_ACTIVATEAPP
Definition: winuser.h:1614
static const MENU_HINT SystemMenuHintTable[]
Definition: mainwnd.c:82
static BOOL MainWndMenuHint(PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
Definition: mainwnd.c:1032
BOOL TbdHandleNotifications(PTOOLBAR_DOCKS TbDocks, LPNMHDR pnmh, LRESULT *Result)
Definition: tooldock.c:291
BOOL TbdDockBarIdFromClientWindow(PTOOLBAR_DOCKS TbDocks, HWND hWndClient, UINT *Id)
Definition: tooldock.c:267
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
static VOID UpdateMainStatusBar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:1020
static VOID MainWndResetFloatingWindows(PMAIN_WND_INFO Info)
Definition: mainwnd.c:500
VOID TbdHandleEnabling(PTOOLBAR_DOCKS TbDocks, HWND hWnd, BOOL Enable)
Definition: tooldock.c:972
#define WM_CREATE
Definition: winuser.h:1590
#define ID_TOOLBAR_TEXT
Definition: mainwnd.c:95
#define WM_NCLBUTTONUP
Definition: winuser.h:1675
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define GetWindowLongPtr
Definition: treelist.c:73
LONG_PTR LRESULT
Definition: windef.h:209
BOOL ToolbarDeleteControlSpace(HWND hWndToolbar, const TBBUTTON *ptbButton)
Definition: misc.c:220
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define TBN_DELETINGBUTTON
Definition: commctrl.h:1310
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by InitMainWindowImpl().

◆ MainWndResetFloatingWindows()

static VOID MainWndResetFloatingWindows ( PMAIN_WND_INFO  Info)
static

Definition at line 500 of file mainwnd.c.

501 {
502  RECT rect;
503 
504  if (GetWindowRect(Info->hMdiClient,
505  &rect))
506  {
507 
508  /* tools datum */
509  MoveWindow(Info->fltTools->hSelf,
510  rect.left + 5,
511  rect.top + 5,
512  Info->fltTools->Width,
513  Info->fltTools->Height,
514  TRUE);
515 
516  /* colors datum */
517  MoveWindow(Info->fltColors->hSelf,
518  rect.left + 5,
519  rect.bottom - Info->fltColors->Height - 5,
520  Info->fltColors->Width,
521  Info->fltColors->Height,
522  TRUE);
523 
524  /* history datum */
525  MoveWindow(Info->fltHistory->hSelf,
526  rect.right - Info->fltHistory->Width - 5,
527  rect.top + 5,
528  Info->fltHistory->Width,
529  Info->fltHistory->Height,
530  TRUE);
531  }
532 }
#define TRUE
Definition: types.h:120
& rect
Definition: startmenu.cpp:1413
struct TraceInfo Info
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by MainWndProc().

◆ MainWndResize()

static VOID CALLBACK MainWndResize ( PVOID  Context,
LONG  cx,
LONG  cy 
)
static

Definition at line 679 of file mainwnd.c.

682 {
683  RECT rcClient = {0};
684  RECT rcStatus = {0};
685  HDWP dwp;
686  INT DocksVisible;
688 
689  /* Calculate the MDI client rectangle */
690  rcClient.right = cx;
691  rcClient.bottom = cy;
692 
693  if (Info->hStatus != NULL)
694  {
695  GetWindowRect(Info->hStatus,
696  &rcStatus);
697  rcClient.bottom -= (rcStatus.bottom - rcStatus.top);
698  }
699 
700  /* Adjust the client rect if docked toolbars are visible */
701  DocksVisible = TbdAdjustUpdateClientRect(&Info->ToolDocks,
702  &rcClient);
703 
704  dwp = BeginDeferWindowPos(2 + DocksVisible);
705  if (dwp != NULL)
706  {
707  /* Update the toolbar docks */
708  if (DocksVisible != 0)
709  {
710  dwp = TbdDeferDocks(dwp,
711  &Info->ToolDocks);
712  if (dwp == NULL)
713  return;
714  }
715 
716  /* Update the MDI client */
717  if (Info->hMdiClient != NULL)
718  {
719  dwp = DeferWindowPos(dwp,
720  Info->hMdiClient,
721  NULL,
722  rcClient.left,
723  rcClient.top,
724  rcClient.right - rcClient.left,
725  rcClient.bottom - rcClient.top,
726  SWP_NOZORDER);
727  if (dwp == NULL)
728  return;
729  }
730 
731  /* Update the status bar */
732  if (Info->hStatus != NULL)
733  {
734  dwp = DeferWindowPos(dwp,
735  Info->hStatus,
736  NULL,
737  0,
738  cy - (rcStatus.bottom - rcStatus.top),
739  cx,
740  rcStatus.bottom - rcStatus.top,
741  SWP_NOZORDER);
742  if (dwp == NULL)
743  return;
744  }
745 
746  EndDeferWindowPos(dwp);
747  }
748 }
HDWP WINAPI BeginDeferWindowPos(_In_ int)
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
smooth NULL
Definition: ftsmooth.c:416
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HDWP TbdDeferDocks(HDWP hWinPosInfo, PTOOLBAR_DOCKS TbDocks)
Definition: tooldock.c:71
struct _MAIN_WND_INFO * PMAIN_WND_INFO
INT TbdAdjustUpdateClientRect(PTOOLBAR_DOCKS TbDocks, PRECT rcClient)
Definition: tooldock.c:44
_Out_opt_ int * cx
Definition: commctrl.h:570
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by InitMainWnd(), and MainWndProc().

◆ MainWndSwitchEditorContext()

VOID MainWndSwitchEditorContext ( PMAIN_WND_INFO  Info,
HWND  hDeactivate,
HWND  hActivate 
)

Definition at line 1313 of file mainwnd.c.

1316 {
1317  PMDI_EDITOR_TYPE EditorType;
1318 
1319  /* FIXME - optimize light weight switching
1320  when switching from and to an editor of same type */
1321 
1322  if (hDeactivate != NULL)
1323  {
1324  EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hDeactivate,
1325  GWLP_USERDATA);
1326  if (EditorType != NULL)
1327  {
1328  switch (*EditorType)
1329  {
1330  case metImageEditor:
1332  FALSE);
1333  break;
1334 
1335  default:
1336  break;
1337  }
1338 
1339  Info->ActiveEditor = NULL;
1340  }
1341  }
1342 
1343  if (hActivate != NULL)
1344  {
1345  EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hActivate,
1346  GWLP_USERDATA);
1347  if (EditorType != NULL)
1348  {
1349  Info->ActiveEditor = EditorType;
1350 
1351  switch (*EditorType)
1352  {
1353  case metImageEditor:
1355  TRUE);
1356  break;
1357 
1358  default:
1359  break;
1360  }
1361  }
1362  }
1363 }
#define TRUE
Definition: types.h:120
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
#define GetWindowLongPtr
Definition: treelist.c:73
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE
VOID SetImageEditorEnvironment(PEDIT_WND_INFO Info, BOOL Setup)
Definition: imgedwnd.c:445

Referenced by ImageEditWndProc().

◆ MainWndToolbarChevronPushed()

static VOID CALLBACK MainWndToolbarChevronPushed ( struct _TOOLBAR_DOCKS TbDocks,
const DOCKBAR Dockbar,
PVOID  Context,
HWND  hwndChild,
LPNMREBARCHEVRON  lpnm 
)
static

Definition at line 436 of file mainwnd.c.

441 {
442  switch (lpnm->wID)
443  {
444  case ID_TOOLBAR_STANDARD:
445  {
447  HWND_DESKTOP,
448  (LPPOINT)&lpnm->rc,
449  2);
450  /* Create a popup menu for all toolbar icons hidden */
451  break;
452  }
453  }
454 }
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND hwndFrom
Definition: winuser.h:3110
#define HWND_DESKTOP
Definition: winuser.h:1195
#define ID_TOOLBAR_STANDARD
Definition: mainwnd.c:94

◆ MainWndToolbarDockBand()

static VOID CALLBACK MainWndToolbarDockBand ( struct _TOOLBAR_DOCKS TbDocks,
const DOCKBAR Dockbar,
PVOID  Context,
DOCK_POSITION  DockFrom,
DOCK_POSITION  DockTo,
LPREBARBANDINFO  rbi 
)
static

Definition at line 365 of file mainwnd.c.

371 {
372  if (rbi->fMask & RBBIM_CHILD && rbi->hwndChild != NULL)
373  {
374  switch (rbi->wID)
375  {
376  case ID_TOOLBAR_TEXT:
377  case ID_TOOLBAR_STANDARD:
378  {
379  SIZE Size;
380  BOOL Vert;
381  DWORD dwStyle = (DWORD)SendMessage(rbi->hwndChild,
382  TB_GETSTYLE,
383  0,
384  0);
385  switch (DockTo)
386  {
387  case LEFT_DOCK:
388  case RIGHT_DOCK:
389  dwStyle |= CCS_VERT | TBSTYLE_WRAPABLE;
390  Vert = TRUE;
391  break;
392 
393  default:
394  dwStyle &= ~(CCS_VERT | TBSTYLE_WRAPABLE);
395  Vert = FALSE;
396  break;
397  }
398 
399  SendMessage(rbi->hwndChild,
400  TB_SETSTYLE,
401  0,
402  (LPARAM)dwStyle);
403 
404  ToolbarUpdateControlSpaces(rbi->hwndChild,
406 
407  if (SendMessage(rbi->hwndChild,
409  0,
410  (LPARAM)&Size))
411  {
412  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
413  rbi->cx = rbi->cxIdeal = (Vert ? Size.cy : Size.cx);
414  rbi->cxMinChild = 0;
415  rbi->cyMinChild = (Vert ? Size.cx : Size.cy);
416  }
417  break;
418  }
419 
420  case ID_TOOLBAR_TEST:
421  {
422  if (DockTo == NO_DOCK)
423  {
424  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
425  rbi->cx = rbi->cxIdeal = 150;
426  rbi->cxMinChild = 0;
427  rbi->cyMinChild = 40;
428  }
429  break;
430  }
431  }
432  }
433 }
#define ID_TOOLBAR_TEST
Definition: mainwnd.c:101
#define TRUE
Definition: types.h:120
#define RBBIM_CHILD
Definition: commctrl.h:1478
#define TB_SETSTYLE
Definition: commctrl.h:1130
VOID ToolbarUpdateControlSpaces(HWND hWndToolbar, ToolbarChangeControlCallback ChangeCallback)
Definition: misc.c:240
#define TB_GETMAXSIZE
Definition: commctrl.h:1161
#define DWORD
Definition: nt_native.h:44
#define CCS_VERT
Definition: commctrl.h:2221
#define RBBIM_SIZE
Definition: commctrl.h:1480
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static VOID TbCustomControlChange(HWND hWndToolbar, HWND hWndControl, BOOL Vert)
Definition: mainwnd.c:356
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define ID_TOOLBAR_STANDARD
Definition: mainwnd.c:94
#define SendMessage
Definition: winuser.h:5709
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:962
#define ID_TOOLBAR_TEXT
Definition: mainwnd.c:95
#define TB_GETSTYLE
Definition: commctrl.h:1131
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1483

◆ MainWndToolbarInsertBand()

static BOOL CALLBACK MainWndToolbarInsertBand ( struct _TOOLBAR_DOCKS TbDocks,
const DOCKBAR Dockbar,
PVOID  Context,
UINT Index,
LPREBARBANDINFO  rbi 
)
static

Definition at line 309 of file mainwnd.c.

314 {
315  switch (rbi->wID)
316  {
317  case ID_TOOLBAR_TEXT:
318  case ID_TOOLBAR_STANDARD:
319  {
320  SIZE Size;
321 
322  if (SendMessage(rbi->hwndChild,
324  0,
325  (LPARAM)&Size))
326  {
327  rbi->fStyle |= RBBS_USECHEVRON | RBBS_HIDETITLE;
328  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
329  rbi->cx = rbi->cxIdeal = Size.cx;
330  rbi->cxMinChild = 0;
331  rbi->cyMinChild = Size.cy;
332  }
333  break;
334  }
335 
336  case ID_TOOLBAR_TEST:
337  {
338  RECT rcBtn;
339 
340  if (GetWindowRect(rbi->hwndChild,
341  &rcBtn))
342  {
343  rbi->fStyle |= RBBS_HIDETITLE;
344  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE;
345  rbi->cx = rcBtn.right - rcBtn.left;
346  rbi->cxMinChild = 0;
347  rbi->cyMinChild = rcBtn.bottom - rcBtn.top;
348  }
349  break;
350  }
351  }
352  return TRUE;
353 }
#define ID_TOOLBAR_TEST
Definition: mainwnd.c:101
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
#define TB_GETMAXSIZE
Definition: commctrl.h:1161
LONG right
Definition: windef.h:293
#define RBBIM_SIZE
Definition: commctrl.h:1480
LONG_PTR LPARAM
Definition: windef.h:208
#define RBBS_HIDETITLE
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1479
#define RBBS_USECHEVRON
Definition: commctrl.h:1470
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define ID_TOOLBAR_STANDARD
Definition: mainwnd.c:94
#define SendMessage
Definition: winuser.h:5709
#define ID_TOOLBAR_TEXT
Definition: mainwnd.c:95
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1483

◆ MainWndTranslateMDISysAccel()

BOOL MainWndTranslateMDISysAccel ( HWND  hwnd,
LPMSG  lpMsg 
)

Definition at line 1407 of file mainwnd.c.

1409 {
1411 
1412  /* Get the window context */
1414  GWLP_USERDATA);
1415  if (Info != NULL && Info->hMdiClient != NULL)
1416  {
1417  return TranslateMDISysAccel(Info->hMdiClient,
1418  lpMsg);
1419  }
1420 
1421  return FALSE;
1422 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
struct _MAIN_WND_INFO * PMAIN_WND_INFO
#define GetWindowLongPtr
Definition: treelist.c:73
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)

Referenced by _tWinMain().

◆ TbCustomControlChange()

static VOID TbCustomControlChange ( HWND  hWndToolbar,
HWND  hWndControl,
BOOL  Vert 
)
static

Definition at line 356 of file mainwnd.c.

359 {
360  /* the toolbar changed from horizontal to vertical or vice versa... */
361  return;
362 }

Referenced by MainWndToolbarDockBand().

◆ UninitMainWindowImpl()

VOID UninitMainWindowImpl ( VOID  )

Definition at line 1450 of file mainwnd.c.

1451 {
1453  hInstance);
1454 }
static const TCHAR szMainWndClass[]
Definition: mainwnd.c:3
HINSTANCE hInstance
Definition: mainwnd.c:15
#define UnregisterClass
Definition: winuser.h:5727

◆ UpdateMainStatusBar()

static VOID UpdateMainStatusBar ( PMAIN_WND_INFO  Info)
static

Definition at line 1020 of file mainwnd.c.

1021 {
1022  if (Info->hStatus != NULL)
1023  {
1024  SendMessage(Info->hStatus,
1025  SB_SIMPLE,
1026  (WPARAM)Info->InMenuLoop,
1027  0);
1028  }
1029 }
UINT_PTR WPARAM
Definition: windef.h:207
struct TraceInfo Info
#define SB_SIMPLE
Definition: commctrl.h:1930
smooth NULL
Definition: ftsmooth.c:416
#define SendMessage
Definition: winuser.h:5709

Referenced by MainWndProc().

Variable Documentation

◆ MainDockBars

const DOCKBAR MainDockBars[]
static
Initial value:
= {
}
#define IDS_TOOLBAR_TEXT
Definition: resource.h:296
#define ID_TOOLBAR_TEST
Definition: mainwnd.c:101
static const TCHAR szToolbarTest[]
Definition: mainwnd.c:102
#define IDS_TOOLBAR_STANDARD
Definition: resource.h:294
static const TCHAR szToolbarStandard[]
Definition: mainwnd.c:96
static const TCHAR szToolbarText[]
Definition: mainwnd.c:97
#define ID_TOOLBAR_STANDARD
Definition: mainwnd.c:94
#define IDS_TOOLBAR_TEST
Definition: resource.h:295
#define ID_TOOLBAR_TEXT
Definition: mainwnd.c:95

Definition at line 105 of file mainwnd.c.

Referenced by CreateToolbars().

◆ MainMenuHintTable

const MENU_HINT MainMenuHintTable[]
static
Initial value:
= {
}
#define IDS_HINT_EXIT
Definition: resource.h:96
#define ID_STATUSBAR
Definition: resource.h:42
#define IDS_HINT_BLANK
Definition: resource.h:94
#define IDS_HINT_STATUS
Definition: resource.h:115
#define IDS_HINT_TOOLS
Definition: resource.h:112
#define IDS_HINT_SAVE
Definition: resource.h:105
#define ID_WINDOW_TILE_VERT
Definition: resource.h:49
#define ID_PRINTPRE
Definition: resource.h:27
#define IDS_HINT_OPEN
Definition: resource.h:102
#define ID_BLANK
Definition: resource.h:43
#define IDS_HINT_PRINT
Definition: resource.h:107
#define ID_SAVEAS
Definition: resource.h:26
#define ID_WINDOW_CASCADE
Definition: resource.h:78
#define ID_CLOSE
Definition: resource.h:23
#define IDS_HINT_NEXT
Definition: resource.h:121
#define IDS_HINT_CLOSE
Definition: resource.h:103
#define ID_OPEN
Definition: resource.h:22
#define IDS_HINT_CLOSEALL
Definition: resource.h:104
#define ID_HISTORY
Definition: resource.h:41
#define ID_COLOR
Definition: definitions.h:121
#define IDS_HINT_PROP
Definition: resource.h:108
#define ID_SAVE
Definition: resource.h:25
#define IDS_HINT_CASCADE
Definition: resource.h:117
#define ID_WINDOW_TILE_HORZ
Definition: resource.h:48
#define IDS_HINT_COLORS
Definition: resource.h:113
#define IDS_HINT_PRINTPRE
Definition: resource.h:108
#define IDS_HINT_ARRANGE
Definition: resource.h:120
#define ID_NEW
Definition: resource.h:21
#define ID_WINDOW_ARRANGE
Definition: resource.h:52
#define ID_EXIT
Definition: resource.h:10
#define ID_TOOLS
Definition: resource.h:39
#define ID_PRINT
Definition: wordpad.h:39
#define IDS_HINT_SAVEAS
Definition: resource.h:106
#define ID_WINDOW_NEXT
Definition: resource.h:51
#define IDS_HINT_TILE_VERT
Definition: resource.h:119
#define ID_PROP
Definition: resource.h:17
#define IDS_HINT_HISTORY
Definition: resource.h:114
#define ID_CLOSEALL
Definition: resource.h:24
#define IDS_HINT_TILE_HORZ
Definition: resource.h:118
#define IDS_HINT_NEW
Definition: resource.h:101

Definition at line 54 of file mainwnd.c.

Referenced by MainWndProc().

◆ MainWndDockBarCallbacks

const DOCKBAR_ITEM_CALLBACKS MainWndDockBarCallbacks
static
Initial value:
= {
}
static BOOL CALLBACK MainWndToolbarInsertBand(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, UINT *Index, LPREBARBANDINFO rbi)
Definition: mainwnd.c:309
static VOID CALLBACK MainWndToolbarDockBand(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, DOCK_POSITION DockFrom, DOCK_POSITION DockTo, LPREBARBANDINFO rbi)
Definition: mainwnd.c:365
static BOOL CALLBACK MainWndDestroyToolbarClient(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hwnd)
Definition: mainwnd.c:295
static VOID CALLBACK MainWndToolbarChevronPushed(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hwndChild, LPNMREBARCHEVRON lpnm)
Definition: mainwnd.c:436
static BOOL CALLBACK MainWndCreateToolbarClient(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hParent, HWND *hwnd)
Definition: mainwnd.c:113

Definition at line 653 of file mainwnd.c.

Referenced by CreateToolbars().

◆ StdButtons

TBBUTTON StdButtons[]
Initial value:
= {
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
}
#define TBICON_SAVE
Definition: resource.h:33
#define ID_COPY
Definition: resource.h:31
#define TBICON_PASTE
Definition: resource.h:194
#define TBICON_REDO
Definition: resource.h:196
#define ID_PRINTPRE
Definition: resource.h:27
#define TBICON_OPEN
Definition: resource.h:188
#define ID_UNDO
Definition: resource.h:34
#define BTNS_BUTTON
Definition: commctrl.h:970
#define TBICON_NEW
Definition: resource.h:187
#define TBICON_COPY
Definition: resource.h:193
#define TBICON_CUT
Definition: resource.h:192
#define TBICON_PRINT
Definition: resource.h:34
#define BTNS_SEP
Definition: commctrl.h:971
#define ID_OPEN
Definition: resource.h:22
#define ID_SAVE
Definition: resource.h:25
#define ID_NEW
Definition: resource.h:21
#define ID_REDO
Definition: resource.h:35
#define TBICON_PRINTPRE
Definition: resource.h:191
#define ID_PRINT
Definition: wordpad.h:39
#define ID_PASTE
Definition: resource.h:32
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define TBICON_UNDO
Definition: resource.h:195
#define ID_CUT
Definition: resource.h:30

Definition at line 10 of file mainwnd.c.

Referenced by MainWndCreateToolbarClient().

◆ SystemMenuHintTable

const MENU_HINT SystemMenuHintTable[]
static
Initial value:
= {
}
#define SC_RESTORE
Definition: winuser.h:2552
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:123
#define SC_MAXIMIZE
Definition: winuser.h:2542
#define IDS_HINT_SYS_MOVE
Definition: resource.h:121
#define IDS_HINT_NEXT
Definition: resource.h:121
#define IDS_HINT_CLOSE
Definition: resource.h:103
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:120
#define IDS_HINT_SYS_SIZE
Definition: resource.h:122
#define SC_MINIMIZE
Definition: winuser.h:2540
#define SC_SIZE
Definition: winuser.h:2538
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:124
#define SC_MOVE
Definition: winuser.h:2539
#define SC_CLOSE
Definition: winuser.h:2546
#define SC_NEXTWINDOW
Definition: winuser.h:2544

Definition at line 82 of file mainwnd.c.

Referenced by MainWndProc().

◆ szMainWndClass

const TCHAR szMainWndClass[] = TEXT("ImageSoftWndClass")
static

Definition at line 3 of file mainwnd.c.

Referenced by CreateMainWindow(), InitMainWindowImpl(), and UninitMainWindowImpl().

◆ szToolbarStandard

const TCHAR szToolbarStandard[] = TEXT("STANDARD")
static

Definition at line 96 of file mainwnd.c.

◆ szToolbarTest

const TCHAR szToolbarTest[] = TEXT("TEST")
static

Definition at line 102 of file mainwnd.c.

◆ szToolbarText

const TCHAR szToolbarText[] = TEXT("TEXT")
static

Definition at line 97 of file mainwnd.c.

◆ TextButtons

TBBUTTON TextButtons[]
Initial value:
= {
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
}
#define ID_TXTLEFT
Definition: resource.h:53
#define ID_TXTRIGHT
Definition: resource.h:55
#define TBICON_BOLD
Definition: resource.h:198
#define ID_BOLD
Definition: resource.h:50
#define BTNS_BUTTON
Definition: commctrl.h:970
#define ID_TXTCENTER
Definition: resource.h:54
#define BTNS_SEP
Definition: commctrl.h:971
#define TBICON_ITALIC
Definition: resource.h:199
#define ID_ITALIC
Definition: resource.h:51
#define ID_ULINE
Definition: resource.h:52
#define TBSTATE_CHECKED
Definition: commctrl.h:944
#define TBICON_TXTRIGHT
Definition: resource.h:203
#define TBICON_TXTCENTER
Definition: resource.h:202
#define TBICON_TXTLEFT
Definition: resource.h:201
#define TBICON_ULINE
Definition: resource.h:200
#define TBSTYLE_GROUP
Definition: commctrl.h:956
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define TBSTYLE_CHECK
Definition: commctrl.h:955

Definition at line 35 of file mainwnd.c.

Referenced by MainWndCreateToolbarClient().