sushi/sushi-define-getters.patch
2020-09-23 13:15:42 +02:00

157 lines
4.2 KiB
Diff

From 47736b0547e40b543cdf0c6aab167f81da57bd1b Mon Sep 17 00:00:00 2001
From: Felipe Borges <felipeborges@gnome.org>
Date: Wed, 23 Sep 2020 12:59:53 +0200
Subject: [PATCH] viewers: Implement getters in the viewers child classes
I have no idea why the getters defined in Renderer.Renderer are not
inherited by their derived classes. I am not very versed in modern
GJS, neither interested much in it.
This fixes sushi tho. :)
---
src/viewers/evince.js | 8 ++++++++
src/viewers/font.js | 8 ++++++++
src/viewers/gst.js | 8 ++++++++
src/viewers/html.js | 8 ++++++++
src/viewers/image.js | 8 ++++++++
src/viewers/libreoffice.js | 8 ++++++++
src/viewers/text.js | 8 ++++++++
7 files changed, 56 insertions(+)
diff --git a/src/viewers/evince.js b/src/viewers/evince.js
index 5330eea..9eb36a9 100644
--- a/src/viewers/evince.js
+++ b/src/viewers/evince.js
@@ -42,6 +42,14 @@ var Klass = GObject.registerClass({
false)
},
}, class EvinceRenderer extends Gtk.ScrolledWindow {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file, fileInfo) {
super._init({ visible: true,
min_content_height: Constants.VIEW_MIN,
diff --git a/src/viewers/font.js b/src/viewers/font.js
index 9bba13d..330c92b 100644
--- a/src/viewers/font.js
+++ b/src/viewers/font.js
@@ -38,6 +38,14 @@ var Klass = GObject.registerClass({
false)
},
}, class FontRenderer extends Sushi.FontWidget {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file) {
super._init({ uri: file.get_uri(),
visible: true })
diff --git a/src/viewers/gst.js b/src/viewers/gst.js
index 14d4b00..0c5654a 100644
--- a/src/viewers/gst.js
+++ b/src/viewers/gst.js
@@ -39,6 +39,14 @@ var Klass = GObject.registerClass({
false)
},
}, class GstRenderer extends Sushi.MediaBin {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file) {
super._init({ uri: file.get_uri() });
diff --git a/src/viewers/html.js b/src/viewers/html.js
index a20d55d..3de4455 100644
--- a/src/viewers/html.js
+++ b/src/viewers/html.js
@@ -38,6 +38,14 @@ var Klass = GObject.registerClass({
false)
},
}, class HTMLRenderer extends WebKit2.WebView {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file) {
super._init();
diff --git a/src/viewers/image.js b/src/viewers/image.js
index bae07cd..8befc05 100644
--- a/src/viewers/image.js
+++ b/src/viewers/image.js
@@ -38,6 +38,14 @@ var Klass = GObject.registerClass({
false)
},
}, class ImageRenderer extends Gtk.DrawingArea {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file) {
super._init();
diff --git a/src/viewers/libreoffice.js b/src/viewers/libreoffice.js
index d153223..8302b4e 100644
--- a/src/viewers/libreoffice.js
+++ b/src/viewers/libreoffice.js
@@ -24,6 +24,14 @@ var Klass = GObject.registerClass({
false)
},
}, class LibreofficeRenderer extends Gtk.ScrolledWindow {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file) {
super._init({ hexpand: true,
visible: true,
diff --git a/src/viewers/text.js b/src/viewers/text.js
index 52d4b17..c621efd 100644
--- a/src/viewers/text.js
+++ b/src/viewers/text.js
@@ -38,6 +38,14 @@ var Klass = GObject.registerClass({
false)
},
}, class TextRenderer extends Gtk.ScrolledWindow {
+ get ready() {
+ return !!this._ready;
+ }
+
+ get fullscreen() {
+ return !!this._fullscreen;
+ }
+
_init(file, fileInfo) {
super._init();
--
2.28.0