Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Oct 27, 2024
1 parent 8c3acfc commit 1502b84
Show file tree
Hide file tree
Showing 32 changed files with 47 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation

import screen_retriever_macos
import tray_manager
import window_manager
import window_manager_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
Expand Down
10 changes: 5 additions & 5 deletions packages/window_manager/example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ PODS:
- FlutterMacOS
- tray_manager (0.0.1):
- FlutterMacOS
- window_manager (0.2.0):
- window_manager_macos (0.2.0):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`)
- tray_manager (from `Flutter/ephemeral/.symlinks/plugins/tray_manager/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
- window_manager_macos (from `Flutter/ephemeral/.symlinks/plugins/window_manager_macos/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
Expand All @@ -20,14 +20,14 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos
tray_manager:
:path: Flutter/ephemeral/.symlinks/plugins/tray_manager/macos
window_manager:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
window_manager_macos:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager_macos/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161
tray_manager: 9064e219c56d75c476e46b9a21182087930baf90
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
window_manager_macos: c5e0ae4310f93c7150a72509f4169e3053527a49

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Cocoa
import FlutterMacOS
import window_manager
import window_manager_macos

class MainFlutterWindow: NSPanel {
override func awakeFromNib() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:window_manager/src/resize_edge.dart';
import 'package:window_manager/src/window_manager.dart';
import 'package:window_manager_platform_interface/window_manager_platform_interface.dart';

/// A widget for drag to resize window.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:window_manager/src/resize_edge.dart';
import 'package:window_manager/src/widgets/drag_to_resize_area.dart';
import 'package:window_manager/src/window_listener.dart';
import 'package:window_manager/src/window_manager.dart';
import 'package:window_manager_platform_interface/window_manager_platform_interface.dart';

final _kIsLinux = !kIsWeb && Platform.isLinux;
final _kIsWindows = !kIsWeb && Platform.isWindows;
Expand Down
3 changes: 1 addition & 2 deletions packages/window_manager/lib/src/widgets/window_caption.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:flutter/material.dart';

import 'package:window_manager/src/widgets/drag_to_move_area.dart';
import 'package:window_manager/src/widgets/window_caption_button.dart';
import 'package:window_manager/src/window_listener.dart';
import 'package:window_manager/src/window_manager.dart';
import 'package:window_manager_platform_interface/window_manager_platform_interface.dart';

const double kWindowCaptionHeight = 32;

Expand Down
6 changes: 1 addition & 5 deletions packages/window_manager/lib/src/window_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path/path.dart' as path;
import 'package:window_manager/src/resize_edge.dart';
import 'package:window_manager/src/title_bar_style.dart';
import 'package:window_manager/src/utils/calc_window_position.dart';
import 'package:window_manager/src/window_listener.dart';
import 'package:window_manager/src/window_options.dart';
import 'package:window_manager_platform_interface/window_manager_platform_interface.dart';

const kWindowEventClose = 'close';
const kWindowEventFocus = 'focus';
Expand Down
7 changes: 2 additions & 5 deletions packages/window_manager/lib/window_manager.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
export 'src/resize_edge.dart';
export 'src/title_bar_style.dart';
export 'src/utils/calc_window_position.dart';
export 'package:window_manager_platform_interface/window_manager_platform_interface.dart';

export 'src/widgets/drag_to_move_area.dart';
export 'src/widgets/drag_to_resize_area.dart';
export 'src/widgets/virtual_window_frame.dart';
export 'src/widgets/window_caption.dart';
export 'src/widgets/window_caption_button.dart';
export 'src/window_listener.dart';
export 'src/window_manager.dart';
export 'src/window_options.dart';
10 changes: 7 additions & 3 deletions packages/window_manager/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ dependencies:
sdk: flutter
path: ^1.8.2
screen_retriever: ^0.2.0
window_manager_linux: ^1.0.1
window_manager_macos: ^1.0.1
window_manager_platform_interface: ^1.0.1
window_manager_windows: ^1.0.1

dev_dependencies:
dependency_validator: ^3.0.0
Expand All @@ -35,8 +39,8 @@ flutter:
plugin:
platforms:
linux:
pluginClass: WindowManagerPlugin
default_package: window_manager_linux
macos:
pluginClass: WindowManagerPlugin
default_package: window_manager_macos
windows:
pluginClass: WindowManagerPlugin
default_package: window_manager_windows
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ project(${PROJECT_NAME} LANGUAGES CXX)

# This value is used when generating builds using this plugin, so it must
# not be changed
set(PLUGIN_NAME "window_manager_plugin")
set(PLUGIN_NAME "window_manager_linux_plugin")

add_library(${PLUGIN_NAME} SHARED
"window_manager_plugin.cc"
"window_manager_linux_plugin.cc"
)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
Expand Down
3 changes: 2 additions & 1 deletion packages/window_manager_linux/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ flutter:
plugin:
platforms:
linux:
pluginClass: WindowManagerLinuxPlugin
pluginClass: WindowManagerPlugin
# pluginClass: WindowManagerLinuxPlugin

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Run `pod lib lint window_manager.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'window_manager'
s.name = 'window_manager_macos'
s.version = '0.2.0'
s.summary = 'A new flutter plugin project.'
s.summary = 'macOS implementation of the window_manager plugin.'
s.description = <<-DESC
A new flutter plugin project.
macOS implementation of the window_manager plugin.
DESC
s.homepage = 'https://leanflutter.org'
s.homepage = 'https://leanflutter.dev'
s.license = { :file => '../LICENSE' }
s.author = { 'LiJianying' => '[email protected]' }
s.source = { :path => '.' }
Expand Down
3 changes: 2 additions & 1 deletion packages/window_manager_macos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ flutter:
plugin:
platforms:
macos:
pluginClass: WindowManagerMacosPlugin
pluginClass: WindowManagerPlugin
# pluginClass: WindowManagerMacosPlugin
5 changes: 5 additions & 0 deletions packages/window_manager_platform_interface/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This is a generated file; do not edit or check into version control.
screen_retriever=/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever-0.2.0/
screen_retriever_linux=/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever_linux-0.2.0/
screen_retriever_macos=/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever_macos-0.2.0/
screen_retriever_windows=/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever_windows-0.2.0/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[],"android":[],"macos":[{"name":"screen_retriever_macos","path":"/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever_macos-0.2.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"screen_retriever_linux","path":"/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever_linux-0.2.0/","native_build":true,"dependencies":[]}],"windows":[{"name":"screen_retriever_windows","path":"/Users/lijy91/.pub-cache/hosted/pub.dev/screen_retriever_windows-0.2.0/","native_build":true,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"screen_retriever","dependencies":["screen_retriever_linux","screen_retriever_macos","screen_retriever_windows"]},{"name":"screen_retriever_linux","dependencies":[]},{"name":"screen_retriever_macos","dependencies":[]},{"name":"screen_retriever_windows","dependencies":[]}],"date_created":"2024-10-27 10:51:10.413309","version":"3.24.3","swift_package_manager_enabled":false}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:ui';

import 'package:window_manager/src/title_bar_style.dart';
import 'package:window_manager_platform_interface/src/title_bar_style.dart';

/// WindowOptions
class WindowOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
library window_manager_platform_interface;

export 'src/resize_edge.dart';
export 'src/title_bar_style.dart';
export 'src/utils/calc_window_position.dart';
export 'src/window_listener.dart';
export 'src/window_manager_method_channel.dart';
export 'src/window_manager_platform_interface.dart';
export 'src/window_options.dart';
1 change: 1 addition & 0 deletions packages/window_manager_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.0.2
screen_retriever: ^0.2.0

dev_dependencies:
flutter_test:
Expand Down
3 changes: 2 additions & 1 deletion packages/window_manager_windows/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ flutter:
plugin:
platforms:
windows:
pluginClass: WindowManagerWindowsPlugin
pluginClass: WindowManagerPlugin
# pluginClass: WindowManagerWindowsPlugin
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ project(${PROJECT_NAME} LANGUAGES CXX)

# This value is used when generating builds using this plugin, so it must
# not be changed
set(PLUGIN_NAME "window_manager_plugin")
set(PLUGIN_NAME "window_manager_windows_plugin")

add_library(${PLUGIN_NAME} SHARED
"window_manager.cpp"
"window_manager_plugin.cpp"
"window_manager_windows_plugin.cpp"
)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
Expand Down

0 comments on commit 1502b84

Please sign in to comment.