Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace GSettings with GtkSettings (#193)
GSettings may not be accessible when running confined - use GtkSettings instead.
- Loading branch information
Showing
15 changed files
with
405 additions
and
116 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 |
---|---|---|
@@ -1,10 +1,30 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
# This file should be version controlled. | ||
|
||
version: | ||
revision: ba78539bdb74dd05144a2490c453383078f81cdd | ||
channel: master | ||
revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 | ||
channel: stable | ||
|
||
project_type: package | ||
project_type: plugin | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 | ||
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 | ||
- platform: linux | ||
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 | ||
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
list(APPEND FLUTTER_PLUGIN_LIST | ||
handy_window | ||
yaru | ||
) | ||
|
||
list(APPEND FLUTTER_FFI_PLUGIN_LIST | ||
|
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,32 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
abstract class YaruSettings { | ||
const YaruSettings._(); | ||
const factory YaruSettings() = YaruMethodChannel; | ||
|
||
Future<String?> getThemeName(); | ||
Stream<String?> get themeNameChanged; | ||
} | ||
|
||
class YaruMethodChannel extends YaruSettings { | ||
const YaruMethodChannel() : super._(); | ||
|
||
@visibleForTesting | ||
final methodChannel = const MethodChannel('yaru'); | ||
|
||
@visibleForTesting | ||
final eventChannel = const EventChannel('yaru/events'); | ||
|
||
@override | ||
Future<String?> getThemeName() async { | ||
return methodChannel.invokeMethod<String>('getThemeName'); | ||
} | ||
|
||
@override | ||
Stream<String?> get themeNameChanged { | ||
return eventChannel | ||
.receiveBroadcastStream('themeNameChanged') | ||
.map((event) => event as String?); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# The Flutter tooling requires that developers have CMake 3.10 or later | ||
# installed. You should not increase this version, as doing so will cause | ||
# the plugin to fail to compile for some customers of the plugin. | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project-level configuration. | ||
set(PROJECT_NAME "yaru") | ||
project(${PROJECT_NAME} LANGUAGES CXX) | ||
|
||
# This value is used when generating builds using this plugin, so it must | ||
# not be changed. | ||
set(PLUGIN_NAME "yaru_plugin") | ||
|
||
# Define the plugin library target. Its name must not be changed (see comment | ||
# on PLUGIN_NAME above). | ||
# | ||
# Any new source files that you add to the plugin should be added here. | ||
add_library(${PLUGIN_NAME} SHARED | ||
"yaru_plugin.cc" | ||
) | ||
|
||
# Apply a standard set of build settings that are configured in the | ||
# application-level CMakeLists.txt. This can be removed for plugins that want | ||
# full control over build settings. | ||
apply_standard_settings(${PLUGIN_NAME}) | ||
|
||
# Symbols are hidden by default to reduce the chance of accidental conflicts | ||
# between plugins. This should not be removed; any symbols that should be | ||
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. | ||
set_target_properties(${PLUGIN_NAME} PROPERTIES | ||
CXX_VISIBILITY_PRESET hidden) | ||
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) | ||
|
||
# Source include directories and library dependencies. Add any plugin-specific | ||
# dependencies here. | ||
target_include_directories(${PLUGIN_NAME} INTERFACE | ||
"${CMAKE_CURRENT_SOURCE_DIR}/include") | ||
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) | ||
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) | ||
|
||
# List of absolute paths to libraries that should be bundled with the plugin. | ||
# This list could contain prebuilt libraries, or libraries created by an | ||
# external build triggered from this build file. | ||
set(yaru_bundled_libraries | ||
"" | ||
PARENT_SCOPE | ||
) |
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,11 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
// clang-format off | ||
|
||
#include "generated_plugin_registrant.h" | ||
|
||
|
||
void fl_register_plugins(FlPluginRegistry* registry) { | ||
} |
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,15 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
// clang-format off | ||
|
||
#ifndef GENERATED_PLUGIN_REGISTRANT_ | ||
#define GENERATED_PLUGIN_REGISTRANT_ | ||
|
||
#include <flutter_linux/flutter_linux.h> | ||
|
||
// Registers Flutter plugins. | ||
void fl_register_plugins(FlPluginRegistry* registry); | ||
|
||
#endif // GENERATED_PLUGIN_REGISTRANT_ |
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,23 @@ | ||
# | ||
# Generated file, do not edit. | ||
# | ||
|
||
list(APPEND FLUTTER_PLUGIN_LIST | ||
) | ||
|
||
list(APPEND FLUTTER_FFI_PLUGIN_LIST | ||
) | ||
|
||
set(PLUGIN_BUNDLED_LIBRARIES) | ||
|
||
foreach(plugin ${FLUTTER_PLUGIN_LIST}) | ||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) | ||
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) | ||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>) | ||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) | ||
endforeach(plugin) | ||
|
||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) | ||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) | ||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) | ||
endforeach(ffi_plugin) |
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,26 @@ | ||
#ifndef FLUTTER_PLUGIN_YARU_PLUGIN_H_ | ||
#define FLUTTER_PLUGIN_YARU_PLUGIN_H_ | ||
|
||
#include <flutter_linux/flutter_linux.h> | ||
|
||
G_BEGIN_DECLS | ||
|
||
#ifdef FLUTTER_PLUGIN_IMPL | ||
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) | ||
#else | ||
#define FLUTTER_PLUGIN_EXPORT | ||
#endif | ||
|
||
typedef struct _YaruPlugin YaruPlugin; | ||
typedef struct { | ||
GObjectClass parent_class; | ||
} YaruPluginClass; | ||
|
||
FLUTTER_PLUGIN_EXPORT GType yaru_plugin_get_type(); | ||
|
||
FLUTTER_PLUGIN_EXPORT void yaru_plugin_register_with_registrar( | ||
FlPluginRegistrar* registrar); | ||
|
||
G_END_DECLS | ||
|
||
#endif // FLUTTER_PLUGIN_YARU_PLUGIN_H_ |
Oops, something went wrong.