Skip to content

Commit 947cd78

Browse files
committed
Move ColorInformation to Background
1 parent 5544bc2 commit 947cd78

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

background/Background.vala

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
*/
77

88
public interface Gala.Background.Background : Object, Gdk.Paintable {
9+
public struct ColorInformation {
10+
double average_red;
11+
double average_green;
12+
double average_blue;
13+
double mean_luminance;
14+
double luminance_variance;
15+
double mean_acutance;
16+
}
17+
918
public static Background get_for_color (Gdk.RGBA color) {
1019
return new SolidColor (color);
1120
}
@@ -26,7 +35,7 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
2635
return new DimBackground (other);
2736
}
2837

29-
public abstract Utils.ColorInformation? get_color_information (int height);
38+
public abstract ColorInformation? get_color_information (int height);
3039

3140
private class SolidColor : Object, Gdk.Paintable, Background {
3241
public Gdk.RGBA color { get; construct; }
@@ -35,7 +44,7 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
3544
Object (color: color);
3645
}
3746

38-
public Utils.ColorInformation? get_color_information (int height) {
47+
public ColorInformation? get_color_information (int height) {
3948
return null;
4049
}
4150

@@ -60,7 +69,7 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
6069
Object (texture: texture);
6170
}
6271

63-
public Utils.ColorInformation? get_color_information (int height) {
72+
public ColorInformation? get_color_information (int height) {
6473
var info = texture.get_color_information (height);
6574
if (info == null) {
6675
return null;
@@ -108,7 +117,7 @@ public interface Gala.Background.Background : Object, Gdk.Paintable {
108117
Object (texture: texture);
109118
}
110119

111-
public Utils.ColorInformation? get_color_information (int height) {
120+
public ColorInformation? get_color_information (int height) {
112121
return Utils.get_background_color_information (texture, height);
113122
}
114123

background/BackgroundManager.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class Gala.Background.BackgroundManager : Object {
8383
changed ();
8484
}
8585

86-
public Utils.ColorInformation? get_background_color_information (int height) throws DBusError, IOError {
86+
public Background.ColorInformation? get_background_color_information (int height) throws DBusError, IOError {
8787
if (current_background == null) {
8888
return null;
8989
}

background/Utils.vala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@ namespace Gala.Background.Utils {
77
private const double SATURATION_WEIGHT = 1.5;
88
private const double WEIGHT_THRESHOLD = 1.0;
99

10-
public struct ColorInformation {
11-
double average_red;
12-
double average_green;
13-
double average_blue;
14-
double mean_luminance;
15-
double luminance_variance;
16-
double mean_acutance;
17-
}
18-
19-
public static ColorInformation? get_background_color_information (Gdk.Texture texture, int panel_height) {
10+
public static Background.ColorInformation? get_background_color_information (Gdk.Texture texture, int panel_height) {
2011
int width = texture.width;
2112
int height = int.min (texture.height, panel_height);
2213

0 commit comments

Comments
 (0)