Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a display scaling view #200

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions data/icons/preferences-desktop-display.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/io.elementary.onboarding.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
<file compressed="true" preprocess="xml-stripblanks">appearance-dark.svg</file>
<file compressed="true" preprocess="xml-stripblanks">appearance-scheduled.svg</file>
</gresource>
<gresource prefix="io/elementary/onboarding/icons">
<file alias ="64x64/categories/preferences-desktop-display-scale.svg" compressed="true">icons/preferences-desktop-display.svg</file>
<file alias ="64x64@2/categories/preferences-desktop-display-scale.svg" compressed="true">icons/preferences-desktop-display.svg</file>
</gresource>
</gresources>
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ src/Views/HouseKeepingView.vala
src/Views/NightLightView.vala
src/Views/OnlineAccountsView.vala
src/Views/StyleView.vala
src/Views/UIScaleView.vala
src/Views/UpdatesView.vala
src/Views/WelcomeView.vala
2 changes: 1 addition & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class Onboarding.App : Gtk.Application {
construct {
application_id = "io.elementary.installer";
application_id = "io.elementary.onboarding";
flags = ApplicationFlags.FLAGS_NONE;
Intl.setlocale (LocaleCategory.ALL, "");
Intl.bindtextdomain (Onboarding.GETTEXT_PACKAGE, Onboarding.LOCALEDIR);
Expand Down
99 changes: 99 additions & 0 deletions src/Interfaces/MutterDisplayConfig.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*-
* Copyright (c) 2018 elementary LLC.
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this software; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* Authored by: Corentin Noël <corentin@elementary.io>
*/

[DBus (name = "org.gnome.Mutter.DisplayConfig")]
public interface MutterDisplayConfigInterface : Object {
public signal void monitors_changed ();
public abstract void get_current_state (out uint serial, out MutterReadMonitor[] monitors, out MutterReadLogicalMonitor[] logical_monitors, out GLib.HashTable<string, GLib.Variant> properties) throws Error;
public abstract void apply_monitors_config (uint serial, MutterApplyMethod method, MutterWriteLogicalMonitor[] logical_monitors, GLib.HashTable<string, GLib.Variant> properties) throws Error;
}

[CCode (type_signature = "u")]
public enum MutterApplyMethod {
VERIFY = 0,
TEMPORARY = 1,
PERSISTENT = 2
}

[CCode (type_signature = "u")]
public enum DisplayTransform {
NORMAL = 0,
ROTATION_90 = 1,
ROTATION_180 = 2,
ROTATION_270 = 3,
FLIPPED = 4,
FLIPPED_ROTATION_90 = 5,
FLIPPED_ROTATION_180 = 6,
FLIPPED_ROTATION_270 = 7;
}

public struct MutterReadMonitorInfo {
public string connector;
public string vendor;
public string product;
public string serial;
public uint hash {
get {
return (connector + vendor + product + serial).hash ();
}
}
}

public struct MutterReadMonitorMode {
public string id;
public int width;
public int height;
public double frequency;
public double preferred_scale;
public double[] supported_scales;
public GLib.HashTable<string, GLib.Variant> properties;
}

public struct MutterReadMonitor {
public MutterReadMonitorInfo monitor;
public MutterReadMonitorMode[] modes;
public GLib.HashTable<string, GLib.Variant> properties;
}

public struct MutterReadLogicalMonitor {
public int x;
public int y;
public double scale;
public DisplayTransform transform;
public bool primary;
public MutterReadMonitorInfo[] monitors;
public GLib.HashTable<string, GLib.Variant> properties;
}

public struct MutterWriteMonitor {
public string connector;
public string monitor_mode;
public GLib.HashTable<string, GLib.Variant> properties;
}

public struct MutterWriteLogicalMonitor {
public int x;
public int y;
public double scale;
public DisplayTransform transform;
public bool primary;
public MutterWriteMonitor[] monitors;
}
Loading