ReactOS 0.4.15-dev-8434-g155a7c7
appview.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Applications Manager
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Application view class and other classes used by it
5 * COPYRIGHT: Copyright 2020 He Yang (1160386205@qq.com)
6 * Copyright 2022,2023 Mark Jansen <mark.jansen@reactos.org>
7 */
8
9#include "rapps.h"
10#include "appview.h"
11#include "gui.h"
12#include <windowsx.h>
13
14using namespace Gdiplus;
15
18
19// **** CMainToolbar ****
20
21VOID
23{
24 HICON hImage;
25
26 if (!(hImage =
28 {
29 return;
30 }
31
32 ImageList_AddIcon(hImageList, hImage);
33 DeleteObject(hImage);
34}
35
38{
39 HIMAGELIST hImageList;
40
41 /* Create the toolbar icon image list */
43 if (!hImageList)
44 {
45 return NULL;
46 }
47
55 AddImageToImageList(hImageList, IDI_EXIT);
56
57 return hImageList;
58}
59
60CMainToolbar::CMainToolbar() : m_iToolbarHeight(24), m_dButtonsWidthMax(0)
61{
62}
63
64VOID
66{
67 UINT idButton = (UINT)lpttt->hdr.idFrom;
68
69 switch (idButton)
70 {
71 case ID_EXIT:
72 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_EXIT);
73 break;
74
75 case ID_INSTALL:
76 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_INSTALL);
77 break;
78
79 case ID_UNINSTALL:
80 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
81 break;
82
83 case ID_MODIFY:
84 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_MODIFY);
85 break;
86
87 case ID_SETTINGS:
88 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SETTINGS);
89 break;
90
91 case ID_REFRESH:
92 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_REFRESH);
93 break;
94
95 case ID_RESETDB:
96 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE_DB);
97 break;
98 }
99}
100
101HWND
103{
104 CStringW szInstallBtn;
105 CStringW szUninstallBtn;
106 CStringW szModifyBtn;
107 CStringW szSelectAllBtn;
108 CStringW szRefreshBtn;
109 CStringW szUpdateDbBtn;
110
111 /* Load tooltip strings */
112 szInstallBtn.LoadStringW(IDS_TOOLTIP_INSTALL);
113 szUninstallBtn.LoadStringW(IDS_TOOLTIP_UNINSTALL);
114 szModifyBtn.LoadStringW(IDS_TOOLTIP_MODIFY);
115 szSelectAllBtn.LoadStringW(IDS_TOOLTIP_SELECT_ALL);
116 szRefreshBtn.LoadStringW(IDS_TOOLTIP_REFRESH);
117 szUpdateDbBtn.LoadStringW(IDS_TOOLTIP_UPDATE_DB);
118
119 /* Create buttons */
120 TBBUTTON Buttons[] = {
121 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
122 {0, ID_INSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szInstallBtn.GetString()},
123 {1, ID_UNINSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szUninstallBtn.GetString()},
124 {2, ID_MODIFY, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szModifyBtn.GetString()},
125 {3, ID_CHECK_ALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szSelectAllBtn.GetString()},
126 {-1, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
127 {4, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szRefreshBtn.GetString()},
128 {5, ID_RESETDB, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, (INT_PTR)szUpdateDbBtn.GetString()}};
129
130 m_hWnd = CreateWindowExW(
132 hwndParent, 0, hInst, NULL);
133
134 if (!m_hWnd)
135 {
136 return FALSE;
137 }
138
141
142 /* Set image list */
143 HIMAGELIST hImageList = InitImageList();
144
145 if (hImageList)
146 {
147 ImageList_Destroy(SetImageList(hImageList));
148 }
149
151
152 /* Remember ideal width to use as a max width of buttons */
153 SIZE size;
156
157 return m_hWnd;
158}
159
160VOID
162{
163 DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
165}
166
167VOID
169{
170 DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
172}
173
174DWORD
176{
177 return m_dButtonsWidthMax;
178}
179// **** CMainToolbar ****
180
181// **** CSearchBar ****
182
183CSearchBar::CSearchBar() : m_Width(180), m_Height(22)
184{
185}
186
187VOID
189{
191}
192
193HWND
195{
196 CStringW szBuf;
199 hwndParent, (HMENU)NULL, hInst, 0);
200
202 szBuf.LoadStringW(IDS_SEARCH_TEXT);
203 SetWindowTextW(szBuf);
204 return m_hWnd;
205}
206// **** CSearchBar ****
207
208// **** CComboBox ****
209
210CComboBox::CComboBox() : m_Width(80), m_Height(22)
211{
212}
213
214HWND
216{
220
222
223 for (int i = 0; i < (int)_countof(m_TypeStringID); i++)
224 {
225 CStringW szBuf;
226 szBuf.LoadStringW(m_TypeStringID[i]);
228 }
229
230 SendMessageW(CB_SETCURSEL, m_DefaultSelectType, 0); // select the first item
231
232 return m_hWnd;
233}
234// **** CComboBox ****
235
236// **** CAppRichEdit ****
237
238VOID
239CAppRichEdit::LoadAndInsertText(UINT uStringID, const CStringW &szText, DWORD TextFlags)
240{
241 CStringW szLoadedText;
242 if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID))
243 {
244 const DWORD StringFlags = CFE_BOLD;
245 InsertText(szLoadedText, StringFlags);
246 InsertText(szText, TextFlags);
247 }
248}
249
250VOID
252{
253 CStringW szLoadedText;
254 if (szLoadedText.LoadStringW(uStringID))
255 {
256 InsertText(L"\n", 0);
257 InsertText(szLoadedText, StringFlags);
258 InsertText(L"\n", 0);
259 }
260}
261
262VOID
264{
265 if (!Text.IsEmpty())
266 {
267 LoadAndInsertText(StringID, Text, TextFlags);
268 }
269}
270
271VOID
273{
274 CStringW szText;
275
276 szText.LoadStringW(IDS_WELCOME_TITLE);
277 SetText(szText, CFE_BOLD);
278
279 szText.LoadStringW(IDS_WELCOME_TEXT);
280 InsertText(szText, 0);
281
282 szText.LoadStringW(IDS_WELCOME_URL);
283 InsertText(szText, CFM_LINK);
284}
285// **** CAppRichEdit ****
286
287int
289{
291 switch (Event)
292 {
293 case ASYNCINET_DATA:
296 break;
301 break;
306 break;
307 case ASYNCINET_ERROR:
310 break;
311 default:
313 break;
314 }
315 return 0;
316}
317
318// **** CAppScrnshotPreview ****
319
320CAppScrnshotPreview::CAppScrnshotPreview(const CStringW &BasePath) : m_BasePath(BasePath)
321{
322}
323
324BOOL
326 HWND hwnd,
327 UINT Msg,
330 LRESULT &theResult,
331 DWORD dwMapId)
332{
333 theResult = 0;
334 switch (Msg)
335 {
336 case WM_CREATE:
339 break;
340 case WM_SIZE:
341 {
343 {
345
346 if (hBrokenImgIcon)
347 {
351 }
352 }
353 break;
354 }
356 {
359 AsyncInet = NULL;
360 switch (wParam)
361 {
362 case ERROR_SUCCESS:
363 if (ContentID == DownloadParam->ID)
364 {
365 DisplayFile(DownloadParam->DownloadFileName);
366 // send a message to trigger resizing
368 InvalidateRect(0, 0);
370 DownloadParam->DownloadFileName; // record tmp file path in order to delete it when cleanup
371 }
372 else
373 {
374 // the picture downloaded is already outdated. delete it.
375 DeleteFileW(DownloadParam->DownloadFileName);
376 }
377 break;
378 case ERROR_CANCELLED:
379 DeleteFileW(DownloadParam->DownloadFileName);
380 break;
381 default:
383 // send a message to trigger resizing
385 InvalidateRect(0, 0);
386 DeleteFileW(DownloadParam->DownloadFileName);
387 break;
388 }
389 delete DownloadParam;
390 break;
391 }
392 case WM_PAINT:
393 {
394 PAINTSTRUCT ps;
395 HDC hdc = BeginPaint(&ps);
396 CRect rect;
398
399 PaintOnDC(hdc, rect.Width(), rect.Height(), ps.fErase);
400
401 EndPaint(&ps);
402 break;
403 }
404 case WM_PRINTCLIENT:
405 {
407 {
408 if (!IsWindowVisible())
409 break;
410 }
411 CRect rect;
413
414 PaintOnDC((HDC)wParam, rect.Width(), rect.Height(), lParam & PRF_ERASEBKGND);
415 break;
416 }
417 case WM_ERASEBKGND:
418 {
419 return TRUE; // do not erase to avoid blinking
420 }
421 case WM_TIMER:
422 {
423 switch (wParam)
424 {
428 HDC hdc = GetDC();
429 CRect rect;
431
432 PaintOnDC(hdc, rect.Width(), rect.Height(), TRUE);
433 ReleaseDC(hdc);
434 }
435 break;
436 }
437 case WM_DESTROY:
438 {
442 break;
443 }
444 }
445 return FALSE;
446}
447
448VOID
450{
452 if (bLoadingTimerOn)
453 {
455 }
459}
460
461VOID
463{
467}
468
469BOOL
471{
474 pImage = Bitmap::FromFile(lpszFileName, 0);
475 if (pImage->GetLastStatus() != Ok)
476 {
478 return FALSE;
479 }
480 return TRUE;
481}
482
483VOID
485{
487}
488
489VOID
491{
492 // use an off screen dc to avoid blinking
496
497 if (bDrawBkgnd)
498 {
499 HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcMem, (HGDIOBJ)GetSysColorBrush(COLOR_BTNFACE));
500 PatBlt(hdcMem, 0, 0, width, height, PATCOPY);
501 SelectObject(hdcMem, hOldBrush);
502 }
503
504 switch (ScrnshotPrevStauts)
505 {
507 {
508 }
509 break;
510
512 {
513 Graphics graphics(hdcMem);
514 Color color(255, 0, 0);
515 SolidBrush dotBrush(Color(255, 100, 100, 100));
516
517 graphics.SetSmoothingMode(SmoothingMode::SmoothingModeAntiAlias);
518
519 // Paint three dot
520 float DotWidth = GetLoadingDotWidth(width, height);
521 graphics.FillEllipse(
522 (Brush *)(&dotBrush), (REAL)width / 2.0 - min(width, height) * 2.0 / 16.0 - DotWidth / 2.0,
523 (REAL)height / 2.0 -
525 DotWidth, DotWidth);
526
527 graphics.FillEllipse(
528 (Brush *)(&dotBrush), (REAL)width / 2.0 - DotWidth / 2.0,
529 (REAL)height / 2.0 - GetFrameDotShift(LoadingAnimationFrame, width, height) - DotWidth / 2.0, DotWidth,
530 DotWidth);
531
532 graphics.FillEllipse(
533 (Brush *)(&dotBrush), (REAL)width / 2.0 + min(width, height) * 2.0 / 16.0 - DotWidth / 2.0,
534 (REAL)height / 2.0 -
536 DotWidth, DotWidth);
537 }
538 break;
539
541 {
542 if (pImage)
543 {
544 // always draw entire image inside the window.
545 Graphics graphics(hdcMem);
546 float ZoomRatio =
547 min(((float)width / (float)pImage->GetWidth()), ((float)height / (float)pImage->GetHeight()));
548 float ZoomedImgWidth = ZoomRatio * (float)pImage->GetWidth();
549 float ZoomedImgHeight = ZoomRatio * (float)pImage->GetHeight();
550
551 graphics.DrawImage(
552 pImage, ((float)width - ZoomedImgWidth) / 2.0, ((float)height - ZoomedImgHeight) / 2.0,
553 ZoomedImgWidth, ZoomedImgHeight);
554 }
555 }
556 break;
557
559 {
563 }
564 break;
565 }
566
567 // copy the content form off-screen dc to hdc
568 BitBlt(hdc, 0, 0, width, height, hdcMem, 0, 0, SRCCOPY);
571}
572
573float
575{
576 return min(width, height) / 20.0;
577}
578
579float
581{
582 return min(width, height) * (1.0 / 16.0) * (2.0 / (2.0 - sqrt(3.0))) *
583 (max(sin((float)Frame * 2 * PI / (LOADING_ANIMATION_PERIOD * LOADING_ANIMATION_FPS)), sqrt(3.0) / 2.0) -
584 sqrt(3.0) / 2.0);
585}
586
589{
590 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
591 static ATL::CWndClassInfo wc = {
592 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL, 0, LoadCursorW(NULL, IDC_ARROW),
593 (HBRUSH)(COLOR_BTNFACE + 1), 0, L"RAppsScrnshotPreview", NULL},
594 NULL,
595 NULL,
596 IDC_ARROW,
597 TRUE,
598 0,
599 _T("")};
600 return wc;
601}
602
603HWND
605{
606 RECT r = {0, 0, 0, 0};
607
608 return CWindowImpl::Create(hParent, r, L"", WS_CHILD | WS_VISIBLE);
609}
610
611VOID
613{
614 if (bLoadingTimerOn)
615 {
618 }
620 if (pImage)
621 {
622 delete pImage;
623 pImage = NULL;
624 }
625 if (AsyncInet)
626 {
628 }
629 if (!TempImagePath.IsEmpty())
630 {
633 }
634}
635
636VOID
638{
642}
643
644BOOL
646{
649
650 if (PathIsURLW(lpszLocation))
651 {
653
655 if (!DownloadParam)
656 return FALSE;
657
658 DownloadParam->hwndNotify = m_hWnd;
659 DownloadParam->ID = ID;
660 // generate a filename
661 CStringW ScrnshotFolder = m_BasePath;
662 PathAppendW(ScrnshotFolder.GetBuffer(MAX_PATH), L"screenshots");
663 ScrnshotFolder.ReleaseBuffer();
664
665 if (!PathIsDirectoryW(ScrnshotFolder.GetString()))
666 {
667 CreateDirectoryW(ScrnshotFolder.GetString(), NULL);
668 }
669
670 if (!GetTempFileNameW(
671 ScrnshotFolder.GetString(), L"img", 0, DownloadParam->DownloadFileName.GetBuffer(MAX_PATH)))
672 {
673 DownloadParam->DownloadFileName.ReleaseBuffer();
674 delete DownloadParam;
676 return FALSE;
677 }
678 DownloadParam->DownloadFileName.ReleaseBuffer();
679
680 DownloadParam->hFile = CreateFileW(
681 DownloadParam->DownloadFileName.GetString(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
682 NULL);
684 {
685 delete DownloadParam;
687 return FALSE;
688 }
689
692 if (!AsyncInet)
693 {
695 DeleteFileW(DownloadParam->DownloadFileName.GetBuffer());
696 delete DownloadParam;
698 return FALSE;
699 }
700 return TRUE;
701 }
702 else
703 {
704 return DisplayFile(lpszLocation);
705 }
706}
707
708int
709CAppScrnshotPreview::GetRequestedWidth(int Height) // calculate requested window width by given height
710{
711 switch (ScrnshotPrevStauts)
712 {
714 return 0;
716 return 200;
718 if (pImage)
719 {
720 // return the width needed to display image inside the window.
721 // and always keep window w/h ratio inside [ 1/SCRNSHOT_MAX_ASPECT_RAT, SCRNSHOT_MAX_ASPECT_RAT ]
722 return (int)floor(
723 (float)Height *
724 max(min((float)pImage->GetWidth() / (float)pImage->GetHeight(), (float)SCRNSHOT_MAX_ASPECT_RAT),
725 1.0 / (float)SCRNSHOT_MAX_ASPECT_RAT));
726 }
727 return 0;
729 return 200;
730 default:
731 return 0;
732 }
733}
734
736{
738}
739// **** CAppScrnshotPreview ****
740
741// **** CAppInfoDisplay ****
742
743BOOL
745 HWND hwnd,
749 LRESULT &theResult,
750 DWORD dwMapId)
751{
752 theResult = 0;
753 switch (message)
754 {
755 case WM_CREATE:
756 {
757 RichEdit = new CAppRichEdit();
759
764 break;
765 }
766 case WM_SIZE:
767 {
769 break;
770 }
772 {
774 break;
775 }
776 case WM_COMMAND:
777 {
779 break;
780 }
781 case WM_NOTIFY:
782 {
783 NMHDR *NotifyHeader = (NMHDR *)lParam;
784 if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
785 {
786 switch (NotifyHeader->code)
787 {
788 case EN_LINK:
789 OnLink((ENLINK *)lParam);
790 break;
791 }
792 }
793 break;
794 }
795 }
796
797 return FALSE;
798}
799
800VOID
802{
803 CRect rect;
805 ResizeChildren(rect.Width(), rect.Height());
806}
807
808VOID
810{
811 int ScrnshotWidth = ScrnshotPrev->GetRequestedWidth(Height);
812
813 // make sure richedit always have room to display
814 ScrnshotWidth = min(ScrnshotWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH);
815
816 DWORD dwError = ERROR_SUCCESS;
817 HDWP hDwp = BeginDeferWindowPos(2);
818
819 if (hDwp)
820 {
821 hDwp = ::DeferWindowPos(hDwp, ScrnshotPrev->m_hWnd, NULL, 0, 0, ScrnshotWidth, Height, 0);
822
823 if (hDwp)
824 {
825 // hide the padding if scrnshot window width == 0
826 int RicheditPosX = ScrnshotWidth ? (ScrnshotWidth + INFO_DISPLAY_PADDING) : 0;
827
828 hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL, RicheditPosX, 0, Width - RicheditPosX, Height, 0);
829
830 if (hDwp)
831 {
832 EndDeferWindowPos(hDwp);
833 }
834 else
835 {
836 dwError = GetLastError();
837 }
838 }
839 else
840 {
841 dwError = GetLastError();
842 }
843 }
844 else
845 {
846 dwError = GetLastError();
847 }
848
849#if DBG
850 ATLASSERT(dwError == ERROR_SUCCESS);
851#endif
852 UNREFERENCED_PARAMETER(dwError);
853
854 UpdateWindow();
855}
856
857VOID
859{
860 switch (Link->msg)
861 {
862 case WM_LBUTTONUP:
863 case WM_RBUTTONUP:
864 {
865 if (pLink)
867
869 GetProcessHeap(), 0,
870 (max(Link->chrg.cpMin, Link->chrg.cpMax) - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) *
871 sizeof(WCHAR));
872 if (!pLink)
873 {
874 /* TODO: Error message */
875 return;
876 }
877
878 RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
879 RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink);
880
881 ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1);
882 }
883 break;
884 }
885}
886
889{
890 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
891 static ATL::CWndClassInfo wc = {/*.m_wc=*/
892 {/*cbSize=*/sizeof(WNDCLASSEX),
893 /*style=*/csStyle,
894 /*lpfnWndProc=*/StartWindowProc,
895 /*cbClsExtra=*/0,
896 /*cbWndExtra=*/0,
897 /*hInstance=*/NULL,
898 /*hIcon=*/NULL,
899 /*hCursor*/ NULL,
900 /*hbrBackground=*/(HBRUSH)(COLOR_BTNFACE + 1),
901 /*lpszMenuName=*/NULL,
902 /*lpszClassName=*/L"RAppsAppInfo",
903 /*hIconSm=*/NULL},
904 /*m_lpszOrigName=*/NULL,
905 /*pWndProc=*/NULL,
906 /*m_lpszCursorID=*/IDC_ARROW,
907 /*m_bSystemCursor*/ TRUE,
908 /*m_atom=*/0,
909 /*m_szAutoName=*/_T("")};
910 return wc;
911}
912
913HWND
915{
916 RECT r = {0, 0, 0, 0};
917
919}
920
921VOID
923{
924 CStringW ScrnshotLocation;
925 if (Info->RetrieveScreenshot(ScrnshotLocation))
926 {
927 ScrnshotPrev->DisplayImage(ScrnshotLocation);
928 }
929 else
930 {
932 }
934 Info->ShowAppInfo(RichEdit);
935}
936
937VOID
939{
943}
944
945VOID
947{
948 WORD wCommand = LOWORD(wParam);
949
950 switch (wCommand)
951 {
952 case ID_OPEN_LINK:
953
954 ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
956 pLink = NULL;
957 break;
958
959 case ID_COPY_LINK:
962 pLink = NULL;
963 break;
964 }
965}
966
968{
969 delete RichEdit;
970 delete ScrnshotPrev;
971}
972// **** CAppInfoDisplay ****
973
974// **** CAppsListView ****
975
979 CAppInfo *AppInfo; // Only used to find the item in the list, do not access on background thread
981 bool Parse;
983
984 void Free() { free(this); }
986 static void StartTasks();
989
990static DWORD CALLBACK
992{
993 for (CAsyncLoadIcon *task = (CAsyncLoadIcon*)Param, *old; task; old->Free())
994 {
995 if (task->TaskId == g_AsyncIconTaskId)
996 {
997 HICON hIcon;
998 if (!task->Parse)
999 hIcon = (HICON)LoadImageW(NULL, task->Location, IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
1000 else if (!ExtractIconExW(task->Location, PathParseIconLocationW(task->Location), &hIcon, NULL, 1))
1001 hIcon = NULL;
1002
1003 if (hIcon)
1004 {
1005 SendMessageW(task->hAppsList, WM_RAPPSLIST_ASYNCICON, (WPARAM)hIcon, (LPARAM)task);
1007 }
1008 }
1009 old = task;
1010 task = task->pNext;
1011 }
1012 return 0;
1013}
1014
1016CAsyncLoadIcon::Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
1017{
1019 CStringW szIconPath;
1020 if (!AppInfo.RetrieveIcon(szIconPath))
1021 return NULL;
1022 SIZE_T cbstr = (szIconPath.GetLength() + 1) * sizeof(WCHAR);
1023 CAsyncLoadIcon *task = (CAsyncLoadIcon*)malloc(sizeof(CAsyncLoadIcon) + cbstr);
1024 if (!task)
1025 return NULL;
1026 task->hAppsList = hAppsList;
1027 task->AppInfo = &AppInfo;
1028 task->TaskId = g_AsyncIconTaskId;
1029 task->Parse = Parse;
1030 CopyMemory(task->Location, szIconPath.GetBuffer(), cbstr);
1031 szIconPath.ReleaseBuffer();
1032 task->pNext = g_AsyncIconTasks;
1033 g_AsyncIconTasks = task;
1034 return task;
1035}
1036
1037void
1039{
1042 if (HANDLE hThread = CreateThread(NULL, 0, AsyncLoadIconProc, tasks, 0, NULL))
1044 else
1045 AsyncLoadIconProc(tasks); // Insist so we at least free the tasks
1046}
1047
1049{
1050 m_hImageListView = 0;
1051}
1052
1054{
1055 if (m_hImageListView)
1059}
1060
1061LRESULT
1063{
1064 LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
1065 if (!m_Watermark.IsEmpty())
1066 {
1067 RECT rc;
1068 GetClientRect(&rc);
1074 SelectFont(HDC(wParam), oldFont);
1075 }
1076 return lRes;
1077}
1078
1079LRESULT
1081{
1083 bHandled = TRUE;
1084 if (task->TaskId == g_AsyncIconTaskId)
1085 {
1086 LVITEM lvi;
1087 LVFINDINFO lvfi;
1088 lvfi.flags = LVFI_PARAM;
1089 lvfi.lParam = (LPARAM)task->AppInfo;
1090 lvi.iItem = ListView_FindItem(m_hWnd, -1, &lvfi);
1091 if (lvi.iItem != -1)
1092 {
1094 if (lvi.iImage != -1)
1095 {
1096 lvi.mask = LVIF_IMAGE;
1097 lvi.iSubItem = 0;
1098 ListView_SetItem(m_hWnd, &lvi);
1099 }
1100 }
1101 }
1102 return 0;
1103}
1104
1105VOID
1107{
1108 m_Watermark = Text;
1109}
1110
1111VOID
1113{
1114 if (bIsVisible)
1115 {
1116 SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
1117 }
1118 else
1119 {
1120 SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
1121 }
1122
1123 bHasCheckboxes = bIsVisible;
1124}
1125
1126VOID
1128{
1129 HWND hHeader;
1130 HDITEMW hColumn;
1131 INT nHeaderID = pnmv->iSubItem;
1132
1134 return;
1135
1136 hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1137 ZeroMemory(&hColumn, sizeof(hColumn));
1138
1139 /* If the sorting column changed, remove the sorting style from the old column */
1140 if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1141 {
1142 bIsAscending = TRUE; // also reset sorting method to ascending
1143 hColumn.mask = HDI_FORMAT;
1144 Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1145 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1146 Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1147 }
1148
1149 /* Set the sorting style to the new column */
1150 hColumn.mask = HDI_FORMAT;
1151 Header_GetItem(hHeader, nHeaderID, &hColumn);
1152
1153 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1154 hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1155 Header_SetItem(hHeader, nHeaderID, &hColumn);
1156
1157 /* Sort the list, using the current values of nHeaderID and bIsAscending */
1158 SortContext ctx = {this, nHeaderID};
1159 SortItems(s_CompareFunc, &ctx);
1160
1161 /* Save new values */
1162 nLastHeaderID = nHeaderID;
1164}
1165
1166BOOL
1168{
1169 LVCOLUMNW Column;
1170
1171 ZeroMemory(&Column, sizeof(Column));
1172
1174 Column.iSubItem = Index;
1175 Column.pszText = const_cast<LPWSTR>(Text.GetString());
1176 Column.cx = Width;
1177 Column.fmt = Format;
1178
1179 return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1180}
1181
1182void
1184{
1186 return;
1187}
1188
1189INT
1191{
1192 LVITEMW Item;
1193
1194 ZeroMemory(&Item, sizeof(Item));
1195
1197 Item.pszText = const_cast<LPWSTR>(lpText);
1198 Item.lParam = lParam;
1199 Item.iItem = ItemIndex;
1200 Item.iImage = IconIndex;
1201
1202 if (IconIndex >= 0)
1203 {
1204 Item.iImage = IconIndex;
1205 Item.mask |= LVIF_IMAGE;
1206 }
1207 return InsertItem(&Item);
1208}
1209
1212{
1213 return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1214}
1215
1218{
1219 SortContext *ctx = ((SortContext *)lParamSort);
1220 return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1221}
1222
1223INT
1224CAppsListView::CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem)
1225{
1226 CStringW Item1, Item2;
1227 LVFINDINFOW IndexInfo;
1228 INT Index;
1229
1230 IndexInfo.flags = LVFI_PARAM;
1231
1232 IndexInfo.lParam = lParam1;
1233 Index = FindItem(-1, &IndexInfo);
1234 GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1235 Item1.ReleaseBuffer();
1236
1237 IndexInfo.lParam = lParam2;
1238 Index = FindItem(-1, &IndexInfo);
1239 GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1240 Item2.ReleaseBuffer();
1241
1242 return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1243}
1244
1245HWND
1247{
1248 RECT r = {205, 28, 465, 250};
1251
1253
1254 if (hwnd)
1255 {
1257 }
1258
1259#pragma push_macro("SubclassWindow")
1260#undef SubclassWindow
1261 m_hWnd = NULL;
1263#pragma pop_macro("SubclassWindow")
1264
1265 return hwnd;
1266}
1267
1268BOOL
1270{
1271 return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1272}
1273
1274VOID
1276{
1277 if (bHasCheckboxes)
1278 {
1279 SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK);
1280 }
1281}
1282
1283VOID
1285{
1286 if (bHasCheckboxes)
1287 {
1289 {
1290 // clear all
1291 SetCheckState(-1, FALSE);
1292 }
1293 else
1294 {
1295 // check all
1296 SetCheckState(-1, TRUE);
1297 }
1298 }
1299}
1300
1301PVOID
1303{
1304 INT item = GetSelectionMark();
1305 if (item == -1)
1306 {
1307 return (PVOID)0;
1308 }
1309 return (PVOID)GetItemData(item);
1310}
1311
1312BOOL
1314{
1315 ++g_AsyncIconTaskId; // Stop loading icons that are now invalid
1316 if (!DeleteAllItems())
1317 return FALSE;
1318
1319 ApplicationViewType = AppType;
1321 ItemCount = 0;
1322 CheckedItemCount = 0;
1323
1324 ListView_Scroll(m_hWnd, 0, 0x7fff * -1); // FIXME: a bug in Wine ComCtl32 where VScroll is not reset after deleting items
1325
1326 // delete old columns
1327 while (ColumnCount)
1328 {
1330 }
1331
1333 {
1335 UINT IconSize = GetSystemMetrics(SM_CXICON);
1337 m_hImageListView = ImageList_Create(IconSize, IconSize, ilc, 0, 1);
1341 IMAGE_ICON, IconSize, IconSize, LR_SHARED);
1342 }
1344
1346 if (g_DefaultPackageIconILIdx == -1)
1348
1349 // add new columns
1350 CStringW szText;
1351 switch (AppType)
1352 {
1354
1355 /* Add columns to ListView */
1356 szText.LoadStringW(IDS_APP_NAME);
1357 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1358
1359 szText.LoadStringW(IDS_APP_INST_VERSION);
1360 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1361
1362 szText.LoadStringW(IDS_APP_DESCRIPTION);
1363 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1364
1365 // disable checkboxes
1367 break;
1368
1370
1371 /* Add columns to ListView */
1372 szText.LoadStringW(IDS_APP_NAME);
1373 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1374
1375 szText.LoadStringW(IDS_APP_INST_VERSION);
1376 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1377
1378 szText.LoadStringW(IDS_APP_DESCRIPTION);
1379 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1380
1381 // enable checkboxes
1383 break;
1384
1385 default:
1386 break;
1387 }
1388
1389 return TRUE;
1390}
1391
1392BOOL
1394{
1395 return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1396}
1397
1398BOOL
1399CAppsListView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
1400{
1401 if (!AppInfo)
1402 {
1404 return TRUE;
1405 }
1406
1409 {
1410 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1411 if (Index == -1)
1412 return FALSE;
1413 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, true);
1414
1415 SetItemText(Index, 1, AppInfo->szDisplayVersion.IsEmpty() ? L"---" : AppInfo->szDisplayVersion);
1416 SetItemText(Index, 2, AppInfo->szComments.IsEmpty() ? L"---" : AppInfo->szComments);
1417
1418 ItemCount++;
1419 return TRUE;
1420 }
1422 {
1423 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1424 if (Index == -1)
1425 return FALSE;
1426 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, false);
1427
1428 if (InitialCheckState)
1429 {
1431 }
1432
1433 SetItemText(Index, 1, AppInfo->szDisplayVersion);
1434 SetItemText(Index, 2, AppInfo->szComments);
1435
1436 ItemCount++;
1437 return TRUE;
1438 }
1439 else
1440 {
1441 return FALSE;
1442 }
1443}
1444
1445// this function is called when parent window receiving an notification about checkstate changing
1446VOID
1448{
1449 if (bCheck)
1450 {
1452 }
1453 else
1454 {
1456 }
1457}
1458// **** CAppsListView ****
1459
1460// **** CApplicationView ****
1461
1462BOOL
1464 HWND hwnd,
1465 UINT message,
1466 WPARAM wParam,
1467 LPARAM lParam,
1468 LRESULT &theResult,
1469 DWORD dwMapId)
1470{
1471 theResult = 0;
1472 switch (message)
1473 {
1474 case WM_CREATE:
1475 {
1476 BOOL bSuccess = TRUE;
1477 m_Panel = new CUiPanel();
1480
1487
1489
1490 RECT rTop;
1491
1492 ::GetWindowRect(m_Toolbar->m_hWnd, &rTop);
1493 m_HSplitter->m_Margin.top = rTop.bottom - rTop.top;
1494 if (!bSuccess)
1495 {
1496 return -1; // creation failure
1497 }
1498 }
1499 break;
1500
1501 case WM_NOTIFY:
1502 {
1503 LPNMHDR pNotifyHeader = (LPNMHDR)lParam;
1504 if (pNotifyHeader->hwndFrom == m_ListView->GetWindow())
1505 {
1506 switch (pNotifyHeader->code)
1507 {
1508 case LVN_ITEMCHANGED:
1509 {
1511
1512 /* Check if this is a valid item
1513 * (technically, it can be also an unselect) */
1514 INT ItemIndex = pnic->iItem;
1515 if (ItemIndex == -1 || ItemIndex >= ListView_GetItemCount(pnic->hdr.hwndFrom))
1516 {
1517 break;
1518 }
1519
1520 /* Check if the focus has been moved to another item */
1521 if ((pnic->uChanged & LVIF_STATE) && (pnic->uNewState & LVIS_FOCUSED) &&
1522 !(pnic->uOldState & LVIS_FOCUSED))
1523 {
1524 ItemGetFocus((LPVOID)pnic->lParam);
1525 }
1526
1527 /* Check if the item is checked/unchecked */
1528 if (pnic->uChanged & LVIF_STATE)
1529 {
1530 int iOldState = STATEIMAGETOINDEX(pnic->uOldState);
1531 int iNewState = STATEIMAGETOINDEX(pnic->uNewState);
1532
1533 if (iOldState == STATEIMAGE_UNCHECKED && iNewState == STATEIMAGE_CHECKED)
1534 {
1535 // this item is just checked
1538 }
1539 else if (iOldState == STATEIMAGE_CHECKED && iNewState == STATEIMAGE_UNCHECKED)
1540 {
1541 // this item is just unchecked
1544 }
1545 }
1546 }
1547 break;
1548
1549 case LVN_COLUMNCLICK:
1550 {
1552
1553 m_ListView->ColumnClick(pnmv);
1554 }
1555 break;
1556
1557 case NM_DBLCLK:
1558 {
1560 if (Item->iItem != -1)
1561 {
1562 /* this won't do anything if the program is already installed */
1563
1565 {
1567 (CAppInfo *)m_ListView->GetItemData(Item->iItem));
1568 }
1569 }
1570 }
1571 break;
1572
1573 case NM_RCLICK:
1574 {
1575 if (((LPNMLISTVIEW)lParam)->iItem != -1)
1576 {
1577 ShowPopupMenuEx(m_hWnd, m_hWnd, 0, ID_INSTALL);
1578 }
1579 }
1580 break;
1581 }
1582 }
1583 else if (pNotifyHeader->hwndFrom == m_Toolbar->GetWindow())
1584 {
1585 switch (pNotifyHeader->code)
1586 {
1587 case TTN_GETDISPINFO:
1589 break;
1590 }
1591 }
1592 }
1593 break;
1594
1595 case WM_SYSCOLORCHANGE:
1596 {
1597 /* Forward WM_SYSCOLORCHANGE to common controls */
1598 m_ListView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1600 m_Toolbar->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1601 m_ComboBox->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1602 }
1603 break;
1604
1605 case WM_SIZE:
1606 {
1608 break;
1609 }
1610
1611 case WM_COMMAND:
1612 {
1614 }
1615 break;
1616 }
1617 return FALSE;
1618}
1619
1620BOOL
1622{
1623 m_Toolbar = new CMainToolbar();
1627
1628 return m_Toolbar->Create(m_hWnd) != NULL;
1629}
1630
1631BOOL
1633{
1639
1640 return m_SearchBar->Create(m_Toolbar->m_hWnd) != NULL;
1641}
1642
1643BOOL
1645{
1649 m_ComboBox->m_Margin.top = 4;
1650
1651 return m_ComboBox->Create(m_Toolbar->m_hWnd) != NULL;
1652}
1653
1654BOOL
1656{
1657 m_HSplitter = new CUiSplitPanel();
1662 m_HSplitter->m_Pos = INT_MAX; // set INT_MAX to use lowest possible position (m_MinSecond)
1663 m_HSplitter->m_MinFirst = 10;
1664 m_HSplitter->m_MinSecond = 140;
1666
1667 return m_HSplitter->Create(m_hWnd) != NULL;
1668}
1669
1670BOOL
1672{
1673 m_ListView = new CAppsListView();
1677
1678 return m_ListView->Create(m_hWnd) != NULL;
1679}
1680
1681BOOL
1683{
1688
1689 return m_AppsInfo->Create(m_hWnd) != NULL;
1690}
1691
1692void
1694{
1695 CWindow::SetRedraw(bRedraw);
1696 m_ListView->SetRedraw(bRedraw);
1697}
1698
1699void
1701{
1703}
1704
1705VOID
1707{
1708 if (wParam == SIZE_MINIMIZED)
1709 return;
1710
1711 /* Size tool bar */
1713
1714 /* Automatically hide captions */
1715 DWORD dToolbarTreshold = m_Toolbar->GetMaxButtonsWidth();
1716 DWORD dSearchbarMargin = (LOWORD(lParam) - m_SearchBar->m_Width - m_ComboBox->m_Width - TOOLBAR_PADDING * 2);
1717
1718 if (dSearchbarMargin > dToolbarTreshold)
1719 {
1721 }
1722 else if (dSearchbarMargin < dToolbarTreshold)
1723 {
1725 }
1726
1727 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
1728 HDWP hdwp = NULL;
1730
1731 hdwp = BeginDeferWindowPos(count);
1732 if (hdwp)
1733 {
1734 hdwp = m_Panel->OnParentSize(r, hdwp);
1735 if (hdwp)
1736 {
1737 EndDeferWindowPos(hdwp);
1738 }
1739 }
1740
1742 hdwp = BeginDeferWindowPos(count);
1743 if (hdwp)
1744 {
1745 hdwp = m_SearchBar->OnParentSize(r, hdwp);
1746 if (hdwp)
1747 {
1748 EndDeferWindowPos(hdwp);
1749 }
1750 }
1751
1754 hdwp = BeginDeferWindowPos(count);
1755 if (hdwp)
1756 {
1757 hdwp = m_ComboBox->OnParentSize(r, hdwp);
1758 if (hdwp)
1759 {
1760 EndDeferWindowPos(hdwp);
1761 }
1762 }
1763}
1764
1765VOID
1767{
1768 if (lParam)
1769 {
1770 if ((HWND)lParam == m_SearchBar->GetWindow())
1771 {
1772 CStringW szBuf;
1773 switch (HIWORD(wParam))
1774 {
1775 case EN_SETFOCUS:
1776 {
1777 CStringW szWndText;
1778
1779 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1780 m_SearchBar->GetWindowTextW(szWndText);
1781 if (szBuf == szWndText)
1782 {
1783 m_SearchBar->SetWindowTextW(L"");
1784 }
1785 }
1786 break;
1787
1788 case EN_KILLFOCUS:
1789 {
1791 if (szBuf.IsEmpty())
1792 {
1793 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1794 m_SearchBar->SetWindowTextW(szBuf.GetString());
1795 }
1796 }
1797 break;
1798
1799 case EN_CHANGE:
1800 {
1801 CStringW szWndText;
1802
1803 szBuf.LoadStringW(IDS_SEARCH_TEXT);
1804 m_SearchBar->GetWindowTextW(szWndText);
1805 if (szBuf == szWndText)
1806 {
1807 szWndText = L"";
1808 m_MainWindow->SearchTextChanged(szWndText);
1809 }
1810 else
1811 {
1812 m_MainWindow->SearchTextChanged(szWndText);
1813 }
1814 }
1815 break;
1816 }
1817
1818 return;
1819 }
1820 else if ((HWND)lParam == m_ComboBox->GetWindow())
1821 {
1822 int NotifyCode = HIWORD(wParam);
1823 switch (NotifyCode)
1824 {
1825 case CBN_SELCHANGE:
1826 int CurrSelection = m_ComboBox->SendMessageW(CB_GETCURSEL);
1827
1828 int ViewModeList[] = {LV_VIEW_DETAILS, LV_VIEW_LIST, LV_VIEW_TILE};
1829 ATLASSERT(CurrSelection < (int)_countof(ViewModeList));
1830 if (!m_ListView->SetViewMode(ViewModeList[CurrSelection]))
1831 {
1832 MessageBoxW(L"View mode invalid or unimplemented");
1833 }
1834 break;
1835 }
1836
1837 return;
1838 }
1839 else if ((HWND)lParam == m_Toolbar->GetWindow())
1840 {
1841 // the message is sent from Toolbar. fall down to continue process
1842 }
1843 else
1844 {
1845 return;
1846 }
1847 }
1848
1849 // the LOWORD of wParam contains a Menu or Control ID
1850 WORD wCommand = LOWORD(wParam);
1851
1852 switch (wCommand)
1853 {
1854 case ID_INSTALL:
1855 case ID_UNINSTALL:
1856 case ID_MODIFY:
1857 case ID_REGREMOVE:
1858 case ID_REFRESH:
1859 case ID_RESETDB:
1860 case ID_CHECK_ALL:
1861 m_MainWindow->SendMessageW(WM_COMMAND, wCommand, 0);
1862 break;
1863 }
1864}
1865
1866CApplicationView::CApplicationView(CMainWindow *MainWindow) : m_MainWindow(MainWindow)
1867{
1868}
1869
1871{
1872 delete m_Toolbar;
1873 delete m_SearchBar;
1874 delete m_ListView;
1875 delete m_AppsInfo;
1876 delete m_HSplitter;
1877}
1878
1881{
1882 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
1883 static ATL::CWndClassInfo wc = {
1884 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_BTNFACE + 1), NULL,
1885 L"RAppsApplicationView", NULL},
1886 NULL,
1887 NULL,
1888 IDC_ARROW,
1889 TRUE,
1890 0,
1891 _T("")};
1892 return wc;
1893}
1894
1895HWND
1897{
1898 RECT r = {0, 0, 0, 0};
1899
1901
1903}
1904
1905BOOL
1907{
1908 if (!m_ListView->SetDisplayAppType(AppType))
1909 {
1910 return FALSE;
1911 }
1912 ApplicationViewType = AppType;
1914
1915 HMENU hMenu = ::GetMenu(m_hWnd);
1916 switch (AppType)
1917 {
1923
1924 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
1925 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);
1926 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, TRUE);
1927 break;
1928
1934
1935 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, TRUE);
1937 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, FALSE);
1938 break;
1939 }
1940 return TRUE;
1941}
1942
1943BOOL
1945{
1946 return m_ListView->AddApplication(AppInfo, InitialCheckState);
1947}
1948
1949VOID
1951{
1953}
1954
1955void
1957{
1959}
1960
1961PVOID
1963{
1965}
1966
1967int
1969{
1970 return m_ListView->GetItemCount();
1971}
1972
1973VOID
1975{
1981}
1982
1983// this function is called when a item of listview get focus.
1984// CallbackParam is the param passed to listview when adding the item (the one getting focus now).
1985VOID
1987{
1988 if (CallbackParam)
1989 {
1990 CAppInfo *Info = static_cast<CAppInfo *>(CallbackParam);
1992
1994 {
1995 HMENU hMenu = ::GetMenu(m_hWnd);
1996
1997 BOOL CanModify = Info->CanModify();
1998
1999 EnableMenuItem(hMenu, ID_MODIFY, CanModify ? MF_ENABLED : MF_GRAYED);
2000 m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, CanModify);
2001 }
2002 }
2003}
2004
2005// this function is called when a item of listview is checked/unchecked
2006// CallbackParam is the param passed to listview when adding the item (the one getting changed now).
2007VOID
2009{
2010 m_MainWindow->ItemCheckStateChanged(bChecked, CallbackParam);
2011}
2012// **** CApplicationView ****
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
Arabic default style
Definition: afstyles.h:94
static int g_DefaultPackageIconILIdx
Definition: appview.cpp:17
int ScrnshotDownloadCallback(pASYNCINET AsyncInet, ASYNC_EVENT Event, WPARAM wParam, LPARAM lParam, VOID *Extension)
Definition: appview.cpp:288
static UINT g_AsyncIconTaskId
Definition: appview.cpp:988
static DWORD CALLBACK AsyncLoadIconProc(LPVOID Param)
Definition: appview.cpp:991
struct CAsyncLoadIcon * g_AsyncIconTasks
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
#define WM_RAPPS_DOWNLOAD_COMPLETE
Definition: appview.h:39
#define WM_RAPPSLIST_ASYNCICON
Definition: appview.h:42
int ScrnshotDownloadCallback(pASYNCINET AsyncInet, ASYNC_EVENT Event, WPARAM wParam, LPARAM lParam, VOID *Extension)
Definition: appview.cpp:288
#define BROKENIMG_ICON_SIZE
Definition: appview.h:24
#define STATEIMAGETOINDEX(x)
Definition: appview.h:60
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:41
#define STATEIMAGE_UNCHECKED
Definition: appview.h:64
#define TOOLBAR_PADDING
Definition: appview.h:36
#define PI
Definition: appview.h:57
#define SCRNSHOT_MAX_ASPECT_RAT
Definition: appview.h:27
#define LOADING_ANIMATION_PERIOD
Definition: appview.h:54
#define STATEIMAGE_CHECKED
Definition: appview.h:65
#define LOADING_ANIMATION_FPS
Definition: appview.h:55
#define RICHEDIT_MIN_WIDTH
Definition: appview.h:33
SCRNSHOT_STATUS
Definition: appview.h:45
@ SCRNSHOT_PREV_LOADING
Definition: appview.h:47
@ SCRNSHOT_PREV_FAILED
Definition: appview.h:49
@ SCRNSHOT_PREV_EMPTY
Definition: appview.h:46
@ SCRNSHOT_PREV_IMAGE
Definition: appview.h:48
struct __ScrnshotDownloadParam ScrnshotDownloadParam
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
#define TIMER_LOADING_ANIMATION
Definition: appview.h:52
#define INFO_DISPLAY_PADDING
Definition: appview.h:30
APPLICATION_VIEW_TYPE
Definition: appview.h:70
@ AppViewTypeInstalledApps
Definition: appview.h:72
@ AppViewTypeAvailableApps
Definition: appview.h:71
pASYNCINET AsyncInetDownload(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, LPCWSTR lpszUrl, BOOL bAllowCache, ASYNCINET_CALLBACK Callback, VOID *Extension)
Definition: asyncinet.cpp:33
BOOL AsyncInetCancel(pASYNCINET AsyncInet)
Definition: asyncinet.cpp:126
VOID AsyncInetRelease(pASYNCINET AsyncInet)
Definition: asyncinet.cpp:184
ASYNC_EVENT
Definition: asyncinet.h:6
@ ASYNCINET_ERROR
Definition: asyncinet.h:15
@ ASYNCINET_COMPLETE
Definition: asyncinet.h:9
@ ASYNCINET_CANCELLED
Definition: asyncinet.h:12
@ ASYNCINET_DATA
Definition: asyncinet.h:7
#define IDI_MAIN
Definition: resource.h:4
#define ID_EXIT
Definition: resource.h:10
HTREEITEM InsertItem(HWND hTree, LPCWSTR szName, HTREEITEM hParent, HTREEITEM hInsertAfter)
Definition: treeview.c:95
#define IDS_TOOLTIP_REFRESH
Definition: resource.h:48
#define ID_REFRESH
Definition: resource.h:16
#define MAX_STR_LEN
Definition: defines.h:43
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:142
INT GetSystemColorDepth()
Definition: misc.cpp:300
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:16
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:43
#define ID_REGREMOVE
Definition: resource.h:83
#define IDS_TOOLTIP_UPDATE_DB
Definition: resource.h:134
#define IDS_APP_DESCRIPTION
Definition: resource.h:139
#define IDS_TOOLTIP_INSTALL
Definition: resource.h:127
#define IDS_SEARCH_TEXT
Definition: resource.h:93
#define ID_UNINSTALL
Definition: resource.h:75
#define IDI_UPDATE_DB
Definition: resource.h:14
#define IDS_WELCOME_TITLE
Definition: resource.h:95
#define ID_COPY_LINK
Definition: resource.h:80
#define IDS_WELCOME_TEXT
Definition: resource.h:96
#define IDS_TOOLTIP_SETTINGS
Definition: resource.h:131
#define IDI_EXIT
Definition: resource.h:5
#define IDI_BROKEN_IMAGE
Definition: resource.h:17
#define IDI_MODIFY
Definition: resource.h:9
#define IDS_APP_INST_VERSION
Definition: resource.h:138
#define IDR_LINKMENU
Definition: resource.h:69
#define ID_CHECK_ALL
Definition: resource.h:85
#define IDI_CHECK_ALL
Definition: resource.h:15
#define IDS_TOOLTIP_MODIFY
Definition: resource.h:129
#define IDR_APPLICATIONMENU
Definition: resource.h:70
#define IDI_INSTALL
Definition: resource.h:6
#define IDI_SETTINGS
Definition: resource.h:8
#define ID_MODIFY
Definition: resource.h:78
#define ID_OPEN_LINK
Definition: resource.h:79
#define IDI_UNINSTALL
Definition: resource.h:7
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:128
#define IDS_TOOLTIP_SELECT_ALL
Definition: resource.h:130
#define ID_RESETDB
Definition: resource.h:84
#define IDS_APP_NAME
Definition: resource.h:137
#define IDS_TOOLTIP_EXIT
Definition: resource.h:133
#define ID_INSTALL
Definition: resource.h:74
#define IDS_WELCOME_URL
Definition: resource.h:97
#define ID_SETTINGS
Definition: resource.h:81
#define IDI_REFRESH
Definition: resource.h:10
#define InterlockedIncrement64(a)
Definition: btrfs_drv.h:143
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
int GetLength() const noexcept
Definition: atlsimpstr.h:362
void Empty() noexcept
Definition: atlsimpstr.h:253
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:738
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1619
HWND Create(HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:1734
HDC GetDC()
Definition: atlwin.h:547
HWND SetFocus()
Definition: atlwin.h:1198
void SetRedraw(BOOL bRedraw=TRUE)
Definition: atlwin.h:1234
CWindow GetParent() const
Definition: atlwin.h:700
BOOL IsWindowVisible() const
Definition: atlwin.h:958
HWND m_hWnd
Definition: atlwin.h:273
static Bitmap * FromFile(const WCHAR *filename, BOOL useEmbeddedColorManagement)
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:946
HWND Create(HWND hwndParent)
Definition: appview.cpp:914
VOID ShowAppInfo(CAppInfo *Info)
Definition: appview.cpp:922
BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:744
VOID SetWelcomeText()
Definition: appview.cpp:938
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:858
VOID ResizeChildren()
Definition: appview.cpp:801
CAppRichEdit * RichEdit
Definition: appview.h:170
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:171
LPWSTR pLink
Definition: appview.h:156
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:888
virtual BOOL RetrieveIcon(CStringW &Path) const =0
CStringW szDisplayName
Definition: appinfo.h:102
VOID SetWelcomeText()
Definition: appview.cpp:272
VOID InsertTextWithString(UINT StringID, const CStringW &Text, DWORD TextFlags)
Definition: appview.cpp:263
VOID LoadAndInsertText(UINT uStringID, const CStringW &szText, DWORD TextFlags)
Definition: appview.cpp:239
float GetLoadingDotWidth(int width, int height)
Definition: appview.cpp:574
CAppScrnshotPreview(const CStringW &BasePath)
Definition: appview.cpp:320
VOID PreviousDisplayCleanup()
Definition: appview.cpp:612
VOID SetStatus(SCRNSHOT_STATUS Status)
Definition: appview.cpp:484
SCRNSHOT_STATUS ScrnshotPrevStauts
Definition: appview.h:103
BOOL DisplayFile(LPCWSTR lpszFileName)
Definition: appview.cpp:470
VOID PaintOnDC(HDC hdc, int width, int height, BOOL bDrawBkgnd)
Definition: appview.cpp:490
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:325
HICON hBrokenImgIcon
Definition: appview.h:105
LONGLONG ContentID
Definition: appview.h:110
int LoadingAnimationFrame
Definition: appview.h:107
CStringW TempImagePath
Definition: appview.h:112
HWND Create(HWND hParent)
Definition: appview.cpp:604
float GetFrameDotShift(int Frame, int width, int height)
Definition: appview.cpp:580
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:645
pASYNCINET AsyncInet
Definition: appview.h:109
CStringW m_BasePath
Definition: appview.h:102
Gdiplus::Image * pImage
Definition: appview.h:104
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:588
int GetRequestedWidth(int Height)
Definition: appview.cpp:709
BOOL CreateToolbar()
Definition: appview.cpp:1621
PVOID GetFocusedItemData()
Definition: appview.cpp:1962
VOID ItemGetFocus(LPVOID CallbackParam)
Definition: appview.cpp:1986
BOOL CreateHSplitter()
Definition: appview.cpp:1655
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:356
HWND Create(HWND hwndParent)
Definition: appview.cpp:1896
BOOL CreateAppInfoDisplay()
Definition: appview.cpp:1682
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1766
static ATL::CWndClassInfo & GetWndClassInfo()
Definition: appview.cpp:1880
CUiPanel * m_Panel
Definition: appview.h:348
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:350
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:351
BOOL AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState)
Definition: appview.cpp:1944
BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
Definition: appview.cpp:1463
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1906
CApplicationView(CMainWindow *MainWindow)
Definition: appview.cpp:1866
CMainWindow * m_MainWindow
Definition: appview.h:355
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:353
void SetFocusOnSearchBar()
Definition: appview.cpp:1700
VOID OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1706
CUiSplitPanel * m_HSplitter
Definition: appview.h:354
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1693
BOOL CreateComboBox()
Definition: appview.cpp:1644
BOOL CreateSearchBar()
Definition: appview.cpp:1632
CMainToolbar * m_Toolbar
Definition: appview.h:349
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:1974
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:1950
BOOL CreateListView()
Definition: appview.cpp:1671
CAppsListView * m_ListView
Definition: appview.h:352
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: appview.cpp:2008
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1190
void DeleteColumn(INT Index)
Definition: appview.cpp:1183
VOID ColumnClick(LPNMLISTVIEW pnmv)
Definition: appview.cpp:1127
BOOL bHasCheckboxes
Definition: appview.h:198
INT ItemCount
Definition: appview.h:200
BOOL SetViewMode(DWORD ViewMode)
Definition: appview.cpp:1393
INT ColumnCount
Definition: appview.h:202
VOID ItemCheckStateNotify(int iItem, BOOL bCheck)
Definition: appview.cpp:1447
VOID CheckAll()
Definition: appview.cpp:1284
HIMAGELIST m_hImageListView
Definition: appview.h:208
HIMAGELIST GetImageList(int iImageList)
Definition: appview.cpp:1211
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1313
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:206
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: appview.cpp:1062
PVOID GetFocusedItemData()
Definition: appview.cpp:1302
HWND Create(HWND hwndParent)
Definition: appview.cpp:1246
BOOL GetCheckState(INT item)
Definition: appview.cpp:1269
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1112
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:1106
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1275
LRESULT OnAsyncIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: appview.cpp:1080
INT nLastHeaderID
Definition: appview.h:204
BOOL AddColumn(INT Index, CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1167
CStringW m_Watermark
Definition: appview.h:209
BOOL AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
Definition: appview.cpp:1399
INT CheckedItemCount
Definition: appview.h:201
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1217
BOOL bIsAscending
Definition: appview.h:197
INT CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem)
Definition: appview.cpp:1224
const int m_DefaultSelectType
Definition: appview.h:333
HWND Create(HWND hwndParent)
Definition: appview.cpp:215
const UINT m_TypeStringID[3]
Definition: appview.h:331
int m_Width
Definition: appview.h:336
int m_Height
Definition: appview.h:337
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
VOID ShowButtonCaption()
Definition: appview.cpp:168
DWORD m_dButtonsWidthMax
Definition: appview.h:279
DWORD GetMaxButtonsWidth() const
Definition: appview.cpp:175
VOID OnGetDispInfo(LPTOOLTIPTEXT lpttt)
Definition: appview.cpp:65
HWND Create(HWND hwndParent)
Definition: appview.cpp:102
const INT m_iToolbarHeight
Definition: appview.h:278
VOID AddImageToImageList(HIMAGELIST hImageList, UINT ImageIndex)
Definition: appview.cpp:22
HIMAGELIST InitImageList()
Definition: appview.cpp:37
VOID HideButtonCaption()
Definition: appview.cpp:161
BOOL SearchTextChanged(CStringW &SearchText)
Definition: gui.cpp:764
BOOL InstallApplication(CAppInfo *Info)
Definition: gui.cpp:749
VOID ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:721
INT Append(T *ptr)
Definition: rosui.h:87
HWND Create(HWND hwndParent)
Definition: crichedit.h:104
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:77
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:91
HWND Create(HWND hwndParent)
Definition: appview.cpp:194
const INT m_Height
Definition: appview.h:309
const INT m_Width
Definition: appview.h:308
VOID SetText(LPCWSTR lpszText)
Definition: appview.cpp:188
DWORD AutoSize()
Definition: rosctrls.h:378
DWORD AddButtons(int count, TBBUTTON *buttons)
Definition: rosctrls.h:332
DWORD SetButtonStructSize()
Definition: rosctrls.h:286
HIMAGELIST SetImageList(HIMAGELIST himl)
Definition: rosctrls.h:424
DWORD GetIdealSize(BOOL useHeight, LPSIZE size)
Definition: rosctrls.h:388
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:257
CUiAlignment m_VerticalAlignment
Definition: rosui.h:258
CUiMargin m_Margin
Definition: rosui.h:255
CUiCollection & Children()
Definition: rosui.h:384
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:439
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:454
INT m_Pos
Definition: rosui.h:584
BOOL m_Horizontal
Definition: rosui.h:585
CUiCollection & First()
Definition: rosui.h:618
BOOL m_DynamicFirst
Definition: rosui.h:586
CUiCollection & Second()
Definition: rosui.h:623
INT m_MinSecond
Definition: rosui.h:588
HWND Create(HWND hwndParent)
Definition: rosui.h:867
INT m_MinFirst
Definition: rosui.h:587
VOID GetWindowTextW(CStringW &szText)
Definition: rosui.h:561
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:546
HWND GetWindow()
Definition: rosui.h:492
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:522
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:516
Status FillEllipse(const Brush *brush, const Rect &rect)
Status SetSmoothingMode(SmoothingMode smoothingMode)
Status DrawImage(Image *image, const Point *destPoints, INT count)
WPARAM wParam
Definition: combotst.c:138
char * Text
Definition: combotst.c:136
struct @1628 Msg[]
LPARAM lParam
Definition: combotst.c:139
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
Definition: commctrl.c:1845
static HWND hwndParent
Definition: cryptui.c:300
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HBITMAP hBitmap
Definition: timezone.c:26
float REAL
Definition: types.h:41
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
HANDLE HWND
Definition: compat.h:19
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
static const WCHAR IconIndex[]
Definition: install.c:52
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
Definition: url.c:2432
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
static BOOLEAN bSuccess
Definition: drive.cpp:477
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
switch(r->id)
Definition: btrfs.c:3046
HINSTANCE hInst
Definition: dxdiag.c:13
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
pKey DeleteObject()
Status
Definition: gdiplustypes.h:25
@ Ok
Definition: gdiplustypes.h:26
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint color
Definition: glext.h:6243
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
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:849
#define INT_MAX
Definition: limits.h:40
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
#define CREATE_ALWAYS
Definition: disk.h:72
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static float(__cdecl *square_half_float)(float x
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static ATOM item
Definition: dde.c:856
#define min(a, b)
Definition: monoChain.cc:55
static const TBBUTTON Buttons[]
Definition: mplay32.c:41
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
HANDLE hThread
Definition: wizard.c:28
#define DWORD
Definition: nt_native.h:44
#define GENERIC_WRITE
Definition: nt_native.h:90
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPED
Definition: pedump.c:615
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_VISIBLE
Definition: pedump.c:620
#define ES_LEFT
Definition: pedump.c:664
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define LV_VIEW_DETAILS
Definition: commctrl.h:2841
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define BTNS_BUTTON
Definition: commctrl.h:998
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVFINDINFO
Definition: commctrl.h:2463
#define BTNS_AUTOSIZE
Definition: commctrl.h:1004
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2270
#define LVN_COLUMNCLICK
Definition: commctrl.h:3139
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVM_GETHEADER
Definition: commctrl.h:2650
#define SBT_NOBORDERS
Definition: commctrl.h:1971
#define ListView_Scroll(hwndLV, dx, dy)
Definition: commctrl.h:2522
#define LVIF_STATE
Definition: commctrl.h:2312
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
#define BTNS_SEP
Definition: commctrl.h:999
#define LVFI_PARAM
Definition: commctrl.h:2436
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
#define LVM_DELETECOLUMN
Definition: commctrl.h:2638
#define LVS_REPORT
Definition: commctrl.h:2262
#define TBSTYLE_LIST
Definition: commctrl.h:993
#define TBSTYLE_EX_MIXEDBUTTONS
Definition: commctrl.h:1012
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LV_VIEW_LIST
Definition: commctrl.h:2843
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2731
#define TTN_GETDISPINFO
Definition: commctrl.h:1878
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LVS_SORTASCENDING
Definition: commctrl.h:2268
#define LV_VIEW_TILE
Definition: commctrl.h:2844
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2634
#define HDF_SORTUP
Definition: commctrl.h:724
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
struct tagNMITEMACTIVATE * LPNMITEMACTIVATE
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
#define LVM_GETIMAGELIST
Definition: commctrl.h:2295
#define LVITEM
Definition: commctrl.h:2375
#define TB_GETEXTENDEDSTYLE
Definition: commctrl.h:1191
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define LVIF_PARAM
Definition: commctrl.h:2311
#define HDI_FORMAT
Definition: commctrl.h:705
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define LVIF_TEXT
Definition: commctrl.h:2309
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2401
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define LVM_SETVIEW
Definition: commctrl.h:2846
#define LVCF_FMT
Definition: commctrl.h:2586
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define NM_RCLICK
Definition: commctrl.h:133
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2328
#define SB_SETTEXT
Definition: commctrl.h:1949
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2326
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define HDF_SORTDOWN
Definition: commctrl.h:725
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2470
#define I_IMAGENONE
Definition: commctrl.h:2386
#define LVS_AUTOARRANGE
Definition: commctrl.h:2272
#define WC_COMBOBOX
Definition: commctrl.h:4718
#define LVSIL_NORMAL
Definition: commctrl.h:2298
#define LPTOOLTIPTEXT
Definition: commctrl.h:1890
#define EM_GETSELTEXT
Definition: richedit.h:95
#define CFE_BOLD
Definition: richedit.h:406
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define CFM_LINK
Definition: richedit.h:337
#define EN_LINK
Definition: richedit.h:202
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
@ UiAlign_Stretch
Definition: rosui.h:249
@ UiAlign_LeftTop
Definition: rosui.h:246
@ UiAlign_RightBtm
Definition: rosui.h:248
#define ID
Definition: ruserpass.c:36
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2513
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
CAsyncLoadIcon * pNext
Definition: appview.cpp:977
CAppInfo * AppInfo
Definition: appview.cpp:979
WCHAR Location[ANYSIZE_ARRAY]
Definition: appview.cpp:982
static void StartTasks()
Definition: appview.cpp:1038
static CAsyncLoadIcon * Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
Definition: appview.cpp:1016
base for all directory entries
Definition: entries.h:138
UINT mask
Definition: commctrl.h:684
int fmt
Definition: commctrl.h:689
Definition: tftpd.h:60
LPWSTR pszText
Definition: commctrl.h:2567
LPARAM lParam
Definition: commctrl.h:2458
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
UINT uNewState
Definition: commctrl.h:3036
LPARAM lParam
Definition: commctrl.h:3040
UINT uOldState
Definition: commctrl.h:3037
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
#define max(a, b)
Definition: svc.c:63
#define GetWindowLongPtr
Definition: treelist.c:73
int32_t INT_PTR
Definition: typedefs.h:64
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
int64_t LONGLONG
Definition: typedefs.h:68
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
#define AddItem
Definition: userenv.h:209
static int Link(const char **args)
Definition: vfdcmd.c:2414
#define _T(x)
Definition: vfdio.h:22
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
HDC hdcMem
Definition: welcome.c:104
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define CopyMemory
Definition: winbase.h:1710
_In_ ULONG NotifyCode
Definition: winddi.h:4265
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
CONST void * LPCVOID
Definition: windef.h:191
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define SelectFont(hdc, hfont)
Definition: windowsx.h:516
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define GetStockFont(i)
Definition: windowsx.h:308
#define ERROR_CANCELLED
Definition: winerror.h:726
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DI_COMPAT
Definition: wingdi.h:68
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DI_NORMAL
Definition: wingdi.h:72
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
#define PATCOPY
Definition: wingdi.h:335
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521
#define WM_PAINT
Definition: winuser.h:1620
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1625
#define CS_VREDRAW
Definition: winuser.h:658
DWORD WINAPI GetSysColor(_In_ int)
#define DT_NOPREFIX
Definition: winuser.h:537
#define EN_KILLFOCUS
Definition: winuser.h:2025
#define COLOR_GRAYTEXT
Definition: winuser.h:932
#define DT_CENTER
Definition: winuser.h:527
#define LR_LOADFROMFILE
Definition: winuser.h:1092
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1608
#define EN_SETFOCUS
Definition: winuser.h:2027
#define WM_SIZE
Definition: winuser.h:1611
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define PRF_ERASEBKGND
Definition: winuser.h:2526
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_COMMAND
Definition: winuser.h:1740
#define CS_HREDRAW
Definition: winuser.h:653
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2247
#define IDC_ARROW
Definition: winuser.h:687
#define CB_SETCURSEL
Definition: winuser.h:1961
#define WM_RBUTTONUP
Definition: winuser.h:1780
#define SW_SHOWNOACTIVATE
Definition: winuser.h:774
#define SIZE_MINIMIZED
Definition: winuser.h:2506
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2149
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:1979
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_ENABLED
Definition: winuser.h:128
#define WM_SETFONT
Definition: winuser.h:1650
#define WM_TIMER
Definition: winuser.h:1742
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2072
#define CB_ADDSTRING
Definition: winuser.h:1936
BOOL WINAPI UpdateWindow(_In_ HWND)
struct tagNMHDR * LPNMHDR
#define SendMessage
Definition: winuser.h:5852
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5728
#define EM_SETSEL
Definition: winuser.h:2018
#define CBS_HASSTRINGS
Definition: winuser.h:285
#define LR_SHARED
Definition: winuser.h:1100
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
#define WM_LBUTTONUP
Definition: winuser.h:1777
#define DT_VCENTER
Definition: winuser.h:543
#define LoadImage
Definition: winuser.h:5824
#define PRF_CHECKVISIBLE
Definition: winuser.h:2523
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_DESTROY
Definition: winuser.h:1609
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define CB_GETCURSEL
Definition: winuser.h:1943
#define GWL_STYLE
Definition: winuser.h:852
#define SM_CXICON
Definition: winuser.h:972
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define COLOR_BTNFACE
Definition: winuser.h:928
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2097
#define MF_GRAYED
Definition: winuser.h:129
#define EN_CHANGE
Definition: winuser.h:2022
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185