Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
fa12f443
Unverified
Commit
fa12f443
authored
Sep 15, 2020
by
stuartmorgan
Committed by
GitHub
Sep 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Windows app template (#65696)
parent
9dd67386
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
53 deletions
+19
-53
CMakeLists.txt
...er_tools/templates/app/windows.tmpl/runner/CMakeLists.txt
+1
-1
flutter_window.h
..._tools/templates/app/windows.tmpl/runner/flutter_window.h
+3
-3
main.cpp.tmpl
...ter_tools/templates/app/windows.tmpl/runner/main.cpp.tmpl
+3
-4
run_loop.cpp
...tter_tools/templates/app/windows.tmpl/runner/run_loop.cpp
+1
-4
run_loop.h
...lutter_tools/templates/app/windows.tmpl/runner/run_loop.h
+3
-3
utils.h
...s/flutter_tools/templates/app/windows.tmpl/runner/utils.h
+3
-3
win32_window.h
...er_tools/templates/app/windows.tmpl/runner/win32_window.h
+4
-5
window_configuration.cpp.tmpl
...tes/app/windows.tmpl/runner/window_configuration.cpp.tmpl
+0
-7
window_configuration.h
.../templates/app/windows.tmpl/runner/window_configuration.h
+0
-18
template_manifest.json
packages/flutter_tools/templates/template_manifest.json
+1
-5
No files found.
packages/flutter_tools/templates/app/windows.tmpl/runner/CMakeLists.txt
View file @
fa12f443
...
...
@@ -7,12 +7,12 @@ add_executable(${BINARY_NAME} WIN32
"run_loop.cpp"
"utils.cpp"
"win32_window.cpp"
"window_configuration.cpp"
"
${
FLUTTER_MANAGED_DIR
}
/generated_plugin_registrant.cc"
"Runner.rc"
"runner.exe.manifest"
)
apply_standard_settings
(
${
BINARY_NAME
}
)
target_compile_definitions
(
${
BINARY_NAME
}
PRIVATE
"NOMINMAX"
)
target_link_libraries
(
${
BINARY_NAME
}
PRIVATE flutter flutter_wrapper_app
)
target_include_directories
(
${
BINARY_NAME
}
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
"
)
add_dependencies
(
${
BINARY_NAME
}
flutter_assemble
)
packages/flutter_tools/templates/app/windows.tmpl/runner/flutter_window.h
View file @
fa12f443
#ifndef FLUTTER_WINDOW_H_
#define FLUTTER_WINDOW_H_
#ifndef
RUNNER_
FLUTTER_WINDOW_H_
#define
RUNNER_
FLUTTER_WINDOW_H_
#include <flutter/dart_project.h>
#include <flutter/flutter_view_controller.h>
...
...
@@ -36,4 +36,4 @@ class FlutterWindow : public Win32Window {
std
::
unique_ptr
<
flutter
::
FlutterViewController
>
flutter_controller_
;
};
#endif // FLUTTER_WINDOW_H_
#endif //
RUNNER_
FLUTTER_WINDOW_H_
packages/flutter_tools/templates/app/windows.tmpl/runner/main.cpp
→
packages/flutter_tools/templates/app/windows.tmpl/runner/main.cpp
.tmpl
View file @
fa12f443
...
...
@@ -5,7 +5,6 @@
#include "flutter_window.h"
#include "run_loop.h"
#include "utils.h"
#include "window_configuration.h"
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
...
...
@@ -23,9 +22,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
flutter::DartProject project(L"data");
FlutterWindow window(&run_loop, project);
Win32Window
::
Point
origin
(
kFlutterWindowOriginX
,
kFlutterWindowOriginY
);
Win32Window
::
Size
size
(
kFlutterWindowWidth
,
kFlutterWindowHeight
);
if
(
!
window
.
CreateAndShow
(
kFlutterWindowTitle
,
origin
,
size
))
{
Win32Window::Point origin(
10, 10
);
Win32Window::Size size(
1280, 720
);
if (!window.CreateAndShow(
L"{{projectName}}"
, origin, size)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);
...
...
packages/flutter_tools/templates/app/windows.tmpl/runner/run_loop.cpp
View file @
fa12f443
#include "run_loop.h"
#include <Windows.h>
// Don't stomp std::min/std::max
#undef max
#undef min
#include <windows.h>
#include <algorithm>
...
...
packages/flutter_tools/templates/app/windows.tmpl/runner/run_loop.h
View file @
fa12f443
#ifndef RUN_LOOP_H_
#define RUN_LOOP_H_
#ifndef RUN
NER_RUN
_LOOP_H_
#define RUN
NER_RUN
_LOOP_H_
#include <flutter/flutter_engine.h>
...
...
@@ -37,4 +37,4 @@ class RunLoop {
std
::
set
<
flutter
::
FlutterEngine
*>
flutter_instances_
;
};
#endif // RUN_LOOP_H_
#endif // RUN
NER_RUN
_LOOP_H_
packages/flutter_tools/templates/app/windows.tmpl/runner/utils.h
View file @
fa12f443
#ifndef
CONSOLE
_UTILS_H_
#define
CONSOLE
_UTILS_H_
#ifndef
RUNNER
_UTILS_H_
#define
RUNNER
_UTILS_H_
// Creates a console for the process, and redirects stdout and stderr to
// it for both the runner and the Flutter library.
void
CreateAndAttachConsole
();
#endif //
CONSOLE
_UTILS_H_
#endif //
RUNNER
_UTILS_H_
packages/flutter_tools/templates/app/windows.tmpl/runner/win32_window.h
View file @
fa12f443
#ifndef WIN32_WINDOW_H_
#define WIN32_WINDOW_H_
#ifndef
RUNNER_
WIN32_WINDOW_H_
#define
RUNNER_
WIN32_WINDOW_H_
#include <Windows.h>
#include <Windowsx.h>
#include <windows.h>
#include <functional>
#include <memory>
...
...
@@ -96,4 +95,4 @@ class Win32Window {
HWND
child_content_
=
nullptr
;
};
#endif // WIN32_WINDOW_H_
#endif //
RUNNER_
WIN32_WINDOW_H_
packages/flutter_tools/templates/app/windows.tmpl/runner/window_configuration.cpp.tmpl
deleted
100644 → 0
View file @
9dd67386
#include "window_configuration.h"
const wchar_t* kFlutterWindowTitle = L"{{projectName}}";
const unsigned int kFlutterWindowOriginX = 10;
const unsigned int kFlutterWindowOriginY = 10;
const unsigned int kFlutterWindowWidth = 1280;
const unsigned int kFlutterWindowHeight = 720;
packages/flutter_tools/templates/app/windows.tmpl/runner/window_configuration.h
deleted
100644 → 0
View file @
9dd67386
#ifndef WINDOW_CONFIGURATION_
#define WINDOW_CONFIGURATION_
// This is a temporary approach to isolate changes that people are likely to
// make to main.cpp, where the APIs are still in flux. This will reduce the
// need to resolve conflicts or re-create changes slightly differently every
// time the Windows Flutter API surface changes.
//
// Longer term there should be simpler configuration options for common
// customizations like this, without requiring native code changes.
extern
const
wchar_t
*
kFlutterWindowTitle
;
extern
const
unsigned
int
kFlutterWindowOriginX
;
extern
const
unsigned
int
kFlutterWindowOriginY
;
extern
const
unsigned
int
kFlutterWindowWidth
;
extern
const
unsigned
int
kFlutterWindowHeight
;
#endif // WINDOW_CONFIGURATION_
packages/flutter_tools/templates/template_manifest.json
View file @
fa12f443
...
...
@@ -84,8 +84,6 @@
"templates/app/linux.tmpl/main.cc"
,
"templates/app/linux.tmpl/my_application.cc"
,
"templates/app/linux.tmpl/my_application.h"
,
"templates/app/linux.tmpl/window_configuration.cc.tmpl"
,
"templates/app/linux.tmpl/window_configuration.h"
,
"templates/app/macos.tmpl/.gitignore"
,
"templates/app/macos.tmpl/Flutter/Flutter-Debug.xcconfig"
,
"templates/app/macos.tmpl/Flutter/Flutter-Release.xcconfig"
,
...
...
@@ -128,7 +126,7 @@
"templates/app/windows.tmpl/runner/CMakeLists.txt"
,
"templates/app/windows.tmpl/runner/flutter_window.cpp"
,
"templates/app/windows.tmpl/runner/flutter_window.h"
,
"templates/app/windows.tmpl/runner/main.cpp"
,
"templates/app/windows.tmpl/runner/main.cpp
.tmpl
"
,
"templates/app/windows.tmpl/runner/resource.h"
,
"templates/app/windows.tmpl/runner/resources/app_icon.ico.img.tmpl"
,
"templates/app/windows.tmpl/runner/runner.exe.manifest"
,
...
...
@@ -139,8 +137,6 @@
"templates/app/windows.tmpl/runner/utils.h"
,
"templates/app/windows.tmpl/runner/win32_window.cpp"
,
"templates/app/windows.tmpl/runner/win32_window.h"
,
"templates/app/windows.tmpl/runner/window_configuration.cpp.tmpl"
,
"templates/app/windows.tmpl/runner/window_configuration.h"
,
"templates/cocoapods/Podfile-ios-objc"
,
"templates/cocoapods/Podfile-ios-swift"
,
"templates/cocoapods/Podfile-macos"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment