[retro-gtk/wip/aplazas/0.13: 4/26] core-view: Handle the display internaly
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/0.13: 4/26] core-view: Handle the display internaly
- Date: Mon, 11 Sep 2017 17:46:42 +0000 (UTC)
commit 8ed64211c634c9961dbb1c0f258e130e723b1d69
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Sep 11 09:47:34 2017 +0200
core-view: Handle the display internaly
Add methods to CoreView to control the display rather than exposing it
via an accessor. This will give more control over the display to
CoreView and will allow to make the display private.
retro-gtk/retro-core-view-extern.c | 25 +++++++++++++++++++++++++
retro-gtk/retro-core-view.vala | 14 ++++++++++----
2 files changed, 35 insertions(+), 4 deletions(-)
---
diff --git a/retro-gtk/retro-core-view-extern.c b/retro-gtk/retro-core-view-extern.c
index 76c6694..fa9ee02 100644
--- a/retro-gtk/retro-core-view-extern.c
+++ b/retro-gtk/retro-core-view-extern.c
@@ -381,3 +381,28 @@ retro_core_view_as_input_device (RetroCoreView *self,
return RETRO_INPUT_DEVICE (retro_core_view_input_device_new (self, device_type));
}
+
+void
+retro_core_view_set_filter (RetroCoreView *self,
+ RetroVideoFilter filter)
+{
+ g_return_val_if_fail (self != NULL, NULL);
+
+ retro_cairo_display_set_filter (self->display, filter);
+}
+
+void
+retro_core_view_show_video (RetroCoreView *self)
+{
+ g_return_val_if_fail (self != NULL, NULL);
+
+ retro_cairo_display_show_video (self->display);
+}
+
+void
+retro_core_view_hide_video (RetroCoreView *self)
+{
+ g_return_val_if_fail (self != NULL, NULL);
+
+ retro_cairo_display_hide_video (self->display);
+}
diff --git a/retro-gtk/retro-core-view.vala b/retro-gtk/retro-core-view.vala
index 8af89ca..2161756 100644
--- a/retro-gtk/retro-core-view.vala
+++ b/retro-gtk/retro-core-view.vala
@@ -1,6 +1,9 @@
// This file is part of retro-gtk. License: GPL-3.0+.
public class Retro.CoreView : Gtk.EventBox {
+ private Binding pixbuf_binding;
+ public Gdk.Pixbuf pixbuf { set; get; }
+
private bool _can_grab_pointer;
public bool can_grab_pointer {
set {
@@ -46,6 +49,10 @@ public class Retro.CoreView : Gtk.EventBox {
audio_player = new PaPlayer ();
+ pixbuf_binding = display.bind_property ("pixbuf", this, "pixbuf",
+ BindingFlags.BIDIRECTIONAL |
+ BindingFlags.SYNC_CREATE);
+
key_state = new HashTable<uint?, bool?> (int_hash, int_equal);
mouse_button_state = new HashTable<uint?, bool?> (int_hash, int_equal);
@@ -71,10 +78,9 @@ public class Retro.CoreView : Gtk.EventBox {
}
}
- public CairoDisplay get_display () {
- return display;
- }
-
+ public extern void set_filter (VideoFilter filter) ;
+ public extern void show_video ();
+ public extern void hide_video ();
public extern InputDevice as_input_device (DeviceType device_type);
internal extern int16 get_input_state (DeviceType device, uint index, uint id);
internal extern uint64 get_device_capabilities ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]