forked from bitsdojo/bitsdojo_window
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,271 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This file configures the analyzer, which statically analyzes Dart code to | ||
# check for errors, warnings, and lints. | ||
# | ||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled | ||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be | ||
# invoked from the command line by running `flutter analyze`. | ||
|
||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
linter: | ||
# The lint rules applied to this project can be customized in the | ||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` | ||
# included above or to enable additional rules. A list of all available lints | ||
# and their documentation is published at | ||
# https://dart-lang.github.io/linter/lints/index.html. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
// Generated file. Do not edit. | ||
// | ||
|
||
// clang-format off | ||
|
||
import FlutterMacOS | ||
import Foundation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
## 0.1.1 | ||
- Linux support now stable | ||
## 0.1.0+1 | ||
- Fix gtk library name | ||
## 0.1.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,121 @@ | ||
library bitsdojo_window_linux; | ||
|
||
import 'dart:ffi'; | ||
import 'package:ffi/ffi.dart'; | ||
|
||
final DynamicLibrary _appExecutable = DynamicLibrary.executable(); | ||
|
||
final getFlutterWindow = | ||
_appExecutable.lookupFunction<IntPtr Function(), int Function()>( | ||
"bitsdojo_window_getFlutterWindow"); | ||
// getAppWindowHandle | ||
typedef IntPtr TGetAppWindowHandle(); | ||
typedef DGetAppWindowHandle = int Function(); | ||
final DGetAppWindowHandle getAppWindowHandle = | ||
_theAPI.ref.getAppWindowHandle.asFunction(); | ||
|
||
final getFlutterGdkWindow = | ||
_appExecutable.lookupFunction<IntPtr Function(), int Function()>( | ||
"bitsdojo_window_getFlutterGdkWindow"); | ||
// getScreenRect | ||
typedef Void TGetScreenRect(IntPtr window, Pointer<Int32> x, Pointer<Int32> y, | ||
Pointer<Int32> width, Pointer<Int32> height); | ||
typedef DGetScreenRect = void Function(int window, Pointer<Int32> x, | ||
Pointer<Int32> y, Pointer<Int32> width, Pointer<Int32> height); | ||
final DGetScreenRect getScreenRect = _theAPI.ref.getScreenRect.asFunction(); | ||
|
||
final setMinSize = _appExecutable.lookupFunction< | ||
Void Function(Int32 width, Int32 height), | ||
void Function(int width, int height)>("bitsdojo_window_setMinSize"); | ||
// getScaleFactor | ||
typedef Void TGetScaleFactor(IntPtr window, Pointer<Int32> scaleFactor); | ||
typedef DGetScaleFactor = void Function(int window, Pointer<Int32> scaleFactor); | ||
final DGetScaleFactor getScaleFactor = _theAPI.ref.getScaleFactor.asFunction(); | ||
|
||
final setMaxSize = _appExecutable.lookupFunction< | ||
Void Function(Int32 width, Int32 height), | ||
void Function(int width, int height)>("bitsdojo_window_setMaxSize"); | ||
// getPosition | ||
typedef Void TGetPosition(IntPtr window, Pointer<Int32> x, Pointer<Int32> y); | ||
typedef DGetPosition = void Function( | ||
int window, Pointer<Int32> x, Pointer<Int32> y); | ||
final DGetPosition getPosition = _theAPI.ref.getPosition.asFunction(); | ||
|
||
// setPosition | ||
typedef Void TSetPosition(IntPtr window, Int32 x, Int32 y); | ||
typedef DSetPosition = void Function(int window, int x, int y); | ||
final DSetPosition setPosition = _theAPI.ref.setPosition.asFunction(); | ||
|
||
// getSize | ||
typedef Void TGetSize( | ||
IntPtr window, Pointer<Int32> width, Pointer<Int32> height); | ||
typedef DGetSize = void Function( | ||
int window, Pointer<Int32> width, Pointer<Int32> height); | ||
final DGetSize getSize = _theAPI.ref.getSize.asFunction(); | ||
|
||
// setSize | ||
typedef Void TSetSize(IntPtr window, Int32 width, Int32 height); | ||
typedef DSetSize = void Function(int window, int width, int height); | ||
final DSetSize setSize = _theAPI.ref.setSize.asFunction(); | ||
// setRect | ||
typedef Void TSetRect( | ||
IntPtr window, Int32 x, Int32 y, Int32 width, Int32 height); | ||
typedef DSetRect = void Function( | ||
int window, int x, int y, int width, int height); | ||
final DSetRect setRect = _theAPI.ref.setRect.asFunction(); | ||
|
||
// setMinSize | ||
typedef Void TSetMinSize(IntPtr window, Int32 width, Int32 height); | ||
typedef DSetMinSize = void Function(int window, int width, int height); | ||
final DSetMinSize setMinSize = _theAPI.ref.setMinSize.asFunction(); | ||
|
||
// setMaxSize | ||
typedef Void TSetMaxSize(IntPtr window, Int32 width, Int32 height); | ||
typedef DSetMaxSize = void Function(int window, int width, int height); | ||
final DSetMinSize setMaxSize = _theAPI.ref.setMaxSize.asFunction(); | ||
|
||
// showWindow | ||
typedef Void TShowWindow(IntPtr window); | ||
typedef DShowWindow = void Function(int window); | ||
final DShowWindow showWindow = _theAPI.ref.showWindow.asFunction(); | ||
|
||
// hideWindow | ||
typedef Void THideWindow(IntPtr window); | ||
typedef DHideWindow = void Function(int window); | ||
final DHideWindow hideWindow = _theAPI.ref.hideWindow.asFunction(); | ||
|
||
// maximizeWindow | ||
typedef Void TMinimizeWindow(IntPtr window); | ||
typedef DMinimizeWindow = void Function(int window); | ||
final DMinimizeWindow minimizeWindow = _theAPI.ref.minimizeWindow.asFunction(); | ||
|
||
// maximizeWindow | ||
typedef Void TMaximizeWindow(IntPtr window); | ||
typedef DMaximizeWindow = void Function(int window); | ||
final DMaximizeWindow maximizeWindow = _theAPI.ref.maximizeWindow.asFunction(); | ||
|
||
// unmaximizeWindow | ||
typedef Void TUnmaximizeWindow(IntPtr window); | ||
typedef DUnmaximizeWindow = void Function(int window); | ||
final DMaximizeWindow unmaximizeWindow = | ||
_theAPI.ref.unmaximizeWindow.asFunction(); | ||
|
||
// setWindowTitle | ||
typedef Void TSetWindowTitle(IntPtr window, Pointer<Utf8> title); | ||
typedef DSetWindowTitle = void Function(int window, Pointer<Utf8> title); | ||
final DSetWindowTitle setWindowTitle = _theAPI.ref.setWindowTitle.asFunction(); | ||
|
||
class BDWAPI extends Struct { | ||
external Pointer<NativeFunction<TGetAppWindowHandle>> getAppWindowHandle; | ||
external Pointer<NativeFunction<TGetScreenRect>> getScreenRect; | ||
external Pointer<NativeFunction<TGetScaleFactor>> getScaleFactor; | ||
external Pointer<NativeFunction<TGetPosition>> getPosition; | ||
external Pointer<NativeFunction<TSetPosition>> setPosition; | ||
external Pointer<NativeFunction<TGetSize>> getSize; | ||
external Pointer<NativeFunction<TSetSize>> setSize; | ||
external Pointer<NativeFunction<TSetRect>> setRect; | ||
external Pointer<NativeFunction<TSetMinSize>> setMinSize; | ||
external Pointer<NativeFunction<TSetMaxSize>> setMaxSize; | ||
external Pointer<NativeFunction<TShowWindow>> showWindow; | ||
external Pointer<NativeFunction<THideWindow>> hideWindow; | ||
external Pointer<NativeFunction<TMinimizeWindow>> minimizeWindow; | ||
external Pointer<NativeFunction<TMaximizeWindow>> maximizeWindow; | ||
external Pointer<NativeFunction<TUnmaximizeWindow>> unmaximizeWindow; | ||
external Pointer<NativeFunction<TSetWindowTitle>> setWindowTitle; | ||
} | ||
|
||
typedef Pointer<BDWAPI> TBitsdojoWindowAPI(); | ||
|
||
final TBitsdojoWindowAPI bitsdojoWindowAPI = _appExecutable | ||
.lookup<NativeFunction<TBitsdojoWindowAPI>>("bitsdojo_window_api") | ||
.asFunction(); | ||
|
||
final Pointer<BDWAPI> _theAPI = bitsdojoWindowAPI(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.