diff --git a/cogl/cogl/cogl-scanout.c b/cogl/cogl/cogl-scanout.c index cfd4bfd7e..11b6b2bd2 100644 --- a/cogl/cogl/cogl-scanout.c +++ b/cogl/cogl/cogl-scanout.c @@ -29,11 +29,27 @@ #include "cogl-scanout.h" +enum +{ + SCANOUT_FAILED, + + N_SIGNALS +}; + +static guint signals[N_SIGNALS]; + G_DEFINE_INTERFACE (CoglScanout, cogl_scanout, G_TYPE_OBJECT) static void cogl_scanout_default_init (CoglScanoutInterface *iface) { + signals[SCANOUT_FAILED] = + g_signal_new ("scanout-failed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + COGL_TYPE_ONSCREEN); } gboolean @@ -54,3 +70,10 @@ cogl_scanout_blit_to_framebuffer (CoglScanout *scanout, else return FALSE; } + +void +cogl_scanout_notify_failed (CoglScanout *scanout, + CoglOnscreen *onscreen) +{ + g_signal_emit (scanout, signals[SCANOUT_FAILED], 0, onscreen); +} diff --git a/cogl/cogl/cogl-scanout.h b/cogl/cogl/cogl-scanout.h index d458a84fe..22e6266aa 100644 --- a/cogl/cogl/cogl-scanout.h +++ b/cogl/cogl/cogl-scanout.h @@ -30,6 +30,7 @@ #include "cogl/cogl-types.h" #include "cogl/cogl-framebuffer.h" +#include "cogl/cogl-onscreen.h" #include @@ -56,4 +57,8 @@ gboolean cogl_scanout_blit_to_framebuffer (CoglScanout *scanout, int y, GError **error); +COGL_EXPORT +void cogl_scanout_notify_failed (CoglScanout *scanout, + CoglOnscreen *onscreen); + #endif /* COGL_SCANOUT_H */