2 * Copyright 2012-2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "sclevents.h"
20 #include "sclevents-win32.h"
21 #elif defined(__EFL__)
22 #include "sclevents-efl.h"
24 #include "sclevents-gtk.h"
27 #include "sclwindows.h"
31 CSCLEvents* CSCLEvents::m_instance = NULL; /* For singleton */
33 CSCLEvents::CSCLEvents()
37 m_touch_event_offset.x = m_touch_event_offset.y = 0;
40 CSCLEvents::~CSCLEvents()
45 CSCLEventsImpl* CSCLEvents::get_scl_events_impl()
50 m_impl = new CSCLEventsImplWin32;
51 #elif defined(__EFL__)
52 m_impl = new CSCLEventsImplEfl;
54 m_impl = new CSCLEventsImplGtk;
60 CSCLEvents* CSCLEvents::get_instance()
63 m_instance = new CSCLEvents();
65 return (CSCLEvents*)m_instance;
69 CSCLEvents::connect_window_events( sclwindow wnd, const sclint evt )
71 CSCLWindows *windows = CSCLWindows::get_instance();
72 //SclWindowContext *winctx = windows->get_window_context(wnd, FALSE);
73 SclWindowContext *winctx = windows->get_window_context(wnd);
75 if (!(winctx->is_virtual)) {
76 get_scl_events_impl()->connect_window_events(wnd, evt);
82 CSCLEvents::set_touch_event_offset(const SclPoint pos)
84 m_touch_event_offset = pos;
88 CSCLEvents::get_touch_event_offset()
90 return &m_touch_event_offset;