/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2002 Chris Schoeneman
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#if WINAPI_XWINDOWS
#pragma once
#include "base/String.h"
namespace pugi
{
class xml_node;
}
class X11LayoutsParser {
public:
static std::vector getX11LanguageList(const String& pathToEvdevFile);
static String convertLayotToISO(const String& pathToEvdevFile, const String& layoutLangCode, bool needToReloadFiles = false);
private:
struct Lang {
String name = "";
std::vector layoutBaseISO639_2;
std::vector variants;
};
static bool readXMLConfigItemElem(const pugi::xml_node* root,
std::vector& langList);
static std::vector getAllLanguageData(const String& pathToEvdevFile);
static void appendVectorUniq(const std::vector& source,
std::vector& dst);
static void convertLayoutToISO639_2(const String& pathToEvdevFile,
bool needToReloadEvdev,
const std::vector& layoutNames,
const std::vector& layoutVariantNames,
std::vector& iso639_2Codes);
static std::vector convertISO639_2ToISO639_1(const std::vector& iso639_2Codes);
};
#endif //WINAPI_XWINDOWS