21
21
#include "mir_toolkit/mir_surface.h"
22
22
#include "mir_toolkit/mir_wait.h"
23
#include "mir_toolkit/mir_presentation_chain.h"
23
24
#include "mir/require.h"
25
26
#include "mir_connection.h"
26
27
#include "mir_surface.h"
28
#include "presentation_chain.h"
27
29
#include "error_connections.h"
28
30
#include "mir/uncaught.h"
555
557
mir::require(spec);
557
std::vector<MirBufferStreamInfo> copy;
559
std::vector<ContentInfo> copy;
558
560
for (auto i = 0u; i < size; i++)
560
562
mir::require(mir_buffer_stream_is_valid(streams[i].stream));
561
copy.emplace_back(streams[i]);
563
copy.emplace_back(ContentInfo{
564
mir::geometry::Displacement{streams[i].displacement_x, streams[i].displacement_y},
565
reinterpret_cast<mcl::ClientBufferStream*>(streams[i].stream)->rpc_id().as_value(),
563
568
spec->streams = copy;
567
572
MIR_LOG_UNCAUGHT_EXCEPTION(ex);
575
void mir_surface_spec_add_presentation_chain(
576
MirSurfaceSpec* spec,
577
int width, int height,
578
int displacement_x, int displacement_y,
579
MirPresentationChain* client_chain)
582
mir::require(spec && client_chain);
583
auto chain = reinterpret_cast<mcl::PresentationChain*>(client_chain);
586
{displacement_x, displacement_y}, chain->rpc_id(), mir::geometry::Size{width, height}};
587
if (spec->streams.is_set())
588
spec->streams.value().push_back(info);
590
spec->streams = std::vector<ContentInfo>{info};
592
catch (std::exception const& ex)
594
MIR_LOG_UNCAUGHT_EXCEPTION(ex);
597
void mir_surface_spec_add_buffer_stream(
598
MirSurfaceSpec* spec,
599
int displacement_x, int displacement_y,
600
MirBufferStream* stream)
603
mir::require(spec && stream);
604
auto bs = reinterpret_cast<mcl::ClientBufferStream*>(stream);
605
ContentInfo info{{displacement_x, displacement_y}, bs->rpc_id().as_value(), {}};
607
if (spec->streams.is_set())
608
spec->streams.value().push_back(info);
610
spec->streams = std::vector<ContentInfo>{info};
612
catch (std::exception const& ex)
614
MIR_LOG_UNCAUGHT_EXCEPTION(ex);
570
617
void mir_surface_spec_set_input_shape(MirSurfaceSpec *spec, MirRectangle const* rectangles,