From 512916a07333d01454e60e519788f59f20e8aba9 Mon Sep 17 00:00:00 2001 From: taeyoon Date: Mon, 14 Sep 2015 13:22:59 +0900 Subject: [PATCH] Fix wayland indicator issue - Fix wayland ServerConnection Change-Id: I6cfaff0621acfa71a460455223c2cb1e99d8d346 --- adaptors/common/server-connection.cpp | 48 +++++++++++++++++ adaptors/wayland/file.list | 1 - adaptors/wayland/server-connection-wl.cpp | 81 ---------------------------- adaptors/x11/file.list | 1 - adaptors/x11/server-connection-x.cpp | 88 ------------------------------- 5 files changed, 48 insertions(+), 171 deletions(-) delete mode 100644 adaptors/wayland/server-connection-wl.cpp delete mode 100644 adaptors/x11/server-connection-x.cpp diff --git a/adaptors/common/server-connection.cpp b/adaptors/common/server-connection.cpp index 8246cd5..598ba06 100644 --- a/adaptors/common/server-connection.cpp +++ b/adaptors/common/server-connection.cpp @@ -43,6 +43,54 @@ namespace Adaptor extern Debug::Filter* gIndicatorLogFilter; #endif +ServerConnection::ServerConnection( + const char* serviceName, + int serviceNumber, + bool isSystem, + ServerConnection::Observer* observer) + +: mConnected(false), + mObserver(observer) +{ + Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER; + + ecore_ipc_init(); + mService.name = eina_stringshare_add(serviceName); + mService.num = serviceNumber; + mService.isSystem = isSystem; + + if( mService.isSystem ) + { + ipctype = ECORE_IPC_LOCAL_SYSTEM; + } + + DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "ServerConnection: Connecting to %s %d\n", mService.name, mService.num ); + + mIpcServer = ecore_ipc_server_connect( ipctype, (char *)mService.name, mService.num, this ); + + if( !mIpcServer ) + { + DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "mIpcServer is null\n" ); + ecore_ipc_shutdown(); + } + else + { + mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_ADD, + &ServerConnection::IpcServerAdd, + this ) ); + + mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, + &ServerConnection::IpcServerDel, + this ) ); + + mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DATA, + &ServerConnection::IpcServerData, + this)); + + mConnected = true; + } +} + ServerConnection::~ServerConnection() { CloseConnection(); diff --git a/adaptors/wayland/file.list b/adaptors/wayland/file.list index b44598b..24483a6 100644 --- a/adaptors/wayland/file.list +++ b/adaptors/wayland/file.list @@ -7,7 +7,6 @@ adaptor_wayland_tizen_internal_src_files = \ $(adaptor_wayland_dir)/framework-wl.cpp \ $(adaptor_wayland_dir)/imf-manager-impl-wl.cpp \ $(adaptor_wayland_dir)/pixmap-image-impl-wl.cpp \ - $(adaptor_wayland_dir)/server-connection-wl.cpp \ $(adaptor_wayland_dir)/virtual-keyboard-impl-wl.cpp \ $(adaptor_wayland_dir)/window-impl-wl.cpp \ $(adaptor_wayland_dir)/event-handler-wl.cpp \ diff --git a/adaptors/wayland/server-connection-wl.cpp b/adaptors/wayland/server-connection-wl.cpp deleted file mode 100644 index 76376c3..0000000 --- a/adaptors/wayland/server-connection-wl.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include "server-connection.h" - -// EXTERNAL INCLUDES -#include - -#include - -// INTERNAL INCLUDES - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ -#if defined(DEBUG_ENABLED) -extern Debug::Filter* gIndicatorLogFilter; -#endif - - -ServerConnection::ServerConnection( - const char* serviceName, - int serviceNumber, - bool isSystem, - ServerConnection::Observer* observer) - -: mConnected(false), - mObserver(observer) -{ - ecore_ipc_init(); - mService.name = eina_stringshare_add(serviceName); - mService.num = serviceNumber; - mService.isSystem = isSystem; - - DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "ServerConnection: Connecting to %s %d\n", mService.name, mService.num ); - - mIpcServer = NULL; - - if( !mIpcServer ) - { - ecore_ipc_shutdown(); - } - else - { - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_ADD, - &ServerConnection::IpcServerAdd, - this ) ); - - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, - &ServerConnection::IpcServerDel, - this ) ); - - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DATA, - &ServerConnection::IpcServerData, - this)); - - mConnected = true; - } -} - -} // Adaptor -} // Internal -} // Dali diff --git a/adaptors/x11/file.list b/adaptors/x11/file.list index 81a71b9..486850d 100644 --- a/adaptors/x11/file.list +++ b/adaptors/x11/file.list @@ -5,7 +5,6 @@ _adaptor_x11_internal_src_files = \ $(adaptor_x11_dir)/display-connection-impl-x.cpp \ $(adaptor_x11_dir)/imf-manager-impl-x.cpp \ $(adaptor_x11_dir)/pixmap-image-impl-x.cpp \ - $(adaptor_x11_dir)/server-connection-x.cpp \ $(adaptor_x11_dir)/virtual-keyboard-impl-x.cpp \ $(adaptor_x11_dir)/window-impl-x.cpp \ $(adaptor_x11_dir)/egl-implementation-x.cpp \ diff --git a/adaptors/x11/server-connection-x.cpp b/adaptors/x11/server-connection-x.cpp deleted file mode 100644 index 22d469c..0000000 --- a/adaptors/x11/server-connection-x.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include "server-connection.h" - -// EXTERNAL INCLUDES -#include - -#include - -// INTERNAL INCLUDES - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ -#if defined(DEBUG_ENABLED) -extern Debug::Filter* gIndicatorLogFilter; -#endif - - -ServerConnection::ServerConnection( - const char* serviceName, - int serviceNumber, - bool isSystem, - ServerConnection::Observer* observer) - -: mConnected(false), - mObserver(observer) -{ - Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER; - - ecore_ipc_init(); - mService.name = eina_stringshare_add(serviceName); - mService.num = serviceNumber; - mService.isSystem = isSystem; - - if (mService.isSystem) - { - ipctype = ECORE_IPC_LOCAL_SYSTEM; - } - - DALI_LOG_INFO( gIndicatorLogFilter, Debug::General, "ServerConnection: Connecting to %s %d\n", mService.name, mService.num ); - - mIpcServer = ecore_ipc_server_connect( ipctype, (char *)mService.name, mService.num, this ); - - if( !mIpcServer ) - { - ecore_ipc_shutdown(); - } - else - { - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_ADD, - &ServerConnection::IpcServerAdd, - this ) ); - - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, - &ServerConnection::IpcServerDel, - this ) ); - - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DATA, - &ServerConnection::IpcServerData, - this)); - - mConnected = true; - } -} - -} // Adaptor -} // Internal -} // Dali -- 2.7.4