ReactOS 0.4.16-dev-106-g10b08aa
Icon Struct Reference

#include <globals.h>

Inheritance diagram for Icon:
Collaboration diagram for Icon:

Public Member Functions

 Icon ()
 
 Icon (ICON_ID id, UINT nid)
 
 Icon (ICON_ID id, UINT nid, int icon_size)
 
 Icon (ICON_TYPE itype, int id, HICON hIcon)
 
 Icon (ICON_TYPE itype, int id, int sys_idx)
 
 operator ICON_ID () const
 
void draw (HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const
 
HBITMAP create_bitmap (COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const
 
int add_to_imagelist (HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const
 
int get_sysiml_idx () const
 
HICON get_hicon () const
 
ICON_TYPE get_icontype () const
 
bool destroy ()
 

Protected Attributes

ICON_ID _id
 
ICON_TYPE _itype
 
HICON _hicon
 
int _sys_idx
 

Detailed Description

Definition at line 96 of file globals.h.

Constructor & Destructor Documentation

◆ Icon() [1/5]

Icon::Icon ( )

Definition at line 242 of file explorer.cpp.

243 : _id(ICID_UNKNOWN),
245 _hicon(0)
246{
247}
@ ICID_UNKNOWN
Definition: globals.h:63
@ IT_STATIC
Definition: globals.h:56
ICON_TYPE _itype
Definition: globals.h:117
HICON _hicon
Definition: globals.h:118
ICON_ID _id
Definition: globals.h:116

◆ Icon() [2/5]

Icon::Icon ( ICON_ID  id,
UINT  nid 
)

Definition at line 249 of file explorer.cpp.

250 : _id(id),
252 _hicon(ResIcon(nid)) // ResIconEx(nid, cx, cy)
253{
254}
NOTIFYICONDATA nid
Definition: magnifier.c:44
convenient loading of standard (32x32) icon resources
Definition: globals.h:310

◆ Icon() [3/5]

Icon::Icon ( ICON_ID  id,
UINT  nid,
int  icon_size 
)

Definition at line 256 of file explorer.cpp.

257 : _id(id),
260{
261}
iconPos iconPos icon_size
Definition: startmenu.cpp:1416
convenient loading of icon resources with specified sizes
Definition: globals.h:332

◆ Icon() [4/5]

Icon::Icon ( ICON_TYPE  itype,
int  id,
HICON  hIcon 
)

Definition at line 263 of file explorer.cpp.

264 : _id((ICON_ID)id),
265 _itype(itype),
267{
268}
ICON_ID
Definition: globals.h:62
HICON hIcon
Definition: msconfig.c:44

◆ Icon() [5/5]

Icon::Icon ( ICON_TYPE  itype,
int  id,
int  sys_idx 
)

Definition at line 270 of file explorer.cpp.

271 : _id((ICON_ID)id),
272 _itype(itype),
273 _sys_idx(sys_idx)
274{
275}
int _sys_idx
Definition: globals.h:119

Member Function Documentation

◆ add_to_imagelist()

int Icon::add_to_imagelist ( HIMAGELIST  himl,
HDC  hdc_wnd,
COLORREF  bk_color = GetSysColor(COLOR_WINDOW),
HBRUSH  bk_brush = GetSysColorBrush(COLOR_WINDOW) 
) const

Definition at line 306 of file explorer.cpp.

307{
308 int ret;
309
310 if (_itype == IT_SYSCACHE) {
311 HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
312
313 int cx, cy;
315
317 HDC hdc = CreateCompatibleDC(hdc_wnd);
318 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
320 SelectBitmap(hdc, hbmp_old);
321 DeleteDC(hdc);
322
323 ret = ImageList_Add(himl, hbmp, 0);
324
326 } else
328
329 return ret;
330}
HBITMAP hbmp
HIMAGELIST himl
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
BOOL WINAPI ImageList_DrawEx(HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, INT dx, INT dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)
Definition: imagelist.c:1264
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2037
pKey DeleteObject()
int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
Definition: explorer.cpp:366
@ IT_SYSCACHE
Definition: globals.h:59
struct ExplorerGlobals g_Globals
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define ILD_NORMAL
Definition: commctrl.h:417
_Out_opt_ int * cx
Definition: commctrl.h:585
#define CLR_DEFAULT
Definition: commctrl.h:320
COLORREF bk_color
Definition: startmenu.cpp:1409
HBRUSH bk_brush
Definition: startmenu.cpp:1410
int ret
#define SelectBitmap(hdc, hbm)
Definition: windowsx.h:514
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by BookmarkList::fill_tree(), and MainFrameBase::FillBookmarks().

◆ create_bitmap()

HBITMAP Icon::create_bitmap ( COLORREF  bk_color,
HBRUSH  hbrBkgnd,
HDC  hdc_wnd 
) const

Definition at line 285 of file explorer.cpp.

286{
287 if (_itype == IT_SYSCACHE) {
288 HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
289
290 int cx, cy;
292
294 HDC hdc = CreateCompatibleDC(hdc_wnd);
295 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
297 SelectBitmap(hdc, hbmp_old);
298 DeleteDC(hdc);
299
300 return hbmp;
301 } else
302 return create_bitmap_from_icon(_hicon, hbrBkgnd, hdc_wnd);
303}
HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
Definition: explorer.cpp:332

Referenced by QuickLaunchBar::AddShortcuts().

◆ destroy()

bool Icon::destroy ( )
inline

Definition at line 113 of file globals.h.

113{if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;}
@ IT_DYNAMIC
Definition: globals.h:58
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105

Referenced by IconCache::free_icon().

◆ draw()

void Icon::draw ( HDC  hdc,
int  x,
int  y,
int  cx,
int  cy,
COLORREF  bk_color,
HBRUSH  bk_brush 
) const

Definition at line 277 of file explorer.cpp.

278{
279 if (_itype == IT_SYSCACHE)
280 ImageList_DrawEx(g_Globals._icon_cache.get_sys_imagelist(), _sys_idx, hdc, x, y, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
281 else
283}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define DI_NORMAL
Definition: wingdi.h:72
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:2080

Referenced by Pane::draw_item().

◆ get_hicon()

HICON Icon::get_hicon ( ) const
inline

Definition at line 110 of file globals.h.

110{return _itype!=IT_SYSCACHE? _hicon: 0;}

Referenced by ShellBrowser::get_image_idx().

◆ get_icontype()

ICON_TYPE Icon::get_icontype ( ) const
inline

Definition at line 111 of file globals.h.

111{ return _itype; }

◆ get_sysiml_idx()

int Icon::get_sysiml_idx ( ) const
inline

Definition at line 109 of file globals.h.

109{return _itype==IT_SYSCACHE? _sys_idx: -1;}

Referenced by FindProgramDlg::Notify().

◆ operator ICON_ID()

Icon::operator ICON_ID ( ) const
inline

Definition at line 103 of file globals.h.

103{return _id;}

Member Data Documentation

◆ _hicon

HICON Icon::_hicon
protected

Definition at line 118 of file globals.h.

Referenced by add_to_imagelist(), create_bitmap(), destroy(), draw(), and get_hicon().

◆ _id

ICON_ID Icon::_id
protected

Definition at line 116 of file globals.h.

Referenced by operator ICON_ID().

◆ _itype

ICON_TYPE Icon::_itype
protected

◆ _sys_idx

int Icon::_sys_idx
protected

Definition at line 119 of file globals.h.

Referenced by add_to_imagelist(), create_bitmap(), draw(), and get_sysiml_idx().


The documentation for this struct was generated from the following files: