<commit_before>/*
 * Copyright (c) 2017 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 <window-impl.h>

// EXTERNAL HEADERS
#include <Ecore.h>
#include <Ecore_Wayland.h>
#include <tizen-extension-client-protocol.h>

#include <dali/integration-api/core.h>
#include <dali/integration-api/system-overlay.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <orientation.h>

// INTERNAL HEADERS
#include <window-render-surface.h>
#include <drag-and-drop-detector-impl.h>
#include <ecore-indicator-impl.h>
#include <window-visibility-observer.h>
#include <orientation-impl.h>

namespace
{
const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds
const float INDICATOR_SHOW_Y_POSITION( 0.0f );
const float INDICATOR_HIDE_Y_POSITION( -52.0f );
}

namespace Dali
{
namespace Internal
{
namespace Adaptor
{

#if defined(DEBUG_ENABLED)
Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
#endif

/**
 * TODO: Abstract Window class out and move this into a window implementation for Ecore
 */
struct Window::EventHandler
{
  /**
   * Constructor
   * @param[in]  window  A pointer to the window class.
   */
  EventHandler( Window* window )
  : mWindow( window ),
    mWindowPropertyHandler( NULL ),
    mWindowIconifyStateHandler( NULL ),
    mWindowFocusInHandler( NULL ),
    mWindowFocusOutHandler( NULL ),
    mEcoreWindow( 0 ),
    mDisplay( NULL ),
    mEventQueue( NULL ),
    mTizenPolicy( NULL ),
    mTizenDisplayPolicy( NULL ),
    mNotificationLevel( -1 ),
    mNotificationChangeState( 0 ),
    mNotificationLevelChangeDone( true ),
    mScreenMode( 0 ),
    mScreenModeChangeState( 0 ),
    mScreenModeChangeDone( true )
  {
    // store ecore window handle
    ECore::WindowRenderSurface* wlWindow( dynamic_cast< ECore::WindowRenderSurface * >( mWindow->mSurface ) );
    if( wlWindow )
    {
      mEcoreWindow = wlWindow->GetWlWindow();
    }
    DALI_ASSERT_ALWAYS( mEcoreWindow != 0 && "There is no ecore Wl window");

    if( mWindow->mEcoreEventHander )
    {
      mWindowIconifyStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this );
      mWindowFocusInHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this );<commit_msg>Initialize class members in window-impl-ecore-wl.cpp<commit_after>/*
 * Copyright (c) 2017 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 <window-impl.h>

// EXTERNAL HEADERS
#include <Ecore.h>
#include <Ecore_Wayland.h>
#include <tizen-extension-client-protocol.h>

#include <dali/integration-api/core.h>
#include <dali/integration-api/system-overlay.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <orientation.h>

// INTERNAL HEADERS
#include <window-render-surface.h>
#include <drag-and-drop-detector-impl.h>
#include <ecore-indicator-impl.h>
#include <window-visibility-observer.h>
#include <orientation-impl.h>

namespace
{
const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds
const float INDICATOR_SHOW_Y_POSITION( 0.0f );
const float INDICATOR_HIDE_Y_POSITION( -52.0f );
}

namespace Dali
{
namespace Internal
{
namespace Adaptor
{

#if defined(DEBUG_ENABLED)
Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
#endif

/**
 * TODO: Abstract Window class out and move this into a window implementation for Ecore
 */
struct Window::EventHandler
{
  /**
   * Constructor
   * @param[in]  window  A pointer to the window class.
   */
  EventHandler( Window* window )
  : mWindow( window ),
    mWindowPropertyHandler( NULL ),
    mWindowIconifyStateHandler( NULL ),
    mWindowFocusInHandler( NULL ),
    mWindowFocusOutHandler( NULL ),
    mEcoreWindow( 0 ),
    mDisplay( NULL ),
    mEventQueue( NULL ),
    mTizenPolicy( NULL ),
    mTizenDisplayPolicy( NULL ),
    mNotificationLevel( -1 ),
    mNotificationChangeState( 0 ),
    mNotificationLevelChangeDone( true ),
    mScreenMode( 0 ),
    mScreenModeChangeState( 0 ),
    mScreenModeChangeDone( true ),
    mBrightness( 0 ),
    mBrightnessChangeState( 0 ),
    mBrightnessChangeDone( true )
  {
    // store ecore window handle
    ECore::WindowRenderSurface* wlWindow( dynamic_cast< ECore::WindowRenderSurface * >( mWindow->mSurface ) );
    if( wlWindow )
    {
      mEcoreWindow = wlWindow->GetWlWindow();
    }
    DALI_ASSERT_ALWAYS( mEcoreWindow != 0 && "There is no ecore Wl window");

    if( mWindow->mEcoreEventHander )
    {
      mWindowIconifyStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this );
      mWindowFocusInHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this );
{'fraction_non_alphanumeric': 0.10693497422251788, 'fraction_numerical': 0.00864792948611342, 'mean_word_length': 4.2478184991273995, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4931370', 'n_tokens_mistral': 1973, 'n_tokens_neox': 1907, 'n_words': 498}