ReactOS  0.4.11-dev-946-g431643b
gui.cpp File Reference
#include "rapps.h"
#include "rosui.h"
#include "crichedit.h"
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <wininet.h>
#include <shellutils.h>
#include <rosctrls.h>
Include dependency graph for gui.cpp:

Go to the source code of this file.

Classes

class  CAvailableAppView
 
class  CMainToolbar
 
class  CAppsListView
 
struct  CAppsListView::SortContext
 
class  CSideTreeView
 
class  CSearchBar
 
class  CMainWindow
 

Macros

#define SEARCH_TIMER_ID   'SR'
 
#define LISTVIEW_ICON_SIZE   24
 
#define TREEVIEW_ICON_SIZE   24
 

Functions

INT GetSystemColorDepth ()
 
HWND CreateMainWindow ()
 
DWORD_PTR ListViewGetlParam (INT item)
 
VOID SetStatusBarText (LPCWSTR szText)
 
INT ListViewAddItem (INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam)
 
VOID NewRichEditText (LPCWSTR szText, DWORD flags)
 
VOID InsertRichEditText (LPCWSTR szText, DWORD flags)
 
CAvailableAppsGetAvailableApps ()
 
VOID SetStatusBarText (const ATL::CStringW &szText)
 
INT ListViewAddItem (INT ItemIndex, INT IconIndex, const ATL::CStringW &Name, LPARAM lParam)
 
VOID NewRichEditText (const ATL::CStringW &szText, DWORD flags)
 
VOID InsertRichEditText (const ATL::CStringW &szText, DWORD flags)
 

Variables

HWND hListView = NULL
 
CMainWindowg_MainWindow
 

Macro Definition Documentation

◆ LISTVIEW_ICON_SIZE

#define LISTVIEW_ICON_SIZE   24

◆ SEARCH_TIMER_ID

#define SEARCH_TIMER_ID   'SR'

Definition at line 25 of file gui.cpp.

Referenced by CMainWindow::OnCommand(), and CMainWindow::ProcessWindowMessage().

◆ TREEVIEW_ICON_SIZE

#define TREEVIEW_ICON_SIZE   24

Definition at line 27 of file gui.cpp.

Referenced by CSideTreeView::AddCategory().

Function Documentation

◆ CreateMainWindow()

HWND CreateMainWindow ( void  )

Definition at line 1767 of file gui.cpp.

1768 {
1769  g_MainWindow = new CMainWindow();
1770  return g_MainWindow->Create();
1771 }
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
HWND Create()
Definition: gui.cpp:1726

◆ GetAvailableApps()

CAvailableApps* GetAvailableApps ( )

Definition at line 1802 of file gui.cpp.

1803 {
1804  return g_MainWindow->GetAvailableApps();
1805 }
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
CAvailableApps * GetAvailableApps()
Definition: gui.cpp:1758

◆ GetSystemColorDepth()

INT GetSystemColorDepth ( )

Definition at line 31 of file gui.cpp.

Referenced by CMainToolbar::InitImageList(), and CMainWindow::UpdateApplicationsList().

32 {
33  DEVMODEW pDevMode;
34  INT ColorDepth;
35 
36  pDevMode.dmSize = sizeof(pDevMode);
37  pDevMode.dmDriverExtra = 0;
38 
40  {
41  /* TODO: Error message */
42  return ILC_COLOR;
43  }
44 
45  switch (pDevMode.dmBitsPerPel)
46  {
47  case 32: ColorDepth = ILC_COLOR32; break;
48  case 24: ColorDepth = ILC_COLOR24; break;
49  case 16: ColorDepth = ILC_COLOR16; break;
50  case 8: ColorDepth = ILC_COLOR8; break;
51  case 4: ColorDepth = ILC_COLOR4; break;
52  default: ColorDepth = ILC_COLOR; break;
53  }
54 
55  return ColorDepth;
56 }
#define ILC_COLOR16
Definition: commctrl.h:341
WORD dmDriverExtra
Definition: wingdi.h:1598
DWORD dmBitsPerPel
Definition: wingdi.h:1624
int32_t INT
Definition: typedefs.h:56
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define ILC_COLOR4
Definition: commctrl.h:339
#define ILC_COLOR32
Definition: commctrl.h:343
#define ILC_COLOR
Definition: commctrl.h:337
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
#define ILC_COLOR24
Definition: commctrl.h:342
WORD dmSize
Definition: wingdi.h:1597
#define ILC_COLOR8
Definition: commctrl.h:340

◆ InsertRichEditText() [1/2]

VOID InsertRichEditText ( LPCWSTR  szText,
DWORD  flags 
)

Definition at line 1797 of file gui.cpp.

Referenced by CAvailableAppView::InsertLanguageInfo_RichEdit(), CAvailableAppView::InsertLoadedTextNewl_RichEdit(), InsertRichEditText(), CAvailableAppView::InsertTextAfterLoaded_RichEdit(), SetWelcomeText(), and ShowInstalledAppInfo().

1798 {
1800 }
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
static const WCHAR szText[]
Definition: dialog.c:139
CRichEdit * GetRichEdit()
Definition: gui.cpp:1753
GLbitfield flags
Definition: glext.h:7161
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72

◆ InsertRichEditText() [2/2]

VOID InsertRichEditText ( const ATL::CStringW szText,
DWORD  flags 
)

Definition at line 1823 of file gui.cpp.

1824 {
1825  InsertRichEditText(szText.GetString(), flags);
1826 }
PCXSTR GetString() const
Definition: atlsimpstr.h:361
GLbitfield flags
Definition: glext.h:7161
VOID InsertRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1797

◆ ListViewAddItem() [1/2]

INT ListViewAddItem ( INT  ItemIndex,
INT  IconIndex,
LPWSTR  lpName,
LPARAM  lParam 
)

Definition at line 1787 of file gui.cpp.

Referenced by ListViewAddItem(), CMainWindow::s_EnumAvailableAppProc(), and CMainWindow::s_EnumInstalledAppProc().

1788 {
1789  return g_MainWindow->GetListView()->AddItem(ItemIndex, IconIndex, lpName, lParam);
1790 }
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
_In_ LPCSTR lpName
Definition: winbase.h:2729
static const WCHAR IconIndex[]
Definition: install.c:51
CAppsListView * GetListView()
Definition: gui.cpp:1748
INT AddItem(INT ItemIndex, INT IconIndex, LPWSTR lpText, LPARAM lParam)
Definition: gui.cpp:503
LPARAM lParam
Definition: combotst.c:139

◆ ListViewAddItem() [2/2]

INT ListViewAddItem ( INT  ItemIndex,
INT  IconIndex,
const ATL::CStringW Name,
LPARAM  lParam 
)

Definition at line 1813 of file gui.cpp.

1814 {
1815  return ListViewAddItem(ItemIndex, IconIndex, const_cast<LPWSTR>(Name.GetString()), lParam);
1816 }
INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam)
Definition: gui.cpp:1787
PCXSTR GetString() const
Definition: atlsimpstr.h:361
static const WCHAR IconIndex[]
Definition: install.c:51
LPARAM lParam
Definition: combotst.c:139

◆ ListViewGetlParam()

DWORD_PTR ListViewGetlParam ( INT  item)

Definition at line 1773 of file gui.cpp.

Referenced by CMainWindow::FreeInstalledAppList(), RemoveAppFromRegistry(), CAvailableAppView::ShowAvailableAppInfo(), and ShowInstalledAppInfo().

1774 {
1775  if (item < 0)
1776  {
1778  }
1780 }
DWORD_PTR GetItemData(int i)
Definition: rosctrls.h:191
int GetSelectionMark()
Definition: rosctrls.h:156
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
static ATOM item
Definition: dde.c:856
CAppsListView * GetListView()
Definition: gui.cpp:1748

◆ NewRichEditText() [1/2]

VOID NewRichEditText ( LPCWSTR  szText,
DWORD  flags 
)

Definition at line 1792 of file gui.cpp.

Referenced by NewRichEditText(), SetWelcomeText(), CAvailableAppView::ShowAvailableAppInfo(), and ShowInstalledAppInfo().

1793 {
1795 }
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
static const WCHAR szText[]
Definition: dialog.c:139
CRichEdit * GetRichEdit()
Definition: gui.cpp:1753
GLbitfield flags
Definition: glext.h:7161
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84

◆ NewRichEditText() [2/2]

VOID NewRichEditText ( const ATL::CStringW szText,
DWORD  flags 
)

Definition at line 1818 of file gui.cpp.

1819 {
1820  NewRichEditText(szText.GetString(), flags);
1821 }
VOID NewRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1792
PCXSTR GetString() const
Definition: atlsimpstr.h:361
GLbitfield flags
Definition: glext.h:7161

◆ SetStatusBarText() [1/2]

VOID SetStatusBarText ( LPCWSTR  szText)

Definition at line 1782 of file gui.cpp.

Referenced by SetStatusBarText().

1783 {
1785 }
CMainWindow * g_MainWindow
Definition: gui.cpp:1765
CStatusBar * GetStatusBar()
Definition: gui.cpp:1743
static const WCHAR szText[]
Definition: dialog.c:139
VOID SetText(LPCWSTR lpszText)
Definition: rosctrls.h:437

◆ SetStatusBarText() [2/2]

VOID SetStatusBarText ( const ATL::CStringW szText)

Definition at line 1808 of file gui.cpp.

1809 {
1810  SetStatusBarText(szText.GetString());
1811 }
VOID SetStatusBarText(LPCWSTR szText)
Definition: gui.cpp:1782
PCXSTR GetString() const
Definition: atlsimpstr.h:361

Variable Documentation

◆ g_MainWindow

CMainWindow* g_MainWindow

Definition at line 1765 of file gui.cpp.

◆ hListView