michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef WindowGfx_h__ michael@0: #define WindowGfx_h__ michael@0: michael@0: /* michael@0: * nsWindowGfx - Painting and aceleration. michael@0: */ michael@0: michael@0: #include "nsWindow.h" michael@0: #include michael@0: michael@0: // This isn't ideal, we should figure out how to export michael@0: // the #defines here; need this to figure out if we have michael@0: // the DirectDraw surface or not. michael@0: #include "cairo-features.h" michael@0: michael@0: class nsWindowGfx { michael@0: public: michael@0: enum IconSizeType { michael@0: kSmallIcon, michael@0: kRegularIcon michael@0: }; michael@0: static gfxIntSize GetIconMetrics(IconSizeType aSizeType); michael@0: static nsresult CreateIcon(imgIContainer *aContainer, bool aIsCursor, uint32_t aHotspotX, uint32_t aHotspotY, gfxIntSize aScaledSize, HICON *aIcon); michael@0: michael@0: private: michael@0: /** michael@0: * Cursor helpers michael@0: */ michael@0: static uint8_t* Data32BitTo1Bit(uint8_t* aImageData, uint32_t aWidth, uint32_t aHeight); michael@0: static HBITMAP DataToBitmap(uint8_t* aImageData, uint32_t aWidth, uint32_t aHeight, uint32_t aDepth); michael@0: }; michael@0: michael@0: #endif // WindowGfx_h__