LibreOffice Module slideshow (master) 1
activitiesqueue.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_ACTIVITIESQUEUE_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_INC_ACTIVITIESQUEUE_HXX
22
23#include <deque>
24
25#include "activity.hxx"
26
28
29#include <memory>
30
31
32/* Definition of ActivitiesQueue class */
33
34namespace slideshow::internal
35 {
42 {
43 public:
50 explicit ActivitiesQueue(
51 std::shared_ptr< ::canvas::tools::ElapsedTime > pPresTimer );
55
58 bool addActivity( const ActivitySharedPtr& pActivity );
59
62 bool addTailActivity( const ActivitySharedPtr& pActivity );
63
70 void process();
71
74 void processDequeued();
75
80 bool isEmpty() const;
81
84 void clear();
85
88 std::shared_ptr< ::canvas::tools::ElapsedTime > const &
89 getTimer() const { return mpTimer; }
90
91 private:
92 std::shared_ptr< ::canvas::tools::ElapsedTime > mpTimer;
93
94 typedef ::std::deque< ActivitySharedPtr > ActivityQueue;
95
97 // activities, that still
98 // await processing for this
99 // round
100
102 // processed last in the queue
103
105 // activities, that are
106 // already processed for
107 // this round, and wants
108 // to be reinserted next
109 // round
110
111 ActivityQueue maDequeuedActivities; // This list collects all activities which did not request
112 // a reinsertion. After the screen update has been
113 // performed, those are notified via dequeued(). This
114 // facilitates cleanup actions taking place _after_ the
115 // current frame has been displayed.
116 };
117
118}
119#endif // INCLUDED_SLIDESHOW_SOURCE_INC_ACTIVITIESQUEUE_HXX
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class handles the XSprite updates needed for animations, such as moves, scales etc.
std::shared_ptr< ::canvas::tools::ElapsedTime > const & getTimer() const
Gets the queue's timer object.
bool addActivity(const ActivitySharedPtr &pActivity)
Add the given activity to the queue.
ActivitiesQueue & operator=(const ActivitiesQueue &)=delete
void processDequeued()
Call all dequeued activities' dequeued() method.
ActivitiesQueue(std::shared_ptr< ::canvas::tools::ElapsedTime > pPresTimer)
Create an ActivitiesQueue.
bool isEmpty() const
Query state of the queue.
bool addTailActivity(const ActivitySharedPtr &pActivity)
Add the given activity prioritized last in the queue.
::std::deque< ActivitySharedPtr > ActivityQueue
std::shared_ptr< ::canvas::tools::ElapsedTime > mpTimer
void clear()
Remove all pending activities from the queue.
void process()
Process the activities queue.
ActivitiesQueue(const ActivitiesQueue &)=delete
::std::shared_ptr< Activity > ActivitySharedPtr
Definition: activity.hxx:83