init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
82
Telegram/SourceFiles/dialogs/ui/dialogs_video_userpic.h
Normal file
82
Telegram/SourceFiles/dialogs/ui/dialogs_video_userpic.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "media/clip/media_clip_reader.h"
|
||||
|
||||
class Painter;
|
||||
|
||||
namespace Data {
|
||||
class PhotoMedia;
|
||||
} // namespace Data
|
||||
|
||||
namespace Ui {
|
||||
struct PeerUserpicView;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Dialogs {
|
||||
class Entry;
|
||||
} // namespace Dialogs
|
||||
|
||||
namespace Dialogs::Ui {
|
||||
|
||||
using namespace ::Ui;
|
||||
|
||||
struct PaintContext;
|
||||
|
||||
class VideoUserpic final {
|
||||
public:
|
||||
VideoUserpic(not_null<PeerData*> peer, Fn<void()> repaint);
|
||||
~VideoUserpic();
|
||||
|
||||
[[nodiscard]] int frameIndex() const;
|
||||
|
||||
void paintLeft(
|
||||
Painter &p,
|
||||
PeerUserpicView &view,
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int size,
|
||||
bool paused);
|
||||
|
||||
private:
|
||||
void clipCallback(Media::Clip::Notification notification);
|
||||
[[nodiscard]] Media::Clip::FrameRequest request(int size) const;
|
||||
bool startReady(int size = 0);
|
||||
|
||||
const not_null<PeerData*> _peer;
|
||||
const Fn<void()> _repaint;
|
||||
|
||||
Media::Clip::ReaderPointer _video;
|
||||
int _lastSize = 0;
|
||||
std::shared_ptr<Data::PhotoMedia> _videoPhotoMedia;
|
||||
PhotoId _videoPhotoId = 0;
|
||||
|
||||
};
|
||||
|
||||
void PaintUserpic(
|
||||
Painter &p,
|
||||
not_null<Entry*> entry,
|
||||
PeerData *peer,
|
||||
VideoUserpic *videoUserpic,
|
||||
PeerUserpicView &view,
|
||||
const Ui::PaintContext &context);
|
||||
|
||||
void PaintUserpic(
|
||||
Painter &p,
|
||||
not_null<PeerData*> peer,
|
||||
VideoUserpic *videoUserpic,
|
||||
PeerUserpicView &view,
|
||||
int x,
|
||||
int y,
|
||||
int outerWidth,
|
||||
int size,
|
||||
bool paused);
|
||||
|
||||
} // namespace Dialogs::Ui
|
||||
Reference in New Issue
Block a user