1 #ifndef __DALI_PEPPER_INTERNAL_OUTPUT_H__
2 #define __DALI_PEPPER_INTERNAL_OUTPUT_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <pepper-dali/internal/output.h>
23 #include <pepper-dali/internal/object.h>
26 #include <dali/public-api/common/intrusive-ptr.h>
27 #include <dali/public-api/common/vector-wrapper.h>
28 #include <dali/public-api/object/base-object.h>
29 #include <dali/public-api/signals/connection-tracker.h>
30 #include <pepper-output-backend.h>
42 typedef IntrusivePtr<Output> OutputPtr;
44 class Output : public BaseObject, public ConnectionTracker
48 static OutputPtr New( Pepper::Compositor compositor, Application application, Pepper::Input input );
50 static void OnDestroy( void* data );
51 static int32_t OnGetSubpixelOrder( void* data );
52 static const char* OnGetMakerName( void* data );
53 static const char* OnGetModelName( void* data );
54 static int OnGetModeCount( void* data );
55 static void OnGetMode( void* data, int index, pepper_output_mode_t* mode );
56 static pepper_bool_t OnSetMode( void* data, const pepper_output_mode_t* mode );
57 static void OnAssignPlanes( void* data, const pepper_list_t* viewList );
58 static void OnStartRepaintLoop( void* data );
59 static void OnRepaint( void* data, const pepper_list_t* planeList );
60 static void OnAttachSurface( void* data, pepper_surface_t* surface, int* width, int* height );
61 static void OnFlushSurface( void* data, pepper_surface_t* surface, pepper_bool_t* keepBuffer );
65 Pepper::Output::OutputSignalType& ObjectViewAddedSignal();
66 Pepper::Output::OutputSignalType& ObjectViewDeletedSignal();
71 * Construct a new Output.
76 * A reference counted object may only be deleted by calling Unreference()
81 * Second-phase constructor. Must be called immediately after creating a new Output;
83 void Initialize( Pepper::Compositor& compositor, Application application, Pepper::Input input );
85 void OnResize( Application& application );
87 void OnObjectViewAdded( Pepper::Object object, Pepper::ObjectView objectView );
88 void OnObjectViewDeleted( Pepper::Object object, Pepper::ObjectView objectView );
93 Output( const Output& );
96 Output& operator=( const Output& rhs );
100 Pepper::Compositor mCompositor;
104 Pepper::Input mInput;
105 std::vector<Pepper::Object> mObjectList;
107 pepper_output_t* mOutput;
108 pepper_plane_t* mPrimaryPlane;
111 Pepper::Output::OutputSignalType mObjectViewAddedSignal;
112 Pepper::Output::OutputSignalType mObjectViewDeletedSignal;
115 } // namespace Internal
117 // Helpers for public-api forwarding methods
119 inline Pepper::Internal::Output& GetImplementation( Pepper::Output& output )
121 DALI_ASSERT_ALWAYS( output && "Output handle is empty" );
123 BaseObject& handle = output.GetBaseObject();
125 return static_cast< Internal::Output& >( handle );
128 inline const Pepper::Internal::Output& GetImplementation( const Pepper::Output& output )
130 DALI_ASSERT_ALWAYS( output && "Output handle is empty" );
132 const BaseObject& handle = output.GetBaseObject();
134 return static_cast< const Internal::Output& >( handle );
137 } // namespace Pepper
141 #endif // __DALI_PEPPER_INTERNAL_OUTPUT_H__