Commit a080477b authored by Giovanni Campagna's avatar Giovanni Campagna

Turn GnomeRRScreen into a GObject

Rework GnomeRRScreen so that it is a full GObject, and all its data
is moved to GnomeRRScreenPrivate.
GObject's are more supported when it comes to introspection and bindings,
in particular wrt constructors. Therefore, this is a necessary step
for useful introspection generation.

https://bugzilla.gnome.org/show_bug.cgi?id=630913
parent af40f93e
......@@ -1909,7 +1909,7 @@ crtc_assignment_apply (CrtcAssignment *assign, guint32 timestamp, GError **error
* status.
*/
gdk_x11_display_grab (gdk_screen_get_display (assign->screen->gdk_screen));
gdk_x11_display_grab (gdk_screen_get_display (assign->screen->priv->gdk_screen));
/* Turn off all crtcs that are currently displaying outside the new screen,
* or are not used in the new setup
......@@ -1973,7 +1973,7 @@ crtc_assignment_apply (CrtcAssignment *assign, guint32 timestamp, GError **error
gnome_rr_screen_set_primary_output (assign->screen, assign->primary);
gdk_x11_display_ungrab (gdk_screen_get_display (assign->screen->gdk_screen));
gdk_x11_display_ungrab (gdk_screen_get_display (assign->screen->priv->gdk_screen));
return success;
}
......@@ -31,7 +31,7 @@ struct ScreenInfo
#endif
};
struct GnomeRRScreen
struct GnomeRRScreenPrivate
{
GdkScreen * gdk_screen;
GdkWindow * gdk_root;
......@@ -44,9 +44,6 @@ struct GnomeRRScreen
int rr_major_version;
int rr_minor_version;
GnomeRRScreenChanged callback;
gpointer data;
Atom connector_type_atom;
};
......
This diff is collapsed.
......@@ -31,11 +31,22 @@
#include <glib.h>
#include <gdk/gdk.h>
typedef struct GnomeRRScreen GnomeRRScreen;
typedef struct GnomeRRScreenPrivate GnomeRRScreenPrivate;
typedef struct GnomeRROutput GnomeRROutput;
typedef struct GnomeRRCrtc GnomeRRCrtc;
typedef struct GnomeRRMode GnomeRRMode;
typedef struct {
GObject parent;
GnomeRRScreenPrivate* priv;
} GnomeRRScreen;
typedef struct {
GObjectClass parent_class;
} GnomeRRScreenClass;
typedef void (* GnomeRRScreenChanged) (GnomeRRScreen *screen, gpointer data);
typedef enum
......@@ -65,6 +76,19 @@ typedef enum {
#define GNOME_RR_CONNECTOR_TYPE_PANEL "Panel" /* This is a laptop's built-in LCD */
#define GNOME_RR_TYPE_SCREEN (gnome_rr_screen_get_type())
#define GNOME_RR_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_RR_TYPE_SCREEN, GnomeRRScreen))
#define GNOME_RR_IS_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_RR_TYPE_SCREEN))
#define GNOME_RR_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_RR_TYPE_SCREEN, GnomeRRScreenClass))
#define GNOME_RR_IS_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_RR_TYPE_SCREEN))
#define GNOME_RR_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_RR_TYPE_SCREEN, GnomeRRScreenClass))
#define GNOME_RR_TYPE_OUTPUT (gnome_rr_output_get_type())
#define GNOME_RR_TYPE_CRTC (gnome_rr_crtc_get_type())
#define GNOME_RR_TYPE_MODE (gnome_rr_mode_get_type())
GType gnome_rr_screen_get_type (void);
/* GnomeRRScreen */
GnomeRRScreen * gnome_rr_screen_new (GdkScreen *screen,
GnomeRRScreenChanged callback,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment