/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #pragma once #include #include #include #include #include #include #include #include #include #include namespace sdext::presenter { /** Manage a set of bitmap groups as they are used for buttons: three bitmaps, one for the normal state, one for a mouse over effect and one to show that the button has been pressed. A bitmap group is defined by some entries in the configuration. */ class PresenterBitmapContainer { 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 BitmapDescriptor { public: BitmapDescriptor(); explicit BitmapDescriptor (const std::shared_ptr& rpDefault); enum Mode {Normal, MouseOver, ButtonDown, Disabled, Mask}; const css::uno::Reference& GetNormalBitmap() const; css::uno::Reference const & GetBitmap(const Mode eMode) const; void SetBitmap ( const Mode eMode, const css::uno::Reference& 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; private: css::uno::Reference mxNormalBitmap; css::uno::Reference mxMouseOverBitmap; css::uno::Reference mxButtonDownBitmap; css::uno::Reference mxDisabledBitmap; css::uno::Reference mxMaskBitmap; }; /** Create a new bitmap container from a section of the configuration. @param rxComponentContext The component context is used to create new API objects. @param rxCanvas Bitmaps are created specifically for this canvas. @param rsConfigurationBase The name of a configuration node whose sub-tree defines the bitmap sets. */ PresenterBitmapContainer ( const OUString& rsConfigurationBase, std::shared_ptr xParentContainer, const css::uno::Reference& rxComponentContext, css::uno::Reference xCanvas, css::uno::Reference xPresenterHelper = nullptr); PresenterBitmapContainer ( const css::uno::Reference& rsRootNode, std::shared_ptr xParentContainer, const css::uno::Reference& rxComponentContext, css::uno::Reference xCanvas, css::uno::Reference xPresenterHelper = nullptr); ~PresenterBitmapContainer(); PresenterBitmapContainer(const PresenterBitmapContainer&) = delete; PresenterBitmapContainer& operator=(const PresenterBitmapContainer&) = delete; void Initialize ( const css::uno::Reference& rxComponentContext); /** Return the bitmap set that is associated with the given name. */ std::shared_ptr GetBitmap (const OUString& rsName) const; static std::shared_ptr LoadBitmap ( const css::uno::Reference& rxNode, const OUString& rsPathToBitmapNode, const css::uno::Reference& rxPresenterHelper, const css::uno::Reference& rxCanvas, const std::shared_ptr& rpDefaultBitmap); private: std::shared_ptr mpParentContainer; typedef ::std::map > BitmapContainer; BitmapContainer maIconContainer; css::uno::Reference mxCanvas; css::uno::Reference mxPresenterHelper; void LoadBitmaps ( const css::uno::Reference& rsRootNode); void ProcessBitmap ( const OUString& rsKey, const css::uno::Reference& rProperties); static std::shared_ptr LoadBitmap ( const css::uno::Reference& rxProperties, const css::uno::Reference& rxPresenterHelper, const css::uno::Reference& rxCanvas, const std::shared_ptr& rpDefault); static BitmapDescriptor::TexturingMode StringToTexturingMode (std::u16string_view rsTexturingMode); }; typedef PresenterBitmapContainer::BitmapDescriptor PresenterBitmapDescriptor; typedef std::shared_ptr SharedBitmapDescriptor; } // end of namespace ::sdext::presenter /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ption value='distro/lhm/libreoffice-7-2+backports'>distro/lhm/libreoffice-7-2+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2024-04-08tdf#50998 tdf#87892 Add sinusoid shapeRMZeroFour
2023-05-15tdf#153789 Colibre icons for Watched Expressions and Call StackRizal Muttaqin
2023-04-23tdf#153892 Colibre Differentiate two Index iconsRizal Muttaqin
2023-03-17Colibre: tdf#126689 Jump Up & Jump Down This Level iconsRizal Muttaqin
2023-02-26tdf#152595 Colibre: Update icons in Start Center to match new brandingRizal Muttaqin
2022-09-29Related tdf#151197: remove remnants of EmojiControl in svg parts of icon-themesJulien Nabet
2022-07-12Colibre: tdf#141110 Update No List iconsRizal Muttaqin
2022-06-20Colibre: tdf#149008 differentiate Description and Caption iconsRizal Muttaqin
2022-05-26Colibre: tdf#148963 improve Restart Numbering, InsertRizal Muttaqin
2022-04-03Colibre: Update dark Send as Fax & Explorer On/Off iconsRizal Muttaqin
2022-04-02Colibre: Update dark Save As Template iconsRizal Muttaqin
2022-03-31Colibre: tdf#148029 Change line only shapes with real intersected shapesRizal Muttaqin
2022-03-29Colibre: Add some inner shapesRizal Muttaqin
2022-03-29Colibre: Simplify db related icons, update filter iconsRizal Muttaqin
2022-03-28Colibre: Add some inner shapesRizal Muttaqin
2022-03-28Colibre: tdf#148029 Change line only shapes with real intersected shapesRizal Muttaqin
2022-03-28Colibre: tdf#148029 Change line only shapes with real intersected shapesRizal Muttaqin
2022-03-27Colibre: Fix contrastRizal Muttaqin
2022-03-27Colibre: tdf#148029 Change line only shapes with real intersected shapesRizal Muttaqin
2022-03-26Colibre: tdf#148029 Change line only shapes with real intersected shapesRizal Muttaqin
2022-03-24Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-23Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-22Update missplaced iconsRizal Muttaqin
2022-03-22Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-22Colibre: tdf#148135 ^ Group and Ungroup iconsRizal Muttaqin
2022-03-21Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-21Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-19Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-19Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-19Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-19Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-18Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-17Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2022-03-13Colibre: tdf#147952 Fix Media Player iconsRizal Muttaqin
2022-03-12Colibre: tdf#146545 Fix some color, remove gradient to fullyRizal Muttaqin
2022-03-12Colibre: tdf#146545 Add dark variantRizal Muttaqin