Merge branch 'dev'

This commit is contained in:
John Preston 2016-04-23 14:41:54 +03:00
commit 9c5e2bbb00
161 changed files with 11358 additions and 5262 deletions

5
.gitignore vendored
View file

@ -33,10 +33,11 @@ ipch/
._*
.qmake.stash
/Mac/
/Telegram/*.xcodeproj/xcuserdata/
/Telegram/*.xcodeproj/project.xcworkspace/
project.xcworkspace
xcuserdata
/Telegram/*.user.*
*.pro.user
/Linux/
/Telegram/Makefile
*.*~

View file

@ -114,12 +114,19 @@ build() {
./configure
make --silent
info_msg "Build MetaStyle"
# Build MetaStyle
mkdir -p "$srcdir/tdesktop/Linux/DebugIntermediateStyle"
cd "$srcdir/tdesktop/Linux/DebugIntermediateStyle"
qmake CONFIG+=debug "../../Telegram/MetaStyle.pro"
make --silent
info_msg "Build codegen_style"
# Build codegen_style
mkdir -p "$srcdir/tdesktop/Linux/obj/codegen_style/Debug"
cd "$srcdir/tdesktop/Linux/obj/codegen_style/Debug"
qmake CONFIG+=debug "../../../../Telegram/build/qmake/codegen_style/codegen_style.pro"
make --silent
info_msg "Build codegen_numbers"
# Build codegen_numbers
mkdir -p "$srcdir/tdesktop/Linux/obj/codegen_numbers/Debug"
cd "$srcdir/tdesktop/Linux/obj/codegen_numbers/Debug"
qmake CONFIG+=debug "../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro"
make --silent
info_msg "Build MetaLang"
# Build MetaLang

View file

@ -32,8 +32,8 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
## Build instructions
* [Visual Studio 2015][msvc]
* [XCode 7][xcode]
* [XCode 7 for OS X 10.6 and 10.7][xcode_old]
* [Xcode 7][xcode]
* [Xcode 7 for OS X 10.6 and 10.7][xcode_old]
* [Qt Creator 3.5.1 Ubuntu][qtcreator]
* [Using qmake on GNU/Linux][qmake]
@ -61,24 +61,10 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
* SourceFiles/art/emoji_250x.png
* SourceFiles/gui/emoji_config.cpp
* ### MetaStyle
* ### codegen_style
* ### codegen_numbers
From two files and two sprites
* Resources/style_classes.txt
* Resources/style.txt
* SourceFiles/art/sprite.png
* SourceFiles/art/sprite_200x.png
Creates two other sprites, four sprite grids and style constants code
* SourceFiles/art/sprite_125x.png
* SourceFiles/art/sprite_150x.png
* SourceFiles/art/grid.png
* SourceFiles/art/grid_125x.png
* SourceFiles/art/grid_150x.png
* SourceFiles/art/grid_200x.png
* GeneratedFiles/style_classes.h
* GeneratedFiles/style_auto.h
* GeneratedFiles/style_auto.cpp
Helper code generating console utilities.
* ### MetaLang

View file

@ -5,13 +5,12 @@ VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Telegram", "Telegram\Telegram.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}"
ProjectSection(ProjectDependencies) = postProject
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0} = {6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}
{E4DF8176-4DEF-4859-962F-B497E3E7A323} = {E4DF8176-4DEF-4859-962F-B497E3E7A323}
{E417CAA4-259B-4C99-88E3-805F1300E8EB} = {E417CAA4-259B-4C99-88E3-805F1300E8EB}
{EB7D16AC-EACF-4577-B05A-F28E5F356794} = {EB7D16AC-EACF-4577-B05A-F28E5F356794}
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6} = {7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MetaStyle", "Telegram\MetaStyle.vcxproj", "{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MetaEmoji", "Telegram\MetaEmoji.vcxproj", "{EB7D16AC-EACF-4577-B05A-F28E5F356794}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Updater", "Telegram\Updater.vcxproj", "{6B4BA3BE-7B15-4B4C-B200-81ABFDEF2C76}"
@ -24,6 +23,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packer", "Telegram\Packer.v
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "codegen_style", "Telegram\build\vc\codegen_style\codegen_style.vcxproj", "{E4DF8176-4DEF-4859-962F-B497E3E7A323}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "codegen_numbers", "Telegram\build\vc\codegen_numbers\codegen_numbers.vcxproj", "{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -44,15 +45,6 @@ Global
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.ActiveCfg = Release|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.Build.0 = Release|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Debug|Win32.ActiveCfg = Debug|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Debug|Win32.Build.0 = Debug|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Debug|x64.ActiveCfg = Debug|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Deploy|Win32.ActiveCfg = Deploy|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Deploy|Win32.Build.0 = Deploy|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Deploy|x64.ActiveCfg = Release|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Release|Win32.ActiveCfg = Release|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Release|Win32.Build.0 = Release|Win32
{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}.Release|x64.ActiveCfg = Release|Win32
{EB7D16AC-EACF-4577-B05A-F28E5F356794}.Debug|Win32.ActiveCfg = Debug|Win32
{EB7D16AC-EACF-4577-B05A-F28E5F356794}.Debug|x64.ActiveCfg = Debug|Win32
{EB7D16AC-EACF-4577-B05A-F28E5F356794}.Deploy|Win32.ActiveCfg = Deploy|Win32
@ -94,11 +86,22 @@ Global
{E4DF8176-4DEF-4859-962F-B497E3E7A323}.Release|Win32.ActiveCfg = Release|Win32
{E4DF8176-4DEF-4859-962F-B497E3E7A323}.Release|Win32.Build.0 = Release|Win32
{E4DF8176-4DEF-4859-962F-B497E3E7A323}.Release|x64.ActiveCfg = Release|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Debug|Win32.ActiveCfg = Debug|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Debug|Win32.Build.0 = Debug|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Debug|x64.ActiveCfg = Debug|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Deploy|Win32.ActiveCfg = Debug|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Deploy|Win32.Build.0 = Debug|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Deploy|x64.ActiveCfg = Release|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Deploy|x64.Build.0 = Release|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Release|Win32.ActiveCfg = Release|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Release|Win32.Build.0 = Release|Win32
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E4DF8176-4DEF-4859-962F-B497E3E7A323} = {2F863EAD-33C9-4014-A573-93F085BA9CB1}
{7C25BFBD-7930-4DE2-AF33-27CE1CC521E6} = {2F863EAD-33C9-4014-A573-93F085BA9CB1}
EndGlobalSection
EndGlobal

View file

@ -1,33 +0,0 @@
QT += core
CONFIG(debug, debug|release) {
DEFINES += _DEBUG
OBJECTS_DIR = ./../DebugIntermediateStyle
MOC_DIR = ./GeneratedFiles/Debug
DESTDIR = ./../DebugStyle
}
CONFIG(release, debug|release) {
OBJECTS_DIR = ./../ReleaseIntermediateStyle
MOC_DIR = ./GeneratedFiles/Release
DESTDIR = ./../ReleaseStyle
}
CONFIG += plugin static c++11
macx {
QMAKE_INFO_PLIST = ./SourceFiles/_other/Style.plist
QMAKE_LFLAGS += -framework Cocoa
}
SOURCES += \
./SourceFiles/_other/msmain.cpp \
./SourceFiles/_other/genstyles.cpp \
HEADERS += \
./SourceFiles/_other/msmain.h \
./SourceFiles/_other/genstyles.h \
INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\
./../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore\
./../../Libraries/QtStatic/qtbase/include\

View file

@ -1,177 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Deploy|Win32">
<Configuration>Deploy</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Telegram\SourceFiles\_other\genstyles.cpp" />
<ClCompile Include="GeneratedFiles\Debug\moc_genstyles.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Deploy\moc_genstyles.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_genstyles.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="SourceFiles\_other\msmain.cpp" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="SourceFiles\_other\msmain.h">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">
</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">
</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">
</Command>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\Telegram\SourceFiles\_other\genstyles.h">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing genstyles.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\."</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing genstyles.h...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">Moc%27ing genstyles.h...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\."</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\."</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
</CustomBuild>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6F483617-7C84-4E7E-91D8-1FF28A4CE3A0}</ProjectGuid>
<Keyword>Qt4VSv1.0</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)IntermediateStyle\</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)Style\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)Style\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)IntermediateStyle\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)Style\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)IntermediateStyle\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;imm32.lib;winmm.lib;qtmaind.lib;glu32.lib;opengl32.lib;Qt5Cored.lib;Qt5Guid.lib;qtharfbuzzngd.lib;qtpcred.lib;qtfreetyped.lib;Qt5Widgetsd.lib;Qt5Networkd.lib;Qt5PlatformSupportd.lib;platforms\qwindowsd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
</Link>
<ProjectReference />
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat />
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;qtmain.lib;opengl32.lib;imm32.lib;winmm.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">
<ClCompile>
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>
</DebugInformationFormat>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;qtmain.lib;opengl32.lib;imm32.lib;winmm.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties UicDir=".\GeneratedFiles" MocDir=".\GeneratedFiles\$(ConfigurationName)" MocOptions="" RccDir=".\GeneratedFiles" lupdateOnBuild="1" lupdateOptions="" lreleaseOptions="" Qt5Version_x0020_Win32="$(DefaultQtVersion)" />
</VisualStudio>
</ProjectExtensions>
</Project>

View file

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;cxx;c;def</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
<Extensions>qrc;*</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>moc;h;cpp</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Debug">
<UniqueIdentifier>{1ace0630-c46a-4299-a4c3-d155a4cb04bb}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Release">
<UniqueIdentifier>{2473bf06-b2ba-4f68-9bfe-72a58da61f94}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Deploy">
<UniqueIdentifier>{5366361d-c2b2-4ae4-929f-05d2d9f43860}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Telegram\SourceFiles\_other\genstyles.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SourceFiles\_other\msmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Deploy\moc_genstyles.cpp">
<Filter>Generated Files\Deploy</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_genstyles.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_genstyles.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\Telegram\SourceFiles\_other\genstyles.h">
<Filter>Header Files</Filter>
</CustomBuild>
<CustomBuild Include="SourceFiles\_other\msmain.h">
<Filter>Header Files</Filter>
</CustomBuild>
</ItemGroup>
</Project>

View file

@ -1,848 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXAggregateTarget section */
5E275BA59C8BA5B561E14CF4 /* Preprocess */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 6CC3B5D2136C7CD6A5CF5A59 /* Build configuration list for PBXNativeTarget "MetaStyle" */;
buildPhases = (
07C3AF43194CCD0F0016CFF1 /* ShellScript */,
7EF0942E79C014DCEC8976BC /* Qt Preprocessors */,
);
dependencies = (
);
name = Preprocess;
productName = "Qt Preprocess";
};
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
07D7954A1B5544B200DE9598 /* qtpcre in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 07D795491B5544B200DE9598 /* qtpcre */; };
1A681B886F50EE30FBE62B4B /* Qt5PrintSupport in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = DBF506D10449BFABD45B82DA /* Qt5PrintSupport */; };
1BB705CDB741E2B7450201A5 /* Cocoa.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = AEA456A2F75ED9F5CDA7BCBE /* Cocoa.framework */; };
328FD74542F6E2C873EE4D4B /* ApplicationServices.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = DFD7912080BC557230093752 /* ApplicationServices.framework */; };
3D6772E35214B81E50791089 /* genstyles.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = F8BC976260B6D624F23C32D6 /* genstyles.cpp */; settings = {ATTRIBUTES = (); }; };
496FD9CEEB508016AFB9F928 /* qico in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 8F500B5166907B6D9A7C3E3D /* qico */; };
59789101736112A570B8EFE6 /* qjp2 in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = F0681BC551FC8A2B132FC646 /* qjp2 */; };
668DDDA0C55405E7FCFD6CA5 /* CoreServices.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 9742F24EE18EA44D52824F1E /* CoreServices.framework */; };
728CDDB7D7F2B9FF141651AD /* msmain.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = EF5243ECB3132AF2796F09DF /* msmain.cpp */; settings = {ATTRIBUTES = (); }; };
7CA5405B8503BFFC60932D2B /* qicns in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 31120EDB269DFF13E1D49847 /* qicns */; };
7F76437B577F737145996DC3 /* qtga in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = DCEFD9167C239650120B0145 /* qtga */; };
8771A8C96E9C391044035D99 /* OpenGL.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D4B32C2222F82AC56BADEB21 /* OpenGL.framework */; };
8D267F2E4776F0ECA2F49DC8 /* IOKit.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = A1A67BEAA744704B29168D39 /* IOKit.framework */; };
8D33FE22B9BBADC7FA46C15B /* qtharfbuzzng in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D6193B79CECC9DD0142D1200 /* qtharfbuzzng */; };
9F33AC0693BC81B27D8F518D /* Qt5Gui in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 04391BE7A8B9D811E255100A /* Qt5Gui */; };
A3F8F2284013928A02AE5C38 /* qwbmp in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 8CF51323544B886B8F4A2232 /* qwbmp */; };
A9563D9C9FD0D76FAAF1CA96 /* qdds in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D3D1BE0BEA3AEE0551AD39AC /* qdds */; };
B9ADD90C014EA3FBE351DF03 /* Qt5Core in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 5A80A1907B6CFFB524C1E57D /* Qt5Core */; };
BE6AB9DF1C4880624131C669 /* Qt5Widgets in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 4689C06178B60B84E7F3A3B7 /* Qt5Widgets */; };
C06DDE378A7AC1FA9E6FF69A /* qtiff in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = F2453BA07315EB9F34F1CD57 /* qtiff */; };
CBF24309A148222794F28401 /* moc_genstyles.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 861D2151FB56504EB72BDB6E /* moc_genstyles.cpp */; settings = {ATTRIBUTES = (); }; };
D1FA8AF31837B51C762A9D4D /* qcocoa in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D53D8E6A188E05078A114294 /* qcocoa */; };
D22929A2B8C5281567FCACDC /* Qt5PlatformSupport in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = E7B2F248E3F7970788F35BF5 /* Qt5PlatformSupport */; };
E45E51A644D5FC9F942ECE55 /* AGL.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 8D9815BDB5BD9F90D2BC05C5 /* AGL.framework */; };
F26454630C80841CBDCFE1CA /* Foundation.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = FCC237CA5AD60B9BA4447615 /* Foundation.framework */; };
F4D3747C3A03B25EDC9057BB /* qwebp in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = ADC6308023253CEA51F86E21 /* qwebp */; };
F8B465CE34D8DF87AAE95913 /* CoreFoundation.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 4D765E1B1EA6C757220C63E7 /* CoreFoundation.framework */; };
F8ED42CF8679BF83227DAFC4 /* Carbon.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 9DFF62A901D70814B8A323D4 /* Carbon.framework */; };
FBD56E2AC34F76BFFDB68619 /* qmng in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 83D37373949868693FB7816D /* qmng */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
0746FEAC193D006900F5C3FD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6DB9C3763D02B1415CD9D565 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5E275BA59C8BA5B561E14CF4;
remoteInfo = "Qt Preprocess";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
04391BE7A8B9D811E255100A /* Qt5Gui */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = Qt5Gui; path = "/usr/local/Qt-5.5.1/lib/libQt5Gui$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
060A694B42A4555240009936 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtga.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtga.pri"; sourceTree = "<absolute>"; };
075EB50EB07CF69FD62FB8DF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql_private.pri"; sourceTree = "<absolute>"; };
07D795491B5544B200DE9598 /* qtpcre */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qtpcre; path = "usr/local/Qt-5.5.1/lib/libqtpcre$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<group>"; };
0ABCEA8D0DD45589040B0AF2 /* /usr/local/Qt-5.5.1/mkspecs/common/unix.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/unix.conf"; sourceTree = "<absolute>"; };
10F719DFC6D0B05605ED1C16 /* MetaStyle.pro */ = {isa = PBXFileReference; lastKnownFileType = text; path = MetaStyle.pro; sourceTree = "<absolute>"; };
111BBEE3D1432C3B517FD539 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdds.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdds.pri"; sourceTree = "<absolute>"; };
16DD53E17C65AC8B450CC6C3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick.pri"; sourceTree = "<absolute>"; };
1FAE75C970AA73F2DEDDB508 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qavfcamera.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qavfcamera.pri"; sourceTree = "<absolute>"; };
23BC8B0FC3279421D41CA268 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_gui.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_gui.pri"; sourceTree = "<absolute>"; };
2440CD1D4CEF80443BCA1B8B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qgenericbearer.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qgenericbearer.pri"; sourceTree = "<absolute>"; };
247D8DF3B1DDB665B80BBA25 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblequick.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblequick.pri"; sourceTree = "<absolute>"; };
24B6929EE3952310F2DAECB1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaudio_coreaudio.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaudio_coreaudio.pri"; sourceTree = "<absolute>"; };
28BD0D10214709D95B161E24 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets.pri"; sourceTree = "<absolute>"; };
293C8DEEE270847AC20E70F9 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network.pri"; sourceTree = "<absolute>"; };
2CBD32689B153445ED220FAE /* MetaStyle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MetaStyle.app; sourceTree = BUILT_PRODUCTS_DIR; };
2E48BB382B895A5ACD79AF9F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth_private.pri"; sourceTree = "<absolute>"; };
2E6D9B1D2743D24E31B0B284 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns.pri"; sourceTree = "<absolute>"; };
311004331A04F3D69C98643C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport_private.pri"; sourceTree = "<absolute>"; };
31120EDB269DFF13E1D49847 /* qicns */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qicns; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqicns$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
33F165B1DB8CBF182C56FAB5 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras_private.pri"; sourceTree = "<absolute>"; };
346287C9E754E7C458153F03 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwbmp.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwbmp.pri"; sourceTree = "<absolute>"; };
360D4B3ED25D126430DE27D4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio.pri"; sourceTree = "<absolute>"; };
3685604BDB64DD6E92169B73 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdeclarativeview.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdeclarativeview.pri"; sourceTree = "<absolute>"; };
382E89A91A34F7898C25FD0D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network_private.pri"; sourceTree = "<absolute>"; };
3F08D430CEC8D2117735CCB4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp_qtdeclarative.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp_qtdeclarative.pri"; sourceTree = "<absolute>"; };
45B95DB3B70B47A910FC847B /* /usr/local/Qt-5.5.1/mkspecs/common/gcc-base.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/gcc-base.conf"; sourceTree = "<absolute>"; };
45DB132B756499D4DF38430E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qjp2.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qjp2.pri"; sourceTree = "<absolute>"; };
4689C06178B60B84E7F3A3B7 /* Qt5Widgets */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = Qt5Widgets; path = "/usr/local/Qt-5.5.1/lib/libQt5Widgets$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
4C6C71914B1926119120DACD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio_private.pri"; sourceTree = "<absolute>"; };
4D765E1B1EA6C757220C63E7 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
4FB6657DA22BC68B819B64B3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmldevtools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmldevtools_private.pri"; sourceTree = "<absolute>"; };
5597304BEC94BFB9EAAEBC4B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions_private.pri"; sourceTree = "<absolute>"; };
5A80A1907B6CFFB524C1E57D /* Qt5Core */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = Qt5Core; path = "/usr/local/Qt-5.5.1/lib/libQt5Core$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
5B22E9E4EE9AAE42ABC24AB3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri"; sourceTree = "<absolute>"; };
5CEA7A2DB2136425A88D1254 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_opengl.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_opengl.pri"; sourceTree = "<absolute>"; };
5F781C7FD8422D359EA1D2FE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core_private.pri"; sourceTree = "<absolute>"; };
6102C69805B6398AF6FA5BEB /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml_private.pri"; sourceTree = "<absolute>"; };
63E722139886C87BC82DBDF5 /* /usr/local/Qt-5.5.1/mkspecs/macx-clang/qmake.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/macx-clang/qmake.conf"; sourceTree = "<absolute>"; };
669FB007C4A3D58424D85EC8 /* /usr/local/Qt-5.5.1/mkspecs/common/shell-unix.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/shell-unix.conf"; sourceTree = "<absolute>"; };
69347C39E4D922E94D0860BF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designercomponents_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designercomponents_private.pri"; sourceTree = "<absolute>"; };
6C08BFC27C4C303A3A5181DB /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport.pri"; sourceTree = "<absolute>"; };
6E67D23B15FC4B628DB2E0B2 /* /usr/local/Qt-5.5.1/mkspecs/qdevice.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/qdevice.pri"; sourceTree = "<absolute>"; };
6FF81CB4A724CE1990CEE99A /* msmain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = msmain.h; path = SourceFiles/_other/msmain.h; sourceTree = "<absolute>"; };
74C1C232DFAA71028A0412CA /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmultimedia_m3u.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmultimedia_m3u.pri"; sourceTree = "<absolute>"; };
77FF486B1F9BCD55A8A3F35D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent.pri"; sourceTree = "<absolute>"; };
7A94C7168B3FCBE5F04A013B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative.pri"; sourceTree = "<absolute>"; };
7C2F42B222EE88E26A6FED62 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designer_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designer_private.pri"; sourceTree = "<absolute>"; };
7D28E9003CE64D8A7F2E292E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent_private.pri"; sourceTree = "<absolute>"; };
7DE30A90667C03C4F91A2A91 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql.pri"; sourceTree = "<absolute>"; };
7ECCC1F9442988B4F2707CC1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core.pri"; sourceTree = "<absolute>"; };
817A0F5A41B553A6DE67FDEB /* /usr/local/Qt-5.5.1/mkspecs/common/macx.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/macx.conf"; sourceTree = "<absolute>"; };
82E7DCFD95559532D8FC6CDD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickparticles_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickparticles_private.pri"; sourceTree = "<absolute>"; };
83D37373949868693FB7816D /* qmng */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qmng; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqmng$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
85061B1DA49D125991117950 /* /usr/local/Qt-5.5.1/mkspecs/macx-xcode/qmake.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/macx-xcode/qmake.conf"; sourceTree = "<absolute>"; };
85B6936EDBE61D9BB8F8B33B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sensors.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sensors.pri"; sourceTree = "<absolute>"; };
861D2151FB56504EB72BDB6E /* moc_genstyles.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_genstyles.cpp; path = GeneratedFiles/Debug/moc_genstyles.cpp; sourceTree = "<absolute>"; };
87A4C1983FD641360BF80A02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblewidgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblewidgets.pri"; sourceTree = "<absolute>"; };
87EEF25EE25CF21572D1438C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets_private.pri"; sourceTree = "<absolute>"; };
8849E60AEC7DB97A475C17EA /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib_private.pri"; sourceTree = "<absolute>"; };
892D36BEF797BA4AF48D378A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_dummy.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_dummy.pri"; sourceTree = "<absolute>"; };
89863CCAF1D29037AE95755D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative_private.pri"; sourceTree = "<absolute>"; };
8A04A4A3625204D12A1207F6 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc.pri"; sourceTree = "<absolute>"; };
8B4BB4E74F8A4442EF563D7D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensorgestures_shakeplugin.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensorgestures_shakeplugin.pri"; sourceTree = "<absolute>"; };
8C31D89BDFCDF466DAED19A0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick_private.pri"; sourceTree = "<absolute>"; };
8C5164D4E37556D40C5E6AA2 /* /usr/local/Qt-5.5.1/mkspecs/common/clang.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/clang.conf"; sourceTree = "<absolute>"; };
8CF51323544B886B8F4A2232 /* qwbmp */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qwbmp; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqwbmp$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
8D9815BDB5BD9F90D2BC05C5 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = "<absolute>"; };
8DDE1D26B3206CDB8B57FABE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg_private.pri"; sourceTree = "<absolute>"; };
8E9136256AFFBA6EF048AA55 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets_private.pri"; sourceTree = "<absolute>"; };
8F500B5166907B6D9A7C3E3D /* qico */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qico; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqico$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
8F572030CE9AB8CC5F672201 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_platformsupport_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_platformsupport_private.pri"; sourceTree = "<absolute>"; };
8F97C9CAE38CA3AFAC0B3953 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets.pri"; sourceTree = "<absolute>"; };
946BEA667170DC1A7A8F9DB0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmng.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmng.pri"; sourceTree = "<absolute>"; };
9742F24EE18EA44D52824F1E /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
9A0BDF67E013BB4FFB8685B0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qqt7engine.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qqt7engine.pri"; sourceTree = "<absolute>"; };
9DFF62A901D70814B8A323D4 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
A022AF919D1977534CA66BB8 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets.pri"; sourceTree = "<absolute>"; };
A1A67BEAA744704B29168D39 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
A35D133D7C0EFB42FA85D194 /* genstyles.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = genstyles.h; path = SourceFiles/_other/genstyles.h; sourceTree = "<absolute>"; };
A4D8AC60897F435C1C3B9D02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri"; sourceTree = "<absolute>"; };
A59F74CD76FDC2B4B9910E18 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri"; sourceTree = "<absolute>"; };
A5B17ABEFBA1C2F43443D644 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras.pri"; sourceTree = "<absolute>"; };
A9E30FA27827990C5F182223 /* /usr/local/Qt-5.5.1/mkspecs/common/gcc-base-mac.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/gcc-base-mac.conf"; sourceTree = "<absolute>"; };
AA73DC3C2901E2979FE8AD5B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xml.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xml.pri"; sourceTree = "<absolute>"; };
AB1C02DDBD8E88DD9A9AFDDD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensorgestures_plugin.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensorgestures_plugin.pri"; sourceTree = "<absolute>"; };
AB745978DF0F41D1801ABDA6 /* .qmake.stash */ = {isa = PBXFileReference; lastKnownFileType = file; path = .qmake.stash; sourceTree = "<absolute>"; };
ABA9AB4619F09DCFD2D4A27F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmltest_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmltest_private.pri"; sourceTree = "<absolute>"; };
ACC8A73268E5D9AF64E97AF4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth.pri"; sourceTree = "<absolute>"; };
ADC6308023253CEA51F86E21 /* qwebp */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qwebp; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqwebp$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
ADFC79902C14A612AE93A89A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg.pri"; sourceTree = "<absolute>"; };
AEA456A2F75ED9F5CDA7BCBE /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
AFD721AA33A2F785E77B1698 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qcocoa.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qcocoa.pri"; sourceTree = "<absolute>"; };
B064BF3B496A7BF7A449CA1E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsqlite.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsqlite.pri"; sourceTree = "<absolute>"; };
B2246267D4C0D789259A86B0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickwidgets_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickwidgets_private.pri"; sourceTree = "<absolute>"; };
B26239063A068F800A2C95F4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwebp.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwebp.pri"; sourceTree = "<absolute>"; };
B382B645B34234E451AE5D94 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml.pri"; sourceTree = "<absolute>"; };
B518DA4EE7376002AFC71FD5 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools_private.pri"; sourceTree = "<absolute>"; };
B51B01657BFE9EAEF5590561 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc_private.pri"; sourceTree = "<absolute>"; };
B678DA730B4ECE863AD631AE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qminimal.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qminimal.pri"; sourceTree = "<absolute>"; };
B8525798C5AA7D7C6D68E1B3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_qtquick2.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_qtquick2.pri"; sourceTree = "<absolute>"; };
B8C1F6C965A7A14FBA8D4518 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmedia_audioengine.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmedia_audioengine.pri"; sourceTree = "<absolute>"; };
BD22EFEFCC02644B1883CE19 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtiff.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtiff.pri"; sourceTree = "<absolute>"; };
BD4D97801B547471B37A4CDC /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bootstrap_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bootstrap_private.pri"; sourceTree = "<absolute>"; };
BDC9ECADEE40D11E3C2EA93F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sensors_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sensors_private.pri"; sourceTree = "<absolute>"; };
BFF0C38FB0EC140C5F0304AE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport.pri"; sourceTree = "<absolute>"; };
C4295BE59CCEBCDD16268349 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qico.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qico.pri"; sourceTree = "<absolute>"; };
C505A18319B9B63C63877858 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script_private.pri"; sourceTree = "<absolute>"; };
C84546C18DCBB04166195DCF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtposition_positionpoll.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtposition_positionpoll.pri"; sourceTree = "<absolute>"; };
CCF75CFFB857487FB18F99F9 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qoffscreen.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qoffscreen.pri"; sourceTree = "<absolute>"; };
CE829DD126DD2B97E8D70A7A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools.pri"; sourceTree = "<absolute>"; };
CF86CD5BB01B9011E6B6FD3E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_clucene_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_clucene_private.pri"; sourceTree = "<absolute>"; };
CFCB992BEC24B71BFB8A2F30 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script.pri"; sourceTree = "<absolute>"; };
CFFBE05DB004895080314289 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvgicon.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvgicon.pri"; sourceTree = "<absolute>"; };
D0CDC87DAFDA7F18A7AF450F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport_private.pri"; sourceTree = "<absolute>"; };
D1FA7CAB5ACC09D563AE569F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets_private.pri"; sourceTree = "<absolute>"; };
D2FE4D909926A0D1656068C4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimedia.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimedia.pri"; sourceTree = "<absolute>"; };
D3D1BE0BEA3AEE0551AD39AC /* qdds */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qdds; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqdds$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
D4B32C2222F82AC56BADEB21 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
D4DE537C1FBBD48BD989FAD1 /* /usr/local/Qt-5.5.1/mkspecs/qconfig.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/qconfig.pri"; sourceTree = "<absolute>"; };
D5141F795670589C8CC41CBC /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_cocoaprintersupport.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_cocoaprintersupport.pri"; sourceTree = "<absolute>"; };
D53D8E6A188E05078A114294 /* qcocoa */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qcocoa; path = "/usr/local/Qt-5.5.1/plugins/platforms/libqcocoa$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
D6193B79CECC9DD0142D1200 /* qtharfbuzzng */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qtharfbuzzng; path = "/usr/local/Qt-5.5.1/lib/libqtharfbuzzng$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
D7A0618DE39A427EBF41940E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help_private.pri"; sourceTree = "<absolute>"; };
D81E3D9A18202BE8EC3D0E2C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_gui_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_gui_private.pri"; sourceTree = "<absolute>"; };
D948D4D8F949D45158F8DE35 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickwidgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickwidgets.pri"; sourceTree = "<absolute>"; };
DB0A26DDC377B2004F61BFE3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib.pri"; sourceTree = "<absolute>"; };
DBF506D10449BFABD45B82DA /* Qt5PrintSupport */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = Qt5PrintSupport; path = "/usr/local/Qt-5.5.1/lib/libQt5PrintSupport$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
DCEFD9167C239650120B0145 /* qtga */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qtga; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqtga$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
DF8188E30892A4654B984221 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmltest.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmltest.pri"; sourceTree = "<absolute>"; };
DFD7912080BC557230093752 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
E0F4563EA350EB65112A0EF4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_opengl_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_opengl_private.pri"; sourceTree = "<absolute>"; };
E37365B4489B4918BEBB707D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xml_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xml_private.pri"; sourceTree = "<absolute>"; };
E432DA897A5F027987342E8F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions.pri"; sourceTree = "<absolute>"; };
E50FA73B8A23BC179A642B27 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools.pri"; sourceTree = "<absolute>"; };
E66B9EC81C285CA9A7FB6A2E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_positioning_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_positioning_private.pri"; sourceTree = "<absolute>"; };
E7B2F248E3F7970788F35BF5 /* Qt5PlatformSupport */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = Qt5PlatformSupport; path = "/usr/local/Qt-5.5.1/lib/libQt5PlatformSupport$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
E7D67CB158408BB7DEA74764 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimedia_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimedia_private.pri"; sourceTree = "<absolute>"; };
EA5D4FF9DE4AC4215D7DCE0D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qcorewlanbearer.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qcorewlanbearer.pri"; sourceTree = "<absolute>"; };
EB1F99FD112917157F3C3F6E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qicns.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qicns.pri"; sourceTree = "<absolute>"; };
EB29AC635054C09EFA749AE1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp.pri"; sourceTree = "<absolute>"; };
EBD39B69F368CEEAC360A16D /* /usr/local/Qt-5.5.1/mkspecs/common/mac.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/mac.conf"; sourceTree = "<absolute>"; };
EF5243ECB3132AF2796F09DF /* msmain.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = msmain.cpp; path = SourceFiles/_other/msmain.cpp; sourceTree = "<absolute>"; };
F0681BC551FC8A2B132FC646 /* qjp2 */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qjp2; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqjp2$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
F0A58515945747E36783CC21 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_inspector.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_inspector.pri"; sourceTree = "<absolute>"; };
F2453BA07315EB9F34F1CD57 /* qtiff */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qtiff; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqtiff$(QT_LIBRARY_SUFFIX).a"; sourceTree = "<absolute>"; };
F2F823087EA182CCBD5748B8 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designer.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designer.pri"; sourceTree = "<absolute>"; };
F33BE16353DD1557A9AB3558 /* /usr/local/Qt-5.5.1/mkspecs/common/clang-mac.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/clang-mac.conf"; sourceTree = "<absolute>"; };
F4EB01857048DCFCFFAAC4D0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qavfmediaplayer.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qavfmediaplayer.pri"; sourceTree = "<absolute>"; };
F7ADBF552F6B9A5982915164 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_positioning.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_positioning.pri"; sourceTree = "<absolute>"; };
F83F87F8A60C9DF666911D42 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvg.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvg.pri"; sourceTree = "<absolute>"; };
F8BC976260B6D624F23C32D6 /* genstyles.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = genstyles.cpp; path = SourceFiles/_other/genstyles.cpp; sourceTree = "<absolute>"; };
F9BEAA743A908603687DA204 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns_private.pri"; sourceTree = "<absolute>"; };
FCC237CA5AD60B9BA4447615 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
FD944B80F033DFE737D401A2 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help.pri"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D1C883685E82D5676953459A /* Link Binary With Libraries */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1BB705CDB741E2B7450201A5 /* Cocoa.framework in Link Binary With Libraries */,
328FD74542F6E2C873EE4D4B /* ApplicationServices.framework in Link Binary With Libraries */,
668DDDA0C55405E7FCFD6CA5 /* CoreServices.framework in Link Binary With Libraries */,
F8B465CE34D8DF87AAE95913 /* CoreFoundation.framework in Link Binary With Libraries */,
F26454630C80841CBDCFE1CA /* Foundation.framework in Link Binary With Libraries */,
8771A8C96E9C391044035D99 /* OpenGL.framework in Link Binary With Libraries */,
E45E51A644D5FC9F942ECE55 /* AGL.framework in Link Binary With Libraries */,
D1FA8AF31837B51C762A9D4D /* qcocoa in Link Binary With Libraries */,
F8ED42CF8679BF83227DAFC4 /* Carbon.framework in Link Binary With Libraries */,
8D267F2E4776F0ECA2F49DC8 /* IOKit.framework in Link Binary With Libraries */,
1A681B886F50EE30FBE62B4B /* Qt5PrintSupport in Link Binary With Libraries */,
D22929A2B8C5281567FCACDC /* Qt5PlatformSupport in Link Binary With Libraries */,
BE6AB9DF1C4880624131C669 /* Qt5Widgets in Link Binary With Libraries */,
A9563D9C9FD0D76FAAF1CA96 /* qdds in Link Binary With Libraries */,
7CA5405B8503BFFC60932D2B /* qicns in Link Binary With Libraries */,
496FD9CEEB508016AFB9F928 /* qico in Link Binary With Libraries */,
59789101736112A570B8EFE6 /* qjp2 in Link Binary With Libraries */,
FBD56E2AC34F76BFFDB68619 /* qmng in Link Binary With Libraries */,
7F76437B577F737145996DC3 /* qtga in Link Binary With Libraries */,
C06DDE378A7AC1FA9E6FF69A /* qtiff in Link Binary With Libraries */,
A3F8F2284013928A02AE5C38 /* qwbmp in Link Binary With Libraries */,
F4D3747C3A03B25EDC9057BB /* qwebp in Link Binary With Libraries */,
9F33AC0693BC81B27D8F518D /* Qt5Gui in Link Binary With Libraries */,
8D33FE22B9BBADC7FA46C15B /* qtharfbuzzng in Link Binary With Libraries */,
07D7954A1B5544B200DE9598 /* qtpcre in Link Binary With Libraries */,
B9ADD90C014EA3FBE351DF03 /* Qt5Core in Link Binary With Libraries */,
);
name = "Link Binary With Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
25B08E2869634E9BCBA333A2 /* Generated Sources */ = {
isa = PBXGroup;
children = (
D0B536A85E53302E4F66CE23 /* GeneratedFiles */,
);
name = "Generated Sources";
sourceTree = "<Group>";
};
2EB56BE3C2D93CDAB0C52E67 /* Sources */ = {
isa = PBXGroup;
children = (
73F2E45FDEB381A085D37A49 /* SourceFiles */,
);
name = Sources;
sourceTree = "<Group>";
};
31562E815E3DF5B1A777D3EF /* _other */ = {
isa = PBXGroup;
children = (
EF5243ECB3132AF2796F09DF /* msmain.cpp */,
F8BC976260B6D624F23C32D6 /* genstyles.cpp */,
6FF81CB4A724CE1990CEE99A /* msmain.h */,
A35D133D7C0EFB42FA85D194 /* genstyles.h */,
);
name = _other;
sourceTree = "<Group>";
};
73F2E45FDEB381A085D37A49 /* SourceFiles */ = {
isa = PBXGroup;
children = (
31562E815E3DF5B1A777D3EF /* _other */,
);
name = SourceFiles;
sourceTree = "<Group>";
};
74B182DB50CB5611B5C1C297 /* Supporting Files */ = {
isa = PBXGroup;
children = (
10F719DFC6D0B05605ED1C16 /* MetaStyle.pro */,
6E67D23B15FC4B628DB2E0B2 /* /usr/local/Qt-5.5.1/mkspecs/qdevice.pri */,
669FB007C4A3D58424D85EC8 /* /usr/local/Qt-5.5.1/mkspecs/common/shell-unix.conf */,
0ABCEA8D0DD45589040B0AF2 /* /usr/local/Qt-5.5.1/mkspecs/common/unix.conf */,
EBD39B69F368CEEAC360A16D /* /usr/local/Qt-5.5.1/mkspecs/common/mac.conf */,
817A0F5A41B553A6DE67FDEB /* /usr/local/Qt-5.5.1/mkspecs/common/macx.conf */,
45B95DB3B70B47A910FC847B /* /usr/local/Qt-5.5.1/mkspecs/common/gcc-base.conf */,
A9E30FA27827990C5F182223 /* /usr/local/Qt-5.5.1/mkspecs/common/gcc-base-mac.conf */,
8C5164D4E37556D40C5E6AA2 /* /usr/local/Qt-5.5.1/mkspecs/common/clang.conf */,
F33BE16353DD1557A9AB3558 /* /usr/local/Qt-5.5.1/mkspecs/common/clang-mac.conf */,
D4DE537C1FBBD48BD989FAD1 /* /usr/local/Qt-5.5.1/mkspecs/qconfig.pri */,
ACC8A73268E5D9AF64E97AF4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth.pri */,
2E48BB382B895A5ACD79AF9F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth_private.pri */,
BD4D97801B547471B37A4CDC /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bootstrap_private.pri */,
CF86CD5BB01B9011E6B6FD3E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_clucene_private.pri */,
77FF486B1F9BCD55A8A3F35D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent.pri */,
7D28E9003CE64D8A7F2E292E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent_private.pri */,
7ECCC1F9442988B4F2707CC1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core.pri */,
5F781C7FD8422D359EA1D2FE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core_private.pri */,
7A94C7168B3FCBE5F04A013B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative.pri */,
89863CCAF1D29037AE95755D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative_private.pri */,
F2F823087EA182CCBD5748B8 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designer.pri */,
7C2F42B222EE88E26A6FED62 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designer_private.pri */,
69347C39E4D922E94D0860BF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_designercomponents_private.pri */,
360D4B3ED25D126430DE27D4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio.pri */,
4C6C71914B1926119120DACD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio_private.pri */,
23BC8B0FC3279421D41CA268 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_gui.pri */,
D81E3D9A18202BE8EC3D0E2C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_gui_private.pri */,
FD944B80F033DFE737D401A2 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help.pri */,
D7A0618DE39A427EBF41940E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help_private.pri */,
A5B17ABEFBA1C2F43443D644 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras.pri */,
33F165B1DB8CBF182C56FAB5 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras_private.pri */,
D2FE4D909926A0D1656068C4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimedia.pri */,
E7D67CB158408BB7DEA74764 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimedia_private.pri */,
28BD0D10214709D95B161E24 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets.pri */,
D1FA7CAB5ACC09D563AE569F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets_private.pri */,
293C8DEEE270847AC20E70F9 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network.pri */,
382E89A91A34F7898C25FD0D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network_private.pri */,
8A04A4A3625204D12A1207F6 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc.pri */,
B51B01657BFE9EAEF5590561 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc_private.pri */,
5CEA7A2DB2136425A88D1254 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_opengl.pri */,
E0F4563EA350EB65112A0EF4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_opengl_private.pri */,
E432DA897A5F027987342E8F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions.pri */,
5597304BEC94BFB9EAAEBC4B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions_private.pri */,
8F572030CE9AB8CC5F672201 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_platformsupport_private.pri */,
F7ADBF552F6B9A5982915164 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_positioning.pri */,
E66B9EC81C285CA9A7FB6A2E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_positioning_private.pri */,
6C08BFC27C4C303A3A5181DB /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport.pri */,
D0CDC87DAFDA7F18A7AF450F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport_private.pri */,
B382B645B34234E451AE5D94 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml.pri */,
6102C69805B6398AF6FA5BEB /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml_private.pri */,
4FB6657DA22BC68B819B64B3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmldevtools_private.pri */,
DF8188E30892A4654B984221 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmltest.pri */,
ABA9AB4619F09DCFD2D4A27F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qmltest_private.pri */,
5B22E9E4EE9AAE42ABC24AB3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri */,
16DD53E17C65AC8B450CC6C3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick.pri */,
8C31D89BDFCDF466DAED19A0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick_private.pri */,
82E7DCFD95559532D8FC6CDD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickparticles_private.pri */,
D948D4D8F949D45158F8DE35 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickwidgets.pri */,
B2246267D4C0D789259A86B0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quickwidgets_private.pri */,
CFCB992BEC24B71BFB8A2F30 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script.pri */,
C505A18319B9B63C63877858 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script_private.pri */,
CE829DD126DD2B97E8D70A7A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools.pri */,
A59F74CD76FDC2B4B9910E18 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri */,
85B6936EDBE61D9BB8F8B33B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sensors.pri */,
BDC9ECADEE40D11E3C2EA93F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sensors_private.pri */,
BFF0C38FB0EC140C5F0304AE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport.pri */,
311004331A04F3D69C98643C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport_private.pri */,
7DE30A90667C03C4F91A2A91 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql.pri */,
075EB50EB07CF69FD62FB8DF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql_private.pri */,
ADFC79902C14A612AE93A89A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg.pri */,
8DDE1D26B3206CDB8B57FABE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg_private.pri */,
DB0A26DDC377B2004F61BFE3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib.pri */,
8849E60AEC7DB97A475C17EA /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib_private.pri */,
E50FA73B8A23BC179A642B27 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools.pri */,
B518DA4EE7376002AFC71FD5 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools_private.pri */,
8F97C9CAE38CA3AFAC0B3953 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets.pri */,
87EEF25EE25CF21572D1438C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets_private.pri */,
A022AF919D1977534CA66BB8 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets.pri */,
8E9136256AFFBA6EF048AA55 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets_private.pri */,
AA73DC3C2901E2979FE8AD5B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xml.pri */,
E37365B4489B4918BEBB707D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xml_private.pri */,
2E6D9B1D2743D24E31B0B284 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns.pri */,
F9BEAA743A908603687DA204 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns_private.pri */,
D5141F795670589C8CC41CBC /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_cocoaprintersupport.pri */,
1FAE75C970AA73F2DEDDB508 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qavfcamera.pri */,
F4EB01857048DCFCFFAAC4D0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qavfmediaplayer.pri */,
AFD721AA33A2F785E77B1698 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qcocoa.pri */,
EA5D4FF9DE4AC4215D7DCE0D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qcorewlanbearer.pri */,
111BBEE3D1432C3B517FD539 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdds.pri */,
3685604BDB64DD6E92169B73 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdeclarativeview.pri */,
2440CD1D4CEF80443BCA1B8B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qgenericbearer.pri */,
EB1F99FD112917157F3C3F6E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qicns.pri */,
C4295BE59CCEBCDD16268349 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qico.pri */,
45DB132B756499D4DF38430E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qjp2.pri */,
B678DA730B4ECE863AD631AE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qminimal.pri */,
F0A58515945747E36783CC21 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_inspector.pri */,
B8525798C5AA7D7C6D68E1B3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_qtquick2.pri */,
EB29AC635054C09EFA749AE1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp.pri */,
3F08D430CEC8D2117735CCB4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp_qtdeclarative.pri */,
946BEA667170DC1A7A8F9DB0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmng.pri */,
CCF75CFFB857487FB18F99F9 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qoffscreen.pri */,
9A0BDF67E013BB4FFB8685B0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qqt7engine.pri */,
B064BF3B496A7BF7A449CA1E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsqlite.pri */,
F83F87F8A60C9DF666911D42 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvg.pri */,
CFFBE05DB004895080314289 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvgicon.pri */,
247D8DF3B1DDB665B80BBA25 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblequick.pri */,
87A4C1983FD641360BF80A02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblewidgets.pri */,
24B6929EE3952310F2DAECB1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaudio_coreaudio.pri */,
060A694B42A4555240009936 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtga.pri */,
BD22EFEFCC02644B1883CE19 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtiff.pri */,
B8C1F6C965A7A14FBA8D4518 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmedia_audioengine.pri */,
74C1C232DFAA71028A0412CA /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmultimedia_m3u.pri */,
C84546C18DCBB04166195DCF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtposition_positionpoll.pri */,
AB1C02DDBD8E88DD9A9AFDDD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensorgestures_plugin.pri */,
8B4BB4E74F8A4442EF563D7D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensorgestures_shakeplugin.pri */,
892D36BEF797BA4AF48D378A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_dummy.pri */,
A4D8AC60897F435C1C3B9D02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri */,
346287C9E754E7C458153F03 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwbmp.pri */,
B26239063A068F800A2C95F4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwebp.pri */,
63E722139886C87BC82DBDF5 /* /usr/local/Qt-5.5.1/mkspecs/macx-clang/qmake.conf */,
85061B1DA49D125991117950 /* /usr/local/Qt-5.5.1/mkspecs/macx-xcode/qmake.conf */,
AB745978DF0F41D1801ABDA6 /* .qmake.stash */,
);
name = "Supporting Files";
sourceTree = "<Group>";
};
801973D3334D0FCA849CF485 /* Debug */ = {
isa = PBXGroup;
children = (
861D2151FB56504EB72BDB6E /* moc_genstyles.cpp */,
);
name = Debug;
sourceTree = "<Group>";
};
AF39DD055C3EF8226FBE929D /* Frameworks */ = {
isa = PBXGroup;
children = (
07D795491B5544B200DE9598 /* qtpcre */,
AEA456A2F75ED9F5CDA7BCBE /* Cocoa.framework */,
DFD7912080BC557230093752 /* ApplicationServices.framework */,
9742F24EE18EA44D52824F1E /* CoreServices.framework */,
4D765E1B1EA6C757220C63E7 /* CoreFoundation.framework */,
FCC237CA5AD60B9BA4447615 /* Foundation.framework */,
D4B32C2222F82AC56BADEB21 /* OpenGL.framework */,
8D9815BDB5BD9F90D2BC05C5 /* AGL.framework */,
D53D8E6A188E05078A114294 /* qcocoa */,
9DFF62A901D70814B8A323D4 /* Carbon.framework */,
A1A67BEAA744704B29168D39 /* IOKit.framework */,
DBF506D10449BFABD45B82DA /* Qt5PrintSupport */,
E7B2F248E3F7970788F35BF5 /* Qt5PlatformSupport */,
4689C06178B60B84E7F3A3B7 /* Qt5Widgets */,
D3D1BE0BEA3AEE0551AD39AC /* qdds */,
31120EDB269DFF13E1D49847 /* qicns */,
8F500B5166907B6D9A7C3E3D /* qico */,
F0681BC551FC8A2B132FC646 /* qjp2 */,
83D37373949868693FB7816D /* qmng */,
DCEFD9167C239650120B0145 /* qtga */,
F2453BA07315EB9F34F1CD57 /* qtiff */,
8CF51323544B886B8F4A2232 /* qwbmp */,
ADC6308023253CEA51F86E21 /* qwebp */,
04391BE7A8B9D811E255100A /* Qt5Gui */,
D6193B79CECC9DD0142D1200 /* qtharfbuzzng */,
5A80A1907B6CFFB524C1E57D /* Qt5Core */,
);
name = Frameworks;
sourceTree = "<Group>";
};
D0B536A85E53302E4F66CE23 /* GeneratedFiles */ = {
isa = PBXGroup;
children = (
801973D3334D0FCA849CF485 /* Debug */,
);
name = GeneratedFiles;
sourceTree = "<Group>";
};
E8C543AB96796ECAA2E65C57 /* MetaStyle */ = {
isa = PBXGroup;
children = (
2EB56BE3C2D93CDAB0C52E67 /* Sources */,
25B08E2869634E9BCBA333A2 /* Generated Sources */,
74B182DB50CB5611B5C1C297 /* Supporting Files */,
AF39DD055C3EF8226FBE929D /* Frameworks */,
FE0A091FDBFB3E9C31B7A1BD /* Products */,
);
name = MetaStyle;
sourceTree = "<Group>";
};
FE0A091FDBFB3E9C31B7A1BD /* Products */ = {
isa = PBXGroup;
children = (
2CBD32689B153445ED220FAE /* MetaStyle.app */,
);
name = Products;
sourceTree = "<Group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
4F0CF954E7A00B07204FA0B2 /* MetaStyle */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6CC3B5D2136C7CD6A5CF5A59 /* Build configuration list for PBXNativeTarget "MetaStyle" */;
buildPhases = (
F7E50F631C51CD5B5DC0BC43 /* Compile Sources */,
D1C883685E82D5676953459A /* Link Binary With Libraries */,
);
buildRules = (
);
dependencies = (
CCEE60BFA9DEFDFF202AFD47 /* PBXTargetDependency */,
);
name = MetaStyle;
productInstallPath = ../Mac/DebugStyle/;
productName = MetaStyle;
productReference = 2CBD32689B153445ED220FAE /* MetaStyle.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6DB9C3763D02B1415CD9D565 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0700;
};
buildConfigurationList = DAC4C1AA5EDEA1C85E9CA5E6 /* Build configuration list for PBXProject "MetaStyle" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = E8C543AB96796ECAA2E65C57 /* MetaStyle */;
productRefGroup = FE0A091FDBFB3E9C31B7A1BD /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
4F0CF954E7A00B07204FA0B2 /* MetaStyle */,
5E275BA59C8BA5B561E14CF4 /* Preprocess */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
07C3AF43194CCD0F0016CFF1 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "mkdir -p ./GeneratedFiles/Debug";
};
7EF0942E79C014DCEC8976BC /* Qt Preprocessors */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
name = "Qt Preprocessors";
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "make -C . -f MetaStyle.xcodeproj/qt_preprocess.mak";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
F7E50F631C51CD5B5DC0BC43 /* Compile Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
728CDDB7D7F2B9FF141651AD /* msmain.cpp in Compile Sources */,
3D6772E35214B81E50791089 /* genstyles.cpp in Compile Sources */,
CBF24309A148222794F28401 /* moc_genstyles.cpp in Compile Sources */,
);
name = "Compile Sources";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
CCEE60BFA9DEFDFF202AFD47 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 5E275BA59C8BA5B561E14CF4 /* Preprocess */;
targetProxy = 0746FEAC193D006900F5C3FD /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
339EE1B2CC4FC24589A0EA95 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)Style$(EFFECTIVE_PLATFORM_NAME)";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1.0;
DYLIB_CURRENT_VERSION = 1.0.0;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui,
../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore,
../../Libraries/QtStatic/qtbase/include,
"/usr/local/Qt-5.5.1/include",
"/usr/local/Qt-5.5.1/include/QtGui",
"/usr/local/Qt-5.5.1/include/QtCore",
GeneratedFiles/Debug,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers,
"/usr/local/Qt-5.5.1/mkspecs/macx-clang",
);
INFOPLIST_FILE = Style.plist;
INSTALL_DIR = ../Mac/ReleaseStyle/;
LDPLUSPLUS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++";
LIBRARY_SEARCH_PATHS = (
/System/Library/Frameworks/,
"/usr/local/Qt-5.5.1/lib",
"/usr/local/Qt-5.5.1/plugins/platforms",
"/usr/local/Qt-5.5.1/plugins/imageformats",
);
MACOSX_DEPLOYMENT_TARGET = 10.8;
OBJROOT = ./../Mac/ReleaseIntermediateStyle;
OTHER_CFLAGS = (
"-pipe",
"-g",
"-Wall",
"-W",
"-fPIE",
"-D_DEBUG",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB",
);
OTHER_CPLUSPLUSFLAGS = (
"-pipe",
"-g",
"-std=c++11",
"-stdlib=libc++",
"-Wall",
"-W",
"-fPIE",
"-D_DEBUG",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB",
);
OTHER_LDFLAGS = (
"-headerpad_max_install_names",
"-stdlib=libc++",
"-L/usr/local/Qt-5.5.1/lib",
"-L/usr/local/Qt-5.5.1/plugins/platforms",
"-lcups",
"-L/usr/local/Qt-5.5.1/plugins/imageformats",
"-lz",
"-lm",
);
PRODUCT_NAME = MetaStyle;
QT_LIBRARY_SUFFIX = "";
SDKROOT = macosx;
SYMROOT = ./../Mac;
};
name = Release;
};
3AA6C32AC930069E80220CF1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)Style$(EFFECTIVE_PLATFORM_NAME)";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 1.0;
DYLIB_CURRENT_VERSION = 1.0.0;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui,
../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore,
../../Libraries/QtStatic/qtbase/include,
"/usr/local/Qt-5.5.1/include",
"/usr/local/Qt-5.5.1/include/QtGui",
"/usr/local/Qt-5.5.1/include/QtCore",
GeneratedFiles/Debug,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers,
"/usr/local/Qt-5.5.1/mkspecs/macx-clang",
);
INFOPLIST_FILE = Style.plist;
INSTALL_DIR = ../Mac/DebugStyle/;
LDPLUSPLUS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++";
LIBRARY_SEARCH_PATHS = (
/System/Library/Frameworks/,
"/usr/local/Qt-5.5.1/lib",
"/usr/local/Qt-5.5.1/plugins/platforms",
"/usr/local/Qt-5.5.1/plugins/imageformats",
);
MACOSX_DEPLOYMENT_TARGET = 10.8;
OBJROOT = ./../Mac/DebugIntermediateStyle;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-pipe",
"-g",
"-Wall",
"-W",
"-fPIE",
"-D_DEBUG",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB",
);
OTHER_CPLUSPLUSFLAGS = (
"-pipe",
"-g",
"-std=c++11",
"-stdlib=libc++",
"-Wall",
"-W",
"-fPIE",
"-D_DEBUG",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB",
);
OTHER_LDFLAGS = (
"-headerpad_max_install_names",
"-stdlib=libc++",
"-L/usr/local/Qt-5.5.1/lib",
"-L/usr/local/Qt-5.5.1/plugins/platforms",
"-lcups",
"-L/usr/local/Qt-5.5.1/plugins/imageformats",
"-lz",
"-lm",
);
PRODUCT_NAME = MetaStyle;
QT_LIBRARY_SUFFIX = _debug;
SDKROOT = macosx;
SYMROOT = ./../Mac;
};
name = Debug;
};
6666AA5E688052234F6758D8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
HEADER_SEARCH_PATHS = (
./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui,
./../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore,
./../../Libraries/QtStatic/qtbase/include,
"/usr/local/Qt-5.5.1/include",
"/usr/local/Qt-5.5.1/include/QtGui",
"/usr/local/Qt-5.5.1/include/QtCore",
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers,
"/usr/local/Qt-5.5.1/mkspecs/macx-clang",
);
INSTALL_DIR = ./../Mac/ReleaseStyle/;
PRODUCT_BUNDLE_IDENTIFIER = "com.tdesktop.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = MetaStyle;
QT_LIBRARY_SUFFIX = "";
SDKROOT = macosx;
};
name = Release;
};
77418F46922677BB04ED38DD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = (
./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui,
./../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore,
./../../Libraries/QtStatic/qtbase/include,
"/usr/local/Qt-5.5.1/include",
"/usr/local/Qt-5.5.1/include/QtGui",
"/usr/local/Qt-5.5.1/include/QtCore",
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers,
"/usr/local/Qt-5.5.1/mkspecs/macx-clang",
);
INSTALL_DIR = ./../Mac/DebugStyle/;
PRODUCT_BUNDLE_IDENTIFIER = "com.tdesktop.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = MetaStyle;
QT_LIBRARY_SUFFIX = _debug;
SDKROOT = macosx;
};
name = Debug;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6CC3B5D2136C7CD6A5CF5A59 /* Build configuration list for PBXNativeTarget "MetaStyle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
77418F46922677BB04ED38DD /* Debug */,
6666AA5E688052234F6758D8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
DAC4C1AA5EDEA1C85E9CA5E6 /* Build configuration list for PBXProject "MetaStyle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3AA6C32AC930069E80220CF1 /* Debug */,
339EE1B2CC4FC24589A0EA95 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
rootObject = 6DB9C3763D02B1415CD9D565 /* Project object */;
}

View file

@ -1,67 +0,0 @@
#############################################################################
# Makefile for building: ../Mac/DebugStyle/MetaStyle.app/Contents/MacOS/MetaStyle
# Generated by qmake (3.0) (Qt 5.5.1)
# Project: MetaStyle.pro
# Template: app
# Command: /usr/local/Qt-5.5.1/bin/qmake -spec macx-xcode -o MetaStyle.xcodeproj/project.pbxproj MetaStyle.pro
#############################################################################
MAKEFILE = project.pbxproj
MOC = /usr/local/Qt-5.5.1/bin/moc
UIC =
LEX = flex
LEXFLAGS =
YACC = yacc
YACCFLAGS = -d
DEFINES = -D_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
INCPATH = -I/usr/local/Qt-5.5.1/mkspecs/macx-clang -I. -I../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui -I../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore -I../../Libraries/QtStatic/qtbase/include -I/usr/local/Qt-5.5.1/include -I/usr/local/Qt-5.5.1/include/QtGui -I/usr/local/Qt-5.5.1/include/QtCore -IGeneratedFiles/Debug -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers
DEL_FILE = rm -f
MOVE = mv -f
IMAGES =
PARSERS =
preprocess: $(PARSERS) compilers
clean preprocess_clean: parser_clean compiler_clean
parser_clean:
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
compilers: GeneratedFiles/Debug/moc_genstyles.cpp
compiler_objective_c_make_all:
compiler_objective_c_clean:
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_header_make_all: GeneratedFiles/Debug/moc_genstyles.cpp
compiler_moc_header_clean:
-$(DEL_FILE) GeneratedFiles/Debug/moc_genstyles.cpp
GeneratedFiles/Debug/moc_genstyles.cpp: ../../Libraries/QtStatic/qtbase/include/QtCore/QMap \
../../Libraries/QtStatic/qtbase/include/QtCore/QVector \
../../Libraries/QtStatic/qtbase/include/QtGui/QBitmap \
../../Libraries/QtStatic/qtbase/include/QtCore/QBuffer \
../../Libraries/QtStatic/qtbase/include/QtCore/QFileInfo \
../../Libraries/QtStatic/qtbase/include/QtCore/QFile \
../../Libraries/QtStatic/qtbase/include/QtCore/QTextStream \
../../Libraries/QtStatic/qtbase/include/QtCore/QString \
../../Libraries/QtStatic/qtbase/include/QtCore/QCoreApplication \
../../Libraries/QtStatic/qtbase/include/QtGui/QGuiApplication \
../../Libraries/QtStatic/qtbase/include/QtGui/QPainter \
SourceFiles/_other/genstyles.h
/usr/local/Qt-5.5.1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -I/usr/local/Qt-5.5.1/mkspecs/macx-clang -I. -I/usr/local/Qt-5.5.1/include/QtGui/5.5.1/QtGui -I/usr/local/Qt-5.5.1/include/QtCore/5.5.1/QtCore -I/usr/local/Qt-5.5.1/include -I/usr/local/Qt-5.5.1/include/QtGui -I/usr/local/Qt-5.5.1/include/QtCore -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/backward -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.1/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include SourceFiles/_other/genstyles.h -o GeneratedFiles/Debug/moc_genstyles.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_rez_source_make_all:
compiler_rez_source_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean

View file

@ -19,6 +19,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
// Legacy styles
using "basic_types.style";
using "basic.style";
QVector<int> phoneNumberParse(const QString &number);
using "overview/overview.style";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

After

Width:  |  Height:  |  Size: 240 KiB

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,413 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
textStyle {
linkFlags: font;
linkFlagsOver: font;
linkFg: color;
linkFgDown: color;
monoFg: color;
selectBg: color;
selectOverlay: color;
lineHeight: pixels;
}
linkButton {
color: color;
overColor: color;
downColor: color;
font: font;
overFont: font;
}
sysButton {
size: size;
img: sprite;
color: color;
overColor: color;
duration: int;
}
flatButton {
color: color;
overColor: color;
downColor: color;
bgColor: color;
overBgColor: color;
downBgColor: color;
width: pixels;
height: pixels;
textTop: pixels;
overTextTop: pixels;
downTextTop: pixels;
font: font;
overFont: font;
duration: int;
cursor: cursor;
}
iconedButton {
icon: sprite;
iconPos: point;
downIcon: sprite;
downIconPos: point;
color: color;
bgColor: color;
overBgColor: color;
width: pixels;
height: pixels;
font: font;
opacity: double;
overOpacity: double;
textPos: point;
downTextPos: point;
duration: int;
cursor: cursor;
}
flatCheckbox {
textColor: color;
bgColor: color;
disColor: color;
width: pixels;
height: pixels;
textTop: pixels;
textLeft: pixels;
font: font;
duration: int;
bgFunc: transition;
cursor: cursor;
disabledCursor: cursor;
imageRect: sprite;
chkImageRect: sprite;
overImageRect: sprite;
chkOverImageRect: sprite;
disImageRect: sprite;
chkDisImageRect: sprite;
imagePos: point;
}
flatInput {
textColor: color;
bgColor: color;
bgActive: color;
width: pixels;
height: pixels;
textMrg: margins;
align: align;
font: font;
cursor: cursor;
imgRect: sprite;
imgPos: point;
borderWidth: pixels;
borderColor: color;
borderActive: color;
borderError: color;
phColor: color;
phFocusColor: color;
phPos: point;
phAlign: align;
phShift: pixels;
phDuration: int;
phLeftFunc: transition;
phAlphaFunc: transition;
phColorFunc: transition;
}
flatTextarea {
textColor: color;
bgColor: color;
width: pixels;
textMrg: margins;
align: align;
font: font;
cursor: cursor;
phColor: color;
phFocusColor: color;
phPos: point;
phAlign: align;
phShift: pixels;
phDuration: int;
phLeftFunc: transition;
phAlphaFunc: transition;
phColorFunc: transition;
}
flatScroll {
barColor: color;
bgColor: color;
barOverColor: color;
bgOverColor: color;
round: pixels;
width: pixels;
minHeight: pixels;
deltax: pixels;
deltat: pixels;
deltab: pixels;
topsh: pixels;
bottomsh: pixels;
shColor: color;
duration: int;
hiding: int;
}
countryInput {
width: pixels;
height: pixels;
top: pixels;
bgColor: color;
ptrSize: size;
textMrg: margins;
font: font;
align: align;
}
slider {
color: color;
thikness: pixels;
width: pixels;
bar: sprite;
}
flatLabel {
font: font;
minWidth: pixels;
width: pixels;
align: align;
}
switcher {
border: pixels;
borderColor: color;
bgColor: color;
bgHovered: color;
bgActive: color;
height: pixels;
font: font;
textColor: color;
activeColor: color;
duration: int;
}
dropdown {
border: pixels;
borderColor: color;
padding: margins;
shadow: sprite;
shadowShift: pixels;
duration: int;
width: pixels;
}
PopupMenu {
skip: pixels;
shadow: sprite;
shadowShift: pixels;
itemBg: color;
itemBgOver: color;
itemFg: color;
itemFgOver: color;
itemFgDisabled: color;
itemFgShortcut: color;
itemFgShortcutOver: color;
itemFgShortcutDisabled: color;
itemPadding: margins;
itemFont: font;
separatorPadding: margins;
separatorWidth: pixels;
separatorFg: color;
arrow: sprite;
duration: int;
widthMin: pixels;
widthMax: pixels;
}
Tooltip {
textBg: color;
textFg: color;
textFont: font;
textBorder: color;
textPadding: margins;
shift: point;
skip: pixels;
widthMax: pixels;
linesMax: int;
}
botKeyboardButton {
margin: pixels;
padding: pixels;
height: pixels;
textTop: pixels;
downTextTop: pixels;
}
BoxButton {
textFg: color;
textFgOver: color;
textBg: color; // rect of textBg with rounded rect of textBgOver upon it
textBgOver: color;
width: pixels;
height: pixels;
textTop: pixels;
font: font;
duration: int;
}
Checkbox {
textFg: color;
textBg: color;
checkFg: color;
checkFgOver: color;
checkFgActive: color;
width: pixels;
height: pixels;
textPosition: point;
diameter: pixels;
thickness: pixels;
checkIcon: sprite;
font: font;
duration: int;
}
Radiobutton {
textFg: color;
textBg: color;
checkFg: color;
checkFgOver: color;
checkFgActive: color;
width: pixels;
height: pixels;
textPosition: point;
diameter: pixels;
thickness: pixels;
checkSkip: pixels;
font: font;
duration: int;
}
InputArea {
textFg: color;
textMargins: margins;
placeholderFg: color;
placeholderFgActive: color;
placeholderMargins: margins;
placeholderAlign: align;
placeholderShift: pixels;
duration: int;
borderFg: color;
borderFgActive: color;
borderFgError: color;
border: pixels;
borderActive: pixels;
borderError: pixels;
font: font;
width: pixels;
heightMin: pixels;
heightMax: pixels;
}
InputField {
textFg: color;
textMargins: margins;
textAlign: align;
placeholderFg: color;
placeholderFgActive: color;
placeholderMargins: margins;
placeholderAlign: align;
placeholderShift: pixels;
duration: int;
borderFg: color;
borderFgActive: color;
borderFgError: color;
border: pixels;
borderActive: pixels;
borderError: pixels;
font: font;
width: pixels;
height: pixels;
iconSprite: sprite;
iconPosition: point;
}
PeerAvatarButton {
size: pixels;
photoSize: pixels;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

View file

@ -25,7 +25,6 @@ fsize: 13px;
normalFont: font(fsize);
semiboldFont: font(fsize semibold);
spriteFile: ':/gui/art/sprite.png' / 2:':/gui/art/sprite_125x.png' / 3:':/gui/art/sprite_150x.png' / 4:':/gui/art/sprite_200x.png';
emojiImgSize: 18px; // exceptional value for retina
emojiSize: 18px;
emojiPadding: 0px;
@ -2297,13 +2296,14 @@ overviewFileExtFont: font(18px semibold);
// Mac specific
macAccessory: size(450, 90);
macAccessoryWidth: 450;
macAccessoryHeight: 90;
macEnableFilterAdd: 2;
macEnableFilterTop: 5;
macSelectorTop: 6;
macAlwaysThisAppTop: 4;
macAppHintTop: 8;
macCautionIconSize: size(16, 16);
macCautionIconSize: 16;
btnContext: iconedButton(btnDefIconed) {
bgColor: white;

File diff suppressed because it is too large Load diff

View file

@ -1,78 +0,0 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QMap>
#include <QtCore/QVector>
#include <QtGui/QBitmap>
#include <QtCore/QBuffer>
#include <QtCore/QFileInfo>
#include <QtCore/QFile>
#include <iostream>
#include <exception>
#include <QtCore/QTextStream>
#include <QtCore/QString>
#include <QtCore/QCoreApplication>
#include <QtGui/QPainter>
using std::string;
using std::cout;
using std::cerr;
using std::exception;
class Exception : public exception {
public:
Exception(const QString &msg) : _msg(msg.toUtf8()) {
}
virtual const char *what() const throw() {
return _msg.constData();
}
virtual ~Exception() throw() {
}
private:
QByteArray _msg;
};
bool genStyles(const QString &classes_in, const QString &classes_out, const QString &styles_in, const QString &styles_out, const QString &path_to_sprites);
class GenStyles : public QObject {
Q_OBJECT
public:
GenStyles(const QString &classes_in, const QString &classes_out, const QString &styles_in, const QString &styles_out, const QString &path_to_sprites) : QObject(0),
_classes_in(classes_in), _classes_out(classes_out), _styles_in(styles_in), _styles_out(styles_out), _path_to_sprites(path_to_sprites) {
}
public slots:
void run() {
if (genStyles(_classes_in, _classes_out, _styles_in, _styles_out, _path_to_sprites)) {
emit finished();
}
}
signals:
void finished();
private:
QString _classes_in, _classes_out, _styles_in, _styles_out, _path_to_sprites;
};

View file

@ -1,64 +0,0 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "msmain.h"
#include <QtCore/QDir>
int main(int argc, char *argv[]) {
QString classes_in("style_classes.txt"), classes_out("style_classes.h"), styles_in("style.txt"), styles_out("style_auto.h"), path_to_sprites("./Resources/art/");
for (int i = 0; i < argc; ++i) {
if (string("-classes_in") == argv[i]) {
if (++i < argc) classes_in = argv[i];
} else if (string("-classes_out") == argv[i]) {
if (++i < argc) classes_out = argv[i];
} else if (string("-styles_in") == argv[i]) {
if (++i < argc) styles_in = argv[i];
} else if (string("-styles_out") == argv[i]) {
if (++i < argc) styles_out = argv[i];
} else if (string("-path_to_sprites") == argv[i]) {
if (++i < argc) path_to_sprites = argv[i];
}
}
#ifdef Q_OS_MAC
if (QDir(QString()).absolutePath() == "/") {
QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString();
if (!first.isEmpty()) {
QFileInfo info(first);
if (info.exists()) {
QDir result(info.absolutePath() + "/../../..");
QString basePath = result.absolutePath() + '/';
classes_in = basePath + classes_in;
classes_out = basePath + classes_out;
styles_in = basePath + styles_in;
styles_out = basePath + styles_out;
path_to_sprites = basePath + path_to_sprites;
}
}
}
#endif
QObject *taskImpl = new GenStyles(classes_in, classes_out, styles_in, styles_out, path_to_sprites);
QCoreApplication a(argc, argv);
QObject::connect(taskImpl, SIGNAL(finished()), &a, SLOT(quit()));
QTimer::singleShot(0, taskImpl, SLOT(run()));
return a.exec();
}

View file

@ -19,14 +19,12 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "ui/style.h"
#include "lang.h"
#include "apiwrap.h"
#include "lang.h"
#include "application.h"
#include "mainwindow.h"
#include "mainwidget.h"
#include "apiwrap.h"
#include "localstorage.h"
ApiWrap::ApiWrap(QObject *parent) : QObject(parent)

View file

@ -21,15 +21,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "stdafx.h"
#include "app.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#include <libexif/exif-data.h>
#endif
#include "styles/style_overview.h"
#include "lang.h"
#include "dialogs/dialogs_layout.h"
#include "audio.h"
#include "application.h"
#include "fileuploader.h"
#include "mainwidget.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#include <libexif/exif-data.h>
#endif
#include "localstorage.h"
#include "apiwrap.h"
#include "numbers.h"
@ -82,7 +84,7 @@ namespace {
HistoryItem *hoveredItem = 0, *pressedItem = 0, *hoveredLinkItem = 0, *pressedLinkItem = 0, *contextItem = 0, *mousedItem = 0;
QPixmap *sprite = 0, *emoji = 0, *emojiLarge = 0;
QPixmap *emoji = 0, *emojiLarge = 0;
style::font monofont;
struct CornersPixmaps {
@ -1993,14 +1995,6 @@ namespace {
if (family.isEmpty()) family = QFontDatabase::systemFont(QFontDatabase::FixedFont).family();
::monofont = style::font(st::normalFont->f.pixelSize(), 0, family);
}
if (!::sprite) {
if (rtl()) {
::sprite = new QPixmap(QPixmap::fromImage(QImage(st::spriteFile).mirrored(true, false)));
} else {
::sprite = new QPixmap(st::spriteFile);
}
if (cRetina()) ::sprite->setDevicePixelRatio(cRetinaFactor());
}
emojiInit();
if (!::emoji) {
::emoji = new QPixmap(QLatin1String(EName));
@ -2061,8 +2055,6 @@ namespace {
void deinitMedia() {
audioFinish();
delete ::sprite;
::sprite = 0;
delete ::emoji;
::emoji = 0;
delete ::emojiLarge;
@ -2140,7 +2132,7 @@ namespace {
}
const QPixmap &sprite() {
return *::sprite;
return style::spritePixmap();
}
const QPixmap &emoji() {
@ -2532,7 +2524,7 @@ namespace {
uint64 max = qMax(1ULL, components[maxtomin[0]]), mid = qMax(1ULL, components[maxtomin[1]]), min = qMax(1ULL, components[maxtomin[2]]);
QImage dog = App::sprite().toImage().copy(st::msgDogImg);
QImage dog = App::sprite().toImage().copy(st::msgDogImg.rect());
QImage::Format f = dog.format();
if (f != QImage::Format_ARGB32 && f != QImage::Format_ARGB32_Premultiplied) {
dog = dog.convertToFormat(QImage::Format_ARGB32_Premultiplied);

View file

@ -21,7 +21,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "stdafx.h"
#include "application.h"
#include "ui/style.h"
#include "shortcuts.h"
#include "pspecific.h"
#include "fileuploader.h"

View file

@ -31,7 +31,7 @@ void BlueTitleShadow::paintEvent(QPaintEvent *e) {
Painter p(this);
QRect r(e->rect());
p.drawPixmap(QRect(r.left(), 0, r.width(), height()), App::sprite(), st::boxBlueShadow);
p.drawPixmap(QRect(r.left(), 0, r.width(), height()), App::sprite(), st::boxBlueShadow.rect());
}
BlueTitleClose::BlueTitleClose(QWidget *parent) : Button(parent)

View file

@ -62,7 +62,7 @@ public:
void setBlueTitle(bool blue);
void raiseShadow();
public slots:
void onClose();
@ -115,7 +115,7 @@ public:
ScrollableBox(const style::flatScroll &scroll, int32 w = st::boxWideWidth);
void resizeEvent(QResizeEvent *e);
protected:
void init(QWidget *inner, int32 bottomSkip = st::boxScrollSkip, int32 topSkip = st::boxTitleHeight);

View file

@ -25,6 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "mainwidget.h"
#include "mainwindow.h"
#include "settingswidget.h"
#include "styles/style_overview.h"
BackgroundInner::BackgroundInner() :
_bgCount(0), _rows(0), _over(-1), _overDown(-1) {
@ -111,7 +112,7 @@ void BackgroundInner::updateWallpapers() {
void BackgroundInner::paintEvent(QPaintEvent *e) {
QRect r(e->rect());
QPainter p(this);
Painter p(this);
if (_rows) {
for (int i = 0; i < _rows; ++i) {
@ -130,7 +131,9 @@ void BackgroundInner::paintEvent(QPaintEvent *e) {
p.drawPixmap(x, y, pix);
if (paper.id == cChatBackgroundId()) {
p.drawPixmap(QPoint(x + st::backgroundSize.width() - st::overviewPhotoChecked.pxWidth(), y + st::backgroundSize.height() - st::overviewPhotoChecked.pxHeight()), App::sprite(), st::overviewPhotoChecked);
int checkPosX = x + st::backgroundSize.width() - st::overviewPhotoChecked.width();
int checkPosY = y + st::backgroundSize.height() - st::overviewPhotoChecked.height();
st::overviewPhotoChecked.paint(p, QPoint(checkPosX, checkPosY), width());
}
}
}

View file

@ -19,9 +19,9 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "ui/style.h"
#include "lang.h"
#include "boxes/photocropbox.h"
#include "lang.h"
#include "application.h"
#include "mainwidget.h"
#include "photocropbox.h"
@ -227,7 +227,7 @@ void PhotoCropBox::keyPressEvent(QKeyEvent *e) {
void PhotoCropBox::paintEvent(QPaintEvent *e) {
Painter p(this);
if (paint(p)) return;
p.setFont(st::boxTextFont);
p.setPen(st::boxPhotoTextFg);
p.drawText(QRect(st::boxPhotoPadding.left(), st::boxPhotoPadding.top() + _thumbh + st::boxPhotoPadding.bottom(), width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(), st::boxTextFont->height), _title, style::al_top);

View file

@ -19,11 +19,10 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "ui/style.h"
#include "boxes/photosendbox.h"
#include "lang.h"
#include "localstorage.h"
#include "mainwidget.h"
#include "photosendbox.h"

View file

@ -0,0 +1,298 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/common/basic_tokenized_file.h"
#include "codegen/common/logging.h"
#include "codegen/common/clean_file_reader.h"
#include "codegen/common/checked_utf8_string.h"
using Token = codegen::common::BasicTokenizedFile::Token;
using Type = Token::Type;
namespace codegen {
namespace common {
namespace {
constexpr int kErrorUnterminatedStringLiteral = 201;
constexpr int kErrorIncorrectUtf8String = 202;
constexpr int kErrorIncorrectToken = 203;
constexpr int kErrorUnexpectedToken = 204;
bool isDigitChar(char ch) {
return (ch >= '0') && (ch <= '9');
}
bool isNameChar(char ch) {
return isDigitChar(ch) || ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) || (ch == '_');
}
bool isWhitespaceChar(char ch) {
return (ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t');
}
Token invalidToken() {
return { Type::Invalid, QString(), ConstUtf8String(nullptr, 0), false };
}
} // namespace
BasicTokenizedFile::BasicTokenizedFile(const QString &filepath) : reader_(filepath) {
}
BasicTokenizedFile::BasicTokenizedFile(const QByteArray &content, const QString &filepath) : reader_(content, filepath) {
}
bool BasicTokenizedFile::putBack() {
if (currentToken_ > 0) {
--currentToken_;
return true;
}
return false;
}
Token BasicTokenizedFile::getAnyToken() {
if (currentToken_ >= tokens_.size()) {
if (readToken() == Type::Invalid) {
return invalidToken();
}
}
return tokens_.at(currentToken_++);
}
Token BasicTokenizedFile::getToken(Type typeCondition) {
if (auto token = getAnyToken()) {
if (token.type == typeCondition) {
return token;
}
putBack();
}
return invalidToken();
}
Type BasicTokenizedFile::readToken() {
auto result = readOneToken(StartWithWhitespace::Allow);
// Try to read double token.
if (result == Type::Int) {
if (readOneToken(StartWithWhitespace::Deny) == Type::Dot) {
// We got int and dot, so it is double already.
result = uniteLastTokens(Type::Double);
// Try to read one more int (after dot).
if (readOneToken(StartWithWhitespace::Deny) == Type::Int) {
result = uniteLastTokens(Type::Double);
}
}
} else if (result == Type::Dot) {
if (readOneToken(StartWithWhitespace::Deny) == Type::Int) {
//We got dot and int, so it is double.
result = uniteLastTokens(Type::Double);
}
}
return result;
}
Type BasicTokenizedFile::readOneToken(StartWithWhitespace condition) {
skipWhitespaces();
if (tokenStartWhitespace_ && condition == StartWithWhitespace::Deny) {
return Type::Invalid;
}
if (reader_.atEnd()) {
return Type::Invalid;
}
auto ch = reader_.currentChar();
if (ch == '"') {
return readString();
} else if (isNameChar(ch)) {
return readNameOrNumber();
}
return readSingleLetter();
}
Type BasicTokenizedFile::saveToken(Type type, const QString &value) {
ConstUtf8String original = { tokenStart_, reader_.currentPtr() };
tokens_.push_back({ type, value, original, tokenStartWhitespace_ });
return type;
}
Type BasicTokenizedFile::uniteLastTokens(Type type) {
auto size = tokens_.size();
if (size < 2) {
return Type::Invalid;
}
auto &token(tokens_[size - 2]);
auto originalFrom = token.original.data();
auto originalTill = tokens_.back().original.end();
token.type = type;
token.original = { originalFrom, originalTill };
token.value += tokens_.back().value;
tokens_.pop_back();
return type;
}
Type BasicTokenizedFile::readNameOrNumber() {
while (!reader_.atEnd()) {
if (!isDigitChar(reader_.currentChar())) {
break;
}
reader_.skipChar();
}
bool onlyDigits = true;
while (!reader_.atEnd()) {
if (!isNameChar(reader_.currentChar())) {
break;
}
onlyDigits = false;
reader_.skipChar();
}
return saveToken(onlyDigits ? Type::Int : Type::Name);
}
Type BasicTokenizedFile::readString() {
reader_.skipChar();
auto offset = reader_.currentPtr();
QByteArray value;
while (!reader_.atEnd()) {
auto ch = reader_.currentChar();
if (ch == '"') {
break;
}
if (ch == '\n') {
reader_.logError(kErrorUnterminatedStringLiteral, lineNumber_) << "unterminated string literal.";
failed_ = true;
return Type::Invalid;
}
if (ch == '\\') {
reader_.skipChar();
ch = reader_.currentChar();
if (reader_.atEnd() || ch == '\n') {
reader_.logError(kErrorUnterminatedStringLiteral, lineNumber_) << "unterminated string literal.";
failed_ = true;
return Type::Invalid;
}
if (reader_.currentPtr() > offset + 1) {
value.append(offset, reader_.currentPtr() - offset - 1);
}
offset = reader_.currentPtr() + 1;
if (ch == 'n') {
value.append('\n');
} else if (ch == 't') {
value.append('\t');
} else if (ch == '"') {
value.append('"');
} else if (ch == '\\') {
value.append('\\');
}
} else {
value.append(ch);
}
reader_.skipChar();
}
if (reader_.atEnd()) {
reader_.logError(kErrorUnterminatedStringLiteral, lineNumber_) << "unterminated string literal.";
failed_ = true;
return Type::Invalid;
}
CheckedUtf8String checked(value);
if (!checked.isValid()) {
reader_.logError(kErrorIncorrectUtf8String, lineNumber_) << "incorrect UTF-8 string literal.";
failed_ = true;
return Type::Invalid;
}
reader_.skipChar();
return saveToken(Type::String, checked.toString());
}
Type BasicTokenizedFile::readSingleLetter() {
auto type = singleLetterTokens_.value(reader_.currentChar(), Type::Invalid);
if (type == Type::Invalid) {
reader_.logError(kErrorIncorrectToken, lineNumber_) << "incorrect token '" << reader_.currentChar() << "'";
return Type::Invalid;
}
reader_.skipChar();
return saveToken(type);
}
void BasicTokenizedFile::skipWhitespaces() {
if (reader_.atEnd()) return;
auto ch = reader_.currentChar();
tokenStartWhitespace_ = isWhitespaceChar(ch);
if (tokenStartWhitespace_) {
do {
if (ch == '\n') {
++lineNumber_;
}
reader_.skipChar();
ch = reader_.currentChar();
} while (!reader_.atEnd() && isWhitespaceChar(ch));
}
tokenStart_ = reader_.currentPtr();
}
LogStream operator<<(LogStream &&stream, BasicTokenizedFile::Token::Type type) {
const char *value = "'invalid'";
switch (type) {
case Type::Invalid: break;
case Type::Int: value = "'int'"; break;
case Type::Double: value = "'double'"; break;
case Type::String: value = "'string'"; break;
case Type::LeftParenthesis: value = "'('"; break;
case Type::RightParenthesis: value = "')'"; break;
case Type::LeftBrace: value = "'{'"; break;
case Type::RightBrace: value = "'}'"; break;
case Type::LeftBracket: value = "'['"; break;
case Type::RightBracket: value = "']'"; break;
case Type::Colon: value = "':'"; break;
case Type::Semicolon: value = "';'"; break;
case Type::Comma: value = "','"; break;
case Type::Dot: value = "'.'"; break;
case Type::Number: value = "'#'"; break;
case Type::Plus: value = "'+'"; break;
case Type::Minus: value = "'-'"; break;
case Type::Equals: value = "'='"; break;
case Type::Name: value = "'identifier'"; break;
}
return std::forward<LogStream>(stream) << value;
}
LogStream BasicTokenizedFile::logError(int code) const {
return reader_.logError(code, lineNumber_);
}
LogStream BasicTokenizedFile::logErrorUnexpectedToken() const {
if (currentToken_ < tokens_.size()) {
auto token = tokens_.at(currentToken_).original.toStdString();
return logError(kErrorUnexpectedToken) << "unexpected token '" << token << "', expected ";
}
return logError(kErrorUnexpectedToken) << "unexpected token, expected ";
}
BasicTokenizedFile::~BasicTokenizedFile() = default;
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,158 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QList>
#include "codegen/common/const_utf8_string.h"
#include "codegen/common/clean_file_reader.h"
namespace codegen {
namespace common {
class LogStream;
// Interface for reading a cleaned from comments file by basic tokens.
class BasicTokenizedFile {
public:
explicit BasicTokenizedFile(const QString &filepath);
explicit BasicTokenizedFile(const QByteArray &content, const QString &filepath = QString());
BasicTokenizedFile(const BasicTokenizedFile &other) = delete;
BasicTokenizedFile &operator=(const BasicTokenizedFile &other) = delete;
struct Token {
// String - utf8 string converted to QString.
enum class Type {
Invalid = 0,
Int,
Double,
String,
LeftParenthesis,
RightParenthesis,
LeftBrace,
RightBrace,
LeftBracket,
RightBracket,
Colon,
Semicolon,
Comma,
Dot,
Number,
Plus,
Minus,
Equals,
Name, // [0-9a-zA-Z_]+ with at least one letter.
};
Type type;
QString value;
ConstUtf8String original;
bool hasLeftWhitespace;
explicit operator bool() const {
return (type != Type::Invalid);
}
};
bool read() {
return reader_.read();
}
bool atEnd() const {
return reader_.atEnd();
}
Token getAnyToken();
Token getToken(Token::Type typeCondition);
bool putBack();
bool failed() const {
return failed_;
}
// Log error to std::cerr with 'code' at the current position in file.
LogStream logError(int code) const;
LogStream logErrorUnexpectedToken() const;
~BasicTokenizedFile();
private:
using Type = Token::Type;
void skipWhitespaces();
// Reads a token, including complex tokens, like double numbers.
Type readToken();
// Read exactly one token, applying condition on the whitespaces.
enum class StartWithWhitespace {
Allow,
Deny,
};
Type readOneToken(StartWithWhitespace condition);
// helpers
Type readNameOrNumber();
Type readString();
Type readSingleLetter();
Type saveToken(Type type, const QString &value = QString());
Type uniteLastTokens(Type type);
CleanFileReader reader_;
QList<Token> tokens_;
int currentToken_ = 0;
int lineNumber_ = 1;
bool failed_ = false;
// Where the last (currently read) token has started.
const char *tokenStart_ = nullptr;
// Did the last (currently read) token start with a whitespace.
bool tokenStartWhitespace_ = false;
const QMap<char, Type> singleLetterTokens_ = {
{ '(', Type::LeftParenthesis },
{ ')', Type::RightParenthesis },
{ '{', Type::LeftBrace },
{ '}', Type::RightBrace },
{ '[', Type::LeftBracket },
{ ']', Type::RightBracket },
{ ':', Type::Colon },
{ ';', Type::Semicolon },
{ ',', Type::Comma },
{ '.', Type::Dot },
{ '#', Type::Number },
{ '+', Type::Plus },
{ '-', Type::Minus },
{ '=', Type::Equals },
};
};
LogStream operator<<(LogStream &&stream, BasicTokenizedFile::Token::Type type);
template <>
LogStream operator<< <BasicTokenizedFile::Token::Type>(LogStream &&stream, BasicTokenizedFile::Token::Type &&value) = delete;
template <>
LogStream operator<< <const BasicTokenizedFile::Token::Type&>(LogStream &&stream, const BasicTokenizedFile::Token::Type &value) = delete;
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,54 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/common/checked_utf8_string.h"
#include <iostream>
#include <QtCore/QTextCodec>
#include "codegen/common/const_utf8_string.h"
namespace codegen {
namespace common {
CheckedUtf8String::CheckedUtf8String(const char *string, int size) {
if (size < 0) {
size = strlen(string);
}
if (!size) { // Valid empty string
return;
}
QTextCodec::ConverterState state;
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
string_ = codec->toUnicode(string, size, &state);
if (state.invalidChars > 0) {
valid_ = false;
}
}
CheckedUtf8String::CheckedUtf8String(const QByteArray &string) : CheckedUtf8String(string.constData(), string.size()) {
}
CheckedUtf8String::CheckedUtf8String(const ConstUtf8String &string) : CheckedUtf8String(string.data(), string.size()) {
}
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,57 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
class QByteArray;
namespace codegen {
namespace common {
class ConstUtf8String;
// Parses a char sequence to a QString using UTF-8 codec.
// You can check for invalid UTF-8 sequence by isValid() method.
class CheckedUtf8String {
public:
CheckedUtf8String(const CheckedUtf8String &other) = default;
CheckedUtf8String &operator=(const CheckedUtf8String &other) = default;
explicit CheckedUtf8String(const char *string, int size = -1);
explicit CheckedUtf8String(const QByteArray &string);
explicit CheckedUtf8String(const ConstUtf8String &string);
bool isValid() const {
return valid_;
}
const QString &toString() const {
return string_;
}
private:
QString string_;
bool valid_ = true;
};
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,164 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/common/clean_file.h"
#include <iostream>
#include <QtCore/QDir>
#include "codegen/common/logging.h"
namespace codegen {
namespace common {
namespace {
bool readFile(const QString &filepath, QByteArray *outResult) {
QFile f(filepath);
if (!f.exists()) {
logError(kErrorFileNotFound, filepath) << ": error: file does not exist.";
return false;
}
auto limit = CleanFile::MaxSize;
if (f.size() > limit) {
logError(kErrorFileTooLarge, filepath) << "' is too large, size=" << f.size() << " > maxsize=" << limit;
return false;
}
if (!f.open(QIODevice::ReadOnly)) {
logError(kErrorFileNotOpened, filepath) << "' for read.";
return false;
}
*outResult = f.readAll();
return true;
}
} // namespace
CleanFile::CleanFile(const QString &filepath)
: filepath_(filepath)
, read_(true) {
}
CleanFile::CleanFile(const QByteArray &content, const QString &filepath)
: filepath_(filepath)
, content_(content)
, read_(false) {
}
bool CleanFile::read() {
if (read_) {
if (!readFile(filepath_, &content_)) {
return false;
}
}
filepath_ = QFileInfo(filepath_).absoluteFilePath();
enum class InsideComment {
None,
SingleLine,
MultiLine,
};
auto insideComment = InsideComment::None;
bool insideString = false;
const char *begin = content_.cbegin(), *end = content_.cend(), *offset = begin;
auto feedContent = [this, &offset, end](const char *ch) {
if (ch > offset) {
if (result_.isEmpty()) result_.reserve(end - offset - 2);
result_.append(offset, ch - offset);
offset = ch;
}
};
auto feedComment = [this, &offset, end](const char *ch) {
if (ch > offset) {
// comments_.push_back({ content_.size(), QByteArray(offset, ch - offset) });
if (result_.isEmpty()) result_.reserve(end - offset - 2);
result_.append(' ');
offset = ch;
}
};
for (const char *ch = offset; ch != end;) {
char currentChar = *ch;
char nextChar = (ch + 1 == end) ? 0 : *(ch + 1);
if (insideComment == InsideComment::None && currentChar == '"') {
bool escaped = ((ch > begin) && *(ch - 1) == '\\') && ((ch - 1 < begin) || *(ch - 2) != '\\');
if (!escaped) {
insideString = !insideString;
}
}
if (insideString) {
++ch;
continue;
}
if (insideComment == InsideComment::None && currentChar == '/' && nextChar == '/') {
feedContent(ch);
insideComment = InsideComment::SingleLine;
ch += 2;
} else if (insideComment == InsideComment::SingleLine && currentChar == '\r' && nextChar == '\n') {
feedComment(ch);
ch += 2;
insideComment = InsideComment::None;
} else if (insideComment == InsideComment::SingleLine && currentChar == '\n') {
feedComment(ch);
++ch;
insideComment = InsideComment::None;
} else if (insideComment == InsideComment::None && currentChar == '/' && nextChar == '*') {
feedContent(ch);
ch += 2;
insideComment = InsideComment::MultiLine;
} else if (insideComment == InsideComment::MultiLine && currentChar == '*' && nextChar == '/') {
ch += 2;
feedComment(ch);
insideComment = InsideComment::None;
} else if (insideComment == InsideComment::MultiLine && currentChar == '\r' && nextChar == '\n') {
feedComment(ch);
ch += 2;
feedContent(ch);
} else if (insideComment == InsideComment::MultiLine && currentChar == '\n') {
feedComment(ch);
++ch;
feedContent(ch);
} else {
++ch;
}
}
if (insideComment == InsideComment::MultiLine) {
common::logError(kErrorUnexpectedEndOfFile, filepath_);
return false;
}
if (insideComment == InsideComment::None && end > offset) {
if (result_.isEmpty()) {
result_ = content_;
} else {
result_.append(offset, end - offset);
}
}
return true;
}
LogStream CleanFile::logError(int code, int line) const {
return common::logError(code, filepath_, line);
}
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,67 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
#include <QtCore/QByteArray>
#include <QtCore/QVector>
#include "codegen/common/logging.h"
namespace codegen {
namespace common {
// Reads a file removing all C-style comments.
class CleanFile {
public:
explicit CleanFile(const QString &filepath);
explicit CleanFile(const QByteArray &content, const QString &filepath = QString());
CleanFile(const CleanFile &other) = delete;
CleanFile &operator=(const CleanFile &other) = delete;
bool read();
const char *data() const {
return result_.constData();
}
const char *end() const {
return result_.constEnd();
}
static constexpr int MaxSize = 10 * 1024 * 1024;
// Log error to std::cerr with 'code' at line number 'line' in data().
LogStream logError(int code, int line) const;
private:
QString filepath_;
QByteArray content_, result_;
bool read_;
//struct Comment {
// int offset;
// QByteArray content;
//};
//QVector<Comment> comments_;
};
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,80 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
#include "codegen/common/clean_file.h"
namespace codegen {
namespace common {
// Wrapper allows you to read forward the CleanFile without overflow checks.
class CleanFileReader {
public:
explicit CleanFileReader(const QString &filepath) : file_(filepath) {
}
explicit CleanFileReader(const QByteArray &content, const QString &filepath = QString()) : file_(content, filepath) {
}
bool read() {
if (!file_.read()) {
return false;
}
pos_ = file_.data();
end_ = file_.end();
return true;
}
bool atEnd() const {
return (pos_ == end_);
}
char currentChar() const {
return atEnd() ? 0 : *pos_;
}
bool skipChar() {
if (atEnd()) {
return false;
}
++pos_;
return true;
}
const char *currentPtr() const {
return pos_;
}
int charsLeft() const {
return (end_ - pos_);
}
// Log error to std::cerr with 'code' at line number 'line' in data().
LogStream logError(int code, int line) const {
return std::forward<LogStream>(file_.logError(code, line));
}
private:
CleanFile file_;
const char *pos_ = nullptr;
const char *end_ = nullptr;
};
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,75 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <string>
#include <QtCore/QString>
#include <QtCore/QByteArray>
namespace codegen {
namespace common {
// This is a simple wrapper around (const char*, size).
// Not null-terminated! It does not hold any ownership.
class ConstUtf8String {
public:
explicit ConstUtf8String(const char *string, int size = -1) : string_(string) {
if (size < 0) {
size = strlen(string);
}
size_ = size;
}
ConstUtf8String(const char *string, const char *end) : ConstUtf8String(string, end - string) {
}
QByteArray toByteArray() const {
return QByteArray(string_, size_);
}
std::string toStdString() const {
return std::string(string_, size_);
}
QString toStringUnchecked() const {
return QString::fromUtf8(string_, size_);
}
bool empty() const {
return size_ == 0;
}
const char *data() const {
return string_;
}
int size() const {
return size_;
}
const char *end() const {
return data() + size();
}
ConstUtf8String mid(int pos, int size = -1) {
return ConstUtf8String(string_ + pos, std::max(std::min(size, size_ - pos), 0));
}
private:
const char *string_;
int size_;
};
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,135 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/common/cpp_file.h"
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
namespace codegen {
namespace common {
namespace {
void writeLicense(QTextStream &stream, const ProjectInfo &project) {
stream << "\
/*\n\
WARNING! All changes made in this file will be lost!\n\
Created from '" << project.source << "' by '" << project.name << "'\n\
\n\
This file is part of Telegram Desktop,\n\
the official desktop version of Telegram messaging app, see https://telegram.org\n\
\n\
Telegram Desktop is free software: you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
the Free Software Foundation, either version 3 of the License, or\n\
(at your option) any later version.\n\
\n\
It is distributed in the hope that it will be useful,\n\
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
GNU General Public License for more details.\n\
\n\
In addition, as a special exception, the copyright holders give permission\n\
to link the code of portions of this program with the OpenSSL library.\n\
\n\
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
*/\n";
}
} // namespace
CppFile::CppFile(const QString &path, const ProjectInfo &project)
: stream_(&content_)
, forceReGenerate_(project.forceReGenerate) {
bool cpp = path.toLower().endsWith(".cpp");
QFileInfo info(path);
info.dir().mkpath(".");
filepath_ = info.absoluteFilePath();
writeLicense(stream_, project);
if (cpp) {
if (!project.precompiledHeader.isEmpty()) {
include(project.precompiledHeader);
}
include(info.baseName() + ".h").newline();
} else {
stream() << "#pragma once";
newline().newline();
}
}
CppFile &CppFile::include(const QString &header) {
stream() << "#include \"" << header << "\"";
return newline();
}
CppFile &CppFile::pushNamespace(const QString &name) {
namespaces_.push_back(name);
stream() << "namespace";
if (!name.isEmpty()) {
stream() << ' ' << name;
}
stream() << " {";
return newline();
}
CppFile &CppFile::popNamespace() {
if (namespaces_.isEmpty()) {
return *this;
}
auto name = namespaces_.back();
namespaces_.pop_back();
stream() << "} // namespace";
if (!name.isEmpty()) {
stream() << ' ' << name;
}
return newline();
}
bool CppFile::finalize() {
while (!namespaces_.isEmpty()) {
popNamespace();
}
stream_.flush();
QFile file(filepath_);
if (!forceReGenerate_ && file.open(QIODevice::ReadOnly)) {
if (file.readAll() == content_) {
file.close();
return true;
}
file.close();
}
if (!file.open(QIODevice::WriteOnly)) {
return false;
}
if (file.write(content_) != content_.size()) {
return false;
}
return true;
}
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,70 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtCore/QTextStream>
namespace codegen {
namespace common {
struct ProjectInfo {
QString name;
QString source;
QString precompiledHeader;
bool forceReGenerate;
};
// Creates a file with license header and codegen warning.
class CppFile {
public:
// If "basepath" is empty the folder containing "path" will be chosen.
// File ending with .cpp will be treated as source, otherwise like header.
CppFile(const QString &path, const ProjectInfo &project);
QTextStream &stream() {
return stream_;
}
CppFile &newline() {
stream() << "\n";
return *this;
}
CppFile &include(const QString &header);
// Empty name adds anonymous namespace.
CppFile &pushNamespace(const QString &name = QString());
CppFile &popNamespace();
bool finalize();
private:
QString filepath_;
QByteArray content_;
QTextStream stream_;
QVector<QString> namespaces_;
bool forceReGenerate_;
};
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,47 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/common/logging.h"
#include <iostream>
#include <QtCore/QDir>
namespace codegen {
namespace common {
namespace {
std::string relativeLocalPath(const QString &filepath) {
auto name = QFile::encodeName(QDir().relativeFilePath(filepath));
return name.constData();
}
} // namespace
LogStream logError(int code, const QString &filepath, int line) {
std::cerr << relativeLocalPath(filepath);
if (line > 0) {
std::cerr << '(' << line << ')';
}
std::cerr << ": error " << code << ": ";
return LogStream(std::cerr);
}
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,78 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
#include <iostream>
namespace codegen {
namespace common {
// Common error codes.
constexpr int kErrorFileNotFound = 101;
constexpr int kErrorFileTooLarge = 102;
constexpr int kErrorFileNotOpened = 103;
constexpr int kErrorUnexpectedEndOfFile = 104;
// Wrapper around std::ostream that adds '\n' to the end of the logging line.
class LogStream {
public:
enum NullType {
Null,
};
explicit LogStream(NullType) : final_(false) {
}
explicit LogStream(std::ostream &stream) : stream_(&stream) {
}
LogStream(LogStream &&other) : stream_(other.stream_), final_(other.final_) {
other.final_ = false;
}
std::ostream *stream() const {
return stream_;
}
~LogStream() {
if (final_) {
*stream_ << '\n';
}
}
private:
std::ostream *stream_ = nullptr;
bool final_ = true;
};
template <typename T>
LogStream operator<<(LogStream &&stream, T &&value) {
if (auto ostream = stream.stream()) {
*ostream << std::forward<T>(value);
}
return std::forward<LogStream>(stream);
}
// Outputs file name, line number and error code to std::err. Usage:
// logError(kErrorFileTooLarge, filepath) << "file too large, size=" << size;
LogStream logError(int code, const QString &filepath, int line = 0);
static constexpr int kErrorInternal = 666;
} // namespace common
} // namespace codegen

View file

@ -0,0 +1,110 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/numbers/generator.h"
#include <QtCore/QDir>
#include <QtCore/QSet>
#include <functional>
namespace codegen {
namespace numbers {
namespace {
} // namespace
Generator::Generator(const Rules &rules, const QString &destBasePath, const common::ProjectInfo &project)
: rules_(rules)
, basePath_(destBasePath)
, project_(project) {
}
bool Generator::writeHeader() {
header_ = std::make_unique<common::CppFile>(basePath_ + ".h", project_);
header_->stream() << "QVector<int> phoneNumberParse(const QString &number);\n";
return header_->finalize();
}
bool Generator::writeSource() {
source_ = std::make_unique<common::CppFile>(basePath_ + ".cpp", project_);
source_->stream() << "\
QVector<int> phoneNumberParse(const QString &number) {\n\
QVector<int> result;\n\
\n\
int32 len = number.size();\n\
if (len > 0) switch (number.at(0).unicode()) {\n";
QString already;
for (auto i = rules_.data.cend(), e = rules_.data.cbegin(); i != e;) {
--i;
QString k = i.key();
bool onlyLastChanged = true;
while (!already.isEmpty() && (already.size() > k.size() || !already.endsWith(k.at(already.size() - 1)))) {
if (!onlyLastChanged) {
source_->stream() << QString("\t").repeated(1 + already.size()) << "}\n";
source_->stream() << QString("\t").repeated(already.size()) << "break;\n";
}
already = already.mid(0, already.size() - 1);
onlyLastChanged = false;
}
if (already == k) {
source_->stream() << QString("\t").repeated(1 + already.size()) << "}\n";
} else {
bool onlyFirstCheck = true;
while (already.size() < k.size()) {
if (!onlyFirstCheck) source_->stream() << QString("\t").repeated(1 + already.size()) << "if (len > " << already.size() << ") switch (number.at(" << already.size() << ").unicode()) {\n";
source_->stream() << QString("\t").repeated(1 + already.size()) << "case '" << k.at(already.size()).toLatin1() << "':\n";
already.push_back(k.at(already.size()));
onlyFirstCheck = false;
}
}
if (i.value().isEmpty()) {
source_->stream() << QString("\t").repeated(1 + already.size()) << "return QVector<int>(1, " << k.size() << ");\n";
} else {
source_->stream() << QString("\t").repeated(1 + already.size()) << "result.reserve(" << (i.value().size() + 1) << ");\n";
source_->stream() << QString("\t").repeated(1 + already.size()) << "result.push_back(" << k.size() << ");\n";
for (int j = 0, l = i.value().size(); j < l; ++j) {
source_->stream() << QString("\t").repeated(1 + already.size()) << "result.push_back(" << i.value().at(j) << ");\n";
}
source_->stream() << QString("\t").repeated(1 + already.size()) << "return result;\n";
}
}
bool onlyLastChanged = true;
while (!already.isEmpty()) {
if (!onlyLastChanged) {
source_->stream() << QString("\t").repeated(1 + already.size()) << "}\n";
}
already = already.mid(0, already.size() - 1);
onlyLastChanged = false;
}
source_->stream() << "\
}\n\
\n\
return result;\n\
}\n";
return source_->finalize();
}
} // namespace numbers
} // namespace codegen

View file

@ -0,0 +1,50 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <QtCore/QString>
#include <QtCore/QSet>
#include "codegen/common/cpp_file.h"
#include "codegen/numbers/parsed_file.h"
namespace codegen {
namespace numbers {
class Generator {
public:
Generator(const Rules &rules, const QString &destBasePath, const common::ProjectInfo &project);
Generator(const Generator &other) = delete;
Generator &operator=(const Generator &other) = delete;
bool writeHeader();
bool writeSource();
private:
const Rules &rules_;
QString basePath_;
const common::ProjectInfo &project_;
std::unique_ptr<common::CppFile> source_, header_;
};
} // namespace numbers
} // namespace codegen

View file

@ -18,6 +18,19 @@ to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QTimer>
#include <QtCore/QCoreApplication>
#include "genstyles.h"
#include "codegen/numbers/options.h"
#include "codegen/numbers/processor.h"
int main(int argc, char *argv[]) {
QCoreApplication app(argc, argv);
auto options = codegen::numbers::parseOptions();
if (options.inputPath.isEmpty()) {
return -1;
}
codegen::numbers::Processor processor(options);
return processor.launch();
}

View file

@ -0,0 +1,74 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/numbers/options.h"
#include <ostream>
#include <QtCore/QCoreApplication>
#include "codegen/common/logging.h"
namespace codegen {
namespace numbers {
namespace {
constexpr int kErrorOutputPathExpected = 902;
constexpr int kErrorInputPathExpected = 903;
constexpr int kErrorSingleInputPathExpected = 904;
} // namespace
using common::logError;
Options parseOptions() {
Options result;
auto args(QCoreApplication::instance()->arguments());
for (int i = 1, count = args.size(); i < count; ++i) { // skip first
const auto &arg(args.at(i));
// Output path
if (arg == "-o") {
if (++i == count) {
logError(kErrorOutputPathExpected, "Command Line") << "output path expected after -o";
return Options();
} else {
result.outputPath = args.at(i);
}
} else if (arg.startsWith("-o")) {
result.outputPath = arg.mid(2);
// Input path
} else {
if (result.inputPath.isEmpty()) {
result.inputPath = arg;
} else {
logError(kErrorSingleInputPathExpected, "Command Line") << "only one input path expected";
return Options();
}
}
}
if (result.inputPath.isEmpty()) {
logError(kErrorInputPathExpected, "Command Line") << "input path expected";
return Options();
}
return result;
}
} // namespace numbers
} // namespace codegen

View file

@ -20,6 +20,19 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include "ui/style_core.h"
#include "style_classes.h"
#include "style_auto.h"
#include <QtCore/QString>
#include <QtCore/QStringList>
namespace codegen {
namespace numbers {
struct Options {
QString outputPath = ".";
QString inputPath;
};
// Parsing failed if inputPath is empty in the result.
Options parseOptions();
} // namespace numbers
} // namespace codegen

View file

@ -0,0 +1,145 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/numbers/parsed_file.h"
#include <iostream>
#include <QtCore/QMap>
#include <QtCore/QDir>
#include <QtCore/QRegularExpression>
#include "codegen/common/basic_tokenized_file.h"
#include "codegen/common/logging.h"
#include "codegen/common/clean_file_reader.h"
#include "codegen/common/checked_utf8_string.h"
using BasicToken = codegen::common::BasicTokenizedFile::Token;
using BasicType = BasicToken::Type;
namespace codegen {
namespace numbers {
namespace {
QByteArray replaceStrings(const QString &filepath) {
common::CleanFileReader reader(filepath);
if (!reader.read()) {
return QByteArray();
}
common::CheckedUtf8String string(reader.currentPtr(), reader.charsLeft());
if (!string.isValid()) {
return QByteArray();
}
QStringList lines = string.toString().split('\n');
for (auto &line : lines) {
auto match = QRegularExpression("^(\\d+;[A-Z]+;)([^;]+)(;.*)?$").match(line);
if (match.hasMatch()) {
line = match.captured(1) + '"' + match.captured(2) + '"' + match.captured(3);
}
}
return lines.join('\n').toUtf8();
}
} // namespace
ParsedFile::ParsedFile(const Options &options)
: content_(replaceStrings(options.inputPath))
, file_(content_, options.inputPath)
, options_(options) {
}
bool ParsedFile::read() {
if (content_.isEmpty() || !file_.read()) {
return false;
}
auto filepath = QFileInfo(options_.inputPath).absoluteFilePath();
do {
if (auto code = file_.getToken(BasicType::Int)) {
if (!file_.getToken(BasicType::Semicolon)) {
logErrorUnexpectedToken() << "';'";
return false;
}
if (!file_.getToken(BasicType::Name)) {
logErrorUnexpectedToken() << "country code";
return false;
}
if (!file_.getToken(BasicType::Semicolon)) {
logErrorUnexpectedToken() << "';'";
return false;
}
if (!file_.getToken(BasicType::String)) {
logErrorUnexpectedToken() << "country name";
return false;
}
if (file_.getToken(BasicType::Semicolon)) {
if (auto firstPart = file_.getToken(BasicType::Int)) {
if (firstPart.original.toByteArray() != code.original.toByteArray()) {
file_.putBack();
result_.data.insert(code.original.toStringUnchecked(), Rule());
continue;
}
Rule rule;
while (auto part = file_.getToken(BasicType::Name)) {
rule.push_back(part.original.size());
}
result_.data.insert(code.original.toStringUnchecked(), rule);
if (rule.isEmpty()) {
logErrorUnexpectedToken() << "bad phone pattern";
return false;
}
if (!file_.getToken(BasicType::Semicolon)) {
logErrorUnexpectedToken() << "';'";
return false;
}
if (!file_.getToken(BasicType::Int)) {
logErrorUnexpectedToken() << "country phone len";
return false;
}
file_.getToken(BasicType::Semicolon);
continue;
} else {
logErrorUnexpectedToken() << "country phone pattern";
return false;
}
} else if (file_.getToken(BasicType::Int)) {
file_.putBack();
result_.data.insert(code.original.toStringUnchecked(), Rule());
continue;
} else {
logErrorUnexpectedToken() << "country phone pattern";
return false;
}
}
if (file_.atEnd()) {
break;
}
logErrorUnexpectedToken() << "numbers rule";
} while (!failed());
if (failed()) {
result_.data.clear();
}
return !failed();
}
} // namespace numbers
} // namespace codegen

View file

@ -0,0 +1,74 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <string>
#include "codegen/common/basic_tokenized_file.h"
#include "codegen/numbers/options.h"
namespace codegen {
namespace numbers {
using Rule = QVector<int>;
struct Rules {
QMap<QString, Rule> data;
};
// Parses an input file to the internal struct.
class ParsedFile {
public:
explicit ParsedFile(const Options &options);
ParsedFile(const ParsedFile &other) = delete;
ParsedFile &operator=(const ParsedFile &other) = delete;
bool read();
Rules getResult() {
return result_;
}
private:
bool failed() const {
return failed_ || file_.failed();
}
// Log error to std::cerr with 'code' at the current position in file.
common::LogStream logError(int code) {
failed_ = true;
return file_.logError(code);
}
common::LogStream logErrorUnexpectedToken() {
failed_ = true;
return file_.logErrorUnexpectedToken();
}
QByteArray content_;
common::BasicTokenizedFile file_;
Options options_;
bool failed_ = false;
Rules result_;
};
} // namespace numbers
} // namespace codegen

View file

@ -0,0 +1,86 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/numbers/processor.h"
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include "codegen/common/cpp_file.h"
#include "codegen/numbers/parsed_file.h"
#include "codegen/numbers/generator.h"
namespace codegen {
namespace numbers {
namespace {
constexpr int kErrorCantWritePath = 851;
} // namespace
Processor::Processor(const Options &options)
: parser_(std::make_unique<ParsedFile>(options))
, options_(options) {
}
int Processor::launch() {
if (!parser_->read()) {
return -1;
}
auto result = parser_->getResult();
if (!write(result)) {
return -1;
}
return 0;
}
bool Processor::write(const Rules &rules) const {
QDir dir(options_.outputPath);
if (!dir.mkpath(".")) {
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
return false;
}
QFileInfo srcFile(options_.inputPath);
QString dstFilePath = dir.absolutePath() + "/numbers";
common::ProjectInfo project = {
"codegen_style",
srcFile.fileName(),
"stdafx.h",
false, // forceReGenerate
};
Generator generator(rules, dstFilePath, project);
if (!generator.writeHeader()) {
return false;
}
if (!generator.writeSource()) {
return false;
}
return true;
}
Processor::~Processor() = default;
} // namespace numbers
} // namespace codegen

View file

@ -0,0 +1,53 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <QtCore/QString>
#include "codegen/numbers/options.h"
namespace codegen {
namespace numbers {
class ParsedFile;
struct Rules;
// Walks through a file, parses it and generates number formatter.
class Processor {
public:
explicit Processor(const Options &options);
Processor(const Processor &other) = delete;
Processor &operator=(const Processor &other) = delete;
// Returns 0 on success.
int launch();
~Processor();
private:
bool write(const Rules &rules) const;
std::unique_ptr<ParsedFile> parser_;
const Options &options_;
};
} // namespace numbers
} // namespace codegen

View file

@ -0,0 +1,719 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/generator.h"
#include <memory>
#include <functional>
#include <QtCore/QDir>
#include <QtCore/QSet>
#include <QtCore/QBuffer>
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include "codegen/style/parsed_file.h"
using Module = codegen::style::structure::Module;
using Struct = codegen::style::structure::Struct;
using Variable = codegen::style::structure::Variable;
using Tag = codegen::style::structure::TypeTag;
namespace codegen {
namespace style {
namespace {
constexpr int kErrorBadIconSize = 861;
constexpr int kErrorBadIconFormat = 862;
char hexChar(uchar ch) {
if (ch < 10) {
return '0' + ch;
} else if (ch < 16) {
return 'a' + (ch - 10);
}
return '0';
}
char hexSecondChar(char ch) {
return hexChar((*reinterpret_cast<uchar*>(&ch)) & 0x0F);
}
char hexFirstChar(char ch) {
return hexChar((*reinterpret_cast<uchar*>(&ch)) >> 4);
}
QString stringToEncodedString(const std::string &str) {
QString result, lineBreak = "\\\n";
result.reserve(str.size() * 8);
bool writingHexEscapedCharacters = false, startOnNewLine = false;
int lastCutSize = 0;
for (uchar ch : str) {
if (result.size() - lastCutSize > 80) {
startOnNewLine = true;
result.append(lineBreak);
lastCutSize = result.size();
}
if (ch == '\n') {
writingHexEscapedCharacters = false;
result.append("\\n");
} else if (ch == '\t') {
writingHexEscapedCharacters = false;
result.append("\\t");
} else if (ch == '"' || ch == '\\') {
writingHexEscapedCharacters = false;
result.append('\\').append(ch);
} else if (ch < 32 || ch > 127) {
writingHexEscapedCharacters = true;
result.append("\\x").append(hexFirstChar(ch)).append(hexSecondChar(ch));
} else {
if (writingHexEscapedCharacters) {
writingHexEscapedCharacters = false;
result.append("\"\"");
}
result.append(ch);
}
}
return '"' + (startOnNewLine ? lineBreak : QString()) + result + '"';
}
QString stringToBinaryArray(const std::string &str) {
QStringList rows, chars;
chars.reserve(13);
rows.reserve(1 + (str.size() / 13));
for (uchar ch : str) {
if (chars.size() > 12) {
rows.push_back(chars.join(", "));
chars.clear();
}
chars.push_back(QString("0x") + hexFirstChar(ch) + hexSecondChar(ch));
}
if (!chars.isEmpty()) {
rows.push_back(chars.join(", "));
}
return QString("{") + ((rows.size() > 1) ? '\n' : ' ') + rows.join(",\n") + " }";
}
QString pxValueName(int value) {
QString result = "px";
if (value < 0) {
value = -value;
result += 'm';
}
return result + QString::number(value);
}
} // namespace
Generator::Generator(const structure::Module &module, const QString &destBasePath, const common::ProjectInfo &project)
: module_(module)
, basePath_(destBasePath)
, baseName_(QFileInfo(basePath_).baseName())
, project_(project) {
}
bool Generator::writeHeader() {
header_ = std::make_unique<common::CppFile>(basePath_ + ".h", project_);
header_->include("ui/style/style_core.h").newline();
if (!writeHeaderStyleNamespace()) {
return false;
}
if (!writeRefsDeclarations()) {
return false;
}
return header_->finalize();
}
bool Generator::writeSource() {
source_ = std::make_unique<common::CppFile>(basePath_ + ".cpp", project_);
writeIncludesInSource();
if (module_.hasVariables()) {
source_->pushNamespace().newline();
source_->stream() << "\
bool inited = false;\n\
\n\
class Module_" << baseName_ << " : public style::internal::ModuleBase {\n\
public:\n\
Module_" << baseName_ << "() { style::internal::registerModule(this); }\n\
~Module_" << baseName_ << "() { style::internal::unregisterModule(this); }\n\
\n\
void start() override {\n\
style::internal::init_" << baseName_ << "();\n\
}\n\
void stop() override {\n\
}\n\
};\n\
Module_" << baseName_ << " registrator;\n";
if (!writeVariableDefinitions()) {
return false;
}
source_->newline().popNamespace();
source_->newline().pushNamespace("st");
if (!writeRefsDefinition()) {
return false;
}
source_->popNamespace().newline();
source_->newline().pushNamespace("style").pushNamespace("internal").newline();
if (!writeVariableInit()) {
return false;
}
}
return source_->finalize();
}
// Empty result means an error.
QString Generator::typeToString(structure::Type type) const {
switch (type.tag) {
case Tag::Invalid: return QString();
case Tag::Int: return "int";
case Tag::Double: return "double";
case Tag::Pixels: return "int";
case Tag::String: return "QString";
case Tag::Color: return "style::color";
case Tag::Point: return "style::point";
case Tag::Sprite: return "style::sprite";
case Tag::Size: return "style::size";
case Tag::Transition: return "style::transition";
case Tag::Cursor: return "style::cursor";
case Tag::Align: return "style::align";
case Tag::Margins: return "style::margins";
case Tag::Font: return "style::font";
case Tag::Icon: return "style::icon";
case Tag::Struct: return "style::" + type.name.back();
}
return QString();
}
// Empty result means an error.
QString Generator::typeToDefaultValue(structure::Type type) const {
switch (type.tag) {
case Tag::Invalid: return QString();
case Tag::Int: return "0";
case Tag::Double: return "0.";
case Tag::Pixels: return "0";
case Tag::String: return "QString()";
case Tag::Color: return "{ Qt::Uninitialized }";
case Tag::Point: return "{ 0, 0 }";
case Tag::Sprite: return "{ 0, 0, 0, 0 }";
case Tag::Size: return "{ 0, 0 }";
case Tag::Transition: return "anim::linear";
case Tag::Cursor: return "style::cur_default";
case Tag::Align: return "style::al_topleft";
case Tag::Margins: return "{ 0, 0, 0, 0 }";
case Tag::Font: return "{ Qt::Uninitialized }";
case Tag::Icon: return "{ Qt::Uninitialized }";
case Tag::Struct: {
if (auto realType = module_.findStruct(type.name)) {
QStringList fields;
for (auto field : realType->fields) {
fields.push_back(typeToDefaultValue(field.type));
}
return "{ " + fields.join(", ") + " }";
}
return QString();
} break;
}
return QString();
}
// Empty result means an error.
QString Generator::valueAssignmentCode(structure::Value value) const {
auto copy = value.copyOf();
if (!copy.isEmpty()) {
return "st::" + copy.back();
}
switch (value.type().tag) {
case Tag::Invalid: return QString();
case Tag::Int: return QString("%1").arg(value.Int());
case Tag::Double: return QString("%1").arg(value.Double());
case Tag::Pixels: return pxValueName(value.Int());
case Tag::String: return QString("qsl(%1)").arg(stringToEncodedString(value.String()));
case Tag::Color: {
auto v(value.Color());
return QString("{ %1, %2, %3, %4 }").arg(v.red).arg(v.green).arg(v.blue).arg(v.alpha);
} break;
case Tag::Point: {
auto v(value.Point());
return QString("{ %1, %2 }").arg(pxValueName(v.x)).arg(pxValueName(v.y));
} break;
case Tag::Sprite: {
auto v(value.Sprite());
return QString("{ %1, %2, %3, %4 }").arg(pxValueName(v.left)).arg(pxValueName(v.top)).arg(pxValueName(v.width)).arg(pxValueName(v.height));
} break;
case Tag::Size: {
auto v(value.Size());
return QString("{ %1, %2 }").arg(pxValueName(v.width)).arg(pxValueName(v.height));
} break;
case Tag::Transition: return QString("anim::%1").arg(value.String().c_str());
case Tag::Cursor: return QString("style::cur_%1").arg(value.String().c_str());
case Tag::Align: return QString("style::al_%1").arg(value.String().c_str());
case Tag::Margins: {
auto v(value.Margins());
return QString("{ %1, %2, %3, %4 }").arg(pxValueName(v.left)).arg(pxValueName(v.top)).arg(pxValueName(v.right)).arg(pxValueName(v.bottom));
} break;
case Tag::Font: {
auto v(value.Font());
QString family = "0";
if (!v.family.empty()) {
auto familyIndex = fontFamilies_.value(v.family, -1);
if (familyIndex < 0) {
return QString();
}
family = QString("font%1index").arg(familyIndex);
}
return QString("{ %1, %2, %3 }").arg(pxValueName(v.size)).arg(v.flags).arg(family);
} break;
case Tag::Icon: {
auto v(value.Icon());
if (v.parts.empty()) return QString();
QStringList parts;
for (const auto &part : v.parts) {
auto maskIndex = iconMasks_.value(part.filename, -1);
if (maskIndex < 0) {
return QString();
}
auto color = valueAssignmentCode(part.color);
auto offset = valueAssignmentCode(part.offset);
parts.push_back(QString("MonoIcon{ &iconMask%1, %2, %3 }").arg(maskIndex).arg(color).arg(offset));
}
return QString("{ %1 }").arg(parts.join(", "));
} break;
case Tag::Struct: {
if (!value.Fields()) return QString();
QStringList fields;
for (auto field : *value.Fields()) {
fields.push_back(valueAssignmentCode(field.variable.value));
}
return "{ " + fields.join(", ") + " }";
} break;
}
return QString();
}
bool Generator::writeHeaderStyleNamespace() {
if (!module_.hasStructs() && !module_.hasVariables()) {
return true;
}
header_->pushNamespace("style");
if (module_.hasVariables()) {
header_->pushNamespace("internal").newline();
header_->stream() << "void init_" << baseName_ << "();\n\n";
header_->popNamespace();
}
if (module_.hasStructs()) {
header_->newline();
if (!writeStructsDefinitions()) {
return false;
}
}
header_->popNamespace().newline();
return true;
}
bool Generator::writeStructsDefinitions() {
if (!module_.hasStructs()) {
return true;
}
bool result = module_.enumStructs([this](const Struct &value) -> bool {
header_->stream() << "struct " << value.name.back() << " {\n";
for (const auto &field : value.fields) {
auto type = typeToString(field.type);
if (type.isEmpty()) {
return false;
}
header_->stream() << "\t" << type << " " << field.name.back() << ";\n";
}
header_->stream() << "};\n\n";
return true;
});
return result;
}
bool Generator::writeRefsDeclarations() {
if (!module_.hasVariables()) {
return true;
}
header_->pushNamespace("st");
bool result = module_.enumVariables([this](const Variable &value) -> bool {
auto name = value.name.back();
auto type = typeToString(value.value.type());
if (type.isEmpty()) {
return false;
}
header_->stream() << "extern const " << type << " &" << name << ";\n";
return true;
});
header_->popNamespace();
return result;
}
bool Generator::writeIncludesInSource() {
if (!module_.hasIncludes()) {
return true;
}
bool result = module_.enumIncludes([this](const Module &module) -> bool {
source_->include("style_" + QFileInfo(module.filepath()).baseName() + ".h");
return true;
});
source_->newline();
return result;
}
bool Generator::writeVariableDefinitions() {
if (!module_.hasVariables()) {
return true;
}
source_->newline();
bool result = module_.enumVariables([this](const Variable &variable) -> bool {
auto name = variable.name.back();
auto type = typeToString(variable.value.type());
if (type.isEmpty()) {
return false;
}
source_->stream() << type << " _" << name << " = " << typeToDefaultValue(variable.value.type()) << ";\n";
return true;
});
return result;
}
bool Generator::writeRefsDefinition() {
if (!module_.hasVariables()) {
return true;
}
source_->newline();
bool result = module_.enumVariables([this](const Variable &variable) -> bool {
auto name = variable.name.back();
auto type = typeToString(variable.value.type());
if (type.isEmpty()) {
return false;
}
source_->stream() << "const " << type << " &" << name << "(_" << name << ");\n";
return true;
});
return result;
}
bool Generator::writeVariableInit() {
if (!module_.hasVariables()) {
return true;
}
if (!collectUniqueValues()) {
return false;
}
bool hasUniqueValues = (!pxValues_.isEmpty() || !fontFamilies_.isEmpty() || !iconMasks_.isEmpty());
if (hasUniqueValues) {
source_->pushNamespace();
if (!writePxValuesInit()) {
return false;
}
if (!writeFontFamiliesInit()) {
return false;
}
if (!writeIconValues()) {
return false;
}
source_->popNamespace().newline();
}
source_->stream() << "\
void init_" << baseName_ << "() {\n\
if (inited) return;\n\
inited = true;\n\n";
if (module_.hasIncludes()) {
bool writtenAtLeastOne = false;
bool result = module_.enumIncludes([this,&writtenAtLeastOne](const Module &module) -> bool {
if (module.hasVariables()) {
source_->stream() << "\tinit_style_" + QFileInfo(module.filepath()).baseName() + "();\n";
writtenAtLeastOne = true;
}
return true;
});
if (!result) {
return false;
}
if (writtenAtLeastOne) {
source_->newline();
}
}
if (!pxValues_.isEmpty() || !fontFamilies_.isEmpty()) {
if (!pxValues_.isEmpty()) {
source_->stream() << "\tinitPxValues();\n";
}
if (!fontFamilies_.isEmpty()) {
source_->stream() << "\tinitFontFamilies();\n";
}
source_->newline();
}
bool result = module_.enumVariables([this](const Variable &variable) -> bool {
auto name = variable.name.back();
auto value = valueAssignmentCode(variable.value);
if (value.isEmpty()) {
return false;
}
source_->stream() << "\t_" << name << " = " << value << ";\n";
return true;
});
source_->stream() << "\
}\n\n";
return result;
}
bool Generator::writePxValuesInit() {
if (pxValues_.isEmpty()) {
return true;
}
for (auto i = pxValues_.cbegin(), e = pxValues_.cend(); i != e; ++i) {
source_->stream() << "int " << pxValueName(i.key()) << " = " << i.key() << ";\n";
}
source_->stream() << "\
void initPxValues() {\n\
if (cRetina()) return;\n\
\n\
switch (cScale()) {\n";
for (int i = 1, scalesCount = scales.size(); i < scalesCount; ++i) {
source_->stream() << "\tcase " << scaleNames.at(i) << ":\n";
for (auto it = pxValues_.cbegin(), e = pxValues_.cend(); it != e; ++it) {
auto value = it.key();
int adjusted = structure::data::pxAdjust(value, scales.at(i));
if (adjusted != value) {
source_->stream() << "\t\t" << pxValueName(value) << " = " << adjusted << ";\n";
}
}
source_->stream() << "\tbreak;\n";
}
source_->stream() << "\
}\n\
}\n\n";
return true;
}
bool Generator::writeFontFamiliesInit() {
if (fontFamilies_.isEmpty()) {
return true;
}
for (auto familyIndex : fontFamilies_) {
source_->stream() << "int font" << familyIndex << "index;\n";
}
source_->stream() << "void initFontFamilies() {\n";
for (auto i = fontFamilies_.cbegin(), e = fontFamilies_.cend(); i != e; ++i) {
auto family = stringToEncodedString(i.key());
source_->stream() << "\tfont" << i.value() << "index = style::internal::registerFontFamily(" << family << ");\n";
}
source_->stream() << "}\n\n";
return true;
}
namespace {
QByteArray iconMaskValueSize(int width, int height) {
QByteArray result;
QLatin1String generateTag("GENERATE:");
result.append(generateTag.data(), generateTag.size());
QLatin1String sizeTag("SIZE:");
result.append(sizeTag.data(), sizeTag.size());
{
QBuffer buffer(&result);
buffer.open(QIODevice::Append);
QDataStream stream(&buffer);
stream.setVersion(QDataStream::Qt_5_1);
stream << qint32(width) << qint32(height);
}
return result;
}
QByteArray iconMaskValuePng(const QString &filepath) {
QByteArray result;
QImage png100x(filepath + ".png");
QImage png200x(filepath + "@2x.png");
png100x.setDevicePixelRatio(1.);
png200x.setDevicePixelRatio(1.);
if (png100x.isNull()) {
common::logError(common::kErrorFileNotOpened, filepath + ".png") << "could not open icon file";
return result;
}
if (png200x.isNull()) {
common::logError(common::kErrorFileNotOpened, filepath + "@2x.png") << "could not open icon file";
return result;
}
if (png100x.format() != png200x.format()) {
common::logError(kErrorBadIconFormat, filepath + ".png") << "1x and 2x icons have different format";
return result;
}
if (png100x.width() * 2 != png200x.width() || png100x.height() * 2 != png200x.height()) {
common::logError(kErrorBadIconSize, filepath + ".png") << "bad icons size, 1x: " << png100x.width() << "x" << png100x.height() << ", 2x: " << png200x.width() << "x" << png200x.height();
return result;
}
QImage png125x = png200x.scaled(structure::data::pxAdjust(png100x.width(), 5), structure::data::pxAdjust(png100x.height(), 5), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QImage png150x = png200x.scaled(structure::data::pxAdjust(png100x.width(), 6), structure::data::pxAdjust(png100x.height(), 6), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QImage composed(png200x.width() + png100x.width(), png200x.height() + png150x.height(), png100x.format());
{
QPainter p(&composed);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(0, 0, composed.width(), composed.height(), QColor(0, 0, 0, 255));
p.drawImage(0, 0, png200x);
p.drawImage(png200x.width(), 0, png100x);
p.drawImage(0, png200x.height(), png150x);
p.drawImage(png150x.width(), png200x.height(), png125x);
}
{
QBuffer buffer(&result);
composed.save(&buffer, "PNG");
// composed.save(filePath + "@final.png", "PNG");
}
return result;
}
} // namespace
bool Generator::writeIconValues() {
if (iconMasks_.isEmpty()) {
return true;
}
for (auto i = iconMasks_.cbegin(), e = iconMasks_.cend(); i != e; ++i) {
QString filePath = i.key();
QByteArray maskData;
QImage png100x, png200x;
if (filePath.startsWith("size://")) {
QStringList dimensions = filePath.mid(7).split(',');
if (dimensions.size() < 2 || dimensions.at(0).toInt() <= 0 || dimensions.at(1).toInt() <= 0) {
common::logError(common::kErrorFileNotOpened, filePath) << "bad dimensions";
return false;
}
maskData = iconMaskValueSize(dimensions.at(0).toInt(), dimensions.at(1).toInt());
} else {
maskData = iconMaskValuePng(filePath);
}
if (maskData.isEmpty()) {
return false;
}
source_->stream() << "const uchar iconMask" << i.value() << "Data[] = " << stringToBinaryArray(maskData.toStdString()) << ";\n";
source_->stream() << "IconMask iconMask" << i.value() << "(iconMask" << i.value() << "Data);\n\n";
}
return true;
}
bool Generator::collectUniqueValues() {
int fontFamilyIndex = 0;
int iconMaskIndex = 0;
std::function<bool(const Variable&)> collector = [this, &collector, &fontFamilyIndex, &iconMaskIndex](const Variable &variable) {
auto value = variable.value;
switch (value.type().tag) {
case Tag::Invalid:
case Tag::Int:
case Tag::Double:
case Tag::String:
case Tag::Color:
case Tag::Transition:
case Tag::Cursor:
case Tag::Align: break;
case Tag::Pixels: pxValues_.insert(value.Int(), true); break;
case Tag::Point: {
auto v(value.Point());
pxValues_.insert(v.x, true);
pxValues_.insert(v.y, true);
} break;
case Tag::Sprite: {
auto v(value.Sprite());
pxValues_.insert(v.left, true);
pxValues_.insert(v.top, true);
pxValues_.insert(v.width, true);
pxValues_.insert(v.height, true);
} break;
case Tag::Size: {
auto v(value.Size());
pxValues_.insert(v.width, true);
pxValues_.insert(v.height, true);
} break;
case Tag::Margins: {
auto v(value.Margins());
pxValues_.insert(v.left, true);
pxValues_.insert(v.top, true);
pxValues_.insert(v.right, true);
pxValues_.insert(v.bottom, true);
} break;
case Tag::Font: {
auto v(value.Font());
pxValues_.insert(v.size, true);
if (!v.family.empty() && !fontFamilies_.contains(v.family)) {
fontFamilies_.insert(v.family, ++fontFamilyIndex);
}
} break;
case Tag::Icon: {
auto v(value.Icon());
for (const auto &part : v.parts) {
pxValues_.insert(part.offset.Point().x, true);
pxValues_.insert(part.offset.Point().y, true);
if (!iconMasks_.contains(part.filename)) {
iconMasks_.insert(part.filename, ++iconMaskIndex);
}
}
} break;
case Tag::Struct: {
auto fields = variable.value.Fields();
if (!fields) {
return false;
}
for (auto field : *fields) {
if (!collector(field.variable)) {
return false;
}
}
} break;
}
return true;
};
return module_.enumVariables(collector);
}
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,79 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <QtCore/QString>
#include <QtCore/QSet>
#include "codegen/common/cpp_file.h"
#include "codegen/style/structure_types.h"
namespace codegen {
namespace style {
namespace structure {
class Module;
} // namespace structure
class Generator {
public:
Generator(const structure::Module &module, const QString &destBasePath, const common::ProjectInfo &project);
Generator(const Generator &other) = delete;
Generator &operator=(const Generator &other) = delete;
bool writeHeader();
bool writeSource();
private:
QString typeToString(structure::Type type) const;
QString typeToDefaultValue(structure::Type type) const;
QString valueAssignmentCode(structure::Value value) const;
bool writeHeaderStyleNamespace();
bool writeStructsDefinitions();
bool writeRefsDeclarations();
bool writeIncludesInSource();
bool writeVariableDefinitions();
bool writeRefsDefinition();
bool writeVariableInit();
bool writePxValuesInit();
bool writeFontFamiliesInit();
bool writeIconValues();
bool writeIconsInit();
bool collectUniqueValues();
const structure::Module &module_;
QString basePath_, baseName_;
const common::ProjectInfo &project_;
std::unique_ptr<common::CppFile> source_, header_;
QMap<int, bool> pxValues_;
QMap<std::string, int> fontFamilies_;
QMap<QString, int> iconMasks_; // icon file -> index
std::vector<int> scales = { 4, 5, 6, 8 }; // scale / 4 gives our 1.00, 1.25, 1.50, 2.00
std::vector<const char *>scaleNames = { "dbisOne", "dbisOneAndQuarter", "dbisOneAndHalf", "dbisTwo" };
};
} // namespace style
} // namespace codegen

View file

@ -1,3 +1,36 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include <QtCore/QCoreApplication>
#include "codegen/style/options.h"
#include "codegen/style/processor.h"
int main(int argc, char *argv[]) {
return 0;
QCoreApplication app(argc, argv);
auto options = codegen::style::parseOptions();
if (options.inputPath.isEmpty()) {
return -1;
}
codegen::style::Processor processor(options);
return processor.launch();
}

View file

@ -0,0 +1,101 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/module.h"
namespace codegen {
namespace style {
namespace structure {
namespace {
QString fullNameKey(const FullName &name) {
return name.join('.');
}
} // namespace
Module::Module(const QString &fullpath) : fullpath_(fullpath) {
}
void Module::addIncluded(std::unique_ptr<Module> &&value) {
included_.push_back(std::move(value));
}
bool Module::addStruct(const Struct &value) {
if (findStruct(value.name)) {
return false;
}
structsByName_.insert(fullNameKey(value.name), structs_.size());
structs_.push_back(value);
return true;
}
const Struct *Module::findStruct(const FullName &name) const {
if (auto result = findStructInModule(name, *this)) {
return result;
}
for (const auto &module : included_) {
if (auto result = findStructInModule(name, *module)) {
return result;
}
}
return nullptr;
}
bool Module::addVariable(const Variable &value) {
if (findVariable(value.name)) {
return false;
}
variablesByName_.insert(fullNameKey(value.name), variables_.size());
variables_.push_back(value);
return true;
}
const Variable *Module::findVariable(const FullName &name) const {
if (auto result = findVariableInModule(name, *this)) {
return result;
}
for (const auto &module : included_) {
if (auto result = findVariableInModule(name, *module)) {
return result;
}
}
return nullptr;
}
const Struct *Module::findStructInModule(const FullName &name, const Module &module) const {
auto index = module.structsByName_.value(fullNameKey(name), -1);
if (index < 0) {
return nullptr;
}
return &module.structs_.at(index);
}
const Variable *Module::findVariableInModule(const FullName &name, const Module &module) const {
auto index = module.variablesByName_.value(fullNameKey(name), -1);
if (index < 0) {
return nullptr;
}
return &module.variables_.at(index);
}
} // namespace structure
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,112 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <vector>
#include "codegen/style/structure_types.h"
namespace codegen {
namespace style {
namespace structure {
class Module {
public:
explicit Module(const QString &fullpath);
QString filepath() const {
return fullpath_;
}
void addIncluded(std::unique_ptr<Module> &&value);
bool hasIncludes() const {
return !included_.empty();
}
template <typename F>
bool enumIncludes(F functor) const {
for (const auto &module : included_) {
if (!functor(*module)) {
return false;
}
}
return true;
}
// Returns false if there is a struct with such name already.
bool addStruct(const Struct &value);
// Returns nullptr if there is no such struct in result_ or any of included modules.
const Struct *findStruct(const FullName &name) const;
bool hasStructs() const {
return !structs_.isEmpty();
}
template <typename F>
bool enumStructs(F functor) const {
for (const auto &value : structs_) {
if (!functor(value)) {
return false;
}
}
return true;
}
// Returns false if there is a variable with such name already.
bool addVariable(const Variable &value);
// Returns nullptr if there is no such variable in result_ or any of included modules.
const Variable *findVariable(const FullName &name) const;
bool hasVariables() const {
return !variables_.isEmpty();
}
template <typename F>
bool enumVariables(F functor) const {
for (const auto &value : variables_) {
if (!functor(value)) {
return false;
}
}
return true;
}
explicit operator bool() const {
return !fullpath_.isEmpty();
}
private:
QString fullpath_;
std::vector<std::unique_ptr<Module>> included_;
QList<Struct> structs_;
QList<Variable> variables_;
QMap<QString, int> structsByName_;
QMap<QString, int> variablesByName_;
const Struct *findStructInModule(const FullName &name, const Module &module) const;
const Variable *findVariableInModule(const FullName &name, const Module &module) const;
};
} // namespace structure
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,90 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/options.h"
#include <ostream>
#include <QtCore/QCoreApplication>
#include "codegen/common/logging.h"
namespace codegen {
namespace style {
namespace {
constexpr int kErrorIncludePathExpected = 901;
constexpr int kErrorOutputPathExpected = 902;
constexpr int kErrorInputPathExpected = 903;
constexpr int kErrorSingleInputPathExpected = 904;
} // namespace
using common::logError;
Options parseOptions() {
Options result;
auto args(QCoreApplication::instance()->arguments());
for (int i = 1, count = args.size(); i < count; ++i) { // skip first
const auto &arg(args.at(i));
// Rebuild all dependencies
if (arg == "--rebuild") {
result.rebuildDependencies = true;
// Include paths
} else if (arg == "-I") {
if (++i == count) {
logError(kErrorIncludePathExpected, "Command Line") << "include path expected after -I";
return Options();
} else {
result.includePaths.push_back(args.at(i));
}
} else if (arg.startsWith("-I")) {
result.includePaths.push_back(arg.mid(2));
// Output path
} else if (arg == "-o") {
if (++i == count) {
logError(kErrorOutputPathExpected, "Command Line") << "output path expected after -o";
return Options();
} else {
result.outputPath = args.at(i);
}
} else if (arg.startsWith("-o")) {
result.outputPath = arg.mid(2);
// Input path
} else {
if (result.inputPath.isEmpty()) {
result.inputPath = arg;
} else {
logError(kErrorSingleInputPathExpected, "Command Line") << "only one input path expected";
return Options();
}
}
}
if (result.inputPath.isEmpty()) {
logError(kErrorInputPathExpected, "Command Line") << "input path expected";
return Options();
}
return result;
}
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,40 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <QtCore/QString>
#include <QtCore/QStringList>
namespace codegen {
namespace style {
struct Options {
QStringList includePaths = { "." };
QString outputPath = ".";
QString inputPath;
bool rebuildDependencies = false;
};
// Parsing failed if inputPath is empty in the result.
Options parseOptions();
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,860 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/parsed_file.h"
#include <iostream>
#include <QtCore/QMap>
#include <QtCore/QDir>
#include <QtCore/QRegularExpression>
#include "codegen/common/basic_tokenized_file.h"
#include "codegen/common/logging.h"
using BasicToken = codegen::common::BasicTokenizedFile::Token;
using BasicType = BasicToken::Type;
namespace codegen {
namespace style {
using structure::logFullName;
namespace {
constexpr int kErrorInIncluded = 801;
constexpr int kErrorTypeMismatch = 802;
constexpr int kErrorUnknownField = 803;
constexpr int kErrorIdentifierNotFound = 804;
constexpr int kErrorAlreadyDefined = 805;
constexpr int kErrorBadString = 806;
QString findInputFile(const Options &options) {
for (const auto &dir : options.includePaths) {
QString tryPath = QDir(dir).absolutePath() + '/' + options.inputPath;
if (QFileInfo(tryPath).exists()) {
return tryPath;
}
}
return options.inputPath;
}
QString tokenValue(const BasicToken &token) {
if (token.type == BasicType::String) {
return token.value;
}
return token.original.toStringUnchecked();
}
bool isValidColor(const QString &str) {
auto len = str.size();
if (len != 3 && len != 4 && len != 6 && len != 8) {
return false;
}
for (auto ch : str) {
auto code = ch.unicode();
if ((code < '0' || code > '9') && (code < 'a' || code > 'f')) {
return false;
}
}
return true;
}
uchar readHexUchar(QChar ch) {
auto code = ch.unicode();
return (code >= '0' && code <= '9') ? ((code - '0') & 0xFF) : ((code + 10 - 'a') & 0xFF);
}
uchar readHexUchar(QChar char1, QChar char2) {
return ((readHexUchar(char1) & 0x0F) << 4) | (readHexUchar(char2) & 0x0F);
}
structure::data::color convertWebColor(const QString &str) {
uchar r = 0, g = 0, b = 0, a = 255;
if (isValidColor(str)) {
auto len = str.size();
if (len == 3 || len == 4) {
r = readHexUchar(str.at(0), str.at(0));
g = readHexUchar(str.at(1), str.at(1));
b = readHexUchar(str.at(2), str.at(2));
if (len == 4) a = readHexUchar(str.at(3), str.at(3));
} else {
r = readHexUchar(str.at(0), str.at(1));
g = readHexUchar(str.at(2), str.at(3));
b = readHexUchar(str.at(4), str.at(5));
if (len == 8) a = readHexUchar(str.at(6), str.at(7));
}
}
return { r, g, b, a };
}
structure::data::color convertIntColor(int r, int g, int b, int a) {
return { uchar(r & 0xFF), uchar(g & 0xFF), uchar(b & 0xFF), uchar(a & 0xFF) };
}
std::string logType(const structure::Type &type) {
if (type.tag == structure::TypeTag::Struct) {
return "struct " + logFullName(type.name);
}
static auto builtInTypes = new QMap<structure::TypeTag, std::string> {
{ structure::TypeTag::Int , "int" },
{ structure::TypeTag::Double , "double" },
{ structure::TypeTag::Pixels , "pixels" },
{ structure::TypeTag::String , "string" },
{ structure::TypeTag::Color , "color" },
{ structure::TypeTag::Point , "point" },
{ structure::TypeTag::Sprite , "sprite" },
{ structure::TypeTag::Size , "size" },
{ structure::TypeTag::Transition, "transition" },
{ structure::TypeTag::Cursor , "cursor" },
{ structure::TypeTag::Align , "align" },
{ structure::TypeTag::Margins , "margins" },
{ structure::TypeTag::Font , "font" },
};
return builtInTypes->value(type.tag, "invalid");
}
bool validateAnsiString(const QString &value) {
for (auto ch : value) {
if (ch.unicode() > 127) {
return false;
}
}
return true;
}
bool validateTransitionString(const QString &value) {
return QRegularExpression("^[a-zA-Z_]+$").match(value).hasMatch();
}
bool validateCursorString(const QString &value) {
return QRegularExpression("^[a-z_]+$").match(value).hasMatch();
}
bool validateAlignString(const QString &value) {
return QRegularExpression("^[a-z_]+$").match(value).hasMatch();
}
} // namespace
ParsedFile::ParsedFile(const Options &options)
: filePath_(findInputFile(options))
, file_(filePath_)
, options_(options) {
}
bool ParsedFile::read() {
if (!file_.read()) {
return false;
}
auto absolutePath = QFileInfo(filePath_).absoluteFilePath();
module_ = std::make_unique<structure::Module>(absolutePath);
do {
if (auto startToken = file_.getToken(BasicType::Name)) {
if (tokenValue(startToken) == "using") {
if (auto includedResult = readIncluded()) {
module_->addIncluded(std::move(includedResult));
continue;
}
} else if (auto braceOpen = file_.getToken(BasicType::LeftBrace)) {
if (auto structResult = readStruct(tokenValue(startToken))) {
if (module_->addStruct(structResult)) {
continue;
}
logError(kErrorAlreadyDefined) << "struct '" << logFullName(structResult.name) << "' already defined";
break;
}
} else if (auto colonToken = file_.getToken(BasicType::Colon)) {
if (auto variableResult = readVariable(tokenValue(startToken))) {
if (module_->addVariable(variableResult)) {
continue;
}
logError(kErrorAlreadyDefined) << "variable '" << logFullName(variableResult.name) << "' already defined";
break;
}
}
}
if (file_.atEnd()) {
break;
}
logErrorUnexpectedToken() << "using keyword, or struct definition, or variable definition";
} while (!failed());
if (failed()) {
module_ = nullptr;
}
return !failed();
}
common::LogStream ParsedFile::logErrorTypeMismatch() {
return logError(kErrorTypeMismatch) << "type mismatch: ";
}
ParsedFile::ModulePtr ParsedFile::readIncluded() {
if (auto usingFile = assertNextToken(BasicType::String)) {
if (assertNextToken(BasicType::Semicolon)) {
ParsedFile included(includedOptions(tokenValue(usingFile)));
if (included.read()) {
return included.getResult();
} else {
logError(kErrorInIncluded) << "error while parsing '" << tokenValue(usingFile).toStdString() << "'";
}
}
}
return nullptr;
}
structure::Struct ParsedFile::readStruct(const QString &name) {
structure::Struct result = { composeFullName(name) };
do {
if (auto fieldName = file_.getToken(BasicType::Name)) {
if (auto field = readStructField(tokenValue(fieldName))) {
result.fields.push_back(field);
}
} else if (assertNextToken(BasicType::RightBrace)) {
if (result.fields.isEmpty()) {
logErrorUnexpectedToken() << "at least one field in struct";
}
break;
}
} while (!failed());
return result;
}
structure::Variable ParsedFile::readVariable(const QString &name) {
structure::Variable result = { composeFullName(name) };
if (auto value = readValue()) {
result.value = value;
if (value.type().tag != structure::TypeTag::Struct) {
assertNextToken(BasicType::Semicolon);
}
}
return result;
}
structure::StructField ParsedFile::readStructField(const QString &name) {
structure::StructField result = { composeFullName(name) };
if (auto colonToken = assertNextToken(BasicType::Colon)) {
if (auto type = readType()) {
result.type = type;
assertNextToken(BasicType::Semicolon);
}
}
return result;
}
structure::Type ParsedFile::readType() {
structure::Type result;
if (auto nameToken = assertNextToken(BasicType::Name)) {
auto name = tokenValue(nameToken);
if (auto builtInType = typeNames_.value(name.toStdString())) {
result = builtInType;
} else {
auto fullName = composeFullName(name);
if (module_->findStruct(fullName)) {
result.tag = structure::TypeTag::Struct;
result.name = fullName;
} else {
logError(kErrorIdentifierNotFound) << "type name '" << logFullName(fullName) << "' not found";
}
}
}
return result;
}
structure::Value ParsedFile::readValue() {
if (auto colorValue = readColorValue()) {
return colorValue;
} else if (auto pointValue = readPointValue()) {
return pointValue;
} else if (auto spriteValue = readSpriteValue()) {
return spriteValue;
} else if (auto sizeValue = readSizeValue()) {
return sizeValue;
} else if (auto transitionValue = readTransitionValue()) {
return transitionValue;
} else if (auto cursorValue = readCursorValue()) {
return cursorValue;
} else if (auto alignValue = readAlignValue()) {
return alignValue;
} else if (auto marginsValue = readMarginsValue()) {
return marginsValue;
} else if (auto fontValue = readFontValue()) {
return fontValue;
} else if (auto iconValue = readIconValue()) {
return iconValue;
} else if (auto numericValue = readNumericValue()) {
return numericValue;
} else if (auto stringValue = readStringValue()) {
return stringValue;
} else if (auto structValue = readStructValue()) {
return structValue;
} else if (auto copyValue = readCopyValue()) {
return copyValue;
} else {
logErrorUnexpectedToken() << "variable value";
}
return {};
}
structure::Value ParsedFile::readStructValue() {
if (auto structName = file_.getToken(BasicType::Name)) {
if (auto result = defaultConstructedStruct(composeFullName(tokenValue(structName)))) {
if (file_.getToken(BasicType::LeftParenthesis)) {
if (!readStructParents(result)) {
return {};
}
}
if (assertNextToken(BasicType::LeftBrace)) {
readStructValueInner(result);
}
return result;
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::defaultConstructedStruct(const structure::FullName &structName) {
if (auto pattern = module_->findStruct(structName)) {
QList<structure::data::field> fields;
fields.reserve(pattern->fields.size());
for (const auto &fieldType : pattern->fields) {
fields.push_back({
{ // variable
fieldType.name,
{ fieldType.type, Qt::Uninitialized }, // value
},
structure::data::field::Status::Uninitialized, // status
});
}
return { structName, fields };
}
return {};
}
void ParsedFile::applyStructParent(structure::Value &result, const structure::FullName &parentName) {
if (auto parent = module_->findVariable(parentName)) {
if (parent->value.type() != result.type()) {
logErrorTypeMismatch() << "parent '" << logFullName(parentName) << "' has type '" << logType(parent->value.type()) << "' while child value has type " << logType(result.type());
return;
}
const auto *srcFields(parent->value.Fields());
auto *dstFields(result.Fields());
if (!srcFields || !dstFields) {
logAssert(false) << "struct data check failed";
return;
}
logAssert(srcFields->size() == dstFields->size()) << "struct size check failed";
for (int i = 0, s = srcFields->size(); i != s; ++i) {
const auto &srcField(srcFields->at(i));
auto &dstField((*dstFields)[i]);
using Status = structure::data::field::Status;
if (srcField.status == Status::Explicit ||
dstField.status == Status::Uninitialized) {
const auto &srcValue(srcField.variable.value);
auto &dstValue(dstField.variable.value);
logAssert(srcValue.type() == dstValue.type()) << "struct field type check failed";
dstValue = srcValue;
dstField.status = Status::Implicit;
}
}
} else {
logError(kErrorIdentifierNotFound) << "parent '" << logFullName(parentName) << "' not found";
}
}
bool ParsedFile::readStructValueInner(structure::Value &result) {
do {
if (auto fieldName = file_.getToken(BasicType::Name)) {
if (!assertNextToken(BasicType::Colon)) {
return false;
}
if (auto field = readVariable(tokenValue(fieldName))) {
if (!assignStructField(result, field)) {
return false;
}
}
} else if (assertNextToken(BasicType::RightBrace)) {
return true;
}
} while (!failed());
return false;
}
bool ParsedFile::assignStructField(structure::Value &result, const structure::Variable &field) {
auto *fields = result.Fields();
if (!fields) {
logAssert(false) << "struct data check failed";
return false;
}
for (auto &already : *fields) {
if (already.variable.name == field.name) {
if (already.variable.value.type() == field.value.type()) {
already.variable.value = field.value;
already.status = structure::data::field::Status::Explicit;
return true;
} else {
logErrorTypeMismatch() << "field '" << logFullName(already.variable.name) << "' has type '" << logType(already.variable.value.type()) << "' while value has type '" << logType(field.value.type()) << "'";
return false;
}
}
}
logError(kErrorUnknownField) << "field '" << logFullName(field.name) << "' was not found in struct of type '" << logType(result.type()) << "'";
return false;
}
bool ParsedFile::readStructParents(structure::Value &result) {
do {
if (auto parentName = assertNextToken(BasicType::Name)) {
applyStructParent(result, composeFullName(tokenValue(parentName)));
if (file_.getToken(BasicType::RightParenthesis)) {
return true;
} else {
assertNextToken(BasicType::Comma);
}
} else {
logErrorUnexpectedToken() << "struct variable parent";
}
} while (!failed());
return false;
}
structure::Value ParsedFile::readPositiveValue() {
auto numericToken = file_.getAnyToken();
if (numericToken.type == BasicType::Int) {
return { structure::TypeTag::Int, tokenValue(numericToken).toInt() };
} else if (numericToken.type == BasicType::Double) {
return { structure::TypeTag::Double, tokenValue(numericToken).toDouble() };
} else if (numericToken.type == BasicType::Name) {
auto value = tokenValue(numericToken);
auto match = QRegularExpression("^\\d+px$").match(value);
if (match.hasMatch()) {
return { structure::TypeTag::Pixels, value.mid(0, value.size() - 2).toInt() };
}
}
file_.putBack();
return {};
}
structure::Value ParsedFile::readNumericValue() {
if (auto value = readPositiveValue()) {
return value;
} else if (auto minusToken = file_.getToken(BasicType::Minus)) {
if (auto positiveValue = readNumericValue()) {
return { positiveValue.type().tag, -positiveValue.Int() };
}
logErrorUnexpectedToken() << "numeric value";
}
return {};
}
structure::Value ParsedFile::readStringValue() {
if (auto stringToken = file_.getToken(BasicType::String)) {
auto value = tokenValue(stringToken);
if (validateAnsiString(value)) {
return { structure::TypeTag::String, stringToken.value.toStdString() };
}
logError(kErrorBadString) << "unicode symbols are not supported";
}
return {};
}
structure::Value ParsedFile::readColorValue() {
if (auto numberSign = file_.getToken(BasicType::Number)) {
auto color = file_.getAnyToken();
if (color.type == BasicType::Int || color.type == BasicType::Name) {
auto chars = tokenValue(color).toLower();
if (isValidColor(chars)) {
return { convertWebColor(chars) };
}
} else {
logErrorUnexpectedToken() << "color value in #ccc, #ccca, #cccccc or #ccccccaa format";
}
} else if (auto rgbaToken = file_.getToken(BasicType::Name)) {
if (tokenValue(rgbaToken) == "rgba") {
assertNextToken(BasicType::LeftParenthesis);
auto r = readNumericValue(); assertNextToken(BasicType::Comma);
auto g = readNumericValue(); assertNextToken(BasicType::Comma);
auto b = readNumericValue(); assertNextToken(BasicType::Comma);
auto a = readNumericValue();
if (r.type().tag != structure::TypeTag::Int || r.Int() < 0 || r.Int() > 255 ||
g.type().tag != structure::TypeTag::Int || g.Int() < 0 || g.Int() > 255 ||
b.type().tag != structure::TypeTag::Int || b.Int() < 0 || b.Int() > 255 ||
a.type().tag != structure::TypeTag::Int || a.Int() < 0 || a.Int() > 255) {
logErrorTypeMismatch() << "expected four 0-255 values for the rgba color";
}
assertNextToken(BasicType::RightParenthesis);
return { convertIntColor(r.Int(), g.Int(), b.Int(), a.Int()) };
} else if (tokenValue(rgbaToken) == "rgb") {
assertNextToken(BasicType::LeftParenthesis);
auto r = readNumericValue(); assertNextToken(BasicType::Comma);
auto g = readNumericValue(); assertNextToken(BasicType::Comma);
auto b = readNumericValue();
if (r.type().tag != structure::TypeTag::Int || r.Int() < 0 || r.Int() > 255 ||
g.type().tag != structure::TypeTag::Int || g.Int() < 0 || g.Int() > 255 ||
b.type().tag != structure::TypeTag::Int || b.Int() < 0 || b.Int() > 255) {
logErrorTypeMismatch() << "expected three int values for the rgb color";
}
assertNextToken(BasicType::RightParenthesis);
return { convertIntColor(r.Int(), g.Int(), b.Int(), 255) };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readPointValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "point") {
assertNextToken(BasicType::LeftParenthesis);
auto x = readNumericValue(); assertNextToken(BasicType::Comma);
auto y = readNumericValue();
if (x.type().tag != structure::TypeTag::Pixels ||
y.type().tag != structure::TypeTag::Pixels) {
logErrorTypeMismatch() << "expected two px values for the point";
}
assertNextToken(BasicType::RightParenthesis);
return { structure::data::point { x.Int(), y.Int() } };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readSpriteValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "sprite") {
assertNextToken(BasicType::LeftParenthesis);
auto x = readNumericValue(); assertNextToken(BasicType::Comma);
auto y = readNumericValue(); assertNextToken(BasicType::Comma);
auto w = readNumericValue(); assertNextToken(BasicType::Comma);
auto h = readNumericValue();
if (x.type().tag != structure::TypeTag::Pixels ||
y.type().tag != structure::TypeTag::Pixels ||
w.type().tag != structure::TypeTag::Pixels ||
h.type().tag != structure::TypeTag::Pixels) {
logErrorTypeMismatch() << "expected four px values for the sprite";
}
assertNextToken(BasicType::RightParenthesis);
return { structure::data::sprite { x.Int(), y.Int(), w.Int(), h.Int() } };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readSizeValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "size") {
assertNextToken(BasicType::LeftParenthesis);
auto w = readNumericValue(); assertNextToken(BasicType::Comma);
auto h = readNumericValue();
if (w.type().tag != structure::TypeTag::Pixels ||
h.type().tag != structure::TypeTag::Pixels) {
logErrorTypeMismatch() << "expected two px values for the size";
}
assertNextToken(BasicType::RightParenthesis);
return { structure::data::size { w.Int(), h.Int() } };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readTransitionValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "transition") {
assertNextToken(BasicType::LeftParenthesis);
auto transition = tokenValue(assertNextToken(BasicType::Name));
assertNextToken(BasicType::RightParenthesis);
if (validateTransitionString(transition)) {
return { structure::TypeTag::Transition, transition.toStdString() };
} else {
logError(kErrorBadString) << "bad transition value";
}
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readCursorValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "cursor") {
assertNextToken(BasicType::LeftParenthesis);
auto cursor = tokenValue(assertNextToken(BasicType::Name));
assertNextToken(BasicType::RightParenthesis);
if (validateCursorString(cursor)) {
return { structure::TypeTag::Cursor, cursor.toStdString() };
} else {
logError(kErrorBadString) << "bad cursor string";
}
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readAlignValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "align") {
assertNextToken(BasicType::LeftParenthesis);
auto align = tokenValue(assertNextToken(BasicType::Name));
assertNextToken(BasicType::RightParenthesis);
if (validateAlignString(align)) {
return { structure::TypeTag::Align, align.toStdString() };
} else {
logError(kErrorBadString) << "bad align string";
}
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readMarginsValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "margins") {
assertNextToken(BasicType::LeftParenthesis);
auto l = readNumericValue(); assertNextToken(BasicType::Comma);
auto t = readNumericValue(); assertNextToken(BasicType::Comma);
auto r = readNumericValue(); assertNextToken(BasicType::Comma);
auto b = readNumericValue();
if (l.type().tag != structure::TypeTag::Pixels ||
t.type().tag != structure::TypeTag::Pixels ||
r.type().tag != structure::TypeTag::Pixels ||
b.type().tag != structure::TypeTag::Pixels) {
logErrorTypeMismatch() << "expected four px values for the margins";
}
assertNextToken(BasicType::RightParenthesis);
return { structure::data::margins { l.Int(), t.Int(), r.Int(), b.Int() } };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readFontValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "font") {
assertNextToken(BasicType::LeftParenthesis);
int flags = 0;
structure::Value family, size;
do {
if (auto formatToken = file_.getToken(BasicType::Name)) {
if (tokenValue(formatToken) == "bold") {
flags |= structure::data::font::Bold;
} else if (tokenValue(formatToken) == "italic") {
flags |= structure::data::font::Italic;
} else if (tokenValue(formatToken) == "underline") {
flags |= structure::data::font::Underline;
} else {
file_.putBack();
}
}
if (auto familyValue = readStringValue()) {
family = familyValue;
} else if (auto sizeValue = readNumericValue()) {
size = sizeValue;
} else if (auto copyValue = readCopyValue()) {
if (copyValue.type().tag == structure::TypeTag::String) {
family = copyValue;
} else if (copyValue.type().tag == structure::TypeTag::Pixels) {
size = copyValue;
} else {
logErrorUnexpectedToken() << "font family, font size or ')'";
}
} else if (file_.getToken(BasicType::RightParenthesis)) {
break;
} else {
logErrorUnexpectedToken() << "font family, font size or ')'";
}
} while (!failed());
if (size.type().tag != structure::TypeTag::Pixels) {
logErrorTypeMismatch() << "px value for the font size expected";
}
return { structure::data::font { family.String(), size.Int(), flags } };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readIconValue() {
if (auto font = file_.getToken(BasicType::Name)) {
if (tokenValue(font) == "icon") {
std::vector<structure::data::monoicon> parts;
if (file_.getToken(BasicType::LeftBrace)) { // complex icon
do {
if (file_.getToken(BasicType::RightBrace)) {
break;
} else if (file_.getToken(BasicType::LeftBrace)) {
if (auto part = readMonoIconFields()) {
assertNextToken(BasicType::RightBrace);
parts.push_back(part);
file_.getToken(BasicType::Comma);
continue;
}
return {};
} else {
logErrorUnexpectedToken() << "icon part or '}'";
return {};
}
} while (true);
} else if (file_.getToken(BasicType::LeftParenthesis)) { // short icon
if (auto theOnlyPart = readMonoIconFields()) {
assertNextToken(BasicType::RightParenthesis);
parts.push_back(theOnlyPart);
}
}
if (parts.empty()) {
logErrorUnexpectedToken() << "at least one icon part";
return {};
}
return { structure::data::icon { parts } };
}
file_.putBack();
}
return {};
}
structure::Value ParsedFile::readCopyValue() {
if (auto copyName = file_.getToken(BasicType::Name)) {
structure::FullName name = { tokenValue(copyName) };
if (auto variable = module_->findVariable(name)) {
return variable->value.makeCopy(variable->name);
}
logError(kErrorIdentifierNotFound) << "identifier '" << logFullName(name) << "' not found";
}
return {};
}
structure::data::monoicon ParsedFile::readMonoIconFields() {
structure::data::monoicon result;
result.filename = readMonoIconFilename();
if (!result.filename.isEmpty() && file_.getToken(BasicType::Comma)) {
if (auto color = readValue()) {
if (color.type().tag == structure::TypeTag::Color) {
result.color = color;
if (file_.getToken(BasicType::Comma)) {
if (auto offset = readValue()) {
if (offset.type().tag == structure::TypeTag::Point) {
result.offset = offset;
} else {
logErrorUnexpectedToken() << "icon offset";
}
} else {
logErrorUnexpectedToken() << "icon offset";
}
} else {
result.offset = { structure::data::point { 0, 0 } };
}
} else {
logErrorUnexpectedToken() << "icon color";
}
} else {
logErrorUnexpectedToken() << "icon color";
}
}
return result;
}
QString ParsedFile::readMonoIconFilename() {
if (auto filename = readValue()) {
if (filename.type().tag == structure::TypeTag::String) {
auto filepath = QString::fromStdString(filename.String());
for (const auto &path : options_.includePaths) {
QFileInfo fileinfo(path + '/' + filepath + ".png");
if (fileinfo.exists()) {
return path + '/' + filepath;
}
}
for (const auto &path : options_.includePaths) {
QFileInfo fileinfo(path + "/icons/" + filepath + ".png");
if (fileinfo.exists()) {
return path + "/icons/" + filepath;
}
}
logError(common::kErrorFileNotFound) << "could not open icon file '" << filename.String() << "'";
} else if (filename.type().tag == structure::TypeTag::Size) {
return QString("size://%1,%2").arg(filename.Size().width).arg(filename.Size().height);
}
}
logErrorUnexpectedToken() << "icon filename or rect size";
return QString();
}
BasicToken ParsedFile::assertNextToken(BasicToken::Type type) {
auto result = file_.getToken(type);
if (!result) {
logErrorUnexpectedToken() << type;
}
return result;
}
Options ParsedFile::includedOptions(const QString &filepath) {
auto result = options_;
result.inputPath = filepath;
result.includePaths[0] = QFileInfo(filePath_).dir().absolutePath();
return result;
}
// Compose context-dependent full name.
structure::FullName ParsedFile::composeFullName(const QString &name) {
return { name };
}
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,139 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <string>
#include "codegen/common/basic_tokenized_file.h"
#include "codegen/style/options.h"
#include "codegen/style/module.h"
namespace codegen {
namespace style {
// Parses an input file to the internal struct.
class ParsedFile {
public:
explicit ParsedFile(const Options &options);
ParsedFile(const ParsedFile &other) = delete;
ParsedFile &operator=(const ParsedFile &other) = delete;
bool read();
using ModulePtr = std::unique_ptr<structure::Module>;
ModulePtr getResult() {
return std::move(module_);
}
private:
bool failed() const {
return failed_ || file_.failed();
}
// Log error to std::cerr with 'code' at the current position in file.
common::LogStream logError(int code) {
failed_ = true;
return file_.logError(code);
}
common::LogStream logErrorUnexpectedToken() {
failed_ = true;
return file_.logErrorUnexpectedToken();
}
common::LogStream logErrorTypeMismatch();
common::LogStream logAssert(bool assertion) {
if (!assertion) {
return logError(common::kErrorInternal) << "internal - ";
}
return common::LogStream(common::LogStream::Null);
}
// Helper methods for context-dependent reading.
ModulePtr readIncluded();
structure::Struct readStruct(const QString &name);
structure::Variable readVariable(const QString &name);
structure::StructField readStructField(const QString &name);
structure::Type readType();
structure::Value readValue();
structure::Value readStructValue();
structure::Value defaultConstructedStruct(const structure::FullName &name);
void applyStructParent(structure::Value &result, const structure::FullName &parentName);
bool readStructValueInner(structure::Value &result);
bool assignStructField(structure::Value &result, const structure::Variable &field);
bool readStructParents(structure::Value &result);
// Simple methods for reading value types.
structure::Value readPositiveValue();
structure::Value readNumericValue();
structure::Value readStringValue();
structure::Value readColorValue();
structure::Value readPointValue();
structure::Value readSpriteValue();
structure::Value readSizeValue();
structure::Value readTransitionValue();
structure::Value readCursorValue();
structure::Value readAlignValue();
structure::Value readMarginsValue();
structure::Value readFontValue();
structure::Value readIconValue();
structure::Value readCopyValue();
structure::data::monoicon readMonoIconFields();
QString readMonoIconFilename();
// Read next token and fire unexpected token error if it is not of "type".
using BasicToken = common::BasicTokenizedFile::Token;
BasicToken assertNextToken(BasicToken::Type type);
// Look through include directories in options_ and find absolute include path.
Options includedOptions(const QString &filepath);
// Compose context-dependent full name.
structure::FullName composeFullName(const QString &name);
QString filePath_;
common::BasicTokenizedFile file_;
Options options_;
bool failed_ = false;
ModulePtr module_;
QMap<std::string, structure::Type> typeNames_ = {
{ "int" , { structure::TypeTag::Int } },
{ "double" , { structure::TypeTag::Double } },
{ "pixels" , { structure::TypeTag::Pixels } },
{ "string" , { structure::TypeTag::String } },
{ "color" , { structure::TypeTag::Color } },
{ "point" , { structure::TypeTag::Point } },
{ "sprite" , { structure::TypeTag::Sprite } },
{ "size" , { structure::TypeTag::Size } },
{ "transition", { structure::TypeTag::Transition } },
{ "cursor" , { structure::TypeTag::Cursor } },
{ "align" , { structure::TypeTag::Align } },
{ "margins" , { structure::TypeTag::Margins } },
{ "font" , { structure::TypeTag::Font } },
};
};
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,103 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/processor.h"
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include "codegen/common/cpp_file.h"
#include "codegen/style/parsed_file.h"
#include "codegen/style/generator.h"
#include "codegen/style/sprite_generator.h"
namespace codegen {
namespace style {
namespace {
constexpr int kErrorCantWritePath = 821;
QString destFileBaseName(const structure::Module &module) {
return "style_" + QFileInfo(module.filepath()).baseName();
}
} // namespace
Processor::Processor(const Options &options)
: parser_(std::make_unique<ParsedFile>(options))
, options_(options) {
}
int Processor::launch() {
if (!parser_->read()) {
return -1;
}
auto module = parser_->getResult();
if (options_.rebuildDependencies) {
bool result = module->enumIncludes([this](const structure::Module &included) -> bool {
return write(included);
});
if (!result) {
return -1;
}
} else if (!write(*module)) {
return -1;
}
return 0;
}
bool Processor::write(const structure::Module &module) const {
QDir dir(options_.outputPath);
if (!dir.mkpath(".")) {
common::logError(kErrorCantWritePath, "Command Line") << "can not open path for writing: " << dir.absolutePath().toStdString();
return false;
}
QFileInfo srcFile(module.filepath());
QString dstFilePath = dir.absolutePath() + '/' + destFileBaseName(module);
common::ProjectInfo project = {
"codegen_style",
srcFile.fileName(),
"stdafx.h",
!options_.rebuildDependencies, // forceReGenerate
};
SpriteGenerator spriteGenerator(module);
if (!spriteGenerator.writeSprites()) {
return false;
}
Generator generator(module, dstFilePath, project);
if (!generator.writeHeader()) {
return false;
}
if (!generator.writeSource()) {
return false;
}
return true;
}
Processor::~Processor() = default;
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,60 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <QtCore/QString>
#include "codegen/style/options.h"
namespace codegen {
namespace style {
namespace structure {
class Module;
} // namespace structure
class ParsedFile;
// Walks through a file, parses it and parses dependency files if necessary.
// Uses Generator class to produce the final output.
class Processor {
public:
explicit Processor(const Options &options);
Processor(const Processor &other) = delete;
Processor &operator=(const Processor &other) = delete;
// Returns 0 on success.
int launch();
~Processor();
private:
bool write(const structure::Module &module) const;
std::unique_ptr<ParsedFile> parser_;
const Options &options_;
// List of files we need to generate with other instance of Generator.
// It is not empty only if rebuild_ flag is true.
QStringList dependenciesToGenerate_;
};
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,179 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/sprite_generator.h"
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QBuffer>
#include <QtGui/QPainter>
#include <QtGui/QColor>
#include <functional>
#include "codegen/style/parsed_file.h"
using Module = codegen::style::structure::Module;
using Struct = codegen::style::structure::Struct;
using Variable = codegen::style::structure::Variable;
using Tag = codegen::style::structure::TypeTag;
namespace codegen {
namespace style {
using structure::logFullName;
namespace {
constexpr int kErrorSpritesIntersect = 841;
constexpr int kErrorCouldNotGenerate = 842;
constexpr int kErrorCouldNotSerialize = 843;
constexpr int kErrorCouldNotOpen = 844;
constexpr int kErrorCouldNotWrite = 845;
} // namespace
SpriteGenerator::SpriteGenerator(const structure::Module &module)
: module_(module)
, basePath_(QFileInfo(module.filepath()).dir().absolutePath()) {
}
bool SpriteGenerator::writeSprites() {
if (!collectSprites()) {
return false;
}
if (sprites_.isEmpty()) {
return true;
}
sprite2x_ = QImage(basePath_ + "/art/sprite_200x.png");
if (sprite2x_.isNull()) {
common::logError(common::kErrorFileNotFound, "/art/sprite_200x.png") << "sprite file was not found";
return false;
}
std::vector<int> sizes = { 5, 6 };
std::vector<const char *> postfixes = { "125", "150" };
for (int i = 0, l = sizes.size(); i < l; ++i) {
auto sprite = generateSprite(sizes[i]);
QString filepath = basePath_ + "/art/sprite_" + postfixes[i] + "x.png";
if (sprite.isNull()) {
common::logError(kErrorCouldNotGenerate, filepath) << "could not generate sprite file";
return false;
}
QByteArray spriteData;
{
QBuffer spriteBuffer(&spriteData);
if (!sprite.save(&spriteBuffer, "PNG")) {
common::logError(kErrorCouldNotSerialize, filepath) << "could not serialize sprite file";
return false;
}
}
QFile file(filepath);
if (file.open(QIODevice::ReadOnly)) {
if (file.readAll() == spriteData) {
continue;
}
file.close();
}
if (!file.open(QIODevice::WriteOnly)) {
common::logError(kErrorCouldNotOpen, filepath) << "could not open sprite file for write";
return false;
}
if (file.write(spriteData) != spriteData.size()) {
common::logError(kErrorCouldNotWrite, filepath) << "could not write sprite file";
return false;
}
// Touch resource file.
filepath = basePath_ + "/telegram.qrc";
QFile qrc(filepath);
if (qrc.open(QIODevice::ReadOnly)) {
auto qrcContent = qrc.readAll();
qrc.close();
if (!qrc.open(QIODevice::WriteOnly)) {
common::logError(kErrorCouldNotOpen, filepath) << "could not open .qrc file for write";
return false;
}
if (qrc.write(qrcContent) != qrcContent.size()) {
common::logError(kErrorCouldNotWrite, filepath) << "could not write .qrc file";
return false;
}
}
}
return true;
}
bool SpriteGenerator::collectSprites() {
std::function<bool(const Variable&)> collector = [this, &collector](const Variable &variable) {
auto value = variable.value;
if (value.type().tag == Tag::Sprite) {
auto v(value.Sprite());
if (!v.width || !v.height) return true;
QRect vRect(v.left, v.top, v.width, v.height);
bool found = false;
for (auto var : sprites_) {
auto sprite = var.value.Sprite();
QRect spriteRect(sprite.left, sprite.top, sprite.width, sprite.height);
if (spriteRect == vRect) {
found = true;
} else if (spriteRect.intersects(vRect)) {
common::logError(kErrorSpritesIntersect, module_.filepath()) << "sprite '" << logFullName(variable.name) << "' intersects with '" << logFullName(var.name) << "'";
return false;
}
}
if (!found) {
sprites_.push_back(variable);
}
} else if (value.type().tag == Tag::Struct) {
auto fields = variable.value.Fields();
if (!fields) {
return false;
}
for (auto field : *fields) {
if (!collector(field.variable)) {
return false;
}
}
}
return true;
};
return module_.enumVariables(collector);
}
QImage SpriteGenerator::generateSprite(int scale) {
auto convert = [scale](int value) -> int { return structure::data::pxAdjust(value, scale); };
QImage result(convert(sprite2x_.width() / 2), convert(sprite2x_.height() / 2), sprite2x_.format());
{
QPainter p(&result);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(0, 0, result.width(), result.height(), QColor(0, 0, 0, 0));
for (auto variable : sprites_) {
auto sprite = variable.value.Sprite();
auto copy = sprite2x_.copy(sprite.left * 2, sprite.top * 2, sprite.width * 2, sprite.height * 2);
copy = copy.scaled(convert(sprite.width), convert(sprite.height), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
p.drawImage(convert(sprite.left), convert(sprite.top), copy);
}
}
return result;
}
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,56 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <QtCore/QString>
#include <QtCore/QSet>
#include <QtGui/QImage>
#include "codegen/style/structure_types.h"
namespace codegen {
namespace style {
namespace structure {
class Module;
} // namespace structure
class SpriteGenerator {
public:
SpriteGenerator(const structure::Module &module);
SpriteGenerator(const SpriteGenerator &other) = delete;
SpriteGenerator &operator=(const SpriteGenerator &other) = delete;
bool writeSprites();
private:
bool collectSprites();
QImage generateSprite(int scale); // scale = 5 for 125% and 6 for 150%.
const structure::Module &module_;
QString basePath_;
QImage sprite2x_;
QList<structure::Variable> sprites_;
};
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,230 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "codegen/style/structure_types.h"
namespace codegen {
namespace style {
namespace structure {
struct Value::DataTypes {
class TInt : public DataBase {
public:
TInt(int value) : value_(value) {
}
int Int() const override { return value_; }
private:
int value_;
};
class TDouble : public DataBase {
public:
TDouble(double value) : value_(value) {
}
double Double() const override { return value_; }
private:
double value_;
};
class TString : public DataBase {
public:
TString(std::string value) : value_(value) {
}
std::string String() const override { return value_; }
private:
std::string value_;
};
class TPoint : public DataBase {
public:
TPoint(data::point value) : value_(value) {
}
data::point Point() const override { return value_; }
private:
data::point value_;
};
class TSprite : public DataBase {
public:
TSprite(data::sprite value) : value_(value) {
}
data::sprite Sprite() const override { return value_; }
private:
data::sprite value_;
};
class TSize : public DataBase {
public:
TSize(data::size value) : value_(value) {
}
data::size Size() const override { return value_; }
private:
data::size value_;
};
class TColor : public DataBase {
public:
TColor(data::color value) : value_(value) {
}
data::color Color() const override { return value_; }
private:
data::color value_;
};
class TMargins : public DataBase {
public:
TMargins(data::margins value) : value_(value) {
}
data::margins Margins() const override { return value_; }
private:
data::margins value_;
};
class TFont : public DataBase {
public:
TFont(data::font value) : value_(value) {
}
data::font Font() const override { return value_; }
private:
data::font value_;
};
class TIcon : public DataBase {
public:
TIcon(data::icon value) : value_(value) {
}
data::icon Icon() const override { return value_; }
private:
data::icon value_;
};
class TFields : public DataBase {
public:
TFields(data::fields value) : value_(value) {
}
const data::fields *Fields() const override { return &value_; }
data::fields *Fields() override { return &value_; }
private:
data::fields value_;
};
};
Value::Value() : Value(TypeTag::Invalid, std::make_shared<DataBase>()) {
}
Value::Value(data::point value) : Value(TypeTag::Point, std::make_shared<DataTypes::TPoint>(value)) {
}
Value::Value(data::sprite value) : Value(TypeTag::Sprite, std::make_shared<DataTypes::TSprite>(value)) {
}
Value::Value(data::size value) : Value(TypeTag::Size, std::make_shared<DataTypes::TSize>(value)) {
}
Value::Value(data::color value) : Value(TypeTag::Color, std::make_shared<DataTypes::TColor>(value)) {
}
Value::Value(data::margins value) : Value(TypeTag::Margins, std::make_shared<DataTypes::TMargins>(value)) {
}
Value::Value(data::font value) : Value(TypeTag::Font, std::make_shared<DataTypes::TFont>(value)) {
}
Value::Value(data::icon value) : Value(TypeTag::Icon, std::make_shared<DataTypes::TIcon>(value)) {
}
Value::Value(const FullName &type, data::fields value)
: type_ { TypeTag::Struct, type }
, data_(std::make_shared<DataTypes::TFields>(value)) {
}
Value::Value(TypeTag type, double value) : Value(type, std::make_shared<DataTypes::TDouble>(value)) {
if (type_.tag != TypeTag::Double) {
type_.tag = TypeTag::Invalid;
data_ = std::make_shared<DataBase>();
}
}
Value::Value(TypeTag type, int value) : Value(type, std::make_shared<DataTypes::TInt>(value)) {
if (type_.tag != TypeTag::Int && type_.tag != TypeTag::Pixels) {
type_.tag = TypeTag::Invalid;
data_ = std::make_shared<DataBase>();
}
}
Value::Value(TypeTag type, std::string value) : Value(type, std::make_shared<DataTypes::TString>(value)) {
if (type_.tag != TypeTag::String &&
type_.tag != TypeTag::Transition &&
type_.tag != TypeTag::Cursor &&
type_.tag != TypeTag::Align) {
type_.tag = TypeTag::Invalid;
data_ = std::make_shared<DataBase>();
}
}
Value::Value(Type type, Qt::Initialization) : type_(type) {
switch (type_.tag) {
case TypeTag::Invalid: data_ = std::make_shared<DataBase>(); break;
case TypeTag::Int: data_ = std::make_shared<DataTypes::TInt>(0); break;
case TypeTag::Double: data_ = std::make_shared<DataTypes::TDouble>(0.); break;
case TypeTag::Pixels: data_ = std::make_shared<DataTypes::TInt>(0); break;
case TypeTag::String: data_ = std::make_shared<DataTypes::TString>(""); break;
case TypeTag::Color: data_ = std::make_shared<DataTypes::TColor>(data::color { 0, 0, 0, 255 }); break;
case TypeTag::Point: data_ = std::make_shared<DataTypes::TPoint>(data::point { 0, 0 }); break;
case TypeTag::Sprite: data_ = std::make_shared<DataTypes::TSprite>(data::sprite { 0, 0, 0, 0 }); break;
case TypeTag::Size: data_ = std::make_shared<DataTypes::TSize>(data::size { 0, 0 }); break;
case TypeTag::Transition: data_ = std::make_shared<DataTypes::TString>("linear"); break;
case TypeTag::Cursor: data_ = std::make_shared<DataTypes::TString>("default"); break;
case TypeTag::Align: data_ = std::make_shared<DataTypes::TString>("topleft"); break;
case TypeTag::Margins: data_ = std::make_shared<DataTypes::TMargins>(data::margins { 0, 0, 0, 0 }); break;
case TypeTag::Font: data_ = std::make_shared<DataTypes::TFont>(data::font { "", 13, 0 }); break;
case TypeTag::Icon: data_ = std::make_shared<DataTypes::TIcon>(data::icon {}); break;
case TypeTag::Struct: data_ = std::make_shared<DataTypes::TFields>(data::fields {}); break;
}
}
Value::Value(TypeTag type, std::shared_ptr<DataBase> &&data) : type_ { type }, data_(std::move(data)) {
}
} // namespace structure
} // namespace style
} // namespace codegen

View file

@ -0,0 +1,254 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
#include <memory>
#include <vector>
#include <QtCore/QString>
#include <QtCore/QStringList>
namespace codegen {
namespace style {
namespace structure {
// List of names, like overview.document.bg
using FullName = QStringList;
inline std::string logFullName(const FullName &name) {
return name.join('.').toStdString();
}
struct Variable;
class Value;
enum class TypeTag {
Invalid,
Int,
Double,
Pixels,
String,
Color,
Point,
Sprite,
Size,
Transition,
Cursor,
Align,
Margins,
Font,
Icon,
Struct,
};
struct Type {
TypeTag tag;
FullName name; // only for type == ClassType::Struct
explicit operator bool() const {
return (tag != TypeTag::Invalid);
}
};
inline bool operator==(const Type &a, const Type &b) {
return (a.tag == b.tag) && (a.name == b.name);
}
inline bool operator!=(const Type &a, const Type &b) {
return !(a == b);
}
namespace data {
inline int pxAdjust(int value, int scale) {
return qRound((value * scale / 4.) + (value > 0 ? -0.01 : 0.01));
}
struct point {
int x, y;
};
struct sprite {
int left, top, width, height;
};
struct size {
int width, height;
};
struct color {
uchar red, green, blue, alpha;
};
struct margins {
int left, top, right, bottom;
};
struct font {
enum Flag {
Bold = 0x01,
Italic = 0x02,
Underline = 0x04,
};
std::string family;
int size;
int flags;
};
struct monoicon;
struct icon {
std::vector<monoicon> parts;
};
struct field; // defined after Variable is defined
using fields = QList<field>;
} // namespace data
class Value {
public:
Value();
Value(data::point value);
Value(data::sprite value);
Value(data::size value);
Value(data::color value);
Value(data::margins value);
Value(data::font value);
Value(data::icon value);
Value(const FullName &type, data::fields value);
// Can be only double.
Value(TypeTag type, double value);
// Can be int / pixels.
Value(TypeTag type, int value);
// Can be string / transition / cursor / align.
Value(TypeTag type, std::string value);
// Default constructed value (uninitialized).
Value(Type type, Qt::Initialization);
Type type() const { return type_; }
int Int() const { return data_->Int(); }
double Double() const { return data_->Double(); }
std::string String() const { return data_->String(); }
data::point Point() const { return data_->Point(); }
data::sprite Sprite() const { return data_->Sprite(); };
data::size Size() const { return data_->Size(); };
data::color Color() const { return data_->Color(); };
data::margins Margins() const { return data_->Margins(); };
data::font Font() const { return data_->Font(); };
data::icon Icon() const { return data_->Icon(); };
const data::fields *Fields() const { return data_->Fields(); };
data::fields *Fields() { return data_->Fields(); };
explicit operator bool() const {
return type_.tag != TypeTag::Invalid;
}
Value makeCopy(const FullName &copyOf) const {
Value result(*this);
result.copyOf_ = copyOf;
return result;
}
const FullName &copyOf() const {
return copyOf_;
}
private:
class DataBase {
public:
virtual int Int() const { return 0; }
virtual double Double() const { return 0.; }
virtual std::string String() const { return std::string(); }
virtual data::point Point() const { return {}; };
virtual data::sprite Sprite() const { return {}; };
virtual data::size Size() const { return {}; };
virtual data::color Color() const { return {}; };
virtual data::margins Margins() const { return {}; };
virtual data::font Font() const { return {}; };
virtual data::icon Icon() const { return {}; };
virtual const data::fields *Fields() const { return nullptr; };
virtual data::fields *Fields() { return nullptr; };
virtual ~DataBase() {
}
};
struct DataTypes;
Value(TypeTag type, std::shared_ptr<DataBase> &&data);
Type type_;
std::shared_ptr<DataBase> data_;
FullName copyOf_; // for copies of existing named values
};
struct Variable {
FullName name;
Value value;
explicit operator bool() const {
return !name.isEmpty();
}
};
namespace data {
struct field {
enum class Status {
Uninitialized,
Implicit,
Explicit
};
Variable variable;
Status status;
};
struct monoicon {
QString filename;
Value color;
Value offset;
explicit operator bool() const {
return !filename.isEmpty();
}
};
} // namespace data
struct StructField {
FullName name;
Type type;
explicit operator bool() const {
return !name.isEmpty();
}
};
struct Struct {
FullName name;
QList<StructField> fields;
explicit operator bool() const {
return !name.isEmpty();
}
};
} // namespace structure
} // namespace style
} // namespace codegen

View file

@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
static const int32 AppVersion = 9044;
static const wchar_t *AppVersionStr = L"0.9.44";
static const bool DevVersion = false;
static const int32 AppVersion = 9045;
static const wchar_t *AppVersionStr = L"0.9.45";
static const bool DevVersion = true;
//#define BETA_VERSION (9044000ULL) // just comment this line to build public version
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";

View file

@ -45,52 +45,22 @@ uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 };
// Base types compile-time check
#ifdef TDESKTOP_CUSTOM_NULLPTR
NullPointerClass nullptr;
#endif
namespace {
template <typename T, int N>
class _TypeSizeCheckerHelper {
public:
_TypeSizeCheckerHelper() {
int _BadTypeSize[N ? -1 : 1];
(void)sizeof(_BadTypeSize);
}
};
template <typename T>
class _TypeSizeCheckerHelper<T, 0> {
public:
_TypeSizeCheckerHelper() {
}
};
template <typename T, int N>
class _TypeSizeChecker {
_TypeSizeCheckerHelper<T, N - sizeof(T)> checker;
};
void _typesCheck() {
_TypeSizeChecker<char, 1>();
_TypeSizeChecker<uchar, 1>();
_TypeSizeChecker<int16, 2>();
_TypeSizeChecker<uint16, 2>();
_TypeSizeChecker<int32, 4>();
_TypeSizeChecker<uint32, 4>();
_TypeSizeChecker<int64, 8>();
_TypeSizeChecker<uint64, 8>();
_TypeSizeChecker<float32, 4>();
_TypeSizeChecker<float64, 8>();
_TypeSizeChecker<mtpPrime, 4>();
_TypeSizeChecker<MTPint, 4>();
_TypeSizeChecker<MTPlong, 8>();
_TypeSizeChecker<MTPint128, 16>();
_TypeSizeChecker<MTPint256, 32>();
_TypeSizeChecker<MTPdouble, 8>();
}
}
static_assert(sizeof(char) == 1, "Basic types size check failed");
static_assert(sizeof(uchar) == 1, "Basic types size check failed");
static_assert(sizeof(int16) == 2, "Basic types size check failed");
static_assert(sizeof(uint16) == 2, "Basic types size check failed");
static_assert(sizeof(int32) == 4, "Basic types size check failed");
static_assert(sizeof(uint32) == 4, "Basic types size check failed");
static_assert(sizeof(int64) == 8, "Basic types size check failed");
static_assert(sizeof(uint64) == 8, "Basic types size check failed");
static_assert(sizeof(float32) == 4, "Basic types size check failed");
static_assert(sizeof(float64) == 8, "Basic types size check failed");
static_assert(sizeof(mtpPrime) == 4, "Basic types size check failed");
static_assert(sizeof(MTPint) == 4, "Basic types size check failed");
static_assert(sizeof(MTPlong) == 8, "Basic types size check failed");
static_assert(sizeof(MTPint128) == 16, "Basic types size check failed");
static_assert(sizeof(MTPint256) == 32, "Basic types size check failed");
static_assert(sizeof(MTPdouble) == 8, "Basic types size check failed");
// Unixtime functions

View file

@ -813,8 +813,7 @@ inline QSharedPointer<T> MakeShared(Args&&... args) {
template <typename T>
class NeverFreedPointer {
public:
explicit NeverFreedPointer() {
}
NeverFreedPointer() = default;
NeverFreedPointer(const NeverFreedPointer<T> &other) = delete;
NeverFreedPointer &operator=(const NeverFreedPointer<T> &other) = delete;
@ -861,7 +860,7 @@ public:
}
private:
T *_p = nullptr;
T *_p;
};

View file

@ -129,22 +129,7 @@ void createCircleMask(int size) {
}
QImage colorizeCircleHalf(int size, int half, int xoffset, style::color color) {
int a = color->c.alpha() + 1;
int fg_r = color->c.red() * a, fg_g = color->c.green() * a, fg_b = color->c.blue() * a, fg_a = 255 * a;
QImage result(half, size, QImage::Format_ARGB32_Premultiplied);
uchar *bits = result.bits(), *maskbits = unreadBadgeStyle->circle.bits();
int bpl = result.bytesPerLine(), maskbpl = unreadBadgeStyle->circle.bytesPerLine();
for (int x = 0; x < half; ++x) {
for (int y = 0; y < size; ++y) {
int s = y * bpl + (x * 4);
int o = maskbits[y * maskbpl + x + xoffset] + 1;
bits[s + 0] = (fg_b * o) >> 16;
bits[s + 1] = (fg_g * o) >> 16;
bits[s + 2] = (fg_r * o) >> 16;
bits[s + 3] = (fg_a * o) >> 16;
}
}
auto result = style::colorizeImage(unreadBadgeStyle->circle, color, QRect(xoffset, 0, half, size));
result.setDevicePixelRatio(cRetinaFactor());
return result;
}

View file

@ -23,7 +23,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "dialogs/dialogs_indexed_list.h"
#include "dialogs/dialogs_layout.h"
#include "ui/style.h"
#include "lang.h"
#include "application.h"
#include "mainwindow.h"
@ -119,8 +118,7 @@ void DialogsInner::paintRegion(Painter &p, const QRegion &region, bool paintingO
if (!paintingOther) {
if (selected) {
int skip = (st::mentionHeight - st::notifyClose.icon.pxHeight()) / 2;
p.drawPixmap(QPoint(w - st::notifyClose.icon.pxWidth() - skip, skip), App::sprite(), st::notifyClose.icon);
p.drawSprite(QPoint(w - st::notifyClose.icon.pxWidth() - skip, skip), st::notifyClose.icon);
}
QString first = (_hashtagFilter.size() < 2) ? QString() : ('#' + _hashtagResults.at(from).mid(0, _hashtagFilter.size() - 1)), second = (_hashtagFilter.size() < 2) ? ('#' + _hashtagResults.at(from)) : _hashtagResults.at(from).mid(_hashtagFilter.size() - 1);
int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second);
@ -299,10 +297,10 @@ void DialogsInner::searchInPeerPaint(Painter &p, int32 w, bool onlyBackground) c
// draw chat icon
if (_searchInPeer->isChat() || _searchInPeer->isMegagroup()) {
p.drawPixmap(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), App::sprite(), st::dlgChatImg);
p.drawSprite(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), st::dlgChatImg);
rectForName.setLeft(rectForName.left() + st::dlgImgSkip);
} else if (_searchInPeer->isChannel()) {
p.drawPixmap(QPoint(rectForName.left() + st::dlgChannelImgPos.x(), rectForName.top() + st::dlgChannelImgPos.y()), App::sprite(), st::dlgChannelImg);
p.drawSprite(QPoint(rectForName.left() + st::dlgChannelImgPos.x(), rectForName.top() + st::dlgChannelImgPos.y()), st::dlgChannelImg);
rectForName.setLeft(rectForName.left() + st::dlgImgSkip);
}
@ -2531,7 +2529,7 @@ void DialogsWidget::keyPressEvent(QKeyEvent *e) {
void DialogsWidget::paintEvent(QPaintEvent *e) {
if (App::wnd() && App::wnd()->contentOverlapped(this, e)) return;
QPainter p(this);
Painter p(this);
QRect r(e->rect());
if (r != rect()) {
p.setClipRect(r);
@ -2545,7 +2543,7 @@ void DialogsWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
return;
}
QRect above(0, 0, width(), _scroll.y());

View file

@ -1427,7 +1427,7 @@ void StickerPanInner::paintStickers(Painter &p, const QRect &r) {
QPoint xPos = pos + QPoint(st::stickerPanSize.width() - st::stickerPanDelete.pxWidth(), 0);
p.setOpacity(hover * (xHover + (1 - xHover) * st::stickerPanDeleteOpacity));
p.drawPixmapLeft(xPos, width(), App::sprite(), st::stickerPanDelete);
p.drawSpriteLeft(xPos, width(), st::stickerPanDelete);
p.setOpacity(1);
}
}
@ -2884,7 +2884,7 @@ void EmojiPan::paintEvent(QPaintEvent *e) {
}
if (rtl()) selx = width() - selx - st::rbEmoji.width;
p.setOpacity(skip ? qMax(1., selx / (skip * st::rbEmoji.width)) : 1.);
p.setOpacity(skip ? qMax(1., selx / float64(skip * st::rbEmoji.width)) : 1.);
p.fillRect(selx, _iconsTop + st::rbEmoji.height - st::stickerIconPadding, st::rbEmoji.width, st::stickerIconSel, st::stickerIconSelColor);
float64 o_left = snap(float64(_iconsX.current()) / st::stickerIconLeft.pxWidth(), 0., 1.);
@ -3951,7 +3951,9 @@ void MentionsInner::paintEvent(QPaintEvent *e) {
if (selected) {
p.fillRect(0, i * st::mentionHeight, width(), st::mentionHeight, st::mentionBgOver->b);
int skip = (st::mentionHeight - st::notifyClose.icon.pxHeight()) / 2;
if (!_hrows->isEmpty() || (!_mrows->isEmpty() && i < _recentInlineBotsInRows)) p.drawPixmap(QPoint(width() - st::notifyClose.icon.pxWidth() - skip, i * st::mentionHeight + skip), App::sprite(), st::notifyClose.icon);
if (!_hrows->isEmpty() || (!_mrows->isEmpty() && i < _recentInlineBotsInRows)) {
p.drawSprite(QPoint(width() - st::notifyClose.icon.pxWidth() - skip, i * st::mentionHeight + skip), st::notifyClose.icon);
}
}
p.setPen(st::black->p);
if (!_mrows->isEmpty()) {

View file

@ -23,7 +23,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "core/click_handler_types.h"
#include "dialogs/dialogs_indexed_list.h"
#include "ui/style.h"
#include "lang.h"
#include "mainwidget.h"
#include "application.h"
@ -5819,9 +5818,9 @@ void HistoryWebPage::draw(Painter &p, const QRect &r, TextSelection selection, u
if (_data->type == WebPageVideo) {
if (_data->siteName == qstr("YouTube")) {
p.drawPixmap(QPoint((pixwidth - st::youtubeIcon.pxWidth()) / 2, (pixheight - st::youtubeIcon.pxHeight()) / 2), App::sprite(), st::youtubeIcon);
p.drawSprite(QPoint((pixwidth - st::youtubeIcon.pxWidth()) / 2, (pixheight - st::youtubeIcon.pxHeight()) / 2), st::youtubeIcon);
} else {
p.drawPixmap(QPoint((pixwidth - st::videoIcon.pxWidth()) / 2, (pixheight - st::videoIcon.pxHeight()) / 2), App::sprite(), st::videoIcon);
p.drawSprite(QPoint((pixwidth - st::videoIcon.pxWidth()) / 2, (pixheight - st::videoIcon.pxHeight()) / 2), st::videoIcon);
}
if (_durationWidth) {
int32 dateX = pixwidth - _durationWidth - st::msgDateImgDelta - 2 * st::msgDateImgPadding.x();
@ -7304,7 +7303,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width
}
QPoint iconPos;
const QRect *iconRect = 0;
const style::sprite *iconRect = nullptr;
if (auto views = Get<HistoryMessageViews>()) {
iconPos = QPoint(infoRight - infoW + st::msgViewsPos.x(), infoBottom - st::msgViewsImg.pxHeight() + st::msgViewsPos.y());
if (id > 0) {
@ -7322,11 +7321,11 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width
iconRect = &(invertedsprites ? st::msgInvSendingViewsImg : st::msgSendingViewsImg);
}
}
p.drawPixmap(iconPos, App::sprite(), *iconRect);
p.drawSprite(iconPos, *iconRect);
} else if (id < 0 && history()->peer->isSelf()) {
iconPos = QPoint(infoRight - infoW, infoBottom - st::msgViewsImg.pxHeight() + st::msgViewsPos.y());
iconRect = &(invertedsprites ? st::msgInvSendingViewsImg : st::msgSendingViewsImg);
p.drawPixmap(iconPos, App::sprite(), *iconRect);
p.drawSprite(iconPos, *iconRect);
}
if (outbg) {
iconPos = QPoint(infoRight - st::msgCheckImg.pxWidth() + st::msgCheckPos.x(), infoBottom - st::msgCheckImg.pxHeight() + st::msgCheckPos.y());
@ -7339,7 +7338,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width
} else {
iconRect = &(invertedsprites ? st::msgInvSendingImg : st::msgSendingImg);
}
p.drawPixmap(iconPos, App::sprite(), *iconRect);
p.drawSprite(iconPos, *iconRect);
}
}
@ -7401,9 +7400,9 @@ void HistoryMessage::draw(Painter &p, const QRect &r, TextSelection selection, u
}
}
uint64 animms = App::main() ? App::main()->animActiveTimeStart(this) : 0;
if (animms > 0 && animms <= ms) {
animms = ms - animms;
uint64 fullAnimMs = App::main() ? App::main()->animActiveTimeStart(this) : 0;
if (fullAnimMs > 0 && fullAnimMs <= ms) {
int animms = ms - fullAnimMs;
if (animms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {
@ -8195,9 +8194,9 @@ void HistoryService::draw(Painter &p, const QRect &r, TextSelection selection, u
height -= unreadbarh;
}
uint64 animms = App::main() ? App::main()->animActiveTimeStart(this) : 0;
if (animms > 0 && animms <= ms) {
animms = ms - animms;
uint64 fullAnimMs = App::main() ? App::main()->animActiveTimeStart(this) : 0;
if (fullAnimMs > 0 && fullAnimMs <= ms) {
int animms = ms - fullAnimMs;
if (animms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {

View file

@ -24,7 +24,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "boxes/confirmbox.h"
#include "boxes/photosendbox.h"
#include "ui/filedialog.h"
#include "ui/style.h"
#include "ui/toast/toast.h"
#include "inline_bots/inline_bot_result.h"
#include "lang.h"
@ -5745,12 +5744,12 @@ void HistoryWidget::onForwardHere() {
App::forward(_peer->id, ForwardContextMessage);
}
void HistoryWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) {
void HistoryWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) {
if (_a_show.animating()) {
p.drawPixmap(a_coordUnder.current(), 0, _cacheTopBarUnder);
p.drawPixmap(a_coordOver.current(), 0, _cacheTopBarOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), st::topBarHeight), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), st::topBarHeight), App::sprite(), st::slideShadow.rect());
return;
}
@ -5773,10 +5772,10 @@ void HistoryWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth)
if (Adaptive::OneColumn()) {
p.setOpacity(st::topBarForwardAlpha + (1 - st::topBarForwardAlpha) * over);
p.drawPixmap(QPoint((st::topBarForwardPadding.right() - st::topBarBackwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarBackwardImg.pxHeight()) / 2), App::sprite(), st::topBarBackwardImg);
p.drawSprite(QPoint((st::topBarForwardPadding.right() - st::topBarBackwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarBackwardImg.pxHeight()) / 2), st::topBarBackwardImg);
} else {
p.setOpacity(st::topBarForwardAlpha + (1 - st::topBarForwardAlpha) * over);
p.drawPixmap(QPoint(width() - (st::topBarForwardPadding.right() + st::topBarForwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarForwardImg.pxHeight()) / 2), App::sprite(), st::topBarForwardImg);
p.drawSprite(QPoint(width() - (st::topBarForwardPadding.right() + st::topBarForwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarForwardImg.pxHeight()) / 2), st::topBarForwardImg);
}
}
@ -7935,7 +7934,7 @@ void HistoryWidget::drawField(Painter &p) {
p.fillRect(0, backy, width(), backh, st::taMsgField.bgColor->b);
if (_editMsgId || _replyToId || (!hasForward && _kbReplyTo)) {
int32 replyLeft = st::replySkip;
p.drawPixmap(QPoint(st::replyIconPos.x(), backy + st::replyIconPos.y()), App::sprite(), _editMsgId ? st::editIcon : st::replyIcon);
p.drawSprite(QPoint(st::replyIconPos.x(), backy + st::replyIconPos.y()), _editMsgId ? st::editIcon : st::replyIcon);
if (!drawPreview) {
if (drawMsgText) {
if (drawMsgText->getMedia() && drawMsgText->getMedia()->hasReplyPreview()) {
@ -7963,7 +7962,7 @@ void HistoryWidget::drawField(Painter &p) {
}
} else if (from && text) {
int32 forwardLeft = st::replySkip;
p.drawPixmap(QPoint(st::replyIconPos.x(), backy + st::replyIconPos.y()), App::sprite(), st::forwardIcon);
p.drawSprite(QPoint(st::replyIconPos.x(), backy + st::replyIconPos.y()), st::forwardIcon);
if (!drawPreview) {
if (!preview->isNull()) {
QRect to(forwardLeft, backy + st::msgReplyPadding.top(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height());
@ -8094,7 +8093,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
return;
}

View file

@ -520,7 +520,7 @@ public:
void updateTopBarSelection();
void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth);
void paintTopBar(Painter &p, float64 over, int32 decreaseWidth);
void topBarClick();
void loadMessages();

View file

@ -21,6 +21,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "stdafx.h"
#include "inline_bots/inline_bot_layout_internal.h"
#include "styles/style_overview.h"
#include "inline_bots/inline_bot_result.h"
#include "localstorage.h"
#include "mainwidget.h"

View file

@ -29,34 +29,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
namespace InlineBots {
namespace {
using ResultsByLoaderMap = QMap<FileLoader*, Result*>;
NeverFreedPointer<ResultsByLoaderMap> ResultsByLoader;
void regLoader(FileLoader *loader, Result *result) {
ResultsByLoader.createIfNull([]() -> ResultsByLoaderMap* {
return new ResultsByLoaderMap();
});
ResultsByLoader->insert(loader, result);
}
void unregLoader(FileLoader *loader) {
if (!ResultsByLoader) {
return;
}
ResultsByLoader->remove(loader);
}
} // namespace
Result *getResultFromLoader(FileLoader *loader) {
if (!ResultsByLoader) {
return nullptr;
}
return ResultsByLoader->value(loader, nullptr);
}
Result::Result(const Creator &creator) : _queryId(creator.queryId), _type(creator.type) {
}

View file

@ -43,7 +43,7 @@ private:
public:
// Constructor is public only for std::make_unique<>() to work.
// Constructor is public only for std_::make_unique<>() to work.
// You should use create() static method instead.
explicit Result(const Creator &creator);
static std_::unique_ptr<Result> create(uint64 queryId, const MTPBotInlineResult &mtpData);
@ -120,6 +120,5 @@ private:
std_::unique_ptr<internal::SendData> sendData;
};
Result *getResultFromLoader(FileLoader *loader);
} // namespace InlineBots

View file

@ -19,12 +19,10 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
#include "ui/style.h"
#include "application.h"
#include "intro/introcode.h"
#include "lang.h"
#include "application.h"
#include "intro/introsignup.h"
#include "intro/intropwdcheck.h"

View file

@ -19,12 +19,10 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
#include "ui/style.h"
#include "application.h"
#include "intro/introphone.h"
#include "lang.h"
#include "application.h"
#include "intro/introcode.h"
namespace {

View file

@ -21,13 +21,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "stdafx.h"
#include "intro/intropwdcheck.h"
#include "lang.h"
#include "ui/style.h"
#include "ui/filedialog.h"
#include "boxes/confirmbox.h"
#include "lang.h"
#include "application.h"
#include "intro/introsignup.h"
IntroPwdCheck::IntroPwdCheck(IntroWidget *parent) : IntroStep(parent)

View file

@ -19,15 +19,13 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
#include "ui/style.h"
#include "intro/introsignup.h"
#include "ui/filedialog.h"
#include "boxes/photocropbox.h"
#include "lang.h"
#include "application.h"
#include "intro/introsignup.h"
IntroSignup::IntroSignup(IntroWidget *parent) : IntroStep(parent)
, a_errorAlpha(0)
, a_photoOver(0)
@ -126,15 +124,15 @@ void IntroSignup::paintEvent(QPaintEvent *e) {
if (_photoSmall.isNull()) {
if (a_photoOver.current() < 1) {
QRect pix(st::setPhotoImg);
pix.moveTo(pix.x() + (pix.width() - st::introPhotoSize) / 2, pix.y() + (pix.height() - st::introPhotoSize) / 2);
pix.setSize(QSize(st::introPhotoSize, st::introPhotoSize));
QRect pix(st::setPhotoImg.rect());
pix.moveTo(pix.x() + (pix.width() - (st::introPhotoSize * cIntRetinaFactor())) / 2, pix.y() + (pix.height() - (st::introPhotoSize * cIntRetinaFactor())) / 2);
pix.setSize(QSize(st::introPhotoSize * cIntRetinaFactor(), st::introPhotoSize * cIntRetinaFactor()));
p.drawPixmap(QPoint(_phLeft, _phTop), App::sprite(), pix);
}
if (a_photoOver.current() > 0) {
QRect pix(st::setOverPhotoImg);
pix.moveTo(pix.x() + (pix.width() - st::introPhotoSize) / 2, pix.y() + (pix.height() - st::introPhotoSize) / 2);
pix.setSize(QSize(st::introPhotoSize, st::introPhotoSize));
QRect pix(st::setOverPhotoImg.rect());
pix.moveTo(pix.x() + (pix.width() - (st::introPhotoSize * cIntRetinaFactor())) / 2, pix.y() + (pix.height() - (st::introPhotoSize * cIntRetinaFactor())) / 2);
pix.setSize(QSize(st::introPhotoSize * cIntRetinaFactor(), st::introPhotoSize * cIntRetinaFactor()));
p.setOpacity(a_photoOver.current());
p.drawPixmap(QPoint(_phLeft, _phTop), App::sprite(), pix);
p.setOpacity(1);

View file

@ -19,14 +19,11 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
#include "ui/style.h"
#include "application.h"
#include "intro/introstart.h"
#include "intro/introphone.h"
#include "lang.h"
#include "application.h"
#include "intro/introphone.h"
#include "langloaderplain.h"
IntroStart::IntroStart(IntroWidget *parent) : IntroStep(parent)
@ -65,7 +62,7 @@ IntroStart::IntroStart(IntroWidget *parent) : IntroStep(parent)
void IntroStart::paintEvent(QPaintEvent *e) {
bool trivial = (rect() == e->rect());
QPainter p(this);
Painter p(this);
if (!trivial) {
p.setClipRect(e->rect());
}
@ -75,7 +72,7 @@ void IntroStart::paintEvent(QPaintEvent *e) {
p.setPen(st::introColor->p);
p.drawText((width() - _headerWidth) / 2, hy, qsl("Telegram Desktop"));
p.drawPixmap(QPoint((width() - st::aboutIcon.pxWidth()) / 2, hy - st::introIconSkip - st::aboutIcon.pxHeight()), App::sprite(), st::aboutIcon);
p.drawSprite(QPoint((width() - st::aboutIcon.pxWidth()) / 2, hy - st::introIconSkip - st::aboutIcon.pxHeight()), st::aboutIcon);
}
void IntroStart::resizeEvent(QResizeEvent *e) {

View file

@ -19,12 +19,10 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
#include "ui/style.h"
#include "localstorage.h"
#include "intro/introwidget.h"
#include "lang.h"
#include "localstorage.h"
#include "intro/introstart.h"
#include "intro/introphone.h"
#include "intro/introcode.h"
@ -269,7 +267,7 @@ void IntroWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
} else if (_a_stage.animating()) {
p.setOpacity(a_opacityHide.current());
p.drawPixmap(step()->x() + st::introSlideShift + a_coordHide.current(), step()->y(), _cacheHide);

View file

@ -19,19 +19,17 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "ui/style.h"
#include "lang.h"
#include "layout.h"
#include "lang.h"
#include "mainwidget.h"
#include "application.h"
#include "fileuploader.h"
#include "mainwindow.h"
#include "ui/filedialog.h"
#include "playerwidget.h"
#include "boxes/addcontactbox.h"
#include "boxes/confirmbox.h"
#include "audio.h"
#include "localstorage.h"

View file

@ -48,27 +48,6 @@ namespace {
return result;
}
FileKey fromFilePart(const QString &val) {
FileKey result = 0;
int32 i = val.size();
if (i != 0x10) return 0;
while (i > 0) {
--i;
result <<= 4;
uint16 ch = val.at(i).unicode();
if (ch >= 'A' && ch <= 'F') {
result |= (ch - 'A') + 0x0A;
} else if (ch >= '0' && ch <= '9') {
result |= (ch - '0');
} else {
return 0;
}
}
return result;
}
QString _basePath, _userBasePath;
bool _started = false;
@ -325,45 +304,6 @@ namespace {
}
};
bool fileExists(const QString &name, int options = UserPath | SafePath) {
if (options & UserPath) {
if (!_userWorking()) return false;
} else {
if (!_working()) return false;
}
// detect order of read attempts
QString toTry[2];
toTry[0] = ((options & UserPath) ? _userBasePath : _basePath) + name + '0';
if (options & SafePath) {
QFileInfo toTry0(toTry[0]);
if (toTry0.exists()) {
toTry[1] = ((options & UserPath) ? _userBasePath : _basePath) + name + '1';
QFileInfo toTry1(toTry[1]);
if (toTry1.exists()) {
QDateTime mod0 = toTry0.lastModified(), mod1 = toTry1.lastModified();
if (mod0 < mod1) {
qSwap(toTry[0], toTry[1]);
}
} else {
toTry[1] = QString();
}
} else {
toTry[0][toTry[0].size() - 1] = '1';
}
}
for (int32 i = 0; i < 2; ++i) {
QString fname(toTry[i]);
if (fname.isEmpty()) break;
if (QFileInfo(fname).exists()) return true;
}
return false;
}
bool fileExists(const FileKey &fkey, int options = UserPath | SafePath) {
return fileExists(toFilePart(fkey), options);
}
bool readFile(FileReadDescriptor &result, const QString &name, int options = UserPath | SafePath) {
if (options & UserPath) {
if (!_userWorking()) return false;

View file

@ -22,7 +22,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "mainwidget.h"
#include "ui/buttons/peer_avatar_button.h"
#include "ui/style.h"
#include "window/top_bar_widget.h"
#include "apiwrap.h"
#include "dialogswidget.h"
@ -2471,7 +2470,7 @@ void MainWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
}
}
@ -2608,7 +2607,7 @@ bool MainWidget::needBackButton() {
return _overview || _profile || (_history->peer() && _history->peer()->id);
}
void MainWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) {
void MainWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) {
if (_profile) {
_profile->paintTopBar(p, over, decreaseWidth);
} else if (_overview) {

View file

@ -153,7 +153,7 @@ public:
void updateAdaptiveLayout();
bool needBackButton();
void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth);
void paintTopBar(Painter &p, float64 over, int32 decreaseWidth);
Window::TopBarWidget *topBar();
PlayerWidget *player();

View file

@ -19,12 +19,9 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "mainwindow.h"
#include "zip.h"
#include "ui/style.h"
#include "lang.h"
#include "shortcuts.h"
#include "application.h"
@ -183,10 +180,10 @@ void NotifyWindow::updateNotifyDisplay() {
QRect rectForName(st::notifyPhotoPos.x() + st::notifyPhotoSize + st::notifyTextLeft, st::notifyTextTop, itemWidth, st::msgNameFont->height);
if (!App::passcoded() && cNotifyView() <= dbinvShowName) {
if (history->peer->isChat() || history->peer->isMegagroup()) {
p.drawPixmap(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), App::sprite(), st::dlgChatImg);
p.drawSprite(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), st::dlgChatImg);
rectForName.setLeft(rectForName.left() + st::dlgImgSkip);
} else if (history->peer->isChannel()) {
p.drawPixmap(QPoint(rectForName.left() + st::dlgChannelImgPos.x(), rectForName.top() + st::dlgChannelImgPos.y()), App::sprite(), st::dlgChannelImg);
p.drawSprite(QPoint(rectForName.left() + st::dlgChannelImgPos.x(), rectForName.top() + st::dlgChannelImgPos.y()), st::dlgChannelImg);
rectForName.setLeft(rectForName.left() + st::dlgImgSkip);
}
}
@ -1782,7 +1779,7 @@ void MainWindow::placeSmallCounter(QImage &img, int size, int count, style::colo
} else {
fontSize = (cntSize < 2) ? 22 : 22;
}
style::font f(fontSize);
style::font f = { fontSize, 0, 0 };
int32 w = f->width(cnt), d, r;
if (size == 16) {
d = (cntSize < 2) ? 2 : 1;
@ -1831,7 +1828,7 @@ QImage MainWindow::iconWithCounter(int size, int count, style::color bg, bool sm
} else {
fontSize = (cntSize < 2) ? 22 : ((cntSize < 3) ? 20 : 16);
}
style::font f(fontSize);
style::font f = { fontSize, 0, 0 };
int32 w = f->width(cnt), d, r;
if (size == 16) {
d = (cntSize < 2) ? 5 : ((cntSize < 3) ? 2 : 1);

View file

@ -123,7 +123,7 @@ MediaView::MediaView() : TWidget(App::wnd())
_saveMsg = QRect(0, 0, _saveMsgText.maxWidth() + st::medviewSaveMsgPadding.left() + st::medviewSaveMsgPadding.right(), st::medviewSaveMsgFont->height + st::medviewSaveMsgPadding.top() + st::medviewSaveMsgPadding.bottom());
_saveMsgText.setLink(1, MakeShared<SaveMsgClickHandler>(this));
_transparentBrush = QBrush(App::sprite().copy(st::mvTransparentBrush));
_transparentBrush = QBrush(App::sprite().copy(st::mvTransparentBrush.rect()));
setWindowFlags(Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::Tool | Qt::NoDropShadowWindowHint);
moveToScreen();
@ -1201,7 +1201,7 @@ void MediaView::paintEvent(QPaintEvent *e) {
if (_saveMsgOpacity.current() > 0) {
p.setOpacity(_saveMsgOpacity.current());
App::roundRect(p, _saveMsg, st::medviewSaveMsg, MediaviewSaveCorners);
p.drawPixmap(_saveMsg.topLeft() + st::medviewSaveMsgCheckPos, App::sprite(), st::medviewSaveMsgCheck);
p.drawSprite(_saveMsg.topLeft() + st::medviewSaveMsgCheckPos, st::medviewSaveMsgCheck);
p.setPen(st::white->p);
textstyleSet(&st::medviewSaveAsTextStyle);
@ -1300,7 +1300,7 @@ void MediaView::paintEvent(QPaintEvent *e) {
}
if (_leftNavIcon.intersects(r)) {
p.setOpacity((o * st::mvIconOverOpacity + (1 - o) * st::mvIconOpacity) * co);
p.drawPixmap(_leftNavIcon.topLeft(), App::sprite(), st::mvLeft);
p.drawSprite(_leftNavIcon.topLeft(), st::mvLeft);
}
}
@ -1311,12 +1311,12 @@ void MediaView::paintEvent(QPaintEvent *e) {
p.setOpacity(o * st::mvControlBgOpacity * co);
for (int i = 0, l = region.rectCount(); i < l; ++i) {
QRect fill(_rightNav.intersected(rs.at(i)));
if (!fill.isEmpty()) p.fillRect(fill, st::black->b);
if (!fill.isEmpty()) p.fillRect(fill, st::black);
}
}
if (_rightNavIcon.intersects(r)) {
p.setOpacity((o * st::mvIconOverOpacity + (1 - o) * st::mvIconOpacity) * co);
p.drawPixmap(_rightNavIcon.topLeft(), App::sprite(), st::mvRight);
p.drawSprite(_rightNavIcon.topLeft(), st::mvRight);
}
}
@ -1327,12 +1327,12 @@ void MediaView::paintEvent(QPaintEvent *e) {
p.setOpacity(o * st::mvControlBgOpacity * co);
for (int i = 0, l = region.rectCount(); i < l; ++i) {
QRect fill(_closeNav.intersected(rs.at(i)));
if (!fill.isEmpty()) p.fillRect(fill, st::black->b);
if (!fill.isEmpty()) p.fillRect(fill, st::black);
}
}
if (_closeNavIcon.intersects(r)) {
p.setOpacity((o * st::mvIconOverOpacity + (1 - o) * st::mvIconOpacity) * co);
p.drawPixmap(_closeNavIcon.topLeft(), App::sprite(), st::mvClose);
p.drawSprite(_closeNavIcon.topLeft(), st::mvClose);
}
}
@ -1340,14 +1340,14 @@ void MediaView::paintEvent(QPaintEvent *e) {
if (_saveVisible && _saveNavIcon.intersects(r)) {
float64 o = overLevel(OverSave);
p.setOpacity((o * st::mvIconOverOpacity + (1 - o) * st::mvIconOpacity) * co);
p.drawPixmap(_saveNavIcon.topLeft(), App::sprite(), st::mvSave);
p.drawSprite(_saveNavIcon.topLeft(), st::mvSave);
}
// more area
if (_moreNavIcon.intersects(r)) {
float64 o = overLevel(OverMore);
p.setOpacity((o * st::mvIconOverOpacity + (1 - o) * st::mvIconOpacity) * co);
p.drawPixmap(_moreNavIcon.topLeft(), App::sprite(), st::mvMore);
p.drawSprite(_moreNavIcon.topLeft(), st::mvMore);
}
p.setPen(st::white->p);

View file

@ -0,0 +1,73 @@
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
using "basic.style";
overviewCheckBg: #0006;
overviewCheckedBg: #2fa9e2;
overviewPhotoSkip: 10px;
overviewPhotoBg: #F1F1F1;
overviewPhotoMinSize: minPhotoSize;
overviewPhotoCheck: icon {
{ size(32px, 32px), overviewCheckBg },
{ "overview_photo_check", #fff, point(8px, 10px) },
};
overviewPhotoChecked: icon {
{ size(32px, 32px), overviewCheckedBg },
{ "overview_photo_check", #fff, point(8px, 10px) },
};
overviewPhotoSelectOverlay: #0a7bb03f;
overviewFilePadding: margins(0px, 3px, 16px, 3px);
overviewFileSize: 70px;
overviewFileNameTop: 7px;
overviewFileStatusTop: 27px;
overviewFileDateTop: 49px;
overviewFileChecked: #2fa9e2;
overviewFileCheck: #00000066;
overviewFileExtPadding: 5px;
overviewFileExtTop: 24px;
overviewFileExtFont: font(18px semibold);
overviewLoader: size(34px, 14px);
overviewLoaderPoint: size(4px, 4px);
overviewLoaderSkip: 4px;
playlistHoverBg: #f2f2f2;
playlistPadding: 10px;
linksSearchMargin: margins(20px, 20px, 20px, 0px);
linksMaxWidth: 520px;
linksLetterFont: font(24px);
linksMargin: margins(0px, 7px, 0px, 5px);
linksTextTop: 6px;
linksBorder: 1px;
linksBorderFg: #eaeaea;
linksDateColor: #808080;
linksDateMargin: margins(0px, 15px, 0px, 2px);
overviewLinksCheck: icon {
{ "overview_links_check_bg", overviewCheckBg },
{ "overview_links_check", #fff, point(4px, 5px) },
};
overviewLinksChecked: icon {
{ "overview_links_check_bg", overviewCheckedBg },
{ "overview_links_check", #fff, point(4px, 5px) },
};

View file

@ -21,15 +21,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "stdafx.h"
#include "overview/overview_layout.h"
#include "styles/style_overview.h"
#include "ui/filedialog.h"
#include "boxes/addcontactbox.h"
#include "boxes/confirmbox.h"
#include "lang.h"
#include "mainwidget.h"
#include "application.h"
#include "fileuploader.h"
#include "mainwindow.h"
#include "ui/filedialog.h"
#include "playerwidget.h"
#include "boxes/addcontactbox.h"
#include "boxes/confirmbox.h"
#include "audio.h"
#include "localstorage.h"
@ -139,6 +140,21 @@ void Date::paint(Painter &p, const QRect &clip, TextSelection selection, const P
}
}
namespace {
void paintPhotoVideoCheck(Painter &p, int width, int height, bool selected) {
int checkPosX = width - st::overviewPhotoCheck.width();
int checkPosY = height - st::overviewPhotoCheck.height();
if (selected) {
p.fillRect(QRect(0, 0, width, height), st::overviewPhotoSelectOverlay);
st::overviewPhotoChecked.paint(p, QPoint(checkPosX, checkPosY), width);
} else {
st::overviewPhotoCheck.paint(p, QPoint(checkPosX, checkPosY), width);
}
}
} // namespace
Photo::Photo(PhotoData *photo, HistoryItem *parent) : ItemBase(parent)
, _data(photo)
, _link(new PhotoOpenClickHandler(photo))
@ -160,7 +176,7 @@ int32 Photo::resizeGetHeight(int32 width) {
}
void Photo::paint(Painter &p, const QRect &clip, TextSelection selection, const PaintContext *context) const {
bool good = _data->loaded();
bool good = _data->loaded(), selected = (selection == FullSelection);
if (!good) {
_data->medium->automaticLoad(_parent);
good = _data->medium->loaded();
@ -197,12 +213,8 @@ void Photo::paint(Painter &p, const QRect &clip, TextSelection selection, const
} else {
p.drawPixmap(0, 0, _pix);
}
if (selection == FullSelection) {
p.fillRect(QRect(0, 0, _width, _height), st::overviewPhotoSelectOverlay);
p.drawSprite(QPoint(rtl() ? 0 : (_width - st::overviewPhotoChecked.pxWidth()), _height - st::overviewPhotoChecked.pxHeight()), st::overviewPhotoChecked);
} else if (context->selecting) {
p.drawSprite(QPoint(rtl() ? 0 : (_width - st::overviewPhotoCheck.pxWidth()), _height - st::overviewPhotoCheck.pxHeight()), st::overviewPhotoCheck);
if (selected || context->selecting) {
paintPhotoVideoCheck(p, _width, _height, selected);
}
}
@ -335,11 +347,8 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const
_radial->draw(p, rinner, st::msgFileRadialLine, selected ? st::msgInBgSelected : st::msgInBg);
}
}
if (selected) {
p.drawSprite(QPoint(rtl() ? 0 : (_width - st::overviewPhotoChecked.pxWidth()), _height - st::overviewPhotoChecked.pxHeight()), st::overviewPhotoChecked);
} else if (context->selecting) {
p.drawSprite(QPoint(rtl() ? 0 : (_width - st::overviewPhotoCheck.pxWidth()), _height - st::overviewPhotoCheck.pxHeight()), st::overviewPhotoCheck);
if (selected || context->selecting) {
paintPhotoVideoCheck(p, _width, _height, selected);
}
}
@ -1060,9 +1069,9 @@ void Link::paint(Painter &p, const QRect &clip, TextSelection selection, const P
if (selection == FullSelection) {
App::roundRect(p, rtlrect(0, top, st::dlgPhotoSize, st::dlgPhotoSize, _width), st::overviewPhotoSelectOverlay, PhotoSelectOverlayCorners);
p.drawSpriteLeft(QPoint(st::dlgPhotoSize - st::linksPhotoCheck.pxWidth(), top + st::dlgPhotoSize - st::linksPhotoCheck.pxHeight()), _width, st::linksPhotoChecked);
st::overviewLinksChecked.paint(p, QPoint(st::dlgPhotoSize - st::overviewLinksChecked.width(), top + st::dlgPhotoSize - st::overviewLinksChecked.height()), _width);
} else if (context->selecting) {
p.drawSpriteLeft(QPoint(st::dlgPhotoSize - st::linksPhotoCheck.pxWidth(), top + st::dlgPhotoSize - st::linksPhotoCheck.pxHeight()), _width, st::linksPhotoCheck);
st::overviewLinksCheck.paint(p, QPoint(st::dlgPhotoSize - st::overviewLinksCheck.width(), top + st::dlgPhotoSize - st::overviewLinksCheck.height()), _width);
}
}

View file

@ -20,17 +20,18 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "styles/style_overview.h"
#include "boxes/addcontactbox.h"
#include "boxes/confirmbox.h"
#include "boxes/photocropbox.h"
#include "ui/filedialog.h"
#include "window/top_bar_widget.h"
#include "lang.h"
#include "mainwindow.h"
#include "mainwidget.h"
#include "overviewwidget.h"
#include "boxes/addcontactbox.h"
#include "boxes/confirmbox.h"
#include "boxes/photocropbox.h"
#include "application.h"
#include "ui/filedialog.h"
#include "playerwidget.h"
#include "window/top_bar_widget.h"
#include "overview/overview_layout.h"
// flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
@ -1999,7 +2000,7 @@ void OverviewWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
return;
}
@ -2022,16 +2023,16 @@ void OverviewWidget::scrollReset() {
_scroll.scrollToY((type() == OverviewLinks || type() == OverviewFiles) ? 0 : _scroll.scrollTopMax());
}
void OverviewWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) {
void OverviewWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) {
if (_a_show.animating()) {
p.drawPixmap(a_coordUnder.current(), 0, _cacheTopBarUnder);
p.drawPixmap(a_coordOver.current(), 0, _cacheTopBarOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), st::topBarHeight), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), st::topBarHeight), App::sprite(), st::slideShadow.rect());
return;
}
p.setOpacity(st::topBarBackAlpha + (1 - st::topBarBackAlpha) * over);
p.drawPixmap(QPoint(st::topBarBackPadding.left(), (st::topBarHeight - st::topBarBackImg.pxHeight()) / 2), App::sprite(), st::topBarBackImg);
p.drawSprite(QPoint(st::topBarBackPadding.left(), (st::topBarHeight - st::topBarBackImg.pxHeight()) / 2), st::topBarBackImg);
p.setFont(st::topBarBackFont->f);
p.setPen(st::topBarBackColor->p);
p.drawText(st::topBarBackPadding.left() + st::topBarBackImg.pxWidth() + st::topBarBackPadding.right(), (st::topBarHeight - st::topBarBackFont->height) / 2 + st::topBarBackFont->ascent, _header);

View file

@ -262,7 +262,7 @@ public:
void scrollBy(int32 add);
void scrollReset();
void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth);
void paintTopBar(Painter &p, float64 over, int32 decreaseWidth);
void topBarClick();
PeerData *peer() const;

View file

@ -19,12 +19,10 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "lang.h"
#include "ui/style.h"
#include "localstorage.h"
#include "passcodewidget.h"
#include "lang.h"
#include "localstorage.h"
#include "mainwindow.h"
#include "application.h"
#include "ui/text/text.h"
@ -172,7 +170,7 @@ void PasscodeWidget::paintEvent(QPaintEvent *e) {
bool trivial = (rect() == e->rect());
setMouseTracking(true);
QPainter p(this);
Painter p(this);
if (!trivial) {
p.setClipRect(e->rect());
}
@ -186,7 +184,7 @@ void PasscodeWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
} else {
p.fillRect(rect(), st::setBG->b);

View file

@ -22,7 +22,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "playerwidget.h"
#include "shortcuts.h"
#include "ui/style.h"
#include "lang.h"
#include "boxes/addcontactbox.h"
#include "application.h"
@ -89,19 +88,19 @@ void PlayerWidget::paintEvent(QPaintEvent *e) {
mid = width() - mid;
right = width() - right;
if (mid < left) {
p.drawPixmap(QRect(mid, top, left - mid, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.x() + (mid - right) * cIntRetinaFactor(), st::playerVolume.y(), (left - mid) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
p.drawPixmap(QRect(mid, top, left - mid, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.rect().x() + (mid - right) * cIntRetinaFactor(), st::playerVolume.rect().y(), (left - mid) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
}
if (right < mid) {
p.setOpacity(st::playerUnavailableOpacity);
p.drawPixmap(QRect(right, top, mid - right, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.x(), st::playerVolume.y(), (mid - right) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
p.drawPixmap(QRect(right, top, mid - right, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.rect().x(), st::playerVolume.rect().y(), (mid - right) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
}
} else {
if (mid > left) {
p.drawPixmap(QRect(left, top, mid - left, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.x(), st::playerVolume.y(), (mid - left) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
p.drawPixmap(QRect(left, top, mid - left, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.rect().x(), st::playerVolume.rect().y(), (mid - left) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
}
if (right > mid) {
p.setOpacity(st::playerUnavailableOpacity);
p.drawPixmap(QRect(mid, top, right - mid, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.x() + (mid - left) * cIntRetinaFactor(), st::playerVolume.y(), (right - mid) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
p.drawPixmap(QRect(mid, top, right - mid, st::playerVolume.pxHeight()), App::sprite(), QRect(st::playerVolume.rect().x() + (mid - left) * cIntRetinaFactor(), st::playerVolume.rect().y(), (right - mid) * cIntRetinaFactor(), st::playerVolume.pxHeight() * cIntRetinaFactor()));
}
}
}

View file

@ -841,11 +841,11 @@ void ProfileInner::paintEvent(QPaintEvent *e) {
_peer->paintUserpic(p, st::profilePhotoSize, _left, top);
} else {
if (a_photoOver.current() < 1) {
p.drawPixmap(QPoint(_left, top), App::sprite(), st::setPhotoImg);
p.drawSprite(QPoint(_left, top), st::setPhotoImg);
}
if (a_photoOver.current() > 0) {
p.setOpacity(a_photoOver.current());
p.drawPixmap(QPoint(_left, top), App::sprite(), st::setOverPhotoImg);
p.drawSprite(QPoint(_left, top), st::setOverPhotoImg);
p.setOpacity(1);
}
}
@ -1927,7 +1927,7 @@ void ProfileWidget::paintEvent(QPaintEvent *e) {
}
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
} else {
p.fillRect(e->rect(), st::white->b);
}
@ -1943,17 +1943,17 @@ void ProfileWidget::keyPressEvent(QKeyEvent *e) {
return _inner.keyPressEvent(e);
}
void ProfileWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) {
void ProfileWidget::paintTopBar(Painter &p, float64 over, int32 decreaseWidth) {
if (_a_show.animating()) {
p.drawPixmap(a_coordUnder.current(), 0, _cacheTopBarUnder);
p.drawPixmap(a_coordOver.current(), 0, _cacheTopBarOver);
p.setOpacity(a_shadow.current());
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), st::topBarHeight), App::sprite(), st::slideShadow);
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), st::topBarHeight), App::sprite(), st::slideShadow.rect());
return;
}
p.setOpacity(st::topBarBackAlpha + (1 - st::topBarBackAlpha) * over);
p.drawPixmap(QPoint(st::topBarBackPadding.left(), (st::topBarHeight - st::topBarBackImg.pxHeight()) / 2), App::sprite(), st::topBarBackImg);
p.drawSprite(QPoint(st::topBarBackPadding.left(), (st::topBarHeight - st::topBarBackImg.pxHeight()) / 2), st::topBarBackImg);
p.setFont(st::topBarBackFont->f);
p.setPen(st::topBarBackColor->p);
p.drawText(st::topBarBackPadding.left() + st::topBarBackImg.pxWidth() + st::topBarBackPadding.right(), (st::topBarHeight - st::topBarBackFont->height) / 2 + st::topBarBackFont->ascent, lang(peer()->isUser() ? lng_profile_info : ((peer()->isChat() || peer()->isMegagroup()) ? lng_profile_group_info : lng_profile_channel_info)));

View file

@ -242,7 +242,7 @@ public:
void dropEvent(QDropEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth);
void paintTopBar(Painter &p, float64 over, int32 decreaseWidth);
void topBarClick();
PeerData *peer() const;

Some files were not shown because too many files have changed in this diff Show more