<commit_before>//===- tools/seec-trace-view/ColourSchemeSettings.cpp ---------------------===//
//
//                                    SeeC
//
// This file is distributed under The MIT License (MIT). See LICENSE.TXT for
// details.
//
//===----------------------------------------------------------------------===//
///
/// \file
///
//===----------------------------------------------------------------------===//

#include <wx/wx.h>
#include <wx/clrpicker.h>
#include <wx/filename.h>
#include <wx/fontpicker.h>
#include <wx/panel.h>
#include <wx/scrolwin.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/xml/xml.h>

#include "seec/ICU/Resources.hpp"
#include "seec/Util/MakeFunction.hpp"
#include "seec/Util/MakeUnique.hpp"
#include "seec/wxWidgets/Config.hpp"
#include "seec/wxWidgets/StringConversion.hpp"
#include "seec/wxWidgets/XmlNodeIterator.hpp"

#include "ColourSchemeSettings.hpp"

using namespace seec;

namespace {

Maybe<wxFontInfo, Error> FontInfoFromXML(wxXmlNode const &Node) {
  wxFontInfo TheFontInfo;

  auto const AttrPointSize = Node.GetAttribute("PointSize");
  if (!AttrPointSize.empty()) {
    long Value = 0;
    if (!AttrPointSize.ToLong(&Value) || Value <= 0) {
      return Error(LazyMessageByRef::create("TraceViewer",
                                            {"ColourSchemes",
                                             "FontPointSizeIncorrect"},
                                            std::make_pair("value",
                                                           toUnicodeString(
                                                             AttrPointSize))));
    }
    TheFontInfo = wxFontInfo(Value);
  }

  auto const Family = Node.GetAttribute("Family");
  if (!Family.empty()) {
    if (Family == "DEFAULT")
      TheFontInfo = TheFontInfo.Family(wxFONTFAMILY_DEFAULT);
    else if (Family == "DECORATIVE")
      TheFontInfo = TheFontInfo.Family(wxFONTFAMILY_DECORATIVE);
    else if (Family == "ROMAN")<commit_msg>Correctly include <array><commit_after>//===- tools/seec-trace-view/ColourSchemeSettings.cpp ---------------------===//
//
//                                    SeeC
//
// This file is distributed under The MIT License (MIT). See LICENSE.TXT for
// details.
//
//===----------------------------------------------------------------------===//
///
/// \file
///
//===----------------------------------------------------------------------===//

#include <wx/wx.h>
#include <wx/clrpicker.h>
#include <wx/filename.h>
#include <wx/fontpicker.h>
#include <wx/panel.h>
#include <wx/scrolwin.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/xml/xml.h>

#include "seec/ICU/Resources.hpp"
#include "seec/Util/MakeFunction.hpp"
#include "seec/Util/MakeUnique.hpp"
#include "seec/wxWidgets/Config.hpp"
#include "seec/wxWidgets/StringConversion.hpp"
#include "seec/wxWidgets/XmlNodeIterator.hpp"

#include <array>

#include "ColourSchemeSettings.hpp"

using namespace seec;

namespace {

Maybe<wxFontInfo, Error> FontInfoFromXML(wxXmlNode const &Node) {
  wxFontInfo TheFontInfo;

  auto const AttrPointSize = Node.GetAttribute("PointSize");
  if (!AttrPointSize.empty()) {
    long Value = 0;
    if (!AttrPointSize.ToLong(&Value) || Value <= 0) {
      return Error(LazyMessageByRef::create("TraceViewer",
                                            {"ColourSchemes",
                                             "FontPointSizeIncorrect"},
                                            std::make_pair("value",
                                                           toUnicodeString(
                                                             AttrPointSize))));
    }
    TheFontInfo = wxFontInfo(Value);
  }

  auto const Family = Node.GetAttribute("Family");
  if (!Family.empty()) {
    if (Family == "DEFAULT")
      TheFontInfo = TheFontInfo.Family(wxFONTFAMILY_DEFAULT);
    else if (Family == "DECORATIVE")
      TheFontInfo = TheFontInfo.Family(wxFONTFAMILY_DECORATIVE);
    else if (Family == "ROMAN")
{'fraction_non_alphanumeric': 0.2140068326012689, 'fraction_numerical': 0.0009760858955588092, 'mean_word_length': 1.747319034852547, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4546992', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1169, 'n_words': 217}