ReactOS  0.4.15-dev-3442-gc05a45e
mainwnd.c
Go to the documentation of this file.
1 #include <precomp.h>
2 
3 static const TCHAR szMainWndClass[] = TEXT("ImageSoftWndClass");
4 
5 #define ID_MDI_FIRSTCHILD 50000
6 #define ID_MDI_WINDOWMENU 5
7 #define NUM_FLT_WND 3
8 
9 /* toolbar buttons */
11 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
12  {TBICON_NEW, ID_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* new */
13  {TBICON_OPEN, ID_OPEN, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* open */
14  {TBICON_SAVE, ID_SAVE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, /* save */
15 
16  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */
17 
18  {TBICON_PRINT, ID_PRINTPRE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* print */
19  {TBICON_PRINTPRE, ID_PRINT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* print preview */
20 
21  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */
22 
23  {TBICON_CUT, ID_CUT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* cut */
24  {TBICON_COPY, ID_COPY, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* copy */
25  {TBICON_PASTE, ID_PASTE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* paste */
26 
27  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */
28 
29  {TBICON_UNDO, ID_UNDO, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* undo */
30  {TBICON_REDO, ID_REDO, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /* redo */
31 
32  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
33 };
34 
36  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */
37 
38  {TBICON_BOLD, ID_BOLD, TBSTATE_ENABLED, BTNS_BUTTON | TBSTYLE_CHECK, {0}, 0, 0}, /* bold */
39  {TBICON_ITALIC, ID_ITALIC, TBSTATE_ENABLED, BTNS_BUTTON | TBSTYLE_CHECK, {0}, 0, 0}, /* italic */
40  {TBICON_ULINE, ID_ULINE, TBSTATE_ENABLED, BTNS_BUTTON | TBSTYLE_CHECK, {0}, 0, 0}, /* underline */
41 
42  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */
43 
46  {TBICON_TXTRIGHT, ID_TXTRIGHT, TBSTATE_ENABLED, BTNS_BUTTON | TBSTYLE_GROUP | TBSTYLE_CHECK, {0}, 0, 0 }, /* right justified */
47 
48  {10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /* separator */
49 };
50 
51 
52 
53 /* menu hints */
54 static const MENU_HINT MainMenuHintTable[] = {
55  /* File Menu */
67 
68  /* view menu */
73 
74  /* Window Menu */
80 };
81 
82 static const MENU_HINT SystemMenuHintTable[] = {
90 };
91 
92 
93 /* Toolbars */
94 #define ID_TOOLBAR_STANDARD 0
95 #define ID_TOOLBAR_TEXT 1
96 static const TCHAR szToolbarStandard[] = TEXT("STANDARD");
97 static const TCHAR szToolbarText[] = TEXT("TEXT");
98 
99 
100 /* Test Toolbar */
101 #define ID_TOOLBAR_TEST 5
102 static const TCHAR szToolbarTest[] = TEXT("TEST");
103 
104 /* Toolbars table */
105 static const DOCKBAR MainDockBars[] = {
109 };
110 
111 
112 static BOOL CALLBACK
114  const DOCKBAR *Dockbar,
115  PVOID Context,
116  HWND hParent,
117  HWND *hwnd)
118 {
119  const TBBUTTON *Buttons = NULL;
120  UINT NumButtons = 0;
121  UINT StartImageRes = 0;
122  UINT NumImages = 0;
123  HWND hWndClient = NULL;
124 
126 
127  switch (Dockbar->BarId)
128  {
129  case ID_TOOLBAR_STANDARD:
130  {
132  NumButtons = ARRAYSIZE(StdButtons);
133  StartImageRes = IDB_MAINNEW;
134  NumImages = 10;
135  break;
136  }
137 
138  case ID_TOOLBAR_TEXT:
139  {
141  NumButtons = ARRAYSIZE(TextButtons);
142  StartImageRes = IDB_TEXTBOLD;
143  NumImages = 6;
144  break;
145  }
146 
147  case ID_TOOLBAR_TEST:
148  {/*
149  hWndClient = CreateWindowEx(WS_EX_TOOLWINDOW,
150  TEXT("BUTTON"),
151  TEXT("Test Button"),
152  WS_CHILD | WS_VISIBLE,
153  0,
154  0,
155  150,
156  25,
157  hParent,
158  NULL,
159  hInstance,
160  NULL);*/
161  break;
162  }
163  }
164 
165  if (Buttons != NULL)
166  {
167  hWndClient = CreateWindowEx(0,
169  NULL,
173  0,
174  0,
175  0,
176  0,
177  hParent,
178  NULL,
179  hInstance,
180  NULL);
181  if (hWndClient != NULL)
182  {
183  HIMAGELIST hImageList;
184 
185  SendMessage(hWndClient,
187  0,
189 
190  SendMessage(hWndClient,
192  sizeof(Buttons[0]),
193  0);
194 
195  SendMessage(hWndClient,
197  0,
199 
200  hImageList = InitImageList(StartImageRes, NumImages);
201 
204  0,
205  (LPARAM)hImageList));
206 
207  SendMessage(hWndClient,
209  NumButtons,
210  (LPARAM)Buttons);
211 
212  }
213  }
214 
215  switch (Dockbar->BarId)
216  {
217  case ID_TOOLBAR_TEXT:
218  {
219  HWND hFontType;
220  HWND hFontSize;
221 
222  /* font selection combo */
223  hFontType = CreateWindowEx(0,
224  WC_COMBOBOX,
225  NULL,
227  CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS, //| CBS_OWNERDRAWFIXED,
228  0, 0, 120, 0,
229  hParent,
230  NULL,
231  hInstance,
232  NULL);
233 
234  if (hFontType != NULL)
235  {
236  MakeFlatCombo(hFontType);
237 
238  SetParent(hFontType,
239  hWndClient);
240 
241  if (!ToolbarInsertSpaceForControl(hWndClient,
242  hFontType,
243  0,
245  TRUE))
246  {
247  DestroyWindow(hFontType);
248  }
249 
250  /* Create the list of fonts */
251  FillFontStyleComboList(hFontType);
252  }
253 
254  /* font size combo */
255  hFontSize = CreateWindowEx(0,
256  WC_COMBOBOX,
257  NULL,
259  0, 0, 50, 0,
260  hParent,
261  NULL,
262  hInstance,
263  NULL);
264  if (hFontSize != NULL)
265  {
266  MakeFlatCombo(hFontSize);
267 
268  SetParent(hFontSize,
269  hWndClient);
270 
271  if (!ToolbarInsertSpaceForControl(hWndClient,
272  hFontSize,
273  1,
275  TRUE))
276  {
277  DestroyWindow(hFontSize);
278  }
279 
280  /* Update the font-size-list */
281  FillFontSizeComboList(hFontSize);
282  }
283  break;
284  }
285  }
286 
287  if (hWndClient != NULL)
288  {
289  *hwnd = hWndClient;
290  return TRUE;
291  }
292 
293  return FALSE;
294 }
295 
296 static BOOL CALLBACK
298  const DOCKBAR *Dockbar,
299  PVOID Context,
300  HWND hwnd)
301 {
302  UNREFERENCED_PARAMETER(TbDocks);
305 
307  return TRUE;
308 }
309 
310 static BOOL CALLBACK
312  const DOCKBAR *Dockbar,
313  PVOID Context,
314  UINT *Index,
315  LPREBARBANDINFO rbi)
316 {
317  switch (rbi->wID)
318  {
319  case ID_TOOLBAR_TEXT:
320  case ID_TOOLBAR_STANDARD:
321  {
322  SIZE Size;
323 
324  if (SendMessage(rbi->hwndChild,
326  0,
327  (LPARAM)&Size))
328  {
329  rbi->fStyle |= RBBS_USECHEVRON | RBBS_HIDETITLE;
330  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
331  rbi->cx = rbi->cxIdeal = Size.cx;
332  rbi->cxMinChild = 0;
333  rbi->cyMinChild = Size.cy;
334  }
335  break;
336  }
337 
338  case ID_TOOLBAR_TEST:
339  {
340  RECT rcBtn;
341 
342  if (GetWindowRect(rbi->hwndChild,
343  &rcBtn))
344  {
345  rbi->fStyle |= RBBS_HIDETITLE;
346  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE;
347  rbi->cx = rcBtn.right - rcBtn.left;
348  rbi->cxMinChild = 0;
349  rbi->cyMinChild = rcBtn.bottom - rcBtn.top;
350  }
351  break;
352  }
353  }
354  return TRUE;
355 }
356 
357 static VOID
359  HWND hWndControl,
360  BOOL Vert)
361 {
362  /* the toolbar changed from horizontal to vertical or vice versa... */
363  return;
364 }
365 
366 static VOID CALLBACK
368  const DOCKBAR *Dockbar,
369  PVOID Context,
370  DOCK_POSITION DockFrom,
371  DOCK_POSITION DockTo,
372  LPREBARBANDINFO rbi)
373 {
374  if (rbi->fMask & RBBIM_CHILD && rbi->hwndChild != NULL)
375  {
376  switch (rbi->wID)
377  {
378  case ID_TOOLBAR_TEXT:
379  case ID_TOOLBAR_STANDARD:
380  {
381  SIZE Size;
382  BOOL Vert;
383  DWORD dwStyle = (DWORD)SendMessage(rbi->hwndChild,
384  TB_GETSTYLE,
385  0,
386  0);
387  switch (DockTo)
388  {
389  case LEFT_DOCK:
390  case RIGHT_DOCK:
391  dwStyle |= CCS_VERT | TBSTYLE_WRAPABLE;
392  Vert = TRUE;
393  break;
394 
395  default:
396  dwStyle &= ~(CCS_VERT | TBSTYLE_WRAPABLE);
397  Vert = FALSE;
398  break;
399  }
400 
401  SendMessage(rbi->hwndChild,
402  TB_SETSTYLE,
403  0,
404  (LPARAM)dwStyle);
405 
406  ToolbarUpdateControlSpaces(rbi->hwndChild,
408 
409  if (SendMessage(rbi->hwndChild,
411  0,
412  (LPARAM)&Size))
413  {
414  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
415  rbi->cx = rbi->cxIdeal = (Vert ? Size.cy : Size.cx);
416  rbi->cxMinChild = 0;
417  rbi->cyMinChild = (Vert ? Size.cx : Size.cy);
418  }
419  break;
420  }
421 
422  case ID_TOOLBAR_TEST:
423  {
424  if (DockTo == NO_DOCK)
425  {
426  rbi->fMask |= RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
427  rbi->cx = rbi->cxIdeal = 150;
428  rbi->cxMinChild = 0;
429  rbi->cyMinChild = 40;
430  }
431  break;
432  }
433  }
434  }
435 }
436 
437 static VOID CALLBACK
439  const DOCKBAR *Dockbar,
440  PVOID Context,
441  HWND hwndChild,
442  LPNMREBARCHEVRON lpnm)
443 {
444  switch (lpnm->wID)
445  {
446  case ID_TOOLBAR_STANDARD:
447  {
449  HWND_DESKTOP,
450  (LPPOINT)&lpnm->rc,
451  2);
452  /* Create a popup menu for all toolbar icons hidden */
453  break;
454  }
455  }
456 }
457 
458 static VOID
460  PRECT wndOldPos)
461 {
462  RECT wndNewPos, TbRect;
463  INT i, xMoved, yMoved;
464  PFLT_WND WndArr[NUM_FLT_WND];
465 
466  if (GetWindowRect(Info->hSelf,
467  &wndNewPos))
468  {
469 
470  xMoved = wndNewPos.left - wndOldPos->left;
471  yMoved = wndNewPos.top - wndOldPos->top;
472 
473  /* store the pointers in an array */
474  WndArr[0] = Info->fltTools;
475  WndArr[1] = Info->fltColors;
476  WndArr[2] = Info->fltHistory;
477 
478  for (i = 0; i < NUM_FLT_WND; i++)
479  {
480  GetWindowRect(WndArr[i]->hSelf,
481  &TbRect);
482 
483  WndArr[i]->x = TbRect.left + xMoved;
484  WndArr[i]->y = TbRect.top + yMoved;
485 
486  MoveWindow(WndArr[i]->hSelf,
487  WndArr[i]->x,
488  WndArr[i]->y,
489  WndArr[i]->Width,
490  WndArr[i]->Height,
491  TRUE);
492  }
493 
494  CopyMemory(wndOldPos,
495  &wndNewPos,
496  sizeof(wndNewPos));
497  }
498 }
499 
500 
501 static VOID
503 {
504  RECT rect;
505 
506  if (GetWindowRect(Info->hMdiClient,
507  &rect))
508  {
509 
510  /* tools datum */
511  MoveWindow(Info->fltTools->hSelf,
512  rect.left + 5,
513  rect.top + 5,
514  Info->fltTools->Width,
515  Info->fltTools->Height,
516  TRUE);
517 
518  /* colors datum */
519  MoveWindow(Info->fltColors->hSelf,
520  rect.left + 5,
521  rect.bottom - Info->fltColors->Height - 5,
522  Info->fltColors->Width,
523  Info->fltColors->Height,
524  TRUE);
525 
526  /* history datum */
527  MoveWindow(Info->fltHistory->hSelf,
528  rect.right - Info->fltHistory->Width - 5,
529  rect.top + 5,
530  Info->fltHistory->Width,
531  Info->fltHistory->Height,
532  TRUE);
533  }
534 }
535 
536 static VOID
538 {
539  RECT rect;
540  HMENU hMenu;
541  UINT Res;
542  PFLT_WND WndArr[NUM_FLT_WND]; /* temp array for looping */
543  INT i;
544 
545  Info->fltTools = HeapAlloc(ProcessHeap,
547  sizeof(FLT_WND));
548  Info->fltColors = HeapAlloc(ProcessHeap,
550  sizeof(FLT_WND));
551  Info->fltHistory = HeapAlloc(ProcessHeap,
553  sizeof(FLT_WND));
554 
555  /* set window dimensions */
556  Info->fltTools->Width = 53;
557  Info->fltTools->Height = 300;
558  Info->fltColors->Width = 200;
559  Info->fltColors->Height = 200;
560  Info->fltHistory->Width = 150;
561  Info->fltHistory->Height = 150;
562 
563  if (! GetWindowRect(Info->hMdiClient,
564  &rect))
565  {
566  return;
567  }
568 
569  /* Set window datums */
570  Info->fltTools->x = rect.left + 5;
571  Info->fltTools->y = rect.top + 5;
572 
573  Info->fltColors->x = rect.left + 5;
574  Info->fltColors->y = rect.bottom - Info->fltColors->Height - 5;
575 
576  Info->fltHistory->x = rect.right - Info->fltHistory->Width - 5;
577  Info->fltHistory->y = rect.top + 5;
578 
579  /* save pointers into array incrementing within the loop*/
580  WndArr[0] = Info->fltTools;
581  WndArr[1] = Info->fltColors;
582  WndArr[2] = Info->fltHistory;
583 
584  for (i = 0, Res = IDS_FLT_TOOLS; Res < IDS_FLT_TOOLS + NUM_FLT_WND; Res++, i++)
585  {
586  if (! AllocAndLoadString(&WndArr[i]->lpName,
587  hInstance,
588  Res))
589  {
590  WndArr[i]->lpName = NULL;
591  }
592 
594  TEXT("ImageSoftFloatWndClass"),
595  WndArr[i]->lpName,
597  WndArr[i]->x,
598  WndArr[i]->y,
599  WndArr[i]->Width,
600  WndArr[i]->Height,
601  Info->hSelf,
602  NULL,
603  hInstance,
604  WndArr[i]);
605  ShowWindow(WndArr[i]->hSelf, SW_HIDE);
606  }
607 
608  hMenu = GetMenu(Info->hSelf);
609 
610  if (Info->fltTools->hSelf != NULL)
611  {
613  {
614  CheckMenuItem(hMenu,
615  ID_TOOLS,
616  MF_CHECKED);
617 
618  ShowHideWindow(Info->fltTools->hSelf);
619  }
620  }
621 
622  if (Info->fltColors->hSelf != NULL)
623  {
625  {
626 
627  }
628  }
629 
630  if (Info->fltHistory->hSelf != NULL)
631  {
633  {
634 
635  }
636  }
637 
638 }
639 
640 static VOID
642 {
643  if (Info->fltTools != NULL)
644  HeapFree(ProcessHeap, 0, Info->fltTools);
645 
646  if (Info->fltColors != NULL)
647  HeapFree(ProcessHeap, 0, Info->fltColors);
648 
649  if (Info->fltHistory != NULL)
650  HeapFree(ProcessHeap, 0, Info->fltHistory);
651 }
652 
653 
654 
661 };
662 
663 static VOID
665 {
666  UINT i;
667 
668  for (i = 0; i < ARRAYSIZE(MainDockBars); i++)
669  {
670  /* FIXME - lookup whether to display the toolbar */
671  TbdAddToolbar(&Info->ToolDocks,
672  &MainDockBars[i],
673  Info,
675  }
676 
678 }
679 
680 static VOID CALLBACK
682  LONG cx,
683  LONG cy)
684 {
685  RECT rcClient = {0};
686  RECT rcStatus = {0};
687  HDWP dwp;
688  INT DocksVisible;
690 
691  /* Calculate the MDI client rectangle */
692  rcClient.right = cx;
693  rcClient.bottom = cy;
694 
695  if (Info->hStatus != NULL)
696  {
697  GetWindowRect(Info->hStatus,
698  &rcStatus);
699  rcClient.bottom -= (rcStatus.bottom - rcStatus.top);
700  }
701 
702  /* Adjust the client rect if docked toolbars are visible */
703  DocksVisible = TbdAdjustUpdateClientRect(&Info->ToolDocks,
704  &rcClient);
705 
706  dwp = BeginDeferWindowPos(2 + DocksVisible);
707  if (dwp != NULL)
708  {
709  /* Update the toolbar docks */
710  if (DocksVisible != 0)
711  {
712  dwp = TbdDeferDocks(dwp,
713  &Info->ToolDocks);
714  if (dwp == NULL)
715  return;
716  }
717 
718  /* Update the MDI client */
719  if (Info->hMdiClient != NULL)
720  {
721  dwp = DeferWindowPos(dwp,
722  Info->hMdiClient,
723  NULL,
724  rcClient.left,
725  rcClient.top,
726  rcClient.right - rcClient.left,
727  rcClient.bottom - rcClient.top,
728  SWP_NOZORDER);
729  if (dwp == NULL)
730  return;
731  }
732 
733  /* Update the status bar */
734  if (Info->hStatus != NULL)
735  {
736  dwp = DeferWindowPos(dwp,
737  Info->hStatus,
738  NULL,
739  0,
740  cy - (rcStatus.bottom - rcStatus.top),
741  cx,
742  rcStatus.bottom - rcStatus.top,
743  SWP_NOZORDER);
744  if (dwp == NULL)
745  return;
746  }
747 
748  EndDeferWindowPos(dwp);
749  }
750 }
751 
752 static VOID
754 {
755  CLIENTCREATESTRUCT ccs;
756  INT statwidths[] = {110, -1};
757 
758  /* FIXME - create controls and initialize the application */
759 
760  /* create the status bar */
761  Info->hStatus = CreateWindowEx(0,
763  NULL,
765  0,
766  0,
767  0,
768  0,
769  Info->hSelf,
771  hInstance,
772  NULL);
773 
774  if (Info->hStatus != NULL)
775  SendMessage(Info->hStatus,
776  SB_SETPARTS,
777  ARRAYSIZE(statwidths),
778  (LPARAM)statwidths);
779 
780  /* create the MDI client window */
781  ccs.hWindowMenu = GetSubMenu(GetMenu(Info->hSelf),
785  TEXT("MDICLIENT"),
786  NULL,
788  0,
789  0,
790  0,
791  0,
792  Info->hSelf,
793  NULL,
794  hInstance,
795  &ccs);
796 
797  TbdInitializeDocks(&Info->ToolDocks,
798  Info->hSelf,
799  Info,
800  MainWndResize);
801 
803 
804  /* initialize file open/save structure */
805  FileInitialize(Info->hSelf);
806 }
807 
808 static VOID
810  WORD CmdId,
811  HWND hControl)
812 {
813  static TCHAR szFileName[MAX_PATH];
814  static TCHAR szImageName[MAX_PATH];
815 
816  UNREFERENCED_PARAMETER(hControl);
817 
818  switch (CmdId)
819  {
820  case ID_NEW:
821  {
822  MessageBox(NULL, _T("Not yet implemented"), NULL, 0);
823  }
824  break;
825 
826  case ID_OPEN:
827  {
828  OPEN_IMAGE_EDIT_INFO OpenInfo;
829 
830  if (DoOpenFile(Info->hSelf,
831  szFileName, /* full file path */
832  szImageName)) /* file name */
833  {
834  OpenInfo.CreateNew = FALSE;
835 
836  OpenInfo.Open.lpImagePath = szFileName;
837  OpenInfo.lpImageName = szImageName;
838 
840  &OpenInfo);
841 
842  /* FIXME: move flt wnd's if scroll bars show
843  MainWndResetFloatingWindows(Info->hMdiClient); */
844  }
845 
846  }
847  break;
848 
849  case ID_TOOLS:
850  {
851  HMENU hMenu = GetMenu(Info->hSelf);
852 
853  if (hMenu != NULL)
854  {
855  UINT uCheck = MF_CHECKED;
856 
857  if (ShowHideWindow(Info->fltTools->hSelf))
858  uCheck = MF_UNCHECKED;
859 
860  CheckMenuItem(hMenu,
861  ID_TOOLS,
862  uCheck);
863  }
864  }
865  break;
866 
867  case ID_COLOR:
868  {
869  HMENU hMenu = GetMenu(Info->hSelf);
870 
871  if (hMenu != NULL)
872  {
873  UINT uCheck = MF_CHECKED;
874 
875  if (ShowHideWindow(Info->fltColors->hSelf))
876  uCheck = MF_UNCHECKED;
877 
878  CheckMenuItem(hMenu,
879  ID_COLOR,
880  uCheck);
881  }
882  }
883  break;
884 
885  case ID_HISTORY:
886  {
887  HMENU hMenu = GetMenu(Info->hSelf);
888 
889  if (hMenu != NULL)
890  {
891  UINT uCheck = MF_CHECKED;
892 
893  if (ShowHideWindow(Info->fltHistory->hSelf))
894  uCheck = MF_UNCHECKED;
895 
896  CheckMenuItem(hMenu,
897  ID_HISTORY,
898  uCheck);
899  }
900  }
901  break;
902 
903  case ID_BRIGHTNESS:
906  Info->hSelf,
908  (LPARAM)Info);
909  break;
910 
911  case ID_CONTRAST:
912  /* FIXME : Create a window for contrast */
913  break;
914 
915  case ID_BLACKANDWHITE:
916  {
917  if (Info->ImageEditors)
918  {
919  DisplayBlackAndWhite(Info->ImageEditors->hSelf,
920  Info->ImageEditors->hDCMem,
921  Info->ImageEditors->hBitmap);
922  }
923  }
924  break;
925 
926  case ID_INVERTCOLORS:
927  {
928  if (Info->ImageEditors)
929  {
930  DisplayInvertedColors(Info->ImageEditors->hSelf,
931  Info->ImageEditors->hDCMem,
932  Info->ImageEditors->hBitmap);
933  }
934  }
935  break;
936 
937  case ID_BLUR:
938  {
939  if (Info->ImageEditors)
940  {
941  DisplayBlur(Info->ImageEditors->hSelf,
942  Info->ImageEditors->hDCMem,
943  Info->ImageEditors->hBitmap);
944  }
945  }
946  break;
947 
948  case ID_SHARPEN:
949  {
950  if (Info->ImageEditors)
951  {
952  DisplaySharpness(Info->ImageEditors->hSelf,
953  Info->ImageEditors->hDCMem,
954  Info->ImageEditors->hBitmap);
955  }
956  }
957  break;
958 
959  case ID_EXIT:
960  SendMessage(Info->hSelf,
961  WM_CLOSE,
962  0,
963  0);
964  break;
965 
966  /* Window Menu */
967  case ID_WINDOW_TILE_HORZ:
968  SendMessage(Info->hMdiClient,
969  WM_MDITILE,
971  0);
972  break;
973 
974  case ID_WINDOW_TILE_VERT:
975  SendMessage(Info->hMdiClient,
976  WM_MDITILE,
978  0);
979  break;
980 
981  case ID_WINDOW_CASCADE:
982  SendMessage(Info->hMdiClient,
984  0,
985  0);
986  break;
987 
988  case ID_WINDOW_ARRANGE:
989  SendMessage(Info->hMdiClient,
991  0,
992  0);
993  break;
994 
995  case ID_WINDOW_NEXT:
996  SendMessage(Info->hMdiClient,
997  WM_MDINEXT,
998  0,
999  0);
1000  break;
1001 
1002  /* Help Menu */
1003  case ID_ABOUT:
1006  Info->hSelf,
1007  AboutDialogProc);
1008  break;
1009  }
1010 }
1011 
1012 static VOID
1014 {
1015  /* FIXME - cleanup allocated resources */
1016 
1018 }
1019 
1020 
1021 static VOID
1023 {
1024  if (Info->hStatus != NULL)
1025  {
1026  SendMessage(Info->hStatus,
1027  SB_SIMPLE,
1028  (WPARAM)Info->InMenuLoop,
1029  0);
1030  }
1031 }
1032 
1033 static BOOL
1035  WORD CmdId,
1036  const MENU_HINT *HintArray,
1037  DWORD HintsCount,
1038  UINT DefHintId)
1039 {
1040  BOOL Found = FALSE;
1041  const MENU_HINT *LastHint;
1042  UINT HintId = DefHintId;
1043 
1044  LastHint = HintArray + HintsCount;
1045  while (HintArray != LastHint)
1046  {
1047  if (HintArray->CmdId == CmdId)
1048  {
1049  HintId = HintArray->HintId;
1050  Found = TRUE;
1051  break;
1052  }
1053  HintArray++;
1054  }
1055 
1056  StatusBarLoadString(Info->hStatus,
1057  SB_SIMPLEID,
1058  hInstance,
1059  HintId);
1060 
1061  return Found;
1062 }
1063 
1064 static LRESULT CALLBACK
1066  UINT uMsg,
1067  WPARAM wParam,
1068  LPARAM lParam)
1069 {
1071  LRESULT Ret = 0;
1072  static BOOL bLBMouseDown = FALSE;
1073  static RECT wndOldPos;
1074 
1075  /* Get the window context */
1077  GWLP_USERDATA);
1078  if (Info == NULL && uMsg != WM_CREATE)
1079  {
1080  goto HandleDefaultMessage;
1081  }
1082 
1083  switch (uMsg)
1084  {
1085  case WM_SIZE:
1086  {
1088  LOWORD(lParam),
1089  HIWORD(lParam));
1090  /* NOTE - do *not* forward this message to DefFrameProc! Otherwise the MDI client
1091  will attempt to resize itself */
1092 
1093  /* reposition the floating toolbars */
1094  if ((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_RESTORED))
1096 
1097  break;
1098  }
1099 
1100  case WM_NCLBUTTONDOWN:
1101  bLBMouseDown = TRUE;
1103  uMsg,
1104  wParam,
1105  lParam);
1106  break;
1107 
1108  case WM_NCLBUTTONUP:
1109 
1110  bLBMouseDown = FALSE;
1112  uMsg,
1113  wParam,
1114  lParam);
1115  break;
1116 
1117  case WM_MOVE:
1118  {
1119  /* if the main window is moved, move the toolbars too */
1120  if (bLBMouseDown)
1121  MainWndMoveFloatingWindows(Info, &wndOldPos);
1122  }
1123  break;
1124 
1125  case WM_NOTIFY:
1126  {
1127  UINT BarId;
1128  LPNMHDR pnmhdr = (LPNMHDR)lParam;
1129  if (!TbdHandleNotifications(&Info->ToolDocks,
1130  pnmhdr,
1131  &Ret))
1132  {
1133  if (TbdDockBarIdFromClientWindow(&Info->ToolDocks,
1134  pnmhdr->hwndFrom,
1135  &BarId))
1136  {
1137  switch (BarId)
1138  {
1139  case ID_TOOLBAR_TEXT:
1140  switch (pnmhdr->code)
1141  {
1142  case TBN_DELETINGBUTTON:
1143  {
1144  LPNMTOOLBAR lpnmtb = (LPNMTOOLBAR)lParam;
1145 
1147  &lpnmtb->tbButton);
1148  break;
1149  }
1150  }
1151  break;
1152  }
1153  }
1154  }
1155  break;
1156  }
1157 
1158  case WM_COMMAND:
1159  {
1161  LOWORD(wParam),
1162  (HWND)lParam);
1163  goto HandleDefaultMessage;
1164  }
1165 
1166  case WM_MENUSELECT:
1167  {
1168  if (Info->hStatus != NULL)
1169  {
1170  if (!MainWndMenuHint(Info,
1171  LOWORD(wParam),
1174  IDS_HINT_BLANK))
1175  {
1177  LOWORD(wParam),
1180  IDS_HINT_BLANK);
1181  }
1182  }
1183  break;
1184  }
1185 
1186  case WM_ENTERMENULOOP:
1187  {
1188  Info->InMenuLoop = TRUE;
1190  break;
1191  }
1192 
1193  case WM_EXITMENULOOP:
1194  {
1195  Info->InMenuLoop = FALSE;
1197  break;
1198  }
1199 
1200  case WM_CLOSE:
1201  {
1203  break;
1204  }
1205 
1206  case WM_ENABLE:
1207  {
1208  TbdHandleEnabling(&Info->ToolDocks,
1209  hwnd,
1210  (BOOL)wParam);
1211  goto HandleDefaultMessage;
1212  }
1213 
1214  case WM_NCACTIVATE:
1215  {
1216  TbdHandleActivation(&Info->ToolDocks,
1217  hwnd,
1218  &wParam,
1219  &lParam);
1220  goto HandleDefaultMessage;
1221  }
1222 
1223  case WM_ACTIVATEAPP:
1224  {
1225  //TbdShowFloatingToolbars(&Info->ToolDocks,
1226  // (BOOL)wParam);
1227  goto HandleDefaultMessage;
1228  }
1229 
1230  case WM_CREATE:
1231  {
1232  Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams);
1233 
1234  /* Initialize the main window context */
1235  Info->hSelf = hwnd;
1236 
1238  GWLP_USERDATA,
1239  (LONG_PTR)Info);
1240 
1241  InitMainWnd(Info);
1242 
1243  /* Show the window */
1244  ShowWindow(hwnd,
1245  Info->nCmdShow);
1246  /* get the windows position */
1248  &wndOldPos);
1249 
1250  break;
1251  }
1252 
1253  case WM_DESTROY:
1254  {
1256 
1258  0,
1259  Info);
1261  GWLP_USERDATA,
1262  0);
1263 
1264  /* Break the message queue loop */
1265  PostQuitMessage(0);
1266  break;
1267  }
1268 
1269  default:
1270  {
1271 HandleDefaultMessage:
1272  if (Info != NULL && Info->hMdiClient != NULL)
1273  {
1274  Ret = DefFrameProc(hwnd,
1275  Info->hMdiClient,
1276  uMsg,
1277  wParam,
1278  lParam);
1279  }
1280  else
1281  {
1282  Ret = DefWindowProc(hwnd,
1283  uMsg,
1284  wParam,
1285  lParam);
1286  }
1287  break;
1288  }
1289  }
1290 
1291  return Ret;
1292 }
1293 
1296  PVOID *Info)
1297 {
1298  MDI_EDITOR_TYPE EditorType;
1299 
1300  if (MainWnd->ActiveEditor != NULL)
1301  {
1302  EditorType = *((PMDI_EDITOR_TYPE)MainWnd->ActiveEditor);
1303  *Info = MainWnd->ActiveEditor;
1304  }
1305  else
1306  {
1307  EditorType = metUnknown;
1308  *Info = NULL;
1309  }
1310 
1311  return EditorType;
1312 }
1313 
1314 VOID
1316  HWND hDeactivate,
1317  HWND hActivate)
1318 {
1319  PMDI_EDITOR_TYPE EditorType;
1320 
1321  /* FIXME - optimize light weight switching
1322  when switching from and to an editor of same type */
1323 
1324  if (hDeactivate != NULL)
1325  {
1326  EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hDeactivate,
1327  GWLP_USERDATA);
1328  if (EditorType != NULL)
1329  {
1330  switch (*EditorType)
1331  {
1332  case metImageEditor:
1334  FALSE);
1335  break;
1336 
1337  default:
1338  break;
1339  }
1340 
1341  Info->ActiveEditor = NULL;
1342  }
1343  }
1344 
1345  if (hActivate != NULL)
1346  {
1347  EditorType = (PMDI_EDITOR_TYPE)GetWindowLongPtr(hActivate,
1348  GWLP_USERDATA);
1349  if (EditorType != NULL)
1350  {
1351  Info->ActiveEditor = EditorType;
1352 
1353  switch (*EditorType)
1354  {
1355  case metImageEditor:
1357  TRUE);
1358  break;
1359 
1360  default:
1361  break;
1362  }
1363  }
1364  }
1365 }
1366 
1367 HWND
1369  int nCmdShow)
1370 {
1372  HWND hMainWnd = NULL;
1373 
1375  0,
1376  sizeof(MAIN_WND_INFO));
1377  if (Info != NULL)
1378  {
1379  ZeroMemory(Info,
1380  sizeof(MAIN_WND_INFO));
1381  Info->nCmdShow = nCmdShow;
1382 
1383  /* FIXME - load the window position from the registry */
1384 
1387  lpCaption,
1389  CW_USEDEFAULT,
1390  CW_USEDEFAULT,
1391  CW_USEDEFAULT,
1392  CW_USEDEFAULT,
1393  NULL,
1394  NULL,
1395  hInstance,
1396  Info);
1397  if (hMainWnd == NULL)
1398  {
1400  0,
1401  Info);
1402  }
1403  }
1404 
1405  return hMainWnd;
1406 }
1407 
1408 BOOL
1410  LPMSG lpMsg)
1411 {
1413 
1414  /* Get the window context */
1416  GWLP_USERDATA);
1417  if (Info != NULL && Info->hMdiClient != NULL)
1418  {
1419  return TranslateMDISysAccel(Info->hMdiClient,
1420  lpMsg);
1421  }
1422 
1423  return FALSE;
1424 }
1425 
1426 BOOL
1428 {
1429  WNDCLASSEX wc = {0};
1430 
1431  wc.cbSize = sizeof(wc);
1432  wc.lpfnWndProc = MainWndProc;
1433  wc.hInstance = hInstance;
1434  wc.hIcon = LoadIcon(hInstance,
1436  wc.hCursor = LoadCursor(NULL,
1437  IDC_ARROW);
1438  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1443  IMAGE_ICON,
1444  16,
1445  16,
1446  LR_SHARED);
1447 
1448  return RegisterClassEx(&wc) != (ATOM)0;
1449 }
1450 
1451 VOID
1453 {
1455  hInstance);
1456 }
#define IDS_TOOLBAR_TEXT
Definition: resource.h:302
#define ID_MDI_WINDOWMENU
Definition: mainwnd.c:6
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1679
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define IDS_HINT_EXIT
Definition: resource.h:94
#define WS_POPUPWINDOW
Definition: pedump.c:638
#define ID_STATUSBAR
Definition: resource.h:43
#define IDS_HINT_BLANK
Definition: resource.h:92
#define ID_TOOLBAR_TEST
Definition: mainwnd.c:101
#define ID_TXTLEFT
Definition: resource.h:54
#define CBS_SORT
Definition: winuser.h:292
#define ID_TXTRIGHT
Definition: resource.h:56
#define LPNMTOOLBAR
Definition: commctrl.h:1457
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TBICON_SAVE
Definition: resource.h:141
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
HWND hSelf
Definition: precomp.h:46
#define IDR_MAINMENU
Definition: resource.h:40
MDI_EDITOR_TYPE MainWndGetCurrentEditor(PMAIN_WND_INFO MainWnd, PVOID *Info)
Definition: mainwnd.c:1295
static HICON
Definition: imagelist.c:84
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
LPCSTR lpszMenuName
Definition: winuser.h:3190
#define IDS_HINT_STATUS
Definition: resource.h:116
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define LR_SHARED
Definition: winuser.h:1094
#define IMAGE_ICON
Definition: winuser.h:212
#define IDC_STATUSBAR
Definition: resource.h:12
#define IDD_BRIGHTNESS
Definition: resource.h:260
#define RegisterClassEx
Definition: winuser.h:5817
#define RBBIM_CHILD
Definition: commctrl.h:1506
static const TCHAR szToolbarTest[]
Definition: mainwnd.c:102
static VOID CALLBACK MainWndResize(PVOID Context, LONG cx, LONG cy)
Definition: mainwnd.c:681
#define SC_RESTORE
Definition: winuser.h:2578
UINT HintId
Definition: precomp.h:89
#define IDS_HINT_TOOLS
Definition: resource.h:113
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HCURSOR hCursor
Definition: winuser.h:3188
WNDPROC lpfnWndProc
Definition: winuser.h:3183
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define ID_TXTFONTSIZE
Definition: resource.h:58
#define IDS_TOOLBAR_STANDARD
Definition: resource.h:300
BOOL FloatToolbarCreateHistoryGui(PMAIN_WND_INFO Info)
Definition: floatwindow.c:276
LPCSTR lpszClassName
Definition: winuser.h:3191
WORD ATOM
Definition: dimm.idl:113
#define SIZE_MAXIMIZED
Definition: winuser.h:2487
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define ID_BLACKANDWHITE
Definition: resource.h:85
TBBUTTON TextButtons[]
Definition: mainwnd.c:35
#define SW_HIDE
Definition: winuser.h:762
#define TBICON_BOLD
Definition: resource.h:163
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
INT y
Definition: precomp.h:49
static VOID MainWndCreateFloatWindows(PMAIN_WND_INFO Info)
Definition: mainwnd.c:537
#define ID_COPY
Definition: resource.h:32
#define TB_SETSTYLE
Definition: commctrl.h:1158
#define SIZE_RESTORED
Definition: winuser.h:2485
#define WM_MDICASCADE
Definition: winuser.h:1806
PVOID ActiveEditor
Definition: mainwnd.h:25
#define CALLBACK
Definition: compat.h:35
#define IDB_MAINNEW
Definition: resource.h:150
_In_ LPCSTR lpName
Definition: winbase.h:2768
VOID ToolbarUpdateControlSpaces(HWND hWndToolbar, ToolbarChangeControlCallback ChangeCallback)
Definition: misc.c:240
#define ID_BOLD
Definition: resource.h:51
BOOL ToolbarInsertSpaceForControl(HWND hWndToolbar, HWND hWndControl, INT Index, INT iCmd, BOOL HideVertical)
Definition: misc.c:297
LONG top
Definition: windef.h:307
#define WS_DLGFRAME
Definition: pedump.c:626
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IDS_HINT_SAVE
Definition: resource.h:106
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define ZeroMemory
Definition: winbase.h:1664
#define WM_MOVE
Definition: winuser.h:1597
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TBICON_PASTE
Definition: resource.h:146
#define TBICON_REDO
Definition: resource.h:148
UINT_PTR WPARAM
Definition: windef.h:207
#define ID_WINDOW_TILE_VERT
Definition: resource.h:49
#define WS_CHILD
Definition: pedump.c:617
HICON hIconSm
Definition: winuser.h:3192
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1237
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define TB_GETMAXSIZE
Definition: commctrl.h:1189
static BOOL CALLBACK MainWndToolbarInsertBand(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, UINT *Index, LPREBARBANDINFO rbi)
Definition: mainwnd.c:311
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:308
BOOL DisplayBlur(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:196
#define STATUSCLASSNAME
Definition: commctrl.h:1939
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#define ID_PRINTPRE
Definition: resource.h:28
BOOL FloatToolbarCreateColorsGui(PMAIN_WND_INFO Info)
Definition: floatwindow.c:168
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:121
struct tagNMHDR * LPNMHDR
#define WM_ENABLE
Definition: winuser.h:1602
#define DefFrameProc
Definition: ros2win.h:32
#define CCS_VERT
Definition: commctrl.h:2249
#define TBICON_OPEN
Definition: resource.h:140
#define ID_UNDO
Definition: resource.h:35
VOID FileInitialize(IN HWND hwnd)
Definition: opensave.c:13
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define IDS_HINT_OPEN
Definition: resource.h:103
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
static VOID FillFontStyleComboList(HWND hwndCombo)
Definition: charmap.c:126
UINT code
Definition: winuser.h:3139
static const TCHAR szMainWndClass[]
Definition: mainwnd.c:3
#define DialogBox
Definition: winuser.h:5741
#define RBBIM_SIZE
Definition: commctrl.h:1508
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define WM_MDIICONARRANGE
Definition: winuser.h:1807
static VOID MainWndCommand(PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
Definition: mainwnd.c:809
#define BTNS_BUTTON
Definition: commctrl.h:998
static VOID CALLBACK MainWndToolbarDockBand(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, DOCK_POSITION DockFrom, DOCK_POSITION DockTo, LPREBARBANDINFO rbi)
Definition: mainwnd.c:367
#define FALSE
Definition: types.h:117
#define WM_NCACTIVATE
Definition: winuser.h:1675
HINSTANCE hInstance
Definition: winuser.h:3186
#define ID_SHARPEN
Definition: resource.h:88
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static VOID DoOpenFile(PINFO pInfo)
Definition: connectdialog.c:34
#define ID_BLANK
Definition: resource.h:44
#define WM_ENTERMENULOOP
Definition: winuser.h:1791
#define IDD_ABOUTBOX
Definition: resource.h:8
#define MDITILE_HORIZONTAL
Definition: winuser.h:2168
#define ID_TXTCENTER
Definition: resource.h:55
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_MENUSELECT
Definition: winuser.h:1734
#define SB_SIMPLEID
Definition: precomp.h:15
#define CreateWindowEx
Definition: winuser.h:5735
#define SC_MAXIMIZE
Definition: winuser.h:2568
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GWLP_USERDATA
Definition: treelist.c:63
#define TBICON_NEW
Definition: resource.h:139
#define SB_SIMPLE
Definition: commctrl.h:1958
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:585
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
#define IDI_IMAGESOFTICON
Definition: resource.h:13
#define MAKELONG(a, b)
Definition: typedefs.h:249
WORD CmdId
Definition: precomp.h:88
#define WM_EXITMENULOOP
Definition: winuser.h:1792
#define TBICON_COPY
Definition: resource.h:145
static const TCHAR szToolbarStandard[]
Definition: mainwnd.c:96
#define WM_MDINEXT
Definition: winuser.h:1803
LONG_PTR LPARAM
Definition: windef.h:208
UINT cbSize
Definition: winuser.h:3181
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2246
static const DOCKBAR MainDockBars[]
Definition: mainwnd.c:105
DOCK_POSITION
Definition: tooldock.h:2
#define ID_ABOUT
Definition: charmap.c:18
static INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:15
#define RBBS_HIDETITLE
return Found
Definition: dirsup.c:1270
BOOL CreateImageEditWindow(PMAIN_WND_INFO MainWnd, POPEN_IMAGE_EDIT_INFO OpenInfo)
Definition: imgedwnd.c:459
#define WC_COMBOBOX
Definition: commctrl.h:4718
#define IDS_HINT_PRINT
Definition: resource.h:108
#define ID_SAVEAS
Definition: resource.h:27
#define TBICON_CUT
Definition: resource.h:144
#define CBS_HASSTRINGS
Definition: winuser.h:285
HBRUSH hbrBackground
Definition: winuser.h:3189
VOID TbdInitializeDocks(PTOOLBAR_DOCKS TbDocks, HWND hWndParent, PVOID Context, PDOCKBAR_PARENTRESIZE ParentResizeProc)
Definition: tooldock.c:1064
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1596
UINT BarId
Definition: tooldock.h:13
#define ID_WINDOW_CASCADE
Definition: resource.h:79
#define MF_CHECKED
Definition: winuser.h:132
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
char TCHAR
Definition: xmlstorage.h:189
#define IDS_HINT_SYS_MOVE
Definition: resource.h:119
#define TBICON_PRINT
Definition: resource.h:54
BOOL MainWndTranslateMDISysAccel(HWND hwnd, LPMSG lpMsg)
Definition: mainwnd.c:1409
#define _T(x)
Definition: vfdio.h:22
#define ID_CLOSE
Definition: resource.h:24
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
INT_PTR CALLBACK BrightnessProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: brightness.c:313
#define BTNS_SEP
Definition: commctrl.h:999
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static VOID MainWndMoveFloatingWindows(PMAIN_WND_INFO Info, PRECT wndOldPos)
Definition: mainwnd.c:459
static BOOL CALLBACK MainWndDestroyToolbarClient(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hwnd)
Definition: mainwnd.c:297
HDWP TbdDeferDocks(HDWP hWinPosInfo, PTOOLBAR_DOCKS TbDocks)
Definition: tooldock.c:71
#define SBARS_SIZEGRIP
Definition: commctrl.h:1923
#define TB_BMP_WIDTH
Definition: precomp.h:20
#define WM_SIZE
Definition: winuser.h:1598
#define MDITILE_VERTICAL
Definition: winuser.h:2169
_In_ WDFCOLLECTION _In_ ULONG Index
#define IDS_HINT_NEXT
Definition: resource.h:122
#define IDS_HINT_CLOSE
Definition: resource.h:104
static VOID TbCustomControlChange(HWND hWndToolbar, HWND hWndControl, BOOL Vert)
Definition: mainwnd.c:358
#define ID_OPEN
Definition: resource.h:23
#define TBICON_ITALIC
Definition: resource.h:164
#define IDS_HINT_CLOSEALL
Definition: resource.h:105
TBBUTTON StdButtons[]
Definition: mainwnd.c:10
BOOL FloatToolbarCreateToolsGui(PMAIN_WND_INFO Info)
Definition: floatwindow.c:55
#define WM_CLOSE
Definition: winuser.h:1608
#define ID_HISTORY
Definition: resource.h:42
VOID FillFontSizeComboList(HWND hwndCombo)
Definition: font.c:83
#define MAX_PATH
Definition: compat.h:34
struct _MAIN_WND_INFO * PMAIN_WND_INFO
#define CopyMemory
Definition: winbase.h:1662
static const TCHAR szToolbarText[]
Definition: mainwnd.c:97
unsigned short WORD
Definition: ntddk_ex.h:93
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:118
static VOID CALLBACK MainWndToolbarChevronPushed(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hwndChild, LPNMREBARCHEVRON lpnm)
Definition: mainwnd.c:438
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ID_ITALIC
Definition: resource.h:52
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static VOID InitMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:753
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define ID_COLOR
Definition: definitions.h:121
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1507
#define IDS_HINT_PROP
Definition: resource.h:106
VOID UninitMainWindowImpl(VOID)
Definition: mainwnd.c:992
#define ID_SAVE
Definition: resource.h:26
#define WS_HSCROLL
Definition: pedump.c:628
#define TB_BMP_HEIGHT
Definition: precomp.h:21
#define CCS_NORESIZE
Definition: commctrl.h:2245
#define ID_CONTRAST
Definition: resource.h:84
BOOL DisplayInvertedColors(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:102
#define IDS_HINT_CASCADE
Definition: resource.h:118
#define IDS_HINT_SYS_SIZE
Definition: resource.h:120
#define DialogBoxParam
Definition: winuser.h:5744
#define ID_WINDOW_TILE_HORZ
Definition: resource.h:48
HWND hMainWnd
Definition: magnifier.c:32
#define NUM_FLT_WND
Definition: mainwnd.c:7
static VOID DestroyMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:1013
#define LPREBARBANDINFO
Definition: commctrl.h:1570
HICON hIcon
Definition: winuser.h:3187
INT TbdAdjustUpdateClientRect(PTOOLBAR_DOCKS TbDocks, PRECT rcClient)
Definition: tooldock.c:44
enum _MDI_EDITOR_TYPE MDI_EDITOR_TYPE
VOID TbdHandleActivation(PTOOLBAR_DOCKS TbDocks, HWND hWnd, WPARAM *wParam, LPARAM *lParam)
Definition: tooldock.c:992
#define COLOR_BTNFACE
Definition: winuser.h:922
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
#define IDS_HINT_COLORS
Definition: resource.h:114
#define TB_ADDBUTTONS
Definition: commctrl.h:1271
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define IDS_HINT_PRINTPRE
Definition: resource.h:109
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1136
#define IDS_HINT_ARRANGE
Definition: resource.h:121
#define ID_NEW
Definition: resource.h:22
#define RBBS_USECHEVRON
Definition: commctrl.h:1498
#define MessageBox
Definition: winuser.h:5802
BOOL ShowHideWindow(HWND hwnd)
Definition: floatwindow.c:45
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define IDB_TEXTBOLD
Definition: resource.h:170
#define WM_COMMAND
Definition: winuser.h:1727
static const MENU_HINT MainMenuHintTable[]
Definition: mainwnd.c:54
#define ID_REDO
Definition: resource.h:36
VOID MakeFlatCombo(HWND hwndCombo)
Definition: custcombo.c:199
HWND hwndFrom
Definition: winuser.h:3137
#define MF_UNCHECKED
Definition: winuser.h:204
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define ID_WINDOW_ARRANGE
Definition: resource.h:52
#define TBICON_PRINTPRE
Definition: resource.h:143
#define LoadCursor
Definition: winuser.h:5792
#define ID_ULINE
Definition: resource.h:53
#define ID_EXIT
Definition: resource.h:10
static VOID MainWndDestroyFloatWindows(PMAIN_WND_INFO Info)
Definition: mainwnd.c:641
#define ID_TOOLS
Definition: resource.h:40
HANDLE ProcessHeap
Definition: servman.c:15
struct _OPEN_IMAGE_EDIT_INFO::@1487::@1490 Open
#define ID_BLUR
Definition: resource.h:87
#define SC_MINIMIZE
Definition: winuser.h:2566
#define IDS_FLT_TOOLS
Definition: resource.h:8
#define ID_BRIGHTNESS
Definition: resource.h:83
#define TEXT(s)
Definition: k32.h:26
#define ID_PRINT
Definition: wordpad.h:39
#define WM_ACTIVATEAPP
Definition: winuser.h:1619
#define IDS_HINT_SAVEAS
Definition: resource.h:107
#define ID_TXTFONTNAME
Definition: resource.h:57
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define TBSTATE_CHECKED
Definition: commctrl.h:972
#define TBICON_TXTRIGHT
Definition: resource.h:168
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_ITEM_CALLBACKS MainWndDockBarCallbacks
Definition: mainwnd.c:655
#define ID_WINDOW_NEXT
Definition: resource.h:51
static const MENU_HINT SystemMenuHintTable[]
Definition: mainwnd.c:82
#define IDS_HINT_TILE_VERT
Definition: resource.h:120
HINSTANCE hInstance
Definition: mainwnd.c:15
#define CBS_DROPDOWN
Definition: winuser.h:283
#define SC_SIZE
Definition: winuser.h:2564
static BOOL MainWndMenuHint(PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
Definition: mainwnd.c:1034
BOOL TbdHandleNotifications(PTOOLBAR_DOCKS TbDocks, LPNMHDR pnmh, LRESULT *Result)
Definition: tooldock.c:291
#define ID_PROP
Definition: resource.h:15
BOOL TbdDockBarIdFromClientWindow(PTOOLBAR_DOCKS TbDocks, HWND hWndClient, UINT *Id)
Definition: tooldock.c:267
#define ID_PASTE
Definition: resource.h:33
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define TBICON_TXTCENTER
Definition: resource.h:167
#define HWND_DESKTOP
Definition: winuser.h:1199
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define WS_VSCROLL
Definition: pedump.c:627
static VOID UpdateMainStatusBar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:1022
static VOID MainWndResetFloatingWindows(PMAIN_WND_INFO Info)
Definition: mainwnd.c:502
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:122
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define SB_SETPARTS
Definition: commctrl.h:1954
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
VOID TbdHandleEnabling(PTOOLBAR_DOCKS TbDocks, HWND hWnd, BOOL Enable)
Definition: tooldock.c:972
#define TBICON_TXTLEFT
Definition: resource.h:166
#define ID_TOOLBAR_STANDARD
Definition: mainwnd.c:94
#define IDS_TOOLBAR_TEST
Definition: resource.h:301
static VOID CreateToolbars(PMAIN_WND_INFO Info)
Definition: mainwnd.c:664
#define IDC_ARROW
Definition: winuser.h:682
#define SC_MOVE
Definition: winuser.h:2565
_Out_opt_ int * cx
Definition: commctrl.h:585
#define SC_CLOSE
Definition: winuser.h:2572
#define TBICON_ULINE
Definition: resource.h:165
#define SendMessage
Definition: winuser.h:5823
#define IDS_HINT_HISTORY
Definition: resource.h:115
#define TBSTYLE_GROUP
Definition: commctrl.h:984
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define WM_CREATE
Definition: winuser.h:1595
#define CCS_NOMOVEY
Definition: commctrl.h:2243
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
#define ID_TOOLBAR_TEXT
Definition: mainwnd.c:95
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WM_NCLBUTTONUP
Definition: winuser.h:1680
#define HIWORD(l)
Definition: typedefs.h:247
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:1065
#define ID_CLOSEALL
Definition: resource.h:25
#define ID_INVERTCOLORS
Definition: resource.h:86
LONG bottom
Definition: windef.h:309
#define TBSTYLE_CHECK
Definition: commctrl.h:983
BOOL DisplaySharpness(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:357
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define LoadImage
Definition: winuser.h:5795
#define TB_GETSTYLE
Definition: commctrl.h:1159
#define IDS_HINT_TILE_HORZ
Definition: resource.h:119
#define SC_NEXTWINDOW
Definition: winuser.h:2570
#define LoadIcon
Definition: winuser.h:5793
#define GetWindowLongPtr
Definition: treelist.c:73
BOOL TbdAddToolbar(PTOOLBAR_DOCKS TbDocks, const DOCKBAR *Dockbar, PVOID Context, const DOCKBAR_ITEM_CALLBACKS *Callbacks)
Definition: tooldock.c:585
#define ID_MDI_FIRSTCHILD
Definition: mainwnd.c:5
enum _MDI_EDITOR_TYPE * PMDI_EDITOR_TYPE
BOOL InitMainWindowImpl(VOID)
Definition: mainwnd.c:966
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
LONG_PTR LRESULT
Definition: windef.h:209
INT x
Definition: precomp.h:48
VOID SetImageEditorEnvironment(PEDIT_WND_INFO Info, BOOL Setup)
Definition: imgedwnd.c:445
#define TBICON_UNDO
Definition: resource.h:147
#define WS_VISIBLE
Definition: pedump.c:620
#define UnregisterClass
Definition: winuser.h:5841
static BOOL CALLBACK MainWndCreateToolbarClient(struct _TOOLBAR_DOCKS *TbDocks, const DOCKBAR *Dockbar, PVOID Context, HWND hParent, HWND *hwnd)
Definition: mainwnd.c:113
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL ToolbarDeleteControlSpace(HWND hWndToolbar, const TBBUTTON *ptbButton)
Definition: misc.c:220
LPARAM lParam
Definition: combotst.c:139
#define ID_CUT
Definition: resource.h:31
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
VOID MainWndSwitchEditorContext(PMAIN_WND_INFO Info, HWND hDeactivate, HWND hActivate)
Definition: mainwnd.c:1315
LPTSTR lpName
Definition: precomp.h:47
static const TBBUTTON Buttons[]
Definition: mainwnd.c:18
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1511
#define TBN_DELETINGBUTTON
Definition: commctrl.h:1338
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190
#define WM_NOTIFY
Definition: richedit.h:61
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150
HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow)
Definition: mainwnd.c:925
#define WM_MDITILE
Definition: winuser.h:1805
#define IDS_HINT_NEW
Definition: resource.h:102
BOOL DisplayBlackAndWhite(HWND hwnd, HDC hdcMem, HBITMAP hBitmap)
Definition: adjust.c:5