samples: change the comments on exampleCompositor 45/241845/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 19 Aug 2020 03:49:22 +0000 (12:49 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:12:04 +0000 (19:12 +0900)
Change-Id: I82dfa3b0fd5f59d2c2bc01f05680bd19cc45ca3f

samples/exampleCompositor.cpp

index 601658b..a544023 100644 (file)
 
 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<DSCanvas> _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<IDSOutput> output) override
        {
                // set the resolution.
@@ -107,18 +80,19 @@ public:
                __displayArea = std::make_shared<DSDisplayArea>(output);
        }
 
+       // The _onOutputAdded is called when the IDSOutput is removed.
        void _onOutputRemoved(std::shared_ptr<IDSOutput> output) override
        {
                __displayArea.reset(); // delete shared_ptr
        }
 
+       // TODO:
        void _onInputAdded(std::shared_ptr<DSInput> input) override
-       {
-       }
+       {}
 
+       // TODO:
        void _onInputRemoved(std::shared_ptr<DSInput> input) override
-       {
-       }
+       {}
 
 private:
        std::shared_ptr<DSCanvas> __canvas;