From b84f891f0dac03a170637a1cf54bd1e25a87eb1f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 21 Feb 2015 21:19:12 +0000 Subject: code formatting git-svn-id: http://svn.miranda-ng.org/main/trunk@12236 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/sidebar.h | 236 +++++++++++++++++++++--------------------- 1 file changed, 118 insertions(+), 118 deletions(-) (limited to 'plugins/TabSRMM/src/sidebar.h') diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index 71a6061b56..1a3d1896df 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -48,10 +48,10 @@ struct TSideBarLayout * a default is always provided, however, it has been designed to be easily extendible without * rewriting lots of code just in order to change how the switchbar items look like. */ - void (__fastcall *pfnContentRenderer)(const HDC hdc, const RECT *rc, const CSideBarButton *item); - void (__fastcall *pfnBackgroundRenderer)(const HDC hdc, const RECT *rc, const CSideBarButton *item); + void(__fastcall *pfnContentRenderer)(const HDC hdc, const RECT *rc, const CSideBarButton *item); + void(__fastcall *pfnBackgroundRenderer)(const HDC hdc, const RECT *rc, const CSideBarButton *item); const SIZE& (__fastcall *pfnMeasureItem)(CSideBarButton *item); - void (__fastcall *pfnLayout)(const CSideBar *sideBar, RECT *rc); + void(__fastcall *pfnLayout)(const CSideBar *sideBar, RECT *rc); UINT uId; // numeric id by which the layout is identified. basically, the index into the array. }; @@ -64,37 +64,37 @@ public: CSideBarButton(const TWindowData *dat, CSideBar *sideBar); ~CSideBarButton(); - LONG getHeight() const { return(m_sz.cy); } - const SIZE& getSize() const { return(m_sz); } - void setSize(const SIZE& newSize) { m_sz = newSize; } - const bool isTopAligned() const { return(m_isTopAligned); } - const HWND getHwnd() const { return(m_hwnd); } - const UINT getID() const { return(m_id); } - const MCONTACT getContactHandle() const { return(m_dat->hContact); } - const TWindowData* getDat() const { return(m_dat); } - const TSideBarLayout* getLayout() const { return(m_sideBarLayout); } - - void RenderThis(const HDC hdc) const; - void renderIconAndNick(const HDC hdc, const RECT *rcItem) const; - int testCloseButton() const; - void Show(const int showCmd) const; - void activateSession() const; - const SIZE& measureItem(); - void setLayout(const TSideBarLayout *newLayout); - void invokeContextMenu(); + LONG getHeight() const { return(m_sz.cy); } + const SIZE& getSize() const { return(m_sz); } + void setSize(const SIZE& newSize) { m_sz = newSize; } + const bool isTopAligned() const { return(m_isTopAligned); } + const HWND getHwnd() const { return(m_hwnd); } + const UINT getID() const { return(m_id); } + const MCONTACT getContactHandle() const { return(m_dat->hContact); } + const TWindowData* getDat() const { return(m_dat); } + const TSideBarLayout* getLayout() const { return(m_sideBarLayout); } + + void RenderThis(const HDC hdc) const; + void renderIconAndNick(const HDC hdc, const RECT *rcItem) const; + int testCloseButton() const; + void Show(const int showCmd) const; + void activateSession() const; + const SIZE& measureItem(); + void setLayout(const TSideBarLayout *newLayout); + void invokeContextMenu(); public: - CSideBar* m_sideBar; - const TSButtonCtrl* m_buttonControl; // private data struct of the Win32 button object + CSideBar* m_sideBar; + const TSButtonCtrl* m_buttonControl; // private data struct of the Win32 button object private: - void _create(); + void _create(); private: - const TSideBarLayout* m_sideBarLayout; - HWND m_hwnd; // window handle for the TSButton object - const TWindowData* m_dat; // session data - UINT m_id; // control id - bool m_isTopAligned; - SIZE m_sz; + const TSideBarLayout* m_sideBarLayout; + HWND m_hwnd; // window handle for the TSButton object + const TWindowData* m_dat; // session data + UINT m_id; // control id + bool m_isTopAligned; + SIZE m_sz; }; class CSideBar @@ -129,101 +129,101 @@ public: CSideBar(TContainerData *pContainer); ~CSideBar(); - void Init(); - void addSession(const TWindowData *dat, int position); - HRESULT removeSession(const TWindowData *dat); - void updateSession(const TWindowData *dat); - - void processScrollerButtons(UINT cmd); - void Layout(const RECT *rc = 0, bool fOnlyCalc = false); - void setVisible(bool fNewVisibility); - void showAll(int showCmd); - - const LONG getWidth() const { return(m_isVisible ? m_width + SIDEBAR_GAP : 0); } - const DWORD getFlags() const { return(m_dwFlags); } - const TContainerData* getContainer() const { return(m_pContainer); } - const bool isActive() const { return(m_isActive); } - const bool isVisible() const { return(m_isVisible); } - const CSideBarButton* getActiveItem() const { return(m_activeItem); } - const CSideBarButton* getScrollUp() const { return(m_up); } - const CSideBarButton* getScrollDown() const { return(m_down); } - bool isSkinnedContainer() const { return(CSkin::m_skinEnabled ? true : false); } - const UINT getLayoutId() const { return(m_uLayout); } - void invalidateButton(const TWindowData *dat); - - const CSideBarButton* setActiveItem(const CSideBarButton *newItem) - { - CSideBarButton *oldItem = m_activeItem; - m_activeItem = const_cast(newItem); - if (oldItem) - ::InvalidateRect(oldItem->getHwnd(), NULL, FALSE); - ::InvalidateRect(m_activeItem->getHwnd(), NULL, FALSE); - scrollIntoView(m_activeItem); - return(oldItem); - } - /** - * this item has its close button currently hovered - * @param item: the CSideBarButton* which is hovered - */ - void setHoveredClose (CSideBarButton* item) - { - m_hoveredClose = item; - } - HWND getScrollWnd() const { return(m_hwndScrollWnd); } - const CSideBarButton* getHoveredClose() const { return(m_hoveredClose); } - const CSideBarButton* setActiveItem (const TWindowData *dat); - - static LRESULT CALLBACK wndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - - static const TSideBarLayout* getLayouts (int& uLayoutCount) - { - uLayoutCount = NR_LAYOUTS; - return(m_layouts); - } - void scrollIntoView (const CSideBarButton *item = 0); - void resizeScrollWnd (LONG x, LONG y, LONG width, LONG height) const; + void Init(); + void addSession(const TWindowData *dat, int position); + HRESULT removeSession(const TWindowData *dat); + void updateSession(const TWindowData *dat); + + void processScrollerButtons(UINT cmd); + void Layout(const RECT *rc = 0, bool fOnlyCalc = false); + void setVisible(bool fNewVisibility); + void showAll(int showCmd); + + const LONG getWidth() const { return(m_isVisible ? m_width + SIDEBAR_GAP : 0); } + const DWORD getFlags() const { return(m_dwFlags); } + const TContainerData* getContainer() const { return(m_pContainer); } + const bool isActive() const { return(m_isActive); } + const bool isVisible() const { return(m_isVisible); } + const CSideBarButton* getActiveItem() const { return(m_activeItem); } + const CSideBarButton* getScrollUp() const { return(m_up); } + const CSideBarButton* getScrollDown() const { return(m_down); } + bool isSkinnedContainer() const { return(CSkin::m_skinEnabled ? true : false); } + const UINT getLayoutId() const { return(m_uLayout); } + void invalidateButton(const TWindowData *dat); + + const CSideBarButton* setActiveItem(const CSideBarButton *newItem) + { + CSideBarButton *oldItem = m_activeItem; + m_activeItem = const_cast(newItem); + if (oldItem) + ::InvalidateRect(oldItem->getHwnd(), NULL, FALSE); + ::InvalidateRect(m_activeItem->getHwnd(), NULL, FALSE); + scrollIntoView(m_activeItem); + return(oldItem); + } + /** + * this item has its close button currently hovered + * @param item: the CSideBarButton* which is hovered + */ + void setHoveredClose(CSideBarButton* item) + { + m_hoveredClose = item; + } + HWND getScrollWnd() const { return(m_hwndScrollWnd); } + const CSideBarButton* getHoveredClose() const { return(m_hoveredClose); } + const CSideBarButton* setActiveItem(const TWindowData *dat); + + static LRESULT CALLBACK wndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + + static const TSideBarLayout* getLayouts(int& uLayoutCount) + { + uLayoutCount = NR_LAYOUTS; + return(m_layouts); + } + void scrollIntoView(const CSideBarButton *item = 0); + void resizeScrollWnd(LONG x, LONG y, LONG width, LONG height) const; private: - void createScroller(); - void destroyScroller(); - void populateAll(); - void removeAll(); - void Invalidate(); - CSideBarButton* findSession(const TWindowData *dat); - CSideBarButton* findSession(const MCONTACT hContact); + void createScroller(); + void destroyScroller(); + void populateAll(); + void removeAll(); + void Invalidate(); + CSideBarButton* findSession(const TWindowData *dat); + CSideBarButton* findSession(const MCONTACT hContact); - LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); private: - HWND m_hwndScrollWnd; - OBJLIST m_buttonlist; // our list of buttons - TContainerData* m_pContainer; // our master and commander... - LONG m_width; // required width of the bar (m_elementWidth + padding) - DWORD m_dwFlags; - CSideBarButton* m_up, *m_down; // the scroller buttons (up down) - CSideBarButton* m_activeItem; // active button item (for highlighting) - const CSideBarButton* m_hoveredClose; // item which must display an active close button - LONG m_topHeight, m_bottomHeight; - LONG m_firstVisibleOffset, m_totalItemHeight; - int m_iTopButtons, m_iBottomButtons; - LONG m_elementHeight, m_elementWidth; // width / height for a single element. - // can be dynamic (see measeureItem() in CSideBarButtonItem - bool m_isActive; // the sidebar is active (false, if it does _nothing at all_ - bool m_isVisible; // visible aswell (not collapsed) - TSideBarLayout* m_currentLayout; // the layout in use. will be passed to new button items - UINT m_uLayout; // layout id number, currently in use + HWND m_hwndScrollWnd; + OBJLIST m_buttonlist; // our list of buttons + TContainerData* m_pContainer; // our master and commander... + LONG m_width; // required width of the bar (m_elementWidth + padding) + DWORD m_dwFlags; + CSideBarButton* m_up, *m_down; // the scroller buttons (up down) + CSideBarButton* m_activeItem; // active button item (for highlighting) + const CSideBarButton* m_hoveredClose; // item which must display an active close button + LONG m_topHeight, m_bottomHeight; + LONG m_firstVisibleOffset, m_totalItemHeight; + int m_iTopButtons, m_iBottomButtons; + LONG m_elementHeight, m_elementWidth; // width / height for a single element. + // can be dynamic (see measeureItem() in CSideBarButtonItem + bool m_isActive; // the sidebar is active (false, if it does _nothing at all_ + bool m_isVisible; // visible aswell (not collapsed) + TSideBarLayout* m_currentLayout; // the layout in use. will be passed to new button items + UINT m_uLayout; // layout id number, currently in use private: - /* - * layouts. m_layouts[] is static and contains layout descriptions - * renderer functions are static aswell - */ - static TSideBarLayout m_layouts[NR_LAYOUTS]; - static void __fastcall m_DefaultBackgroundRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); - static void __fastcall m_DefaultContentRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); - static void __fastcall m_AdvancedContentRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); - - static const SIZE& __fastcall m_measureAdvancedVertical(CSideBarButton *item); + /* + * layouts. m_layouts[] is static and contains layout descriptions + * renderer functions are static aswell + */ + static TSideBarLayout m_layouts[NR_LAYOUTS]; + static void __fastcall m_DefaultBackgroundRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); + static void __fastcall m_DefaultContentRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); + static void __fastcall m_AdvancedContentRenderer(const HDC hdc, const RECT *rc, const CSideBarButton *item); + + static const SIZE& __fastcall m_measureAdvancedVertical(CSideBarButton *item); }; inline void CSideBarButton::setLayout(const TSideBarLayout *newLayout) -- cgit v1.2.3