PresenterClock.cxx (5d03e972) PresenterClock.cxx (45b93914)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 11 unchanged lines hidden (view full) ---

20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sdext.hxx"
26
27#include "PresenterClock.hxx"
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 11 unchanged lines hidden (view full) ---

20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sdext.hxx"
26
27#include "PresenterClock.hxx"
28#include "PresenterComponent.hxx"
28#include "PresenterConfigurationAccess.hxx"
29#include "PresenterGeometryHelper.hxx"
30#include <com/sun/star/awt/InvalidateStyle.hpp>
31#include <com/sun/star/awt/MouseButton.hpp>
32#include <com/sun/star/awt/Point.hpp>
33#include <com/sun/star/awt/XWindowPeer.hpp>
34#include <com/sun/star/container/XNameAccess.hpp>
35#include <com/sun/star/deployment/XPackageInformationProvider.hpp>

--- 160 unchanged lines hidden (view full) ---

196 const ::rtl::OUString& rsCurrentThemeName);
197 void LoadBitmaps (
198 PresenterConfigurationAccess& rConfiguration,
199 const Reference<container::XNameAccess>& rxNameAccess,
200 const Reference<rendering::XCanvas>& rxCanvas);
201 void LoadBitmap (
202 const OUString& rsKey,
203 const ::std::vector<Any>& rValues,
29#include "PresenterConfigurationAccess.hxx"
30#include "PresenterGeometryHelper.hxx"
31#include <com/sun/star/awt/InvalidateStyle.hpp>
32#include <com/sun/star/awt/MouseButton.hpp>
33#include <com/sun/star/awt/Point.hpp>
34#include <com/sun/star/awt/XWindowPeer.hpp>
35#include <com/sun/star/container/XNameAccess.hpp>
36#include <com/sun/star/deployment/XPackageInformationProvider.hpp>

--- 160 unchanged lines hidden (view full) ---

197 const ::rtl::OUString& rsCurrentThemeName);
198 void LoadBitmaps (
199 PresenterConfigurationAccess& rConfiguration,
200 const Reference<container::XNameAccess>& rxNameAccess,
201 const Reference<rendering::XCanvas>& rxCanvas);
202 void LoadBitmap (
203 const OUString& rsKey,
204 const ::std::vector<Any>& rValues,
205 const OUString& rsBitmapPath,
204 const Reference<container::XNameAccess>& rxBitmapLoader);
205 void ScaleBitmaps (void);
206 };
207
208
209 class DigitalDefaultPainter : public PresenterClock::Painter
210 {
211 public:

--- 817 unchanged lines hidden (view full) ---

1029
1030 if ( ! mbThemeLoaded)
1031 {
1032 mbThemeLoaded = true;
1033
1034 // Get access to the clock bitmaps in the configuration.
1035 PresenterConfigurationAccess aConfiguration (
1036 mxComponentContext,
206 const Reference<container::XNameAccess>& rxBitmapLoader);
207 void ScaleBitmaps (void);
208 };
209
210
211 class DigitalDefaultPainter : public PresenterClock::Painter
212 {
213 public:

--- 817 unchanged lines hidden (view full) ---

1031
1032 if ( ! mbThemeLoaded)
1033 {
1034 mbThemeLoaded = true;
1035
1036 // Get access to the clock bitmaps in the configuration.
1037 PresenterConfigurationAccess aConfiguration (
1038 mxComponentContext,
1037 OUString::createFromAscii("org.openoffice.Office.PresenterScreen"),
1039 OUString::createFromAscii("org.openoffice.Office.extension.PresenterScreen"),
1038 PresenterConfigurationAccess::READ_ONLY);
1039
1040 Reference<container::XNameAccess> xTheme (GetTheme(aConfiguration));
1041 if (xTheme.is())
1042 LoadBitmaps(aConfiguration, xTheme, rxCanvas);
1043 else
1044 mbThemeLoadingFailed = true;
1045 }

--- 65 unchanged lines hidden (view full) ---

1111
1112
1113void AnalogBitmapPainter::LoadBitmaps (
1114 PresenterConfigurationAccess& rConfiguration,
1115 const Reference<container::XNameAccess>& rxClockTheme,
1116 const Reference<rendering::XCanvas>& rxCanvas)
1117{
1118 (void)rConfiguration;
1040 PresenterConfigurationAccess::READ_ONLY);
1041
1042 Reference<container::XNameAccess> xTheme (GetTheme(aConfiguration));
1043 if (xTheme.is())
1044 LoadBitmaps(aConfiguration, xTheme, rxCanvas);
1045 else
1046 mbThemeLoadingFailed = true;
1047 }

--- 65 unchanged lines hidden (view full) ---

1113
1114
1115void AnalogBitmapPainter::LoadBitmaps (
1116 PresenterConfigurationAccess& rConfiguration,
1117 const Reference<container::XNameAccess>& rxClockTheme,
1118 const Reference<rendering::XCanvas>& rxCanvas)
1119{
1120 (void)rConfiguration;
1121
1122 // Get base path to bitmaps.
1123 Reference<deployment::XPackageInformationProvider> xInformationProvider (
1124 mxComponentContext->getValueByName(OUString::createFromAscii(
1125 "/singletons/com.sun.star.deployment.PackageInformationProvider")),
1126 UNO_QUERY);
1127 OUString sLocation;
1128 if (xInformationProvider.is())
1129 sLocation = xInformationProvider->getPackageLocation(gsExtensionIdentifier);
1130 sLocation += OUString::createFromAscii("/");
1131
1119 // Create the bitmap loader.
1120 Reference<lang::XMultiComponentFactory> xFactory (
1121 mxComponentContext->getServiceManager(), UNO_QUERY);
1122 if ( ! xFactory.is())
1123 return;
1124 Sequence<Any> aArguments(1);
1125 aArguments[0] <<= rxCanvas;
1126 Reference<container::XNameAccess> xBitmapLoader(

--- 16 unchanged lines hidden (view full) ---

1143 aBitmapProperties[2] = OUString::createFromAscii("YOffset");
1144 PresenterConfigurationAccess::ForAll(
1145 xBitmaps,
1146 aBitmapProperties,
1147 ::boost::bind(&AnalogBitmapPainter::LoadBitmap,
1148 this,
1149 _1,
1150 _2,
1132 // Create the bitmap loader.
1133 Reference<lang::XMultiComponentFactory> xFactory (
1134 mxComponentContext->getServiceManager(), UNO_QUERY);
1135 if ( ! xFactory.is())
1136 return;
1137 Sequence<Any> aArguments(1);
1138 aArguments[0] <<= rxCanvas;
1139 Reference<container::XNameAccess> xBitmapLoader(

--- 16 unchanged lines hidden (view full) ---

1156 aBitmapProperties[2] = OUString::createFromAscii("YOffset");
1157 PresenterConfigurationAccess::ForAll(
1158 xBitmaps,
1159 aBitmapProperties,
1160 ::boost::bind(&AnalogBitmapPainter::LoadBitmap,
1161 this,
1162 _1,
1163 _2,
1164 sLocation,
1151 xBitmapLoader));
1152}
1153
1154
1155
1156
1157void AnalogBitmapPainter::LoadBitmap (
1158 const OUString& rsKey,
1159 const ::std::vector<Any>& rValues,
1165 xBitmapLoader));
1166}
1167
1168
1169
1170
1171void AnalogBitmapPainter::LoadBitmap (
1172 const OUString& rsKey,
1173 const ::std::vector<Any>& rValues,
1174 const OUString& rsBitmapPath,
1160 const Reference<container::XNameAccess>& rxBitmapLoader)
1161{
1162 if (rValues.size() == 3)
1163 {
1164 BitmapDescriptor* pDescriptor = NULL;
1165 if (rsKey == OUString::createFromAscii("Face"))
1166 pDescriptor = &maFace;
1167 else if (rsKey == OUString::createFromAscii("HourHand"))

--- 7 unchanged lines hidden (view full) ---

1175 OUString sFileName;
1176 if ( ! (rValues[0] >>= sFileName))
1177 return;
1178
1179 rValues[1] >>= pDescriptor->maOffset.X;
1180 rValues[2] >>= pDescriptor->maOffset.Y;
1181
1182 pDescriptor->mxBitmap = Reference<rendering::XBitmap>(
1175 const Reference<container::XNameAccess>& rxBitmapLoader)
1176{
1177 if (rValues.size() == 3)
1178 {
1179 BitmapDescriptor* pDescriptor = NULL;
1180 if (rsKey == OUString::createFromAscii("Face"))
1181 pDescriptor = &maFace;
1182 else if (rsKey == OUString::createFromAscii("HourHand"))

--- 7 unchanged lines hidden (view full) ---

1190 OUString sFileName;
1191 if ( ! (rValues[0] >>= sFileName))
1192 return;
1193
1194 rValues[1] >>= pDescriptor->maOffset.X;
1195 rValues[2] >>= pDescriptor->maOffset.Y;
1196
1197 pDescriptor->mxBitmap = Reference<rendering::XBitmap>(
1183 rxBitmapLoader->getByName(sFileName), UNO_QUERY);
1198 rxBitmapLoader->getByName(rsBitmapPath+sFileName), UNO_QUERY);
1184
1185 if ( ! pDescriptor->mxBitmap.is())
1186 mbThemeLoadingFailed = true;
1187 }
1188}
1189
1190
1191

--- 239 unchanged lines hidden ---
1199
1200 if ( ! pDescriptor->mxBitmap.is())
1201 mbThemeLoadingFailed = true;
1202 }
1203}
1204
1205
1206

--- 239 unchanged lines hidden ---