Merge branch 'master' into qt4x5

Conflicts:
	goldendict.pro
This commit is contained in:
Timon Wong 2013-08-19 10:54:38 +08:00
commit e09ca5402d
53 changed files with 4731 additions and 166 deletions

6
.gitignore vendored
View file

@ -30,3 +30,9 @@ version.txt
.DS_Store
Info.plist
GoldenDict.xcodeproj/
# visual studio files
*.sdf
*.opensdf
*.suo
*.vcxproj.user

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "winlibs/lib/msvc"]
path = winlibs/lib/msvc
url = git@github.com:Tvangeste/goldendict-winlibs-prebuilt.git

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura and Tvangeste.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<QtTranslate>
<OutputFile Condition="'%(QtLrelease.OutputFile)' == ''">%(Filename).qm</OutputFile>
<Compress Condition="'%(QtLrelease.Compress)' == ''">false</Compress>
<LRELEASE Condition="'%(QtLrelease.LRELEASE)' == ''">$(QTDIR)\bin\lrelease.exe</LRELEASE>
<CommandLineTemplate>%(LRELEASE) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>
</QtTranslate>
</ItemDefinitionGroup>
<PropertyGroup>
<BuildGenerateSourcesTargets>$(BuildGenerateSourcesTargets);_QtTranslate</BuildGenerateSourcesTargets>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura and Tvangeste.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="QtTranslate">
<Targets>QtTranslate</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<UsingTask
TaskName="QtLrelease"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="SelectQtTranslate"
DependsOnTargets="_SelectedFiles;SelectCustomBuild"
>
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<QtTranslate
Remove="@(QtTranslate)"
Condition="'%(Identity)' != '@(SelectedFiles)'"
/>
</ItemGroup>
</Target>
<Target
Name="QtTranslate"
Condition="'@(QtTranslate)' != ''"
DependsOnTargets="SelectQtTranslate"
Inputs="@(QtTranslate)"
Outputs="%(OutputFile)"
>
<Message Text="LRELEASE %(QtTranslate.Identity) -> $([System.IO.Path]::GetFileName('%(QtTranslate.OutputFile)'))"
Importance="high"/>
<ItemGroup>
<QtTranslate_tlog
Include="%(QtTranslate.OutputFile)"
Condition="'%(QtTranslate.OutputFile)' != '' and '%(QtTranslate.ExcludedFromBuild)' != 'true'"
>
<Source>@(QtTranslate, '|')</Source>
</QtTranslate_tlog>
</ItemGroup>
<WriteLinesToFile
Condition="'@(QtTranslate_tlog)' != '' and '%(QtTranslate_tlog.ExcludedFromBuild)' != 'true'"
File="$(IntDir)$(ProjectName).write.1.tlog"
Lines="^%(QtTranslate_tlog.Source);@(QtTranslate_tlog-&gt;'%(Fullpath)')"
/>
<MakeDir
Directories="$([System.IO.Path]::GetDirectoryName('%(QtTranslate.OutputFile)'))"
/>
<QtLrelease
Condition="'%(QtTranslate.ExcludedFromBuild)' != 'true'"
OutputFile="%(QtTranslate.OutputFile)"
Inputs="%(QtTranslate.Identity)"
AdditionalOptions="%(QtTranslate.AdditionalOptions)"
CommandLineTemplate="%(QtTranslate.CommandLineTemplate)"
/>
</Target>
<Target
Name="QtTranslateAndInclude"
Condition="'@(QtTranslate)' != ''"
DependsOnTargets="SelectQtTranslate;QtTranslate"
>
<ItemGroup>
<ClInclude
Include="%(QtTranslate.OutputFile)"
Condition="'%(QtTranslate.ExcludedFromBuild)' != 'true'"
>
<AutoGen>True</AutoGen>
<DependentUpon>%(QtTranslate.Identity)</DependentUpon>
</ClInclude>
</ItemGroup>
</Target>
<Target
Name="_QtTranslate"
BeforeTargets="ClCompile"
DependsOnTargets="$(BeforeQtTranslateTargets);QtTranslateAndInclude;$(AfterQtTranslateTargets)"
/>
</Project>

View file

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura and Tvangeste.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<ProjectSchemaDefinitions
xmlns="http://schemas.microsoft.com/build/2009/properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
>
<Rule
Name="QtLrelease"
DisplayName="Qt Lrelease Tool"
PageTemplate="tool"
SwitchPrefix="-"
Order="220"
>
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtTranslate"
HasConfigurationCondition="true"
/>
</Rule.DataSource>
<Rule.Categories>
<Category
Name="General"
DisplayName="General"
/>
<Category
Name="Command Line"
DisplayName="Command Line"
Subtype="CommandLine"
/>
</Rule.Categories>
<StringProperty
Name="OutputFile"
Subtype="file"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtlinguist/linguist-manager.html#using-lrelease"
DisplayName="Output File"
Description="Write output to &lt;file&gt;. (-qm &lt;file&gt;)"
Switch="qm &quot;[value]&quot;"
/>
<BoolProperty
Name="Compress"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtlinguist/linguist-manager.html#using-lrelease"
DisplayName="Compress the QM files"
Description="Compress the QM files. (-compress)"
Switch="compress"
/>
<StringProperty
Name="Inputs"
Category="Command Line"
IsRequired="true"
>
<StringProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtTranslate"
SourceType="Item"
/>
</StringProperty.DataSource>
</StringProperty>
<StringProperty
Subtype="AdditionalOptions"
Name="AdditionalOptions"
Category="Command Line"
DisplayName="Additional Options"
F1Keyword="vc.project.AdditionalOptionsPage"
/>
<StringProperty
Name="LRELEASE"
Subtype="file"
DisplayName="LRELEASE"
Description="Path to lrelease.exe"
IncludeInCommandLine="False"
/>
<StringProperty
Name="CommandLineTemplate"
Category="Command Line"
DisplayName="Command Line"
Visible="False"
IncludeInCommandLine="False"
/>
</Rule>
<ItemType Name="QtTranslate" DisplayName="Qt Translation" />
<FileExtension Name="*.ts" ContentType="QtTranslate" />
<ContentType Name="QtTranslate" DisplayName="Qt Translation" ItemType="QtTranslate" />
</ProjectSchemaDefinitions>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<QtMOCCompile>
<OutputFile Condition="'%(QtMOCCompile.OutputFile)' == ''">%(Filename)%(Extension).$(Platform).$(Configuration).cpp</OutputFile>
<DoNotGenerateInclude Condition="'%(QtMOCCompile.DoNotGenerateInclude)' == ''">false</DoNotGenerateInclude>
<NoWarnings Condition="'%(QtMOCCompile.NoWarnings)' == ''">false</NoWarnings>
<BaseIncludePath Condition="'%(QtMOCCompile.BaseIncludePath)' == ''"></BaseIncludePath>
<DefaultIncludeDirectories Condition="'%(QtMOCCompile.DefaultIncludeDirectories)' == ''"></DefaultIncludeDirectories>
<AdditionalIncludeDirectories Condition="'%(QtMOCCompile.AdditionalIncludeDirectories)' == ''"></AdditionalIncludeDirectories>
<PreprocessOnly Condition="'%(QtMOCCompile.PreprocessOnly)' == ''">false</PreprocessOnly>
<DefaultPreprocessorDefinitions Condition="'%(QtMOCCompile.DefaultPreprocessorDefinitions)' == ''"></DefaultPreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(QtMOCCompile.PreprocessorDefinitions)' == ''"></PreprocessorDefinitions>
<DefaultUndefinePreprocessorDefinitions Condition="'%(QtMOCCompile.DefaultUndefinePreprocessorDefinitions)' == ''"></DefaultUndefinePreprocessorDefinitions>
<UndefinePreprocessorDefinitions Condition="'%(QtMOCCompile.PreprocessorDefinitions)' == ''"></UndefinePreprocessorDefinitions>
<MOC Condition="'%(QtMOCCompile.MOC)' == ''">$(QTDIR)\bin\moc.exe</MOC>
<ClCompileAssemblerListingLocation Condition="'%(QtMOCCompile.ClCompileAssemblerListingLocation)' == ''"></ClCompileAssemblerListingLocation>
<ClCompileObjectFileName Condition="'%(QtMOCCompile.ClCompileObjectFileName)' == ''"></ClCompileObjectFileName>
<ClCompileXMLDocumentationFileName Condition="'%(QtMOCCompile.ClCompileXMLDocumentationFileName)' == ''"></ClCompileXMLDocumentationFileName>
<CommandLineTemplate>%(MOC) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>
</QtMOCCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<BuildGenerateSourcesTargets>$(BuildGenerateSourcesTargets);_QtMOCCompile</BuildGenerateSourcesTargets>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="QtMOCCompile">
<Targets>QtMOCCompile</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<UsingTask
TaskName="QtMOC"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="SelectQtMOCCompile"
DependsOnTargets="_SelectedFiles;SelectCustomBuild"
>
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<QtMOCCompile
Remove="@(QtMOCCompile)"
Condition="'%(Identity)' != '@(SelectedFiles)'"
/>
</ItemGroup>
</Target>
<Target
Name="QtMOCCompile"
Condition="'@(QtMOCCompile)' != ''"
DependsOnTargets="SelectQtMOCCompile;QtUICCompile"
Inputs="@(QtMOCCompile)"
Outputs="%(OutputFile)"
>
<Message Text="MOC %(QtMOCCompile.Identity) -> $([System.IO.Path]::GetFileName('%(QtMOCCompile.OutputFile)'))"
Importance="high"/>
<!-- Almost for sure this will cause issues when this target is skipped. -->
<ItemGroup>
<!-- Take care of other common C++ extensions. -->
<ClCompile
Include="%(QtMOCCompile.RootDir)%(QtMOCCompile.Directory)%(QtMOCCompile.Filename).cpp"
Condition="!exists('%(QtMOCCompile.RootDir)%(QtMOCCompile.Directory)%(QtMOCCompile.Filename).cpp')"
>
<QtMOCCompileFakeItem>true</QtMOCCompileFakeItem>
</ClCompile>
<QtMOCCompileNoExtension Include="@(QtMOCCompile-&gt;'%(RootDir)%(Directory)%(Filename)')" />
<ClCompileNoExtension Include="@(ClCompile-&gt;'%(RootDir)%(Directory)%(Filename)')" />
<BuddyClCompile Include="@(ClCompileNoExtension)" Condition="'%(Identity)' == '@(QtMOCCompileNoExtension)'" />
<QtMOCCompile>
<DefaultIncludeDirectories Condition="'%(QtMOCCompile.DefaultIncludeDirectories)' == ''">@(BuddyClCompile->'%(AdditionalIncludeDirectories)')</DefaultIncludeDirectories>
<DefaultPreprocessorDefinitions Condition="'%(QtMOCCompile.DefaultPreprocessorDefinitions)' == ''">@(BuddyClCompile->'%(PreprocessorDefinitions)')</DefaultPreprocessorDefinitions>
<DefaultUndefinePreprocessorDefinitions Condition="'%(QtMOCCompile.DefaultUndefinePreprocessorDefinitions)' == ''">@(BuddyClCompile->'%(UndefinePreprocessorDefinitions)')</DefaultUndefinePreprocessorDefinitions>
</QtMOCCompile>
</ItemGroup>
<ItemGroup>
<QtMOCCompile_tlog
Include="%(QtMOCCompile.OutputFile)"
Condition="'%(QtMOCCompile.OutputFile)' != '' and '%(QtMOCCompile.ExcludedFromBuild)' != 'true'"
>
<Source>@(QtMOCCompile, '|')</Source>
</QtMOCCompile_tlog>
</ItemGroup>
<WriteLinesToFile
Condition="'@(QtMOCCompile_tlog)' != '' and '%(QtMOCCompile_tlog.ExcludedFromBuild)' != 'true'"
File="$(IntDir)$(ProjectName).write.1.tlog"
Lines="^%(QtMOCCompile_tlog.Source);@(QtMOCCompile_tlog-&gt;'%(Fullpath)')"
/>
<MakeDir
Directories="$([System.IO.Path]::GetDirectoryName('%(QtMOCCompile.OutputFile)'))"
/>
<QtMOC
Condition="'%(QtMOCCompile.ExcludedFromBuild)' != 'true'"
OutputFile="%(QtMOCCompile.OutputFile)"
DoNotGenerateInclude="%(QtMOCCompile.DoNotGenerateInclude)"
NoWarnings="%(QtMOCCompile.NoWarnings)"
BaseIncludePath="%(QtMOCCompile.BaseIncludePath)"
DefaultIncludeDirectories="%(QtMOCCompile.DefaultIncludeDirectories)"
AdditionalIncludeDirectories="%(QtMOCCompile.AdditionalIncludeDirectories)"
PreprocessOnly="%(QtMOCCompile.PreprocessOnly)"
DefaultPreprocessorDefinitions="%(QtMOCCompile.DefaultPreprocessorDefinitions)"
PreprocessorDefinitions="%(QtMOCCompile.PreprocessorDefinitions)"
DefaultUndefinePreprocessorDefinitions="%(QtMOCCompile.DefaultUndefinePreprocessorDefinitions)"
UndefinePreprocessorDefinitions="%(QtMOCCompile.UndefinePreprocessorDefinitions)"
Inputs="%(QtMOCCompile.Identity)"
AdditionalOptions="%(QtMOCCompile.AdditionalOptions)"
CommandLineTemplate="%(QtMOCCompile.CommandLineTemplate)"
/>
<ItemGroup>
<ClCompile
Remove="@(ClCompile)"
Condition="'%(ClCompile.QtMOCCompileFakeItem)' == 'true'"
/>
<QtMOCCompileNoExtension Remove="*" />
<ClCompileNoExtension Remove="*" />
<BuddyClCompile Remove="*" />
</ItemGroup>
</Target>
<Target
Name="QtMOCCompileAndInclude"
Condition="'@(QtMOCCompile)' != ''"
DependsOnTargets="SelectQtMOCCompile;QtMOCCompile"
>
<ItemGroup>
<ClCompile
Include="%(QtMOCCompile.OutputFile)"
Condition="'%(QtMOCCompile.ExcludedFromBuild)' != 'true'"
>
<AutoGen>True</AutoGen>
<DependentUpon>%(QtMOCCompile.Identity)</DependentUpon>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>%(QtMOCCompile.AdditionalIncludeDirectories);%(QtMOCCompile.DefaultIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(QtMOCCompile.DefaultPreprocessorDefinitions);%(QtMOCCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
<UndefinePreprocessorDefinitions>%(QtMOCCompile.DefaultUndefinePreprocessorDefinitions);%(QtMOCCompile.UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
<AssemblerListingLocation Condition="'%(QtMOCCompile.ClCompileAssemblerListingLocation)' != ''">%(QtMOCCompile.ClCompileAssemblerListingLocation)</AssemblerListingLocation>
<ObjectFileName Condition="'%(QtMOCCompile.ClCompileObjectFileName)' != ''">%(QtMOCCompile.ClCompileObjectFileName)</ObjectFileName>
<XMLDocumentationFileName Condition="'%(QtMOCCompile.ClCompileXMLDocumentationFileName)' != ''">%(QtMOCCompile.ClCompileXMLDocumentationFileName)</XMLDocumentationFileName>
</ClCompile>
</ItemGroup>
</Target>
<Target
Name="_QtMOCCompile"
BeforeTargets="ClCompile"
DependsOnTargets="$(BeforeQtMOCCompileTargets);QtMOCCompileAndInclude;$(AfterQtMOCCompileTargets)"
/>
</Project>

View file

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<ProjectSchemaDefinitions
xmlns="http://schemas.microsoft.com/build/2009/properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
>
<Rule
Name="QtMOC"
DisplayName="Qt Meta Object Compiler"
PageTemplate="tool"
SwitchPrefix="-"
Order="222"
>
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtMOCCompile"
HasConfigurationCondition="true"
/>
</Rule.DataSource>
<Rule.Categories>
<Category
Name="General"
DisplayName="General"
/>
<Category
Name="Command Line"
DisplayName="Command Line"
Subtype="CommandLine"
/>
</Rule.Categories>
<StringProperty
Name="OutputFile"
Subtype="file"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Output File"
Description="Write output to &lt;file&gt; rather than to standard output. (-o &lt;file&gt;)"
Switch="o &quot;[value]&quot;"
/>
<!-- -f -->
<BoolProperty
Name="DoNotGenerateInclude"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Do Not Generate Include"
Description="Do not generate an #include statement in the output. This may be used to run the moc on on a C++ file containing one or more class declarations. You should then #include the meta-object code in the .cpp file. (-i)"
Switch="i"
/>
<BoolProperty
Name="NoWarnings"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="No Warnings"
Description="Do not generate any warnings. (Not recommended.) (-nw)"
Switch="nw"
/>
<StringListProperty
Name="BaseIncludePath"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Base Include Path"
Description="Makes the moc prepend &lt;path&gt;/ to the file name in the generated #include statement. (-p&lt;path&gt;)"
Switch="p &quot;[value]&quot;"
/>
<StringListProperty
Name="DefaultIncludeDirectories"
Switch="I &quot;[value]&quot;"
Visible="false"
/>
<StringListProperty
Name="AdditionalIncludeDirectories"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Additional Include Directories"
Description="Add dir to the include path for header files. (-I &lt;dir&gt;)"
Switch="I &quot;[value]&quot;"
/>
<BoolProperty
Name="PreprocessOnly"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Preprocess Only"
Description="Preprocess only; do not generate meta-object code. (-E)"
Switch="E"
/>
<StringListProperty
Name="DefaultPreprocessorDefinitions"
Switch="D &quot;[value]&quot;"
Visible="false"
/>
<StringListProperty
Name="PreprocessorDefinitions"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Preprocessor Definitions"
Description="Define macro, with optional definition. (-D &lt;macro&gt;[=&lt;def&gt;])"
Switch="D &quot;[value]&quot;"
/>
<StringListProperty
Name="DefaultUndefinePreprocessorDefinitions"
Switch="U &quot;[value]&quot;"
Visible="false"
/>
<StringListProperty
Name="UndefinePreprocessorDefinitions"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/moc.html#command-line-options"
DisplayName="Undefine Preprocessor Definitions"
Description="Undefine macro. (-U &lt;macro&gt;)"
Switch="U &quot;[value]&quot;"
/>
<StringProperty
Name="Inputs"
Category="Command Line"
IsRequired="true"
>
<StringProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtMOCCompile"
SourceType="Item"
/>
</StringProperty.DataSource>
</StringProperty>
<StringProperty
Subtype="AdditionalOptions"
Name="AdditionalOptions"
Category="Command Line"
DisplayName="Additional Options"
F1Keyword="vc.project.AdditionalOptionsPage"
/>
<StringProperty
Name="MOC"
Subtype="file"
DisplayName="MOC"
Description="Path to moc.exe"
IncludeInCommandLine="False"
/>
<StringProperty
Name="CommandLineTemplate"
Category="Command Line"
DisplayName="Command Line"
Visible="False"
IncludeInCommandLine="False"
/>
</Rule>
<ItemType Name="QtMOCCompile" DisplayName="Qt MOC Compile" />
<FileExtension Name="*.h;*.hpp;*.hxx;*.hh" ContentType="QtMOCCompile" />
<ContentType Name="QtMOCCompile" DisplayName="Qt MOC Compile" ItemType="QtMOCCompile" />
</ProjectSchemaDefinitions>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<QtRCCCompile>
<OutputFile Condition="'%(QtRCCCompile.OutputFile)' == ''">%(Filename)%(Extension).cpp</OutputFile>
<ExternalInitializationFunction Condition="'%(QtRCCCompile.ExternalInitializationFunction)' == ''">%(Filename)</ExternalInitializationFunction>
<Threshold Condition="'%(QtRCCCompile.Threshold)' == ''"></Threshold>
<CompressLevel Condition="'%(QtRCCCompile.CompressLevel)' == ''">-1</CompressLevel>
<Root Condition="'%(QtRCCCompile.Root)' == ''"></Root>
<DisableCompression Condition="'%(QtRCCCompile.DisableCompression)' == ''">true</DisableCompression>
<Binary Condition="'%(QtRCCCompile.Binary)' == ''">false</Binary>
<RCC Condition="'%(QtRCCCompile.RCC)' == ''">$(QTDIR)\bin\rcc.exe</RCC>
<AdditionalDependencies Condition="'%(QtRCCCompile.AdditionalDependencies)' == ''">$(QTDIR)\bin\rcc.exe;$(MSBuildProjectFile)</AdditionalDependencies>
<ClCompileAssemblerListingLocation Condition="'%(QtMOCCompile.ClCompileAssemblerListingLocation)' == ''"></ClCompileAssemblerListingLocation>
<ClCompileObjectFileName Condition="'%(QtMOCCompile.ClCompileObjectFileName)' == ''"></ClCompileObjectFileName>
<ClCompileXMLDocumentationFileName Condition="'%(QtMOCCompile.ClCompileXMLDocumentationFileName)' == ''"></ClCompileXMLDocumentationFileName>
<CommandLineTemplate>%(RCC) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>
</QtRCCCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<BuildGenerateSourcesTargets>$(BuildGenerateSourcesTargets);_QtRCCCompile</BuildGenerateSourcesTargets>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="QtRCCCompile">
<Targets>QtRCCCompile</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<UsingTask
TaskName="QtRCC"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="SelectQtRCCCompile"
DependsOnTargets="_SelectedFiles;SelectCustomBuild"
>
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<QtRCCCompile
Remove="@(QtRCCCompile)"
Condition="'%(Identity)' != '@(SelectedFiles)'"
/>
</ItemGroup>
</Target>
<Target Name="CalculateQtRCCDeps"
DependsOnTargets="SelectQtRCCCompile"
Outputs="%(QtRCCCompile.Identity)">
<Message Text="Calculating dependencies for %(QtRCCCompile.Identity)" />
<!-- Look into the qrc file and fetch all the referenced files -->
<XmlPeek XmlInputPath="%(QtRCCCompile.FullPath)"
Query="//file/text()">
<Output TaskParameter="Result" ItemName="QtRCCDeps" />
</XmlPeek>
<!-- Add the calculated dependencies to the AdditionalDependencies -->
<ItemGroup>
<QtRCCCompile>
<AdditionalDependencies>@(QtRCCDeps);%(QtRCCCompile.AdditionalDependencies)</AdditionalDependencies>
</QtRCCCompile>
</ItemGroup>
<Message Text="Actual Dependencies: @(QtRCCCompile->'%(AdditionalDependencies)')" />
</Target>
<Target
Name="QtRCCCompile"
Condition="'@(QtRCCCompile)' != ''"
DependsOnTargets="SelectQtRCCCompile;CalculateQtRCCDeps"
Inputs="@(QtRCCCompile);%(QtRCCCompile.AdditionalDependencies);"
Outputs="%(OutputFile)"
>
<Message Text="RCC %(QtRCCCompile.Identity) -> $([System.IO.Path]::GetFileName('%(QtRCCCompile.OutputFile)'))"
Importance="high"/>
<ItemGroup>
<QtRCCCompile_tlog
Include="%(QtRCCCompile.OutputFile)"
Condition="'%(QtRCCCompile.OutputFile)' != '' and '%(QtRCCCompile.ExcludedFromBuild)' != 'true'"
>
<Source>@(QtRCCCompile, '|')</Source>
</QtRCCCompile_tlog>
</ItemGroup>
<WriteLinesToFile
Condition="'@(QtRCCCompile_tlog)' != '' and '%(QtRCCCompile_tlog.ExcludedFromBuild)' != 'true'"
File="$(IntDir)$(ProjectName).write.1.tlog"
Lines="^%(QtRCCCompile_tlog.Source);@(QtRCCCompile_tlog-&gt;'%(Fullpath)')"
/>
<MakeDir
Directories="$([System.IO.Path]::GetDirectoryName('%(QtRCCCompile.OutputFile)'))"
/>
<QtRCC
Condition="'%(QtRCCCompile.ExcludedFromBuild)' != 'true'"
OutputFile="%(QtRCCCompile.OutputFile)"
ExternalInitializationFunction="%(QtRCCCompile.ExternalInitializationFunction)"
Threshold="%(QtRCCCompile.Threshold)"
CompressLevel="%(QtRCCCompile.CompressLevel)"
Root="%(QtRCCCompile.Root)"
DisableCompression="%(QtRCCCompile.DisableCompression)"
Binary="%(QtRCCCompile.Binary)"
Inputs="%(QtRCCCompile.Identity)"
AdditionalOptions="%(QtRCCCompile.AdditionalOptions)"
CommandLineTemplate="%(QtRCCCompile.CommandLineTemplate)"
/>
</Target>
<Target
Name="QtRCCCompileAndInclude"
Condition="'@(QtRCCCompile)' != ''"
DependsOnTargets="SelectQtRCCCompile;QtRCCCompile"
>
<ItemGroup>
<ClCompile
Include="%(QtRCCCompile.OutputFile)"
Condition="'%(QtRCCCompile.ExcludedFromBuild)' != 'true'"
>
<AutoGen>True</AutoGen>
<DependentUpon>%(QtRCCCompile.Identity)</DependentUpon>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AssemblerListingLocation Condition="'%(QtRCCCompile.ClCompileAssemblerListingLocation)' != ''">%(QtRCCCompile.ClCompileAssemblerListingLocation)</AssemblerListingLocation>
<ObjectFileName Condition="'%(QtRCCCompile.ClCompileObjectFileName)' != ''">%(QtRCCCompile.ClCompileObjectFileName)</ObjectFileName>
<XMLDocumentationFileName Condition="'%(QtRCCCompile.ClCompileXMLDocumentationFileName)' != ''">%(QtRCCCompile.ClCompileXMLDocumentationFileName)</XMLDocumentationFileName>
</ClCompile>
</ItemGroup>
</Target>
<Target
Name="_QtRCCCompile"
BeforeTargets="ClCompile"
DependsOnTargets="$(BeforeQtRCCCompileTargets);QtRCCCompileAndInclude;$(AfterQtRCCCompileTargets)"
/>
</Project>

View file

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<ProjectSchemaDefinitions
xmlns="http://schemas.microsoft.com/build/2009/properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
>
<Rule
Name="QtRCC"
DisplayName="Qt Resource Compiler"
PageTemplate="tool"
SwitchPrefix="-"
Order="223"
>
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtRCCCompile"
HasConfigurationCondition="true"
/>
</Rule.DataSource>
<Rule.Categories>
<Category
Name="General"
DisplayName="General"
/>
<Category
Name="Command Line"
DisplayName="Command Line"
Subtype="CommandLine"
/>
</Rule.Categories>
<StringProperty
Name="OutputFile"
Subtype="file"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/rcc.html"
DisplayName="Output File"
Description="Write output to file rather than to stdout. (-o &lt;file&gt;)"
Switch="o &quot;[value]&quot;"
/>
<StringListProperty
Name="ExternalInitializationFunction"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/rcc.html"
DisplayName="External Initialization Function"
Description="Create an external initialization function with name. (-name &lt;name&gt;)"
Switch="name &quot;[value]&quot;"
/>
<IntProperty
Name="Threshold"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/rcc.html"
DisplayName="Threshold"
Description="Specifies a threshold level (as a percentage) to use when deciding whether to compress a file. If the reduction in the file size is greater than the threshold level, it is compressed; otherwise, the uncompressed data is stored instead. The default threshold level is 70%, meaning that compressed files which are 30% or less of their original size are stored as compressed data. (-threshold &lt;level&gt;)"
Switch="threshold [value]"
MinValue="0"
MaxValue="100"
/>
<EnumProperty
Name="CompressLevel"
DisplayName="Compress Level"
Description="Compress input files to the given compression level, which is an integer in the range 1 to 9. Level 1 does the least compression but is fastest. Level 9 does the most compression but is slowest. To turn off compression, use -no-compress. The default value for level is -1, which means use zlib's default compression level. (-compress &lt;level&gt;)"
Switch="compress [value]"
>
<EnumValue
Name="-1"
DisplayName="-1 (zlib's default)"
/>
<EnumValue
Name="1"
DisplayName="1 (least)"
/>
<EnumValue
Name="2"
DisplayName="2"
/>
<EnumValue
Name="3"
DisplayName="3"
/>
<EnumValue
Name="4"
DisplayName="4"
/>
<EnumValue
Name="5"
DisplayName="5"
/>
<EnumValue
Name="6"
DisplayName="6"
/>
<EnumValue
Name="7"
DisplayName="7"
/>
<EnumValue
Name="8"
DisplayName="8"
/>
<EnumValue
Name="9"
DisplayName="9 (most)"
/>
</EnumProperty>
<StringListProperty
Name="Root"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/rcc.html"
DisplayName="Root"
Description="Prefix the resource access path with path. The default is no prefix. (-root &lt;path&gt;)"
Switch="root &quot;[value]&quot;"
/>
<BoolProperty
Name="DisableCompression"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/rcc.html"
DisplayName="Disable Compression"
Description="Disable compression. (-no-compress)"
Switch="no-compress"
/>
<BoolProperty
Name="Binary"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/rcc.html"
DisplayName="Binary"
Description="Output a binary file for use as a dynamic resource. (-binary)"
Switch="binary"
/>
<StringProperty
Name="Inputs"
Category="Command Line"
IsRequired="true"
>
<StringProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtRCCCompile"
SourceType="Item"
/>
</StringProperty.DataSource>
</StringProperty>
<StringProperty
Subtype="AdditionalOptions"
Name="AdditionalOptions"
Category="Command Line"
DisplayName="Additional Options"
F1Keyword="vc.project.AdditionalOptionsPage"
/>
<StringProperty
Name="RCC"
Subtype="file"
DisplayName="RCC"
Description="Path to rcc.exe"
IncludeInCommandLine="False"
/>
<StringListProperty
Name="AdditionalDependencies"
Subtype="file"
DisplayName="Additional Dependencies"
Description="Provide additional dependencies that affect the end result. Note: files, listed inside the QRC are determined automatically and should not be added manually."
IncludeInCommandLine="False"
/>
<StringProperty
Name="CommandLineTemplate"
Category="Command Line"
DisplayName="Command Line"
Visible="False"
IncludeInCommandLine="False"
/>
</Rule>
<ItemType Name="QtRCCCompile" DisplayName="Qt RRC Compile" />
<FileExtension Name="*.qrc" ContentType="QtRCCCompile" />
<ContentType Name="QtRCCCompile" DisplayName="Qt RRC Compile" ItemType="QtRCCCompile" />
</ProjectSchemaDefinitions>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<QtUICCompile>
<OutputFile Condition="'%(QtUICCompile.OutputFile)' == ''">%(Filename)%(Extension).h</OutputFile>
<TranslationFunction Condition="'%(QtUICCompile.TranslationFunction)' == ''"></TranslationFunction>
<DontGenerateHeaderGuards Condition="'%(QtUICCompile.DontGenerateHeaderGuards)' == ''">false</DontGenerateHeaderGuards>
<UIC Condition="'%(QtUICCompile.UIC)' == ''">$(QTDIR)\bin\uic.exe</UIC>
<CommandLineTemplate>%(UIC) [AllOptions] [AdditionalOptions] [Inputs]</CommandLineTemplate>
</QtUICCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<BuildGenerateSourcesTargets>$(BuildGenerateSourcesTargets);_QtUICCompile</BuildGenerateSourcesTargets>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
<AvailableItemName Include="QtUICCompile">
<Targets>QtUICCompile</Targets>
</AvailableItemName>
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<UsingTask
TaskName="QtUIC"
TaskFactory="XamlTaskFactory"
AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
</UsingTask>
<Target
Name="SelectQtUICCompile"
DependsOnTargets="_SelectedFiles;SelectCustomBuild"
>
<ItemGroup Condition="'@(SelectedFiles)' != ''">
<QtUICCompile
Remove="@(QtUICCompile)"
Condition="'%(Identity)' != '@(SelectedFiles)'"
/>
</ItemGroup>
</Target>
<Target
Name="QtUICCompile"
Condition="'@(QtUICCompile)' != ''"
DependsOnTargets="SelectQtUICCompile"
Inputs="@(QtUICCompile)"
Outputs="%(OutputFile)"
>
<Message Text="UIC %(QtUICCompile.Identity) -> $([System.IO.Path]::GetFileName('%(QtUICCompile.OutputFile)'))"
Importance="high"/>
<ItemGroup>
<QtUICCompile_tlog
Include="%(QtUICCompile.OutputFile)"
Condition="'%(QtUICCompile.OutputFile)' != '' and '%(QtUICCompile.ExcludedFromBuild)' != 'true'"
>
<Source>@(QtUICCompile, '|')</Source>
</QtUICCompile_tlog>
</ItemGroup>
<WriteLinesToFile
Condition="'@(QtUICCompile_tlog)' != '' and '%(QtUICCompile_tlog.ExcludedFromBuild)' != 'true'"
File="$(IntDir)$(ProjectName).write.1.tlog"
Lines="^%(QtUICCompile_tlog.Source);@(QtUICCompile_tlog-&gt;'%(Fullpath)')"
/>
<MakeDir
Directories="$([System.IO.Path]::GetDirectoryName('%(QtUICCompile.OutputFile)'))"
/>
<QtUIC
Condition="'%(QtUICCompile.ExcludedFromBuild)' != 'true'"
OutputFile="%(QtUICCompile.OutputFile)"
TranslationFunction="%(QtUICCompile.TranslationFunction)"
DontGenerateHeaderGuards="%(QtUICCompile.DontGenerateHeaderGuards)"
Inputs="%(QtUICCompile.Identity)"
AdditionalOptions="%(QtUICCompile.AdditionalOptions)"
CommandLineTemplate="%(QtUICCompile.CommandLineTemplate)"
/>
</Target>
<Target
Name="QtUICCompileAndInclude"
Condition="'@(QtUICCompile)' != ''"
DependsOnTargets="SelectQtUICCompile;QtUICCompile"
>
<ItemGroup>
<ClInclude
Include="%(QtUICCompile.OutputFile)"
Condition="'%(QtUICCompile.ExcludedFromBuild)' != 'true'"
>
<AutoGen>True</AutoGen>
<DependentUpon>%(QtUICCompile.Identity)</DependentUpon>
</ClInclude>
</ItemGroup>
</Target>
<Target
Name="_QtUICCompile"
BeforeTargets="ClCompile"
DependsOnTargets="$(BeforeQtUICCompileTargets);QtUICCompileAndInclude;$(AfterQtUICCompileTargets)"
/>
</Project>

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is (c) 2013 Adam Badura.
Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file.
-->
<ProjectSchemaDefinitions
xmlns="http://schemas.microsoft.com/build/2009/properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
>
<Rule
Name="QtUIC"
DisplayName="Qt User Interface Compiler"
PageTemplate="tool"
SwitchPrefix="-"
Order="221"
>
<Rule.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtUICCompile"
HasConfigurationCondition="true"
/>
</Rule.DataSource>
<Rule.Categories>
<Category
Name="General"
DisplayName="General"
/>
<Category
Name="Command Line"
DisplayName="Command Line"
Subtype="CommandLine"
/>
</Rule.Categories>
<StringProperty
Name="OutputFile"
Subtype="file"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/uic.html"
DisplayName="Output File"
Description="Write output to &lt;file&gt; instead of to standard output. (-o &lt;file&gt;)"
Switch="o &quot;[value]&quot;"
/>
<StringListProperty
Name="TranslationFunction"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/uic.html"
DisplayName="Translation Function"
Description="Use &lt;func&gt; for translating strings instead of tr(). (-tr &lt;func&gt;)"
Switch="tr &quot;[value]&quot;"
/>
<BoolProperty
Name="DontGenerateHeaderGuards"
HelpUrl="http://qt-project.org/doc/qt-5.0/qtdoc/uic.html"
DisplayName="Don't Generate Header Guards"
Description="Don't generate guards against multiple inclusion (#ifndef FOO_H …). (-p)"
Switch="p"
/>
<StringProperty
Name="Inputs"
Category="Command Line"
IsRequired="true"
>
<StringProperty.DataSource>
<DataSource
Persistence="ProjectFile"
ItemType="QtUICCompile"
SourceType="Item"
/>
</StringProperty.DataSource>
</StringProperty>
<StringProperty
Subtype="AdditionalOptions"
Name="AdditionalOptions"
Category="Command Line"
DisplayName="Additional Options"
F1Keyword="vc.project.AdditionalOptionsPage"
/>
<StringProperty
Name="UIC"
Subtype="file"
DisplayName="UIC"
Description="Path to uic.exe"
IncludeInCommandLine="False"
/>
<StringProperty
Name="CommandLineTemplate"
Category="Command Line"
DisplayName="Command Line"
Visible="False"
IncludeInCommandLine="False"
/>
</Rule>
<ItemType Name="QtUICCompile" DisplayName="Qt UIC Compile" />
<FileExtension Name="*.ui" ContentType="QtUICCompile" />
<ContentType Name="QtUICCompile" DisplayName="Qt UIC Compile" ItemType="QtUICCompile" />
</ProjectSchemaDefinitions>

6
MSBuild/custom.props Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Be careful adding properties and items here, they will be defined *before*
most other properties are defined, hence things like $(IntDir) have
wrong values, since they are not yet properly defined -->
</Project>

43
MSBuild/custom.targets Normal file
View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionFile>$(ProjectDir)version.txt</VersionFile>
<NewVersionFile>$(IntDir)version.txt</NewVersionFile>
</PropertyGroup>
<!-- Update the version.txt file, but only if needed, when the version really changes -->
<Target Name="GenerateGitVersionFile" AfterTargets="InitializeBuildStatus">
<WriteLinesToFile
File="$(VersionFile)"
Lines="1.5+git"
Overwrite="true"
Encoding="ASCII"
Condition="!Exists($(VersionFile))" />
<Exec Command="git describe --tags --always --dirty > $(NewVersionFile)"
IgnoreExitCode="True" />
<PropertyGroup>
<GoldenDictVersion>$([System.IO.File]::ReadAllText($(VersionFile)).Trim())</GoldenDictVersion>
<NewGoldenDictVersion>$([System.IO.File]::ReadAllText($(NewVersionFile)).Trim())</NewGoldenDictVersion>
</PropertyGroup>
<Message Text="Version change: $(GoldenDictVersion) ~> $(NewGoldendictVersion)"
Importance="high"
Condition="('$(NewGoldenDictVersion)' != '') And
('$(NewGoldenDictVersion)' != '$(GoldenDictVersion)')" />
<Copy
SourceFiles="$(NewVersionFile)"
DestinationFiles="$(VersionFile)"
Condition="('$(NewGoldenDictVersion)' != '') And
('$(NewGoldenDictVersion)' != '$(GoldenDictVersion)')"
/>
</Target>
<Target Name="CleanVersionFiles" AfterTargets="Clean">
<Delete Files="$(VersionFile);$(NewVersionFile)" />
</Target>
</Project>

View file

@ -18,7 +18,7 @@ This code has been run and tested on Windows XP/Vista/7, Ubuntu Linux, Mac OS X.
sudo apt-get install git pkg-config build-essential qt4-qmake \
libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \
qt4-qmake libqt4-dev libqtwebkit-dev libxtst-dev liblzo2-dev libbz2-dev \
libqt4-dev libqtwebkit-dev libxtst-dev liblzo2-dev libbz2-dev \
libao-dev libavutil-dev libavformat-dev
## How to build

View file

@ -21,9 +21,19 @@ About::About( QWidget * parent ): QDialog( parent )
version = QString::fromLatin1( versionFile.readAll() ).trimmed();
ui.version->setText( version );
#if defined (_MSC_VER)
QString compilerVersion = QString( "Visual C++ %1.%2.%3" )
.arg( GD_CXX_MSVC_MAJOR )
.arg( GD_CXX_MSVC_MINOR )
.arg( GD_CXX_MSVC_BUILD );
#else
QString compilerVersion = QLatin1String( "GCC " ) + QLatin1String( __VERSION__ );
#endif
ui.qtVersion->setText( tr( "Based on Qt %1 (%2, %3 bit)" ).arg(
QLatin1String( qVersion() ),
QLatin1String( "GCC " ) + QLatin1String( __VERSION__ ),
compilerVersion,
QString::number( QSysInfo::WordSize ) ) );
QFile creditsFile( ":/CREDITS.txt" );

View file

@ -4,8 +4,22 @@
#ifndef ABOUT_HH
#define ABOUT_HH
#include <QDialog>
#include "ui_about.h"
#include <QDialog>
// Microsoft Visual C++ version
#if defined (_MSC_VER)
// how many digits does the build number have?
# if _MSC_FULL_VER / 10000 == _MSC_VER
# define GD_CXX_MSVC_BUILD (_MSC_FULL_VER % 10000) // four digits
# elif _MSC_FULL_VER / 100000 == _MSC_VER
# define GD_CXX_MSVC_BUILD (_MSC_FULL_VER % 100000) // five digits
# else
# define GD_CXX_MSVC_BUILD 0
# endif
# define GD_CXX_MSVC_MAJOR (_MSC_VER/100-6)
# define GD_CXX_MSVC_MINOR (_MSC_VER%100)
#endif
class About: public QDialog
{

View file

@ -447,13 +447,7 @@ void ArticleRequest::altSearchFinished()
for( unsigned x = 0; x < altsVector.size(); ++x )
{
DPRINTF( "Alt: %ls\n",
#ifdef Q_OS_WIN
gd::toQString( altsVector[ x ] ).toStdWString().c_str()
#else
altsVector[ x ].c_str()
#endif
);
qDebug() << "Alt:" << gd::toQString( altsVector[ x ] );
}
wstring wordStd = gd::toWString( word );

View file

@ -305,6 +305,11 @@ qint64 ArticleResourceReply::bytesAvailable() const
qint64 ArticleResourceReply::readData( char * out, qint64 maxSize )
{
// From the doc: "This function might be called with a maxSize of 0,
// which can be used to perform post-reading operations".
if ( maxSize == 0 )
return 0;
DPRINTF( "====reading %d bytes\n", (int)maxSize );
bool finished = req->isFinished();

View file

@ -125,7 +125,10 @@ Reader::Reader( File::Class & f, uint32_t offset ): file( f )
{
file.seek( offset );
offsets.resize( file.read< uint32_t >() );
uint32_t size = file.read< uint32_t >();
if ( size == 0 )
return;
offsets.resize( size );
file.read( &offsets.front(), offsets.size() * sizeof( uint32_t ) );
}

View file

@ -103,6 +103,9 @@ long DataRequest::dataSize()
void DataRequest::getDataSlice( size_t offset, size_t size, void * buffer )
throw( exSliceOutOfRange )
{
if ( size == 0 )
return;
Mutex::Lock _( dataMutex );
if ( offset + size > data.size() || !hasAnyData )

View file

@ -460,6 +460,9 @@ dictData *dict_data_open( const char *filename, int computeCRC )
for(;;)
{
#ifdef __WIN32
wchar_t wname[16384];
#endif
if (dict_read_header( filename, h, computeCRC )) {
break; /*
err_fatal( __func__,
@ -467,7 +470,6 @@ dictData *dict_data_open( const char *filename, int computeCRC )
}
#ifdef __WIN32
wchar_t wname[16384];
if( MultiByteToWideChar( CP_UTF8, 0, filename, -1, wname, 16384 ) == 0 )
break;
@ -543,9 +545,8 @@ char *dict_data_read_ (
dictData *h, unsigned long start, unsigned long size,
const char *preFilter, const char *postFilter )
{
(void) preFilter;
(void) postFilter;
char *buffer, *pt;
char * buffer;
char * pt;
unsigned long end;
int count;
char *inBuffer;
@ -554,6 +555,8 @@ char *dict_data_read_ (
int firstOffset, lastOffset;
int i, j;
int found, target, lastStamp;
(void) preFilter;
(void) postFilter;
end = start + size;
@ -670,6 +673,10 @@ char *dict_data_read_ (
count = h->cache[target].count;
inBuffer = h->cache[target].inBuffer;
} else {
#ifdef __WIN32
DWORD pos ;
DWORD readed;
#endif
h->cache[target].chunk = -1;
if (!h->cache[target].inBuffer)
h->cache[target].inBuffer = xmalloc( h->chunkLength );
@ -688,8 +695,8 @@ char *dict_data_read_ (
}
#ifdef __WIN32
DWORD pos = SetFilePointer( h->fd, h->offsets[ i ], 0, FILE_BEGIN );
DWORD readed = 0;
pos = SetFilePointer( h->fd, h->offsets[ i ], 0, FILE_BEGIN );
readed = 0;
if( pos != INVALID_SET_FILE_POINTER || GetLastError() != NO_ERROR )
ReadFile( h->fd, outBuffer, h->chunks[ i ], &readed, 0 );
if( h->chunks[ i ] != readed )

19
dsl.cc
View file

@ -348,7 +348,7 @@ void DslDictionary::doDeferredInit()
chunks = new ChunkedStorage::Reader( idx, idxHeader.chunksOffset );
// Open the .dict file
// Open the .dsl file
dz = dict_data_open( getDictionaryFilenames()[ 0 ].c_str(), 0 );
@ -1609,13 +1609,8 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
// Building the index
initializing.indexingDictionary( Utf8::encode( scanner.getDictionaryName() ) );
DPRINTF( "Dictionary name: %ls\n",
#ifdef Q_OS_WIN
gd::toQString( scanner.getDictionaryName() ).toStdWString().c_str()
#else
scanner.getDictionaryName().c_str()
#endif
);
qDebug() << "Building the index for dictionary:"
<< gd::toQString( scanner.getDictionaryName() );
File::Class idx( indexFile, "wb" );
@ -1797,13 +1792,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
if ( isDslWs( curString[ 0 ] ) )
break; // No more headwords
DPRINTF( "Alt headword: %ls\n",
#ifdef Q_OS_WIN
gd::toQString( curString ).toStdWString().c_str()
#else
curString.c_str()
#endif
);
qDebug() << "Alt headword" << gd::toQString( curString );
processUnsortedParts( curString, true );
expandTildes( curString, allEntryWords.front() );

View file

@ -2,16 +2,15 @@
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#include "dsl_details.hh"
#include "folding.hh"
#include "langcoder.hh"
#include <wctype.h>
#include <stdio.h>
#include "dprintf.hh"
#include "ufile.hh"
#ifdef Q_OS_WIN
#include "wstring_qt.hh"
#endif
#include <stdio.h>
#include <wctype.h>
namespace Dsl {
namespace Details {
@ -545,13 +544,8 @@ void ArticleDom::closeTag( wstring const & name,
else
if ( warn )
{
FDPRINTF( stderr, "Warning: no corresponding opening tag for closing tag \"/%ls\" found.\n",
#ifdef Q_OS_WIN
gd::toQString( name ).toStdWString().c_str()
#else
name.c_str()
#endif
);
qWarning() << "Warning: no corresponding opening tag for closing tag" <<
gd::toQString( name ) << "found.";
}
}
@ -592,7 +586,7 @@ void ArticleDom::nextChar() throw( eot )
DslScanner::DslScanner( string const & fileName ) throw( Ex, Iconv::Ex ):
encoding( Windows1252 ), iconv( encoding ), readBufferPtr( readBuffer ),
readBufferLeft( 0 ), linesRead( 0 )
readBufferLeft( 0 ), wcharBuffer( 64 ), linesRead( 0 )
{
// Since .dz is backwards-compatible with .gz, we use gz- functions to
// read it -- they are much nicer than the dict_data- ones.

View file

@ -171,12 +171,12 @@ void expandOptionalParts( wstring & str, list< wstring > * result,
/// them.
void expandTildes( wstring & str, wstring const & tildeReplacement );
// Unescapes any escaped chars. Be sure to handle all their special meanings
// before unescaping them.
/// Unescapes any escaped chars. Be sure to handle all their special meanings
/// before unescaping them.
void unescapeDsl( wstring & str );
// Normalizes the headword. Currently turns any sequences of consecutive spaces
// into a single space.
/// Normalizes the headword. Currently turns any sequences of consecutive spaces
/// into a single space.
void normalizeHeadword( wstring & );
/// Strip DSL {{...}} comments

View file

@ -9,7 +9,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
#ifdef __WIN32
#include <windows.h>
@ -248,7 +250,7 @@ bool Class::eof() throw( exWriteError )
if ( writeBuffer )
flushWriteBuffer();
return feof( f );
return feof( f ) != 0;
}
FILE * Class::file() throw( exWriteError )

View file

@ -153,13 +153,7 @@ ForvoArticleRequest::ForvoArticleRequest( wstring const & str,
void ForvoArticleRequest::addQuery( QNetworkAccessManager & mgr,
wstring const & str )
{
DPRINTF( "Requesting article %ls\n",
#ifdef Q_OS_WIN
gd::toQString( str ).toStdWString().c_str()
#else
str.c_str()
#endif
);
qDebug() << "Requesting article" << gd::toQString( str );
QString key;

View file

@ -46,7 +46,41 @@ LIBS += \
!isEmpty(DISABLE_INTERNAL_PLAYER): DEFINES += DISABLE_INTERNAL_PLAYER
win32 {
TARGET = GoldenDict
TARGET = GoldenDict
win32-msvc* {
VERSION = 1.5.0 # More complicated things cause errors during compilation under MSVC++
DEFINES += __WIN32 _CRT_SECURE_NO_WARNINGS
contains(QMAKE_TARGET.arch, x86_64) {
DEFINES += NOMINMAX __WIN64
LIBS += -L$${PWD}/winlibs/lib/msvc/x64
} else {
LIBS += -L$${PWD}/winlibs/lib/msvc
}
QMAKE_CXXFLAGS += /wd4290 # silence the warning C4290: C++ exception specification ignored
QMAKE_LFLAGS_RELEASE += /LTCG /OPT:REF /OPT:ICF
# QMAKE_CXXFLAGS_RELEASE += /GL # slows down the linking significantly
LIBS += -lshell32 -luser32 -lsapi -lole32 -lhunspell
HUNSPELL_LIB = hunspell
} else {
LIBS += -L$${PWD}/winlibs/lib
!x64:QMAKE_LFLAGS += -Wl,--large-address-aware
isEmpty(HUNSPELL_LIB) {
greaterThan(QT_MAJOR_VERSION, 4) {
lessThan(QT_MINOR_VERSION, 1) {
LIBS += -lhunspell-1.3-sjlj
} else {
LIBS += -lhunspell-1.3-dw2
}
} else {
LIBS += -lhunspell-1.3.2
}
} else {
LIBS += -l$$HUNSPELL_LIB
}
}
LIBS += -liconv \
-lwsock32 \
-lpsapi \
@ -64,30 +98,15 @@ win32 {
-lavcodec-gd
}
isEmpty(HUNSPELL_LIB) {
greaterThan(QT_MAJOR_VERSION, 4) {
lessThan(QT_MINOR_VERSION, 1) {
LIBS += -lhunspell-1.3-sjlj
} else {
LIBS += -lhunspell-1.3-dw2
}
} else {
LIBS += -lhunspell-1.3.2
}
} else {
LIBS += -l$$HUNSPELL_LIB
}
RC_FILE = goldendict.rc
INCLUDEPATH += winlibs/include
LIBS += -L$${PWD}/winlibs/lib
# Enable console in Debug mode on Windows, with useful logging messages
Debug:CONFIG += console
Release:DEFINES += NO_CONSOLE
!x64:QMAKE_LFLAGS += -Wl,--large-address-aware
gcc48:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
}

View file

@ -1,11 +1,13 @@
#include "winuser.h"
#include "windows.h"
IDI_ICON1 ICON DISCARDABLE "icons/programicon.ico"
IDI_ICON2 ICON DISCARDABLE "icons/programicon_old.ico"
#define GOLDENDICT_VER 1,5,0,0
#define GOLDENDICT_VER_STR "1.5.0"
#ifndef _MSC_VER // Visual Studio embeds the manifest automatically
1 RT_MANIFEST GoldenDict.exe.manifest
#endif
1 VERSIONINFO
FILEVERSION GOLDENDICT_VER

38
goldendict.sln Normal file
View file

@ -0,0 +1,38 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "goldendict", "goldendict.vcxproj", "{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Debug-Qt4|Win32 = Debug-Qt4|Win32
Debug-Qt4|x64 = Debug-Qt4|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release-Qt4|Win32 = Release-Qt4|Win32
Release-Qt4|x64 = Release-Qt4|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug|Win32.ActiveCfg = Debug|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug|Win32.Build.0 = Debug|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug|x64.ActiveCfg = Debug|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug|x64.Build.0 = Debug|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug-Qt4|Win32.ActiveCfg = Debug-Qt4|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug-Qt4|Win32.Build.0 = Debug-Qt4|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug-Qt4|x64.ActiveCfg = Debug-Qt4|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Debug-Qt4|x64.Build.0 = Debug-Qt4|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release|Win32.ActiveCfg = Release|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release|Win32.Build.0 = Release|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release|x64.ActiveCfg = Release|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release|x64.Build.0 = Release|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release-Qt4|Win32.ActiveCfg = Release-Qt4|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release-Qt4|Win32.Build.0 = Release-Qt4|Win32
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release-Qt4|x64.ActiveCfg = Release-Qt4|x64
{C3D65E5B-B7EE-3F85-B73F-6D65D9C501A8}.Release-Qt4|x64.Build.0 = Release-Qt4|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

1368
goldendict.vcxproj Normal file

File diff suppressed because it is too large Load diff

1938
goldendict.vcxproj.filters Normal file

File diff suppressed because it is too large Load diff

View file

@ -499,13 +499,7 @@ QVector< wstring > HunspellHeadwordsRequest::suggest( wstring & word )
if ( Folding::applySimpleCaseOnly( alt ) != lowercasedWord ) // No point in providing same word
{
DPRINTF( ">>>>>Alt: %ls\n",
#ifdef Q_OS_WIN
gd::toQString( alt ).toStdWString().c_str()
#else
alt.c_str()
#endif
);
qDebug() << ">>>>>Alt:" << gd::toQString( alt );
result.append( alt );
}
}

View file

@ -1,8 +1,15 @@
/* This file is (c) 2008-2013 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#include "langcoder.hh"
#include "folding.hh"
#include "wstring_qt.hh"
#include "language.hh"
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <cctype>
#include <QLocale>

View file

@ -51,7 +51,7 @@
<message>
<location filename="../about.cc" line="22"/>
<source>Based on Qt %1 (%2, %3 bit)</source>
<translation type="unfinished"></translation>
<translation>Basado en Qt %1 (%2, %3 bit)</translation>
</message>
</context>
<context>
@ -59,12 +59,12 @@
<message>
<location filename="../article_maker.cc" line="152"/>
<source>Expand article</source>
<translation type="unfinished"></translation>
<translation>Expandir artículo</translation>
</message>
<message>
<location filename="../article_maker.cc" line="158"/>
<source>Collapse article</source>
<translation type="unfinished"></translation>
<translation>Plegar artículo</translation>
</message>
<message>
<location filename="../article_maker.cc" line="180"/>
@ -131,12 +131,12 @@
<message>
<location filename="../article_maker.cc" line="590"/>
<source>Expand article</source>
<translation type="unfinished"></translation>
<translation>Expandir artículo</translation>
</message>
<message>
<location filename="../article_maker.cc" line="598"/>
<source>Collapse article</source>
<translation type="unfinished"></translation>
<translation>Plegar artículo</translation>
</message>
<message>
<location filename="../article_maker.cc" line="615"/>
@ -169,12 +169,12 @@
<message>
<location filename="../articleview.cc" line="150"/>
<source>Copy as text</source>
<translation type="unfinished"></translation>
<translation>Copiar como texto</translation>
</message>
<message>
<location filename="../articleview.cc" line="156"/>
<source>Inspect</source>
<translation type="unfinished"></translation>
<translation>Inspeccionar</translation>
</message>
<message>
<location filename="../articleview.cc" line="673"/>
@ -199,12 +199,12 @@
<message>
<location filename="../articleview.cc" line="695"/>
<source>Video</source>
<translation type="unfinished"></translation>
<translation>Video</translation>
</message>
<message>
<location filename="../articleview.cc" line="704"/>
<source>Video: %1</source>
<translation type="unfinished"></translation>
<translation>Video: %1</translation>
</message>
<message>
<location filename="../articleview.cc" line="721"/>
@ -278,7 +278,7 @@
<message>
<location filename="../articleview.cc" line="1585"/>
<source>WARNING: FFmpeg Audio Player: %1</source>
<translation type="unfinished"></translation>
<translation>ATENCIÓN: Reproductor de audio FFmpeg: %1</translation>
</message>
<message>
<source>Save &amp;image</source>
@ -338,7 +338,7 @@
<message>
<location filename="../articleview.cc" line="1526"/>
<source>Failed to run a player to play sound file: %1</source>
<translation>No fue posible ejecutar un programa reproductor de audios: %1</translation>
<translation>No fue posible ejecutar un programa reproductor de audio: %1</translation>
</message>
<message>
<location filename="../articleview.cc" line="1544"/>
@ -560,12 +560,12 @@ between classic and school orthography in cyrillic)</source>
<message>
<location filename="../dictinfo.ui" line="91"/>
<source>Open folder</source>
<translation type="unfinished"></translation>
<translation>Abrir carpeta</translation>
</message>
<message>
<location filename="../dictinfo.ui" line="110"/>
<source>Edit dictionary</source>
<translation type="unfinished">Editar diccionario</translation>
<translation>Editar diccionario</translation>
</message>
<message>
<location filename="../dictinfo.ui" line="120"/>
@ -581,7 +581,8 @@ between classic and school orthography in cyrillic)</source>
<location filename="../dictinfo.cc" line="29"/>
<source>Edit the dictionary via command:
%1</source>
<translation type="unfinished"></translation>
<translation>Editar el diccionario vía comando:
%1</translation>
</message>
</context>
<context>
@ -606,7 +607,7 @@ between classic and school orthography in cyrillic)</source>
<message>
<location filename="../dictionarybar.cc" line="25"/>
<source>Extended menu with all dictionaries...</source>
<translation type="unfinished"></translation>
<translation>Menú extendido con todos los diccionarios...</translation>
</message>
<message>
<location filename="../dictionarybar.cc" line="112"/>
@ -621,7 +622,7 @@ between classic and school orthography in cyrillic)</source>
<message>
<location filename="../dictionarybar.cc" line="139"/>
<source>Open dictionary folder</source>
<translation type="unfinished"></translation>
<translation>Abrir carpeta del diccionario</translation>
</message>
<message>
<location filename="../dictionarybar.cc" line="146"/>
@ -787,7 +788,7 @@ between classic and school orthography in cyrillic)</source>
<message>
<location filename="../groups.cc" line="147"/>
<source>Are you sure you want to remove the group &lt;b&gt;%1&lt;/b&gt;?</source>
<translation>¿Esta seguro que desea eliminar el grupo &lt;b&gt;%1&lt;/b&gt;?</translation>
<translation>¿Está seguro que desea eliminar el grupo &lt;b&gt;%1&lt;/b&gt;?</translation>
</message>
<message>
<location filename="../groups.ui" line="186"/>
@ -798,7 +799,7 @@ between classic and school orthography in cyrillic)</source>
<message>
<location filename="../groups.cc" line="160"/>
<source>Are you sure you want to remove all the groups?</source>
<translation>¿Esta seguro que desea eliminar todos los grupos?</translation>
<translation>¿Está seguro que desea eliminar todos los grupos?</translation>
</message>
<message>
<source>Groups</source>
@ -2740,7 +2741,7 @@ Reordene los grupos usando el mouse sobre las pestañas con los nombres de los m
<message>
<location filename="../main.cc" line="150"/>
<source>Error in configuration file. Continue with default settings?</source>
<translation type="unfinished"></translation>
<translation>Error en archivo de configuración. ¿Desea continuar con los valores por defecto?</translation>
</message>
</context>
<context>
@ -2811,12 +2812,12 @@ Reordene los grupos usando el mouse sobre las pestañas con los nombres de los m
<message>
<location filename="../mainwindow.cc" line="2970"/>
<source>Article, Complete (*.html)</source>
<translation type="unfinished"></translation>
<translation>Artículo, Completo (*.html)</translation>
</message>
<message>
<location filename="../mainwindow.cc" line="2971"/>
<source>Article, HTML Only (*.html)</source>
<translation type="unfinished"></translation>
<translation>Artículo, sólo HTML (*.html)</translation>
</message>
<message>
<location filename="../mainwindow.cc" line="2974"/>
@ -2974,7 +2975,7 @@ Reordene los grupos usando el mouse sobre las pestañas con los nombres de los m
<message>
<location filename="../mainwindow.cc" line="3026"/>
<source>Saving article...</source>
<translation type="unfinished"></translation>
<translation>Guardando artículo...</translation>
</message>
<message>
<location filename="../mainwindow.cc" line="3075"/>
@ -3013,7 +3014,7 @@ Reordene los grupos usando el mouse sobre las pestañas con los nombres de los m
<message>
<location filename="../mainwindow.cc" line="3569"/>
<source>Open dictionary folder</source>
<translation type="unfinished"></translation>
<translation>Abrir carpeta del diccionario</translation>
</message>
<message>
<location filename="../mainwindow.cc" line="3575"/>
@ -3368,12 +3369,12 @@ Reordene los grupos usando el mouse sobre las pestañas con los nombres de los m
<message>
<location filename="../mdx.cc" line="552"/>
<source>Dictionary file was tampered or corrupted</source>
<translation type="unfinished"></translation>
<translation>El archivo del diccionario ha sido manipulado o corrompido</translation>
</message>
<message>
<location filename="../mdx.cc" line="563"/>
<source>Failed loading article from %1, reason: %2</source>
<translation type="unfinished"></translation>
<translation>Error al cargar artículo de %1, motivo: %2</translation>
</message>
</context>
<context>
@ -3662,12 +3663,12 @@ Sin embargo, si esta opción se activa se cerrará la ventana principal.</transl
<message>
<location filename="../preferences.ui" line="311"/>
<source>Adjust this value to avoid huge context menus.</source>
<translation type="unfinished"></translation>
<translation>Ajuste este valor para evitar menús contextuales enormes.</translation>
</message>
<message>
<location filename="../preferences.ui" line="314"/>
<source>Context menu dictionaries limit:</source>
<translation type="unfinished"></translation>
<translation>Límite de diccionarios en menú contextual:</translation>
</message>
<message>
<location filename="../preferences.ui" line="394"/>
@ -3921,32 +3922,32 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../preferences.ui" line="858"/>
<source>Play audio files via FFmpeg(libav) and libao</source>
<translation type="unfinished"></translation>
<translation>Reproducir archivos de audio vía FFmpeg(libav) y libao</translation>
</message>
<message>
<location filename="../preferences.ui" line="861"/>
<source>Use internal player</source>
<translation type="unfinished"></translation>
<translation>Utilizar reproductor de audio interno</translation>
</message>
<message>
<location filename="../preferences.ui" line="1294"/>
<source>Select this option to automatic collapse big articles</source>
<translation type="unfinished"></translation>
<translation>Seleccionar esta opción para automáticamente plegar artículos grandes</translation>
</message>
<message>
<location filename="../preferences.ui" line="1297"/>
<source>Collapse articles more than</source>
<translation type="unfinished"></translation>
<translation>Plegar artículos con más de</translation>
</message>
<message>
<location filename="../preferences.ui" line="1304"/>
<source>Articles longer than this size will be collapsed</source>
<translation type="unfinished"></translation>
<translation>Los artículos que superen este tamaño aparecerán automáticamente plegados</translation>
</message>
<message>
<location filename="../preferences.ui" line="1320"/>
<source>symbols</source>
<translation type="unfinished"></translation>
<translation>símbolos</translation>
</message>
<message>
<source>Use Windows native playback API. Limited to .wav files only,
@ -3990,12 +3991,12 @@ you must place bass.dll (http://www.un4seen.com) into GoldenDict folder.</source
<location filename="../preferences.ui" line="1057"/>
<source>Some sites detect GoldenDict via HTTP headers and block the requests.
Enable this option to workaround the problem.</source>
<translation type="unfinished"></translation>
<translation>Algunos sitios web detectan GoldenDict vía encabezados HTTP y de esta manera lo bloquean. Active esta opción para eludir este problema.</translation>
</message>
<message>
<location filename="../preferences.ui" line="1061"/>
<source>Do not identify GoldenDict in HTTP headers</source>
<translation type="unfinished"></translation>
<translation>No identificar GoldenDict en encabezados HTTP</translation>
</message>
<message>
<location filename="../preferences.ui" line="1112"/>
@ -4333,97 +4334,97 @@ página web de descarga utilizando el navegador de internet.</translation>
<message>
<location filename="../aard.cc" line="393"/>
<source>Article loading error</source>
<translation type="unfinished"></translation>
<translation>Error al cargar artículo</translation>
</message>
<message>
<location filename="../aard.cc" line="475"/>
<source>Article decoding error</source>
<translation type="unfinished"></translation>
<translation>Error al decodificar artículo</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="134"/>
<source>avformat_alloc_context() failed.</source>
<translation type="unfinished"></translation>
<translation>Fallo en avformat_alloc_context().</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="141"/>
<source>av_malloc() failed.</source>
<translation type="unfinished"></translation>
<translation>Fallo en av_malloc().</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="150"/>
<source>avio_alloc_context() failed.</source>
<translation type="unfinished"></translation>
<translation>Fallo en avio_alloc_context().</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="167"/>
<source>avformat_open_input() failed: %1.</source>
<translation type="unfinished"></translation>
<translation>Fallo en avformat_open_input(): %1.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="174"/>
<source>avformat_find_stream_info() failed: %1.</source>
<translation type="unfinished"></translation>
<translation>Fallo en avformat_find_stream_info(): %1.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="189"/>
<source>Could not find audio stream.</source>
<translation type="unfinished"></translation>
<translation>No pudo encontrarse un stream de audio.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="197"/>
<source>Codec [id: %1] not found.</source>
<translation type="unfinished"></translation>
<translation>Códec [id: %1] no encontrado.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="204"/>
<source>avcodec_open2() failed: %1.</source>
<translation type="unfinished"></translation>
<translation>Fallo en avcodec_open2(): %1.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="265"/>
<source>Cannot find usable audio output device.</source>
<translation type="unfinished"></translation>
<translation>No se encuentra disponible un dispositivo de salida de audio.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="278"/>
<source>Unsupported sample format.</source>
<translation type="unfinished"></translation>
<translation>Formato de muestreo no soportado.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="288"/>
<source>ao_open_live() failed: </source>
<translation type="unfinished"></translation>
<translation>Fallo en ao_open_live(): </translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="293"/>
<source>No driver.</source>
<translation type="unfinished"></translation>
<translation>No existe controlador de dispositivo disponible.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="296"/>
<source>This driver is not a live output device.</source>
<translation type="unfinished"></translation>
<translation>Este controlador no es un dispositivo de salida activo.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="299"/>
<source>A valid option key has an invalid value.</source>
<translation type="unfinished"></translation>
<translation>Una opción de clave válida contiene un valor inválido.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="302"/>
<source>Cannot open the device: %1, channels: %2, rate: %3, bits: %4.</source>
<translation type="unfinished"></translation>
<translation>No se puede abrir el dispositivo: %1, channels: %2, rate: %3, bits: %4.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="309"/>
<source>Unknown error.</source>
<translation type="unfinished"></translation>
<translation>Error desconocido.</translation>
</message>
<message>
<location filename="../ffmpegaudio.cc" line="334"/>
<source>avcodec_alloc_frame() failed.</source>
<translation type="unfinished"></translation>
<translation>Fallo en avcodec_alloc_frame().</translation>
</message>
</context>
<context>
@ -4450,17 +4451,17 @@ página web de descarga utilizando el navegador de internet.</translation>
<location filename="../articleview.cc" line="2166"/>
<location filename="../articleview.cc" line="2173"/>
<source>ERROR: %1</source>
<translation type="unfinished">ERROR: %1</translation>
<translation>ERROR: %1</translation>
</message>
<message>
<location filename="../articleview.cc" line="2166"/>
<source>Resource saving error: </source>
<translation type="unfinished">Error al guardar recurso: </translation>
<translation>Error al guardar recurso: </translation>
</message>
<message>
<location filename="../articleview.cc" line="2173"/>
<source>The referenced resource failed to download.</source>
<translation type="unfinished">No fue posible descargar el recurso referenciado.</translation>
<translation>No fue posible descargar el recurso referenciado.</translation>
</message>
</context>
<context>
@ -4812,7 +4813,7 @@ respectivamente, %GDBIG5% para Big-5, %GDBIG5HKSCS% para Big5-HKSCS, %GDGBK% par
<message>
<location filename="../sources.ui" line="353"/>
<source>Any external programs. A string %GDWORD% will be replaced with the query word. If such string is not presented, the word will be fed into standard input.</source>
<translation type="unfinished"></translation>
<translation>Ingrese todos los programas externos que quiera. La ocurrencia %GDWORD% se reemplazará por el término de búsqueda especificado. Si la ocurrencia no esta presente, el término será enviado a la entrada estándar.</translation>
</message>
<message>
<location filename="../sources.ui" line="506"/>

View file

@ -1,9 +0,0 @@
#!/bin/sh
#
# Run this script for properly play of the sounds under Mac OS X
#
if test -f "/usr/local/lib/ao/plugins-4/libmacosx.so"; then :
else
mkdir -p /usr/local/lib/ao/plugins-4
cp lib/libmacosx.so /usr/local/lib/ao/plugins-4/
fi

BIN
maclibs/lib/ao/libmacosx.so Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,42 @@
#!/bin/bash
# $1 - GoldenDict source directory
if [ ${OSTYPE:0:6} != "darwin" ]; then
echo "OSX Only"
exit 1
fi
if [[ -n "$1" && ! -d "$1" ]]; then
echo "Invalid GoldenDict source directory"
exit 1
fi
./configure \
CFLAGS="-arch i386 -arch x86_64 -DCUSTOM_AO_PLUGIN_PATH=\\\"@executable_path/../Frameworks/ao\\\"" \
LDFLAGS="-arch i386 -arch x86_64" \
--disable-dependency-tracking
make clean && make
install_name_tool \
-id @executable_path/../Frameworks/libao.dylib \
src/.libs/libao.dylib
for PLUGIN_DIR in `find src/plugins -type d -maxdepth 1`; do
PLUGIN_NAME=$(basename "$PLUGIN_DIR")
PLUGIN_PATH=$PLUGIN_DIR/.libs/lib$PLUGIN_NAME.so
if [ -f "$PLUGIN_PATH" ]; then
install_name_tool \
-id @executable_path/../Frameworks/ao/$PLUGIN_NAME.so \
$PLUGIN_PATH
fi
done
if [ -n "$1" ]; then
cp src/.libs/libao.dylib $1/maclibs/lib
# Copy plugins
mkdir -p $1/maclibs/lib/ao
find src/plugins -type f -maxdepth 3 -name "*.so" -exec cp {} $1/maclibs/lib/ao \;
fi

View file

@ -0,0 +1,9 @@
Patched libao source for OSX can be found here:
https://github.com/timonwong/libao/tree/goldendict
You can checkout the source directly using git:
git clone -b goldendict https://github.com/timonwong/libao.git
Then, copy libao-build.sh (along with this file) to libao source directory, and build using following commands:
chmod +x libao-build.sh
./libao-build.sh [goldendict source directory]

View file

@ -255,13 +255,7 @@ MediaWikiArticleRequest::MediaWikiArticleRequest( wstring const & str,
void MediaWikiArticleRequest::addQuery( QNetworkAccessManager & mgr,
wstring const & str )
{
DPRINTF( "Requesting article %ls\n",
#ifdef Q_OS_WIN
gd::toQString( str ).toStdWString().c_str()
#else
str.c_str()
#endif
);
qDebug() << "Requesting article" << gd::toQString( str );
QUrl reqUrl( url + "/api.php?action=parse&prop=text|revid&format=xml&redirects" );
@ -368,8 +362,6 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r )
QByteArray articleBody = articleString.toUtf8();
DPRINTF( "Article body after: %s\n", articleBody.data() );
articleBody.prepend( dictPtr->isToLanguageRTL() ? "<div class=\"mwiki\" dir=\"rtl\">" :
"<div class=\"mwiki\">" );
articleBody.append( "</div>" );

View file

@ -25,16 +25,16 @@ MouseOver & MouseOver::instance()
#ifdef Q_OS_WIN32
const UINT WM_MY_SHOW_TRANSLATION = WM_USER + 301;
static wchar_t className[] = L"GoldenDictMouseover";
typedef BOOL WINAPI ( *ChangeWindowMessageFilterFunc )( UINT, DWORD );
typedef BOOL ( WINAPI *ChangeWindowMessageFilterFunc )( UINT, DWORD );
#ifndef CHANGEFILTERSTRUCT
#ifndef WINAPI_FAMILY
typedef struct tagCHANGEFILTERSTRUCT {
DWORD cbSize;
DWORD ExtStatus;
} CHANGEFILTERSTRUCT, *PCHANGEFILTERSTRUCT;
#endif
typedef BOOL WINAPI ( *ChangeWindowMessageFilterExFunc )( HWND, UINT, DWORD, PCHANGEFILTERSTRUCT );
typedef BOOL ( WINAPI *ChangeWindowMessageFilterExFunc )( HWND, UINT, DWORD, PCHANGEFILTERSTRUCT );
#endif // Q_OS_WIN32

View file

@ -4,7 +4,11 @@
#include "termination.hh"
#include <exception>
#include <typeinfo>
#ifndef _MSC_VER
#include <cxxabi.h>
#endif
#include <string>
#ifndef __WIN32
@ -28,13 +32,24 @@ static void termHandler()
char * function = 0;
size_t functionLength = 0;
#ifdef _MSC_VER
std::type_info * ti = 0;
#else
std::type_info * ti = __cxxabiv1::__cxa_current_exception_type();
#endif
if ( ti )
{
char const * name = ti->name();
#ifdef _MSC_VER
char * ret = 0;
// avoid 'unused' warnings
(void) status;
(void) functionLength;
#else
char * ret = abi::__cxa_demangle( name, function, &functionLength, &status );
#endif
if ( ret )
{

View file

@ -1,6 +1,7 @@
#ifdef __WIN32
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <windows.h>

View file

@ -5,6 +5,11 @@
#include "zlib.h"
// eliminate some VC++ warnings
#ifdef _MSC_VER
#define fileno _fileno
#endif
#ifdef __cplusplus
extern "C"
{

View file

@ -141,6 +141,10 @@ string encode( wstring const & in ) throw()
wstring decode( string const & in ) throw( exCantDecode )
{
if ( in.size() == 0 )
return wstring();
std::vector< wchar > buffer( in.size() );
long result = decode( in.data(), in.size(), &buffer.front() );

1
winlibs/lib/msvc Submodule

@ -0,0 +1 @@
Subproject commit 36a7611087f93eae4f645bbae6b8a71b3c8c986f

View file

@ -1,6 +1,5 @@
#include <windows.h>
#include <servprov.h>
#include <winable.h>
#include "wordbyauto.hh"
#include "uiauto.hh"
@ -12,7 +11,7 @@ public:
GDAutomationClient();
~GDAutomationClient();
bool getWordAtPoint( POINT pt );
WCHAR *getText() { return buffer; };
WCHAR *getText() { return buffer; }
private:
WCHAR buffer[256];
IUIAutomation *pGDAutomation;

10
xdxf.cc
View file

@ -25,6 +25,10 @@
#include "indexedzip.hh"
#include "filetype.hh"
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <QIODevice>
#include <QXmlStreamReader>
#include <QTextDocument>
@ -96,7 +100,11 @@ struct IdxHeader
// resource index.
uint32_t zipIndexRootOffset;
uint32_t revisionNumber; // Format revision
} __attribute__((packed));
}
#ifndef _MSC_VER
__attribute__((packed))
#endif
;
bool indexIsOldOrBad( string const & indexFile )
{

View file

@ -16,7 +16,11 @@ struct EndOfCdirRecord
quint16 numDisk, numDiskCd, totalEntriesDisk, totalEntries;
quint32 size, offset;
quint16 commentLength;
} __attribute__((packed));
}
#ifndef _MSC_VER
__attribute__((packed))
#endif
;
struct CentralFileHeaderRecord
{
@ -26,7 +30,11 @@ struct CentralFileHeaderRecord
quint16 fileNameLength, extraFieldLength, fileCommentLength, diskNumberStart,
intFileAttrs;
quint32 externalFileAttrs, offsetOfLocalHeader;
} __attribute__((packed));
}
#ifndef _MSC_VER
__attribute__((packed))
#endif
;
struct LocalFileHeaderRecord
{
@ -34,7 +42,11 @@ struct LocalFileHeaderRecord
quint16 verNeeded, gpBits, compressionMethod, fileTime, fileDate;
quint32 crc32, compressedSize, uncompressedSize;
quint16 fileNameLength, extraFieldLength;
} __attribute__((packed));
}
#ifndef _MSC_VER
__attribute__((packed))
#endif
;
#pragma pack( pop )