<commit_before>//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.Microsoft::WR::
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// debug.cpp: Debugging utilities.

#include "common/winrtutils.h"

#include <windows.ui.xaml.media.dxinterop.h>
#include <wrl\implements.h>
#include <wrl\module.h>
#include <wrl\event.h>
#include <wrl\wrappers\corewrappers.h>
#include <windows.applicationmodel.core.h>
#include <windows.graphics.display.h>
#include <math.h>

using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Storage;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::ApplicationModel;
using namespace ABI::Windows::Graphics::Display;
using namespace ABI::Windows::UI::Core;

namespace winrt 
{

static float GetLogicalDpi()
{
  ComPtr<IDisplayPropertiesStatics> dp;
  FLOAT dpi = 1.0;

  if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), dp.GetAddressOf()))) {
    if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) {
      return dpi;
    }
  }
  return 1.0;
}


// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
float convertDipsToPixels(float dips)
{
   static const float dipsPerInch = 96.0f;
   return floor(dips * GetLogicalDpi() / dipsPerInch + 0.5f); // Round to nearest integer.
}

bool isSwapChainBackgroundPanel(ComPtr<IUnknown> window)
{
    ComPtr<ISwapChainBackgroundPanelNative> panelNative;
    return S_OK == (window.Get())->QueryInterface(IID_PPV_ARGS(&panelNative));
}<commit_msg>use WINAIU_PARTITION_PHONE<commit_after>//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.Microsoft::WR::
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// debug.cpp: Debugging utilities.

#include "common/winrtutils.h"


#include <wrl\implements.h>
#include <wrl\module.h>
#include <wrl\event.h>
#include <wrl\wrappers\corewrappers.h>
#include <windows.applicationmodel.core.h>
#include <windows.graphics.display.h>
#include <math.h>

#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE)
#include <windows.ui.xaml.media.dxinterop.h>
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE)

using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Storage;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::ApplicationModel;
using namespace ABI::Windows::Graphics::Display;
using namespace ABI::Windows::UI::Core;

namespace winrt 
{

static float GetLogicalDpi()
{
  ComPtr<IDisplayPropertiesStatics> dp;
  FLOAT dpi = 1.0;

  if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), dp.GetAddressOf()))) {
    if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) {
      return dpi;
    }
  }
  return 1.0;
}


// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
float convertDipsToPixels(float dips)
{
   static const float dipsPerInch = 96.0f;
   return floor(dips * GetLogicalDpi() / dipsPerInch + 0.5f); // Round to nearest integer.
}

bool isSwapChainBackgroundPanel(ComPtr<IUnknown> window)
{
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE)
    return FALSE;
#else
    ComPtr<ISwapChainBackgroundPanelNative> panelNative;
    return S_OK == (window.Get())->QueryInterface(IID_PPV_ARGS(&panelNative));
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE)
}
{'fraction_non_alphanumeric': 0.12068004459308806, 'fraction_numerical': 0.00947603121516165, 'mean_word_length': 5.537340619307832, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5738342', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1196, 'n_words': 274}