summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-05-13 13:27:37 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-05-13 13:27:37 +0000
commit690b0e1f33d4426cd7afdf6b35404090e56344b3 (patch)
tree8c1dab75ee93f5909d86df15dbf75e2b34c81520
parenta0fe5db9655fb9f462520631b99e81734e88a51d (diff)
INTEGRATION: CWS presenterscreen (1.2.4); FILE MERGED
2008/04/22 08:25:23 af 1.2.4.2: RESYNC: (1.2-1.3); FILE MERGED 2008/04/16 15:25:28 af 1.2.4.1: #i18486# Merged bitmap description of this container and PresenterTheme.
-rw-r--r--sdext/source/presenter/PresenterBitmapContainer.hxx95
1 files changed, 79 insertions, 16 deletions
diff --git a/sdext/source/presenter/PresenterBitmapContainer.hxx b/sdext/source/presenter/PresenterBitmapContainer.hxx
index cb2228ccfbdc..d3d7297bc052 100644
--- a/sdext/source/presenter/PresenterBitmapContainer.hxx
+++ b/sdext/source/presenter/PresenterBitmapContainer.hxx
@@ -8,7 +8,7 @@
*
* $RCSfile: PresenterBitmapContainer.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -32,14 +32,19 @@
#ifndef SDEXT_PRESENTER_BITMAP_CONTAINER_HXX
#define SDEXT_PRESENTER_BITMAP_CONTAINER_HXX
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/drawing/XPresenterHelper.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/rendering/XBitmap.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/Color.hpp>
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <map>
#include <vector>
+#include <boost/shared_ptr.hpp>
namespace css = ::com::sun::star;
@@ -58,18 +63,44 @@ public:
/** There is one bitmap for the normal state, one for a mouse over effect and one
to show that a button has been pressed.
*/
- class BitmapSet
+ class BitmapDescriptor
{
public:
- css::uno::Reference<css::rendering::XBitmap> mxNormalIcon;
- css::uno::Reference<css::rendering::XBitmap> mxMouseOverIcon;
- css::uno::Reference<css::rendering::XBitmap> mxButtonDownIcon;
+ BitmapDescriptor (void);
+ BitmapDescriptor (const ::boost::shared_ptr<BitmapDescriptor>& rpDefault);
+
+ enum Mode {Normal, MouseOver, ButtonDown, Disabled, Mask};
+ css::uno::Reference<css::rendering::XBitmap> GetNormalBitmap (void) const;
+ css::uno::Reference<css::rendering::XBitmap> GetBitmap (
+ const Mode eMode,
+ const bool bMissingDefaultsToNormal = true) const;
+ void SetBitmap (
+ const Mode eMode,
+ const css::uno::Reference<css::rendering::XBitmap>& rxBitmap);
+
+ sal_Int32 mnWidth;
+ sal_Int32 mnHeight;
+ sal_Int32 mnXOffset;
+ sal_Int32 mnYOffset;
+ sal_Int32 mnXHotSpot;
+ sal_Int32 mnYHotSpot;
+ css::util::Color maReplacementColor;
+ enum TexturingMode { Once, Repeat, Stretch };
+ TexturingMode meHorizontalTexturingMode;
+ TexturingMode meVerticalTexturingMode;
/** Fill in missing bitmaps by making mxNormalIcon lighter or
darker.
*/
void Update (
const css::uno::Reference<css::rendering::XGraphicDevice>& rxDevice);
+
+ private:
+ css::uno::Reference<css::rendering::XBitmap> mxNormalBitmap;
+ css::uno::Reference<css::rendering::XBitmap> mxMouseOverBitmap;
+ css::uno::Reference<css::rendering::XBitmap> mxButtonDownBitmap;
+ css::uno::Reference<css::rendering::XBitmap> mxDisabledBitmap;
+ css::uno::Reference<css::rendering::XBitmap> mxMaskBitmap;
};
/** Create a new bitmap container from a section of the configuration.
@@ -82,31 +113,63 @@ public:
bitmap sets.
*/
PresenterBitmapContainer (
+ const ::rtl::OUString& rsConfigurationBase,
+ const ::boost::shared_ptr<PresenterBitmapContainer>& rpParentContainer,
+ const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
+ const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
+ const ::rtl::OUString& rsBasePath,
+ const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper = NULL);
+ PresenterBitmapContainer (
+ const css::uno::Reference<css::container::XNameAccess>& rsRootNode,
+ const ::boost::shared_ptr<PresenterBitmapContainer>& rpParentContainer,
const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
- const ::rtl::OUString& rsConfigurationBase);
+ const ::rtl::OUString& rsBasePath,
+ const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper = NULL);
~PresenterBitmapContainer (void);
+ void Initialize (
+ const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext);
+
/** Return the bitmap set that is associated with the given name.
*/
- BitmapSet GetButtons (const ::rtl::OUString& rsName) const;
+ ::boost::shared_ptr<BitmapDescriptor> GetBitmap (const ::rtl::OUString& rsName) const;
+
+ static ::boost::shared_ptr<BitmapDescriptor> LoadBitmap (
+ const css::uno::Reference<css::container::XHierarchicalNameAccess>& rxNode,
+ const ::rtl::OUString& rsPathToBitmapNode,
+ const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper,
+ const ::rtl::OUString& rsBitmapBasePath,
+ const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
+ const ::boost::shared_ptr<BitmapDescriptor>& rpDefaultBitmap);
private:
- typedef ::std::map<rtl::OUString,BitmapSet> BitmapContainer;
+ ::boost::shared_ptr<PresenterBitmapContainer> mpParentContainer;
+ typedef ::std::map<rtl::OUString, ::boost::shared_ptr<BitmapDescriptor> > BitmapContainer;
BitmapContainer maIconContainer;
+ ::rtl::OUString msBasePath;
+ css::uno::Reference<css::rendering::XCanvas> mxCanvas;
+ css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
- void LoadButtons (
- const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
- const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
- const ::rtl::OUString& rsConfigurationBase);
+ void LoadBitmaps (
+ const css::uno::Reference<css::container::XNameAccess>& rsRootNode);
void ProcessBitmap (
const ::rtl::OUString& rsKey,
- const ::std::vector<css::uno::Any>& rValues,
- const ::rtl::OUString& rsLocation,
+ const css::uno::Reference<css::beans::XPropertySet>& rProperties);
+ static ::boost::shared_ptr<BitmapDescriptor> LoadBitmap (
+ const css::uno::Reference<css::beans::XPropertySet>& rxProperties,
+ const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper,
+ const ::rtl::OUString& rsBasePath,
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
- const css::uno::Reference<css::drawing::XPresenterHelper>& rxBitmapLoader);
+ const ::boost::shared_ptr<PresenterBitmapContainer::BitmapDescriptor>& rpDefault);
+ static BitmapDescriptor::TexturingMode
+ StringToTexturingMode (const ::rtl::OUString& rsTexturingMode);
};
+
+typedef PresenterBitmapContainer::BitmapDescriptor PresenterBitmapDescriptor;
+typedef ::boost::shared_ptr<PresenterBitmapContainer::BitmapDescriptor> SharedBitmapDescriptor;
+
} } // end of namespace ::sdext::presenter
#endif