1 #ifndef __DALI_PEPPER_INTERNAL_SHELL_H__
2 #define __DALI_PEPPER_INTERNAL_SHELL_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/shell.h>
23 #include <pepper-dali/internal/shell-client.h>
26 #include <dali/public-api/common/intrusive-ptr.h>
27 #include <dali/public-api/object/base-object.h>
28 #include <wayland-server.h>
40 typedef IntrusivePtr<Shell> ShellPtr;
42 struct ShellClientInfo
45 Pepper::ShellClient mShellClient;
46 struct wl_listener mDestroyListner;
49 class Shell : public BaseObject
53 static ShellPtr New( Pepper::Compositor compositor );
55 void OnClientDestroyed( Pepper::ShellClient shellClient );
60 * Construct a new Shell.
65 * A reference counted object may only be deleted by calling Unreference()
70 * Second-phase constructor. Must be called immediately after creating a new Shell;
72 void Initialize( Pepper::Compositor& compositor );
74 static void OnBind( struct wl_client* client, void* data, uint32_t version, uint32_t id );
79 Shell( const Shell& );
82 Shell& operator=( const Shell& rhs );
86 Pepper::Compositor mCompositor;
88 std::vector<Pepper::ShellClient> mShellClientList;
91 } // namespace Internal
93 // Helpers for public-api forwarding methods
95 inline Pepper::Internal::Shell& GetImplementation( Pepper::Shell& shell )
97 DALI_ASSERT_ALWAYS( shell && "Shell handle is empty" );
99 BaseObject& handle = shell.GetBaseObject();
101 return static_cast< Internal::Shell& >( handle );
104 inline const Pepper::Internal::Shell& GetImplementation( const Pepper::Shell& shell )
106 DALI_ASSERT_ALWAYS( shell && "Shell handle is empty" );
108 const BaseObject& handle = shell.GetBaseObject();
110 return static_cast< const Internal::Shell& >( handle );
113 } // namespace Pepper
117 #endif // __DALI_PEPPER_INTERNAL_SHELL_H__