From 0f4f3401761c83faa611aec5b4a65637ff5bef3c Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 19 Aug 2020 12:49:22 +0900 Subject: [PATCH] samples: change the comments on exampleCompositor Change-Id: I82dfa3b0fd5f59d2c2bc01f05680bd19cc45ca3f --- samples/exampleCompositor.cpp | 46 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/samples/exampleCompositor.cpp b/samples/exampleCompositor.cpp index 601658b..a544023 100644 --- a/samples/exampleCompositor.cpp +++ b/samples/exampleCompositor.cpp @@ -32,38 +32,7 @@ using namespace display_server; -/* - 1. MyCompositor and DSCompositor are created. - 2. DSCompositor probes the InputDevice and the OutputDevice at the creation time. - 3. DSCompositor sends the InputAdd/Remove signals and the OutputAdd/Remove signal. - 4. MyCompositor gets those signals and set up outputs and inputs. - 5. MyCompositor configures the canvases with zones and outputs. - 6. MyCompositor configures the the seats with zones. -*/ - -// DSCompositor () -// initialization/deinitialize TDM -// initialization/deinitialize libinput -// initialization/deinitialize wl_server -// initialization event_loop -// call the output callbacks ( OutputAdd, OutputRemove, OutputResolutionSet) -// call the output callbacks ( InputAdd, InputRemove ) -// plugins loading??? - -// policyArea or screenArea ? -// policyRegion or screenRegion ? -// policyZone or screenZone ? -// displayArea or outputArea ? -// displayRegion or outputRegion ? -// displayZone or outputZone ? - -// DSCompositor listen signals. OutputAdd/Remove/ResolutionSet and InputAdd/Remove. -// compositor->connectSignal(DSOuptut::ADD_SIGNAL, DSCompositor::OutputAdd); -// compositor->connectSignal(IDSOutput::REMOVE_SIGNAL, DSCompositor::OutputRemove); -// compositor->connectSignal(IDSOutput::RESOLUTION_SET_SIGNAL, DSCompositor::OutputResolutionSet); -// compositor->connectSignal(DSInput::ADD_SIGNAL, DSCompositor::InputAdd); -// compositor->connectSignal(DSInput::REMOVE_SIGNAL, DSCompositor::InputRemove); - +// MyCompositor has to inherit DSCompositor. class MyCompositor : public DSCompositor { public: @@ -77,6 +46,9 @@ public: virtual ~MyCompositor() {} + // The _onInitialized is called when the DSCompositor is ready to run. + // Make a seat and a policy area. Attach the seat to the policy area. + // Attach the policy area and the display area to canvas and return it. std::shared_ptr _onInitialized() override { int width = __displayArea->getWidth(); @@ -98,6 +70,7 @@ public: return __canvas; } + // The _onOutputAdded is called when the IDSOutput is added. void _onOutputAdded(std::shared_ptr output) override { // set the resolution. @@ -107,18 +80,19 @@ public: __displayArea = std::make_shared(output); } + // The _onOutputAdded is called when the IDSOutput is removed. void _onOutputRemoved(std::shared_ptr output) override { __displayArea.reset(); // delete shared_ptr } + // TODO: void _onInputAdded(std::shared_ptr input) override - { - } + {} + // TODO: void _onInputRemoved(std::shared_ptr input) override - { - } + {} private: std::shared_ptr __canvas; -- 2.7.4