Skip to content

Windows: text input #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jan 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
db6c434
Move linux headers to shared
clarkezone Nov 28, 2018
45caf82
Update gitignore
clarkezone Nov 28, 2018
7955864
Fix adding plugin
clarkezone Nov 28, 2018
ea67a73
WIP
clarkezone Nov 28, 2018
76ff507
WIP
clarkezone Nov 28, 2018
a20bdc6
WIP
clarkezone Nov 28, 2018
de5263c
WIP
clarkezone Nov 28, 2018
86abb4c
Fix up things
clarkezone Nov 30, 2018
acdec7c
Update projects
clarkezone Dec 4, 2018
df268c1
Merge branch 'upstreammaster' into wininputactual
clarkezone Dec 4, 2018
24689ff
Fixup linux paths
clarkezone Dec 4, 2018
6a15943
add script to fetch the json library
clarkezone Dec 4, 2018
caadc2e
PR Feedback part 1: reorder headers, removing using, move git ignore,…
clarkezone Dec 9, 2018
166fedc
PR feedback part 2: shared->common, add some comments to some embedde…
clarkezone Dec 10, 2018
0f65d0d
Move include up a level, and update include guards
stuartmorgan-g Dec 11, 2018
e0edde0
Fix Linux Make build
stuartmorgan-g Dec 11, 2018
f30d7cc
Fix GN build
stuartmorgan-g Dec 11, 2018
55d3c81
Merge 'master' into WindowsTextInputPR
stuartmorgan-g Dec 11, 2018
078f752
Merge branch 'master' into WindowsTextInputPR
stuartmorgan-g Dec 21, 2018
43366bf
Merge remote-tracking branch 'parent/master' into WindowsTextInputPR
clarkezone Dec 27, 2018
0ae2927
More code review feedback
clarkezone Dec 27, 2018
d5583a7
Restore echo off to build_jsonlib.bat
clarkezone Dec 29, 2018
d299a82
Code review feedback
clarkezone Dec 31, 2018
02446e9
Revert newline change
stuartmorgan-g Jan 1, 2019
edf602e
clang-format
stuartmorgan-g Jan 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ speed up the debugging process.
request, or [write a plugin](plugins/README.md#writing-your-own-plugins)!
* The Linux and Windows implementations currently use GLFW. This is not going
to be the final implementation for either platform.
* Plugins and text input do not yet work on Windows.
6 changes: 3 additions & 3 deletions example/windows/GLFW Example.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Dynamic Library|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(ProjectDir)..\..\library\windows\dependencies\GLFW\;$(ProjectDir)..\..\library\windows\;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)..\..\library\windows\dependencies\;$(ProjectDir)..\..\;$(IncludePath);$(ProjectDir)..\..\library\windows\</IncludePath>
<LibraryPath>$(ProjectDir)..\..\library\windows\dependencies\GLFW\;$(SolutionDir)bin\$(Platform)\$(Configuration)\GLFW Library\;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static Library|x64'">
Expand All @@ -84,7 +84,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Dynamic Library|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<IncludePath>$(ProjectDir)..\..\library\windows\dependencies\GLFW\;$(ProjectDir)..\..\library\windows\;$(IncludePath)</IncludePath>
<IncludePath>$(ProjectDir)..\..\library\windows\dependencies\;$(ProjectDir)..\..\;$(IncludePath);$(ProjectDir)..\..\library\windows\</IncludePath>
<LibraryPath>$(ProjectDir)..\..\library\windows\dependencies\GLFW\;$(SolutionDir)bin\$(Platform)\$(Configuration)\GLFW Library\;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static Library|x64'">
Expand Down Expand Up @@ -227,4 +227,4 @@
<PropertyGroup>
<LocalDebuggerWorkingDirectory>$(SolutionDir)</LocalDebuggerWorkingDirectory>
</PropertyGroup>
</Project>
</Project>
12 changes: 6 additions & 6 deletions example/windows/flutter_embedder_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#include <iostream>
#include <vector>

#include <embedder.h>
#include "embedder.h"

int main(int argc, char **argv) {
if (!FlutterInit()) {
if (!flutter_desktop_embedding::FlutterInit()) {
std::cout << "Couldn't init GLFW" << std::endl;
}
// Arguments for the Flutter Engine.
Expand All @@ -31,15 +31,15 @@ int main(int argc, char **argv) {
#endif
// Start the engine.
// TODO: Make paths relative to the executable so it can be run from anywhere.
auto window = CreateFlutterWindowInSnapshotMode(
auto window = flutter_desktop_embedding::CreateFlutterWindowInSnapshotMode(
640, 480, "..\\..\\example\\flutter_app\\build\\flutter_assets",
"..\\..\\library\\windows\\dependencies\\engine\\icudtl.dat", arguments);
if (window == nullptr) {
FlutterTerminate();
flutter_desktop_embedding::FlutterTerminate();
return EXIT_FAILURE;
}

FlutterWindowLoop(window);
FlutterTerminate();
flutter_desktop_embedding::FlutterWindowLoop(window);
flutter_desktop_embedding::FlutterTerminate();
return EXIT_SUCCESS;
}
4 changes: 4 additions & 0 deletions library/windows/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore third party code fetched as part of build process of the Flutter embedding library
third_party

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down Expand Up @@ -327,3 +330,4 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/

35 changes: 26 additions & 9 deletions library/windows/GLFW Library.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@
<IntDir>$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<TargetName>flutter_embedder</TargetName>
<TargetExt>.dll</TargetExt>
<IncludePath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies\GLFW\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies\GLFW\;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies;$(ProjectDir)third_party\jsoncpp\include;$(ProjectDir)..\..\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies\json\x64\debug;$(ProjectDir)dependencies\GLFW\;$(LibraryPath)</LibraryPath>
<SourcePath>$(ProjectDir)..\..\library\common\internal;$(SourcePath)</SourcePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static Library|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
Expand All @@ -91,8 +92,9 @@
<IntDir>$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<TargetName>flutter_embedder</TargetName>
<TargetExt>.dll</TargetExt>
<IncludePath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies\GLFW\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies\GLFW\;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies;$(ProjectDir)third_party\jsoncpp\include;$(ProjectDir)..\..\;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)dependencies\engine\;$(ProjectDir)dependencies\json\x64\release;;$(ProjectDir)dependencies\GLFW\;$(LibraryPath)</LibraryPath>
<SourcePath>$(ProjectDir)..\..\library\common\internal;$(SourcePath)</SourcePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static Library|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
Expand All @@ -108,9 +110,10 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>flutter_engine.dll.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>flutter_engine.dll.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies);json_vc71_libmtd.lib</AdditionalDependencies>
</Link>
<Link>
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
Expand All @@ -123,7 +126,7 @@
</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>$(ProjectDir)scripts\update_flutter_engine &amp;&amp; $(ProjectDir)scripts\get_engine_artifacts &amp;&amp; $(ProjectDir)scripts\get_GLFW</Command>
<Command>$(ProjectDir)scripts\update_flutter_engine &amp;&amp; $(ProjectDir)scripts\get_engine_artifacts &amp;&amp; $(ProjectDir)scripts\get_GLFW &amp;&amp; $(ProjectDir)scripts\build_jsonlib</Command>
<Message>Get the flutter engine, engine artifacts and GLFW</Message>
</PreBuildEvent>
<ProjectReference>
Expand Down Expand Up @@ -186,11 +189,12 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>flutter_engine.dll.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>flutter_engine.dll.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies);json_vc71_libmt.lib</AdditionalDependencies>
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
Expand All @@ -201,7 +205,7 @@
</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>$(ProjectDir)scripts\update_flutter_engine &amp;&amp; $(ProjectDir)scripts\get_engine_artifacts &amp;&amp; $(ProjectDir)scripts\get_GLFW</Command>
<Command>$(ProjectDir)scripts\update_flutter_engine &amp;&amp; $(ProjectDir)scripts\get_engine_artifacts &amp;&amp; $(ProjectDir)scripts\get_GLFW &amp;&amp; $(ProjectDir)scripts\build_jsonlib</Command>
<Message>Get the flutter engine, engine artifacts and GLFW</Message>
</PreBuildEvent>
<ProjectReference>
Expand Down Expand Up @@ -259,6 +263,19 @@
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\common\glfw\text_input_plugin.cc" />
<ClCompile Include="..\common\internal\engine_method_result.cc" />
<ClCompile Include="..\common\internal\json_message_codec.cc" />
<ClCompile Include="..\common\internal\plugin_handler.cc" />
<ClCompile Include="..\common\internal\text_input_model.cc" />
<ClCompile Include="..\common\json_method_call.cc" />
<ClCompile Include="..\common\json_method_codec.cc" />
<ClCompile Include="..\common\json_plugin.cc" />
<ClCompile Include="..\common\method_call.cc" />
<ClCompile Include="..\common\method_channel.cc" />
<ClCompile Include="..\common\method_codec.cc" />
<ClCompile Include="..\common\method_result.cc" />
<ClCompile Include="..\common\plugin.cc" />
<ClCompile Include="embedder.cpp" />
</ItemGroup>
<ItemGroup>
Expand All @@ -270,4 +287,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
67 changes: 35 additions & 32 deletions library/windows/GLFW Library.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
<?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;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="embedder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="embedder.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="exports.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>
<?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;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="embedder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\common\internal\plugin_handler.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="embedder.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="exports.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions library/windows/dependencies/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ flutter_engine.*
.last_engine_version
icudtl.dat
glfw3.*
json
Empty file.
Loading