Skip to content

Commit

Permalink
Update some libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
alesimula committed Jun 27, 2023
1 parent 2ca9327 commit c46184f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 61 deletions.
16 changes: 8 additions & 8 deletions lib/global_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ import 'package:fluent_ui/fluent_ui.dart';
class GState {
// App options
static final connectionStatus = SharedValue(value: WSAPeriodicConnector.alertStatus);
static final ipAddress = PersistableValue(value: "127.0.0.1", loader: (o)=>o.ipAddress.asIpv4, setter: (o,e)=>o.ipAddress = e.ipv4AsInt ?? IntUtils.LOCALHOST);
static final androidPort = PersistableValue(value: 58526, loader: (o)=>o.port, setter: (o,e)=>o.port = e);
static final ipAddress = PersistableValue<String>(value: "127.0.0.1", loader: (o)=>o.ipAddress.asIpv4, setter: (o,e)=>o.ipAddress = e.ipv4AsInt ?? IntUtils.LOCALHOST);
static final androidPort = PersistableValue<int>(value: 58526, loader: (o)=>o.port, setter: (o,e)=>o.port = e);
static final androidPortPending = SharedValue(value: androidPort.$.toString());
// Interface options
static final locale = PersistableValue<NamedLocale>(value: LocaleUtils.SYSTEM_LOCALE, loader: (o)=>LocaleUtils.fromLCIDOrDefault(o.locale), setter: (o,e)=> o.locale = e.lcid);
// Theme options
static final theme = PersistableValue(value: Options_Theme.SYSTEM, loader: (o)=>o.theme, setter: (o,e)=> o.theme = e);
static final iconShape = PersistableValue(value: Options_IconShape.SQUIRCLE, loader: (o)=>o.iconShape, setter: (o,e)=> o.iconShape = e);
static final legacyIcons = PersistableValue(value: false, loader: (o)=>o.legacyIcons, setter: (o,e)=> o.legacyIcons = e);
static final mica = PersistableValue(value: Options_Mica.FULL, loader: (o)=>o.mica, setter: (o,e)=> o.mica = e);
static final autostartWSA = PersistableValue(value: false, loader: (o)=>o.autostart, setter: (o,e)=> o.autostart = e);
static final installTimeout = PersistableValue(value: 30, loader: (o)=>o.timeout, setter: (o,e)=> o.timeout = e);
static final theme = PersistableValue<Options_Theme>(value: Options_Theme.SYSTEM, loader: (o)=>o.theme, setter: (o,e)=> o.theme = e);
static final iconShape = PersistableValue<Options_IconShape>(value: Options_IconShape.SQUIRCLE, loader: (o)=>o.iconShape, setter: (o,e)=> o.iconShape = e);
static final legacyIcons = PersistableValue<bool>(value: false, loader: (o)=>o.legacyIcons, setter: (o,e)=> o.legacyIcons = e);
static final mica = PersistableValue<Options_Mica>(value: Options_Mica.FULL, loader: (o)=>o.mica, setter: (o,e)=> o.mica = e);
static final autostartWSA = PersistableValue<bool>(value: false, loader: (o)=>o.autostart, setter: (o,e)=> o.autostart = e);
static final installTimeout = PersistableValue<int>(value: 30, loader: (o)=>o.timeout, setter: (o,e)=> o.timeout = e);
// APK Info
static final apkTitle = SharedValue<String>(value: "");
static final package = SharedValue<String>(value: "");
Expand Down
16 changes: 8 additions & 8 deletions lib/windows/win_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,18 +349,18 @@ class WinIO {
final ppf = calloc<COMObject>();

try {
shellLink.SetPath(lpPath);
if (lpArgs != null) shellLink.SetArguments(lpArgs);
if (description != null) shellLink.SetDescription(lpDescription);
if (lpIcon != null) shellLink.SetIconLocation(lpIcon, 0);
shellLink.setPath(lpPath);
if (lpArgs != null) shellLink.setArguments(lpArgs);
if (description != null) shellLink.setDescription(lpDescription);
if (lpIcon != null) shellLink.setIconLocation(lpIcon, 0);

final hr = shellLink.QueryInterface(ptrIID_IPersistFile, ppf.cast());
final hr = shellLink.queryInterface(ptrIID_IPersistFile, ppf.cast());
if (SUCCEEDED(hr)) {
final persistFile = IPersistFile(ppf);
persistFile.Save(lpLinkPath, TRUE);
persistFile.Release();
persistFile.save(lpLinkPath, TRUE);
persistFile.release();
}
shellLink.Release();
shellLink.release();
} finally {
free(lpPath);
if (lpArgs != null) free(lpArgs);
Expand Down
16 changes: 8 additions & 8 deletions lib/windows/win_wmi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WinWMI {

try {
// For example, query for all the running processes
int hr = service.ExecQuery(TEXT('WQL'), TEXT('SELECT $valName FROM $wmiClass'),
int hr = service.execQuery(TEXT('WQL'), TEXT('SELECT $valName FROM $wmiClass'),
WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_FORWARD_ONLY | WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_RETURN_IMMEDIATELY, nullptr, pEnumerator);

if (FAILED(hr)) {
Expand All @@ -36,7 +36,7 @@ class WinWMI {

if (enumerator.ptr.address > 0) {
final pClsObj = calloc<IntPtr>();
hr = enumerator.Next(WBEM_TIMEOUT_TYPE.WBEM_INFINITE, 1, pClsObj.cast(), uReturn);
hr = enumerator.next(WBEM_TIMEOUT_TYPE.WBEM_INFINITE, 1, pClsObj.cast(), uReturn);

// Break out of the while loop if we've run out of processes to inspect
if (uReturn.value == 0) {
Expand All @@ -47,19 +47,19 @@ class WinWMI {
final clsObj = IWbemClassObject(pClsObj.cast());

final vtProp = calloc<VARIANT>();
hr = clsObj.Get(TEXT(valName), 0, vtProp, nullptr, nullptr);
hr = clsObj.get(TEXT(valName), 0, vtProp, nullptr, nullptr);
String? value = SUCCEEDED(hr) ? vtProp.ref.bstrVal.toDartString() : null;

VariantClear(vtProp);
free(vtProp);
clsObj.Release();
clsObj.release();

return value;
}
}
}
finally {
enumerator?.Release() ?? free(pEnumerator);
enumerator?.release() ?? free(pEnumerator);
}
}

Expand Down Expand Up @@ -106,7 +106,7 @@ class WinWMI {
if (FAILED(hr)) {
log(WindowsException(hr).toString(), level: 1000);

pLoc.Release();
pLoc.release();
free(clsid);
free(iid);
CoUninitialize();
Expand All @@ -118,12 +118,12 @@ class WinWMI {
// Connect to the root\cimv2 namespace with the
// current user and obtain pointer pSvc
// to make IWbemServices calls.
hr = pLoc.ConnectServer(TEXT(_namespace), nullptr, nullptr, nullptr, NULL, nullptr, nullptr, proxy);
hr = pLoc.connectServer(TEXT(_namespace), nullptr, nullptr, nullptr, NULL, nullptr, nullptr, proxy);

if (FAILED(hr)) {
log(WindowsException(hr).toString(), level: 1000);

pLoc.Release();
pLoc.release();
free(clsid);
free(iid);
free(proxy);
Expand Down
61 changes: 27 additions & 34 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,46 @@ packages:
description:
path: bitsdojo_window
ref: master
resolved-ref: "7e8d5b25e68915a80499edd50f4bc11a9c42ffc4"
resolved-ref: afd0d0b1160a098a41e2476f27fabfb0eea96efa
url: "https://github.com/alesimula/bitsdojo_window.git"
source: git
version: "0.1.1+1"
version: "0.1.5"
bitsdojo_window_linux:
dependency: transitive
description:
path: bitsdojo_window_linux
ref: master
resolved-ref: "7e8d5b25e68915a80499edd50f4bc11a9c42ffc4"
resolved-ref: afd0d0b1160a098a41e2476f27fabfb0eea96efa
url: "https://github.com/alesimula/bitsdojo_window.git"
source: git
version: "0.1.1"
version: "0.1.3"
bitsdojo_window_macos:
dependency: transitive
description:
path: bitsdojo_window_macos
ref: master
resolved-ref: "7e8d5b25e68915a80499edd50f4bc11a9c42ffc4"
resolved-ref: afd0d0b1160a098a41e2476f27fabfb0eea96efa
url: "https://github.com/alesimula/bitsdojo_window.git"
source: git
version: "0.1.0"
version: "0.1.3"
bitsdojo_window_platform_interface:
dependency: transitive
description:
path: bitsdojo_window_platform_interface
ref: master
resolved-ref: "7e8d5b25e68915a80499edd50f4bc11a9c42ffc4"
resolved-ref: afd0d0b1160a098a41e2476f27fabfb0eea96efa
url: "https://github.com/alesimula/bitsdojo_window.git"
source: git
version: "0.1.0"
version: "0.1.2"
bitsdojo_window_windows:
dependency: transitive
description:
path: bitsdojo_window_windows
ref: master
resolved-ref: "7e8d5b25e68915a80499edd50f4bc11a9c42ffc4"
resolved-ref: afd0d0b1160a098a41e2476f27fabfb0eea96efa
url: "https://github.com/alesimula/bitsdojo_window.git"
source: git
version: "0.1.0"
version: "0.1.5"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -154,7 +154,7 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
version: "2.0.2"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -307,21 +307,21 @@ packages:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.7"
version: "2.1.10"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.0.6"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.1.6"
petitparser:
dependency: transitive
description:
Expand All @@ -342,7 +342,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.4"
pointycastle:
dependency: transitive
description:
Expand Down Expand Up @@ -391,56 +391,49 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
version: "2.1.1"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
shared_preferences_ios:
version: "2.1.4"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_ios
name: shared_preferences_foundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.2.2"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.2.0"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.2.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
version: "2.1.0"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.2.0"
shared_value:
dependency: "direct main"
description:
Expand Down Expand Up @@ -522,7 +515,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.2"
universal_io:
dependency: transitive
description:
Expand Down Expand Up @@ -550,14 +543,14 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.2"
version: "3.1.4"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+3"
version: "1.0.0"
xml:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ dependencies:
synchronized: ^3.0.0
provider: ^6.0.0
system_theme: 2.0.0
bitsdojo_window: #^0.1.1+1
bitsdojo_window:
git:
# Credits to bufan22 for fixing errors with new Windows versions
url: https://github.com/alesimula/bitsdojo_window.git
path: bitsdojo_window
ref: master
dyn_mouse_scroll:
git: https://github.com/alesimula/dyn_mouse_scroll.git
flutter_acrylic: ^1.0.0+1
flutter_acrylic: ^1.0.0+2
url_strategy: ^0.2.0
yaml: ^3.1.0
#transparent_pointer: ^1.0.0
Expand All @@ -39,7 +39,7 @@ dependencies:
protobuf: ^2.0.0
#path_provider: ^2.0.6
mdi: ^5.0.0-nullsafety.0
win32: ^2.3.0
win32: ^3.0.0
base32: ^2.1.1
charset: ^0.1.1

Expand Down

0 comments on commit c46184f

Please sign in to comment.