mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
Everywhere: Hoist the Services folder to the top-level
This commit is contained in:
parent
a7dc40eff3
commit
22e0eeada2
Notes:
github-actions[bot]
2024-11-10 11:52:06 +00:00
Author: https://github.com/trflynn89
Commit: 22e0eeada2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
68 changed files with 41 additions and 41 deletions
53
Services/ImageDecoder/ConnectionFromClient.h
Normal file
53
Services/ImageDecoder/ConnectionFromClient.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <ImageDecoder/Forward.h>
|
||||
#include <ImageDecoder/ImageDecoderClientEndpoint.h>
|
||||
#include <ImageDecoder/ImageDecoderServerEndpoint.h>
|
||||
#include <LibGfx/BitmapSequence.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
#include <LibThreading/BackgroundAction.h>
|
||||
|
||||
namespace ImageDecoder {
|
||||
|
||||
class ConnectionFromClient final
|
||||
: public IPC::ConnectionFromClient<ImageDecoderClientEndpoint, ImageDecoderServerEndpoint> {
|
||||
C_OBJECT(ConnectionFromClient);
|
||||
|
||||
public:
|
||||
~ConnectionFromClient() override = default;
|
||||
|
||||
virtual void die() override;
|
||||
|
||||
struct DecodeResult {
|
||||
bool is_animated = false;
|
||||
u32 loop_count = 0;
|
||||
Gfx::FloatPoint scale { 1, 1 };
|
||||
Gfx::BitmapSequence bitmaps;
|
||||
Vector<u32> durations;
|
||||
};
|
||||
|
||||
private:
|
||||
using Job = Threading::BackgroundAction<DecodeResult>;
|
||||
|
||||
explicit ConnectionFromClient(IPC::Transport);
|
||||
|
||||
virtual Messages::ImageDecoderServer::DecodeImageResponse decode_image(Core::AnonymousBuffer const&, Optional<Gfx::IntSize> const& ideal_size, Optional<ByteString> const& mime_type) override;
|
||||
virtual void cancel_decoding(i64 image_id) override;
|
||||
virtual Messages::ImageDecoderServer::ConnectNewClientsResponse connect_new_clients(size_t count) override;
|
||||
|
||||
ErrorOr<IPC::File> connect_new_client();
|
||||
|
||||
NonnullRefPtr<Job> make_decode_image_job(i64 image_id, Core::AnonymousBuffer, Optional<Gfx::IntSize> ideal_size, Optional<ByteString> mime_type);
|
||||
|
||||
i64 m_next_image_id { 0 };
|
||||
HashMap<i64, NonnullRefPtr<Job>> m_pending_jobs;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue