Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gnome-flashback
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gnome-flashback
Commits
55e758e2
Commit
55e758e2
authored
Sep 10, 2017
by
Alberts Muktupāvels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backends: add GfMonitorManager classes
parent
2636c3d5
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
600 additions
and
4 deletions
+600
-4
backends/Makefile.am
backends/Makefile.am
+9
-0
backends/gf-backend-native.c
backends/gf-backend-native.c
+10
-0
backends/gf-backend-private.h
backends/gf-backend-private.h
+4
-1
backends/gf-backend-x11-cm.c
backends/gf-backend-x11-cm.c
+22
-1
backends/gf-backend-x11-nested.c
backends/gf-backend-x11-nested.c
+13
-0
backends/gf-backend.c
backends/gf-backend.c
+32
-0
backends/gf-backend.h
backends/gf-backend.h
+4
-2
backends/gf-monitor-manager-dummy-private.h
backends/gf-monitor-manager-dummy-private.h
+38
-0
backends/gf-monitor-manager-dummy.c
backends/gf-monitor-manager-dummy.c
+46
-0
backends/gf-monitor-manager-kms-private.h
backends/gf-monitor-manager-kms-private.h
+38
-0
backends/gf-monitor-manager-kms.c
backends/gf-monitor-manager-kms.c
+44
-0
backends/gf-monitor-manager-private.h
backends/gf-monitor-manager-private.h
+59
-0
backends/gf-monitor-manager-xrandr-private.h
backends/gf-monitor-manager-xrandr-private.h
+42
-0
backends/gf-monitor-manager-xrandr.c
backends/gf-monitor-manager-xrandr.c
+53
-0
backends/gf-monitor-manager.c
backends/gf-monitor-manager.c
+153
-0
backends/gf-monitor-manager.h
backends/gf-monitor-manager.h
+33
-0
No files found.
backends/Makefile.am
View file @
55e758e2
...
...
@@ -31,6 +31,15 @@ libbackends_la_SOURCES = \
gf-backend.h
\
gf-edid-parse.c
\
gf-edid-private.h
\
gf-monitor-manager-dummy-private.h
\
gf-monitor-manager-dummy.c
\
gf-monitor-manager-kms-private.h
\
gf-monitor-manager-kms.c
\
gf-monitor-manager-private.h
\
gf-monitor-manager-xrandr-private.h
\
gf-monitor-manager-xrandr.c
\
gf-monitor-manager.c
\
gf-monitor-manager.h
\
gf-monitor-spec-private.h
\
gf-monitor-spec.c
\
gf-orientation-manager-private.h
\
...
...
backends/gf-backend-native.c
View file @
55e758e2
...
...
@@ -25,6 +25,7 @@
#include "config.h"
#include "gf-backend-native-private.h"
#include "gf-monitor-manager-kms-private.h"
struct
_GfBackendNative
{
...
...
@@ -39,6 +40,14 @@ gf_backend_native_post_init (GfBackend *backend)
GF_BACKEND_CLASS
(
gf_backend_native_parent_class
)
->
post_init
(
backend
);
}
static
GfMonitorManager
*
gf_backend_native_create_monitor_manager
(
GfBackend
*
backend
)
{
return
g_object_new
(
GF_TYPE_MONITOR_MANAGER_KMS
,
"backend"
,
backend
,
NULL
);
}
static
void
gf_backend_native_class_init
(
GfBackendNativeClass
*
native_class
)
{
...
...
@@ -47,6 +56,7 @@ gf_backend_native_class_init (GfBackendNativeClass *native_class)
backend_class
=
GF_BACKEND_CLASS
(
native_class
);
backend_class
->
post_init
=
gf_backend_native_post_init
;
backend_class
->
create_monitor_manager
=
gf_backend_native_create_monitor_manager
;
}
static
void
...
...
backends/gf-backend-private.h
View file @
55e758e2
...
...
@@ -27,6 +27,7 @@
#define GF_BACKEND_PRIVATE_H
#include "gf-backend.h"
#include "gf-monitor-manager-private.h"
G_BEGIN_DECLS
...
...
@@ -34,7 +35,9 @@ struct _GfBackendClass
{
GObjectClass
parent_class
;
void
(
*
post_init
)
(
GfBackend
*
backend
);
void
(
*
post_init
)
(
GfBackend
*
backend
);
GfMonitorManager
*
(
*
create_monitor_manager
)
(
GfBackend
*
backend
);
};
G_END_DECLS
...
...
backends/gf-backend-x11-cm.c
View file @
55e758e2
...
...
@@ -21,6 +21,7 @@
#include "config.h"
#include "gf-backend-x11-cm-private.h"
#include "gf-monitor-manager-xrandr-private.h"
struct
_GfBackendX11Cm
{
...
...
@@ -29,20 +30,40 @@ struct _GfBackendX11Cm
G_DEFINE_TYPE
(
GfBackendX11Cm
,
gf_backend_x11_cm
,
GF_TYPE_BACKEND_X11
)
static
GfMonitorManager
*
gf_backend_x11_cm_create_monitor_manager
(
GfBackend
*
backend
)
{
return
g_object_new
(
GF_TYPE_MONITOR_MANAGER_XRANDR
,
"backend"
,
backend
,
NULL
);
}
static
gboolean
gf_backend_x11_cm_handle_host_xevent
(
GfBackendX11
*
x11
,
XEvent
*
event
)
{
return
FALSE
;
GfBackend
*
backend
;
GfMonitorManager
*
monitor_manager
;
GfMonitorManagerXrandr
*
xrandr
;
backend
=
GF_BACKEND
(
x11
);
monitor_manager
=
gf_backend_get_monitor_manager
(
backend
);
xrandr
=
GF_MONITOR_MANAGER_XRANDR
(
monitor_manager
);
return
gf_monitor_manager_xrandr_handle_xevent
(
xrandr
,
event
);
}
static
void
gf_backend_x11_cm_class_init
(
GfBackendX11CmClass
*
x11_cm_class
)
{
GfBackendClass
*
backend_class
;
GfBackendX11Class
*
backend_x11_class
;
backend_class
=
GF_BACKEND_CLASS
(
x11_cm_class
);
backend_x11_class
=
GF_BACKEND_X11_CLASS
(
x11_cm_class
);
backend_class
->
create_monitor_manager
=
gf_backend_x11_cm_create_monitor_manager
;
backend_x11_class
->
handle_host_xevent
=
gf_backend_x11_cm_handle_host_xevent
;
}
...
...
backends/gf-backend-x11-nested.c
View file @
55e758e2
...
...
@@ -21,6 +21,7 @@
#include "config.h"
#include "gf-backend-x11-nested-private.h"
#include "gf-monitor-manager-dummy-private.h"
struct
_GfBackendX11Nested
{
...
...
@@ -29,6 +30,14 @@ struct _GfBackendX11Nested
G_DEFINE_TYPE
(
GfBackendX11Nested
,
gf_backend_x11_nested
,
GF_TYPE_BACKEND_X11
)
static
GfMonitorManager
*
gf_backend_x11_nested_create_monitor_manager
(
GfBackend
*
backend
)
{
return
g_object_new
(
GF_TYPE_MONITOR_MANAGER_DUMMY
,
"backend"
,
backend
,
NULL
);
}
static
gboolean
gf_backend_x11_nested_handle_host_xevent
(
GfBackendX11
*
x11
,
XEvent
*
event
)
...
...
@@ -39,10 +48,14 @@ gf_backend_x11_nested_handle_host_xevent (GfBackendX11 *x11,
static
void
gf_backend_x11_nested_class_init
(
GfBackendX11NestedClass
*
x11_nested_class
)
{
GfBackendClass
*
backend_class
;
GfBackendX11Class
*
backend_x11_class
;
backend_class
=
GF_BACKEND_CLASS
(
x11_nested_class
);
backend_x11_class
=
GF_BACKEND_X11_CLASS
(
x11_nested_class
);
backend_class
->
create_monitor_manager
=
gf_backend_x11_nested_create_monitor_manager
;
backend_x11_class
->
handle_host_xevent
=
gf_backend_x11_nested_handle_host_xevent
;
}
...
...
backends/gf-backend.c
View file @
55e758e2
...
...
@@ -30,6 +30,7 @@
#include "gf-backend-native-private.h"
#include "gf-backend-x11-cm-private.h"
#include "gf-backend-x11-nested-private.h"
#include "gf-monitor-manager-dummy-private.h"
#include "gf-orientation-manager-private.h"
#include "gf-settings-private.h"
...
...
@@ -37,6 +38,8 @@ typedef struct
{
GfSettings
*
settings
;
GfOrientationManager
*
orientation_manager
;
GfMonitorManager
*
monitor_manager
;
}
GfBackendPrivate
;
static
void
...
...
@@ -47,6 +50,19 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GfBackend, gf_backend, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE
(
G_TYPE_INITABLE
,
initable_iface_init
))
static
GfMonitorManager
*
create_monitor_manager
(
GfBackend
*
backend
)
{
if
(
g_getenv
(
"DUMMY_MONITORS"
))
{
return
g_object_new
(
GF_TYPE_MONITOR_MANAGER_DUMMY
,
"backend"
,
backend
,
NULL
);
}
return
GF_BACKEND_GET_CLASS
(
backend
)
->
create_monitor_manager
(
backend
);
}
static
gboolean
gf_backend_initable_init
(
GInitable
*
initable
,
GCancellable
*
cancellable
,
...
...
@@ -79,6 +95,7 @@ gf_backend_dispose (GObject *object)
backend
=
GF_BACKEND
(
object
);
priv
=
gf_backend_get_instance_private
(
backend
);
g_clear_object
(
&
priv
->
monitor_manager
);
g_clear_object
(
&
priv
->
orientation_manager
);
g_clear_object
(
&
priv
->
settings
);
...
...
@@ -88,6 +105,11 @@ gf_backend_dispose (GObject *object)
static
void
gf_backend_real_post_init
(
GfBackend
*
backend
)
{
GfBackendPrivate
*
priv
;
priv
=
gf_backend_get_instance_private
(
backend
);
priv
->
monitor_manager
=
create_monitor_manager
(
backend
);
}
static
void
...
...
@@ -150,3 +172,13 @@ gf_backend_new (GfBackendType type)
return
backend
;
}
GfMonitorManager
*
gf_backend_get_monitor_manager
(
GfBackend
*
backend
)
{
GfBackendPrivate
*
priv
;
priv
=
gf_backend_get_instance_private
(
backend
);
return
priv
->
monitor_manager
;
}
backends/gf-backend.h
View file @
55e758e2
...
...
@@ -26,7 +26,7 @@
#ifndef GF_BACKEND_H
#define GF_BACKEND_H
#include
<glib-object.h>
#include
"gf-monitor-manager.h"
G_BEGIN_DECLS
...
...
@@ -40,7 +40,9 @@ typedef enum
GF_BACKEND_TYPE_NATIVE
}
GfBackendType
;
GfBackend
*
gf_backend_new
(
GfBackendType
type
);
GfBackend
*
gf_backend_new
(
GfBackendType
type
);
GfMonitorManager
*
gf_backend_get_monitor_manager
(
GfBackend
*
backend
);
G_END_DECLS
...
...
backends/gf-monitor-manager-dummy-private.h
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/meta-monitor-manager-dummy.h
*/
#ifndef GF_MONITOR_MANAGER_DUMMY_PRIVATE_H
#define GF_MONITOR_MANAGER_DUMMY_PRIVATE_H
#include "gf-monitor-manager-private.h"
G_BEGIN_DECLS
#define GF_TYPE_MONITOR_MANAGER_DUMMY (gf_monitor_manager_dummy_get_type ())
G_DECLARE_FINAL_TYPE
(
GfMonitorManagerDummy
,
gf_monitor_manager_dummy
,
GF
,
MONITOR_MANAGER_DUMMY
,
GfMonitorManager
)
G_END_DECLS
#endif
backends/gf-monitor-manager-dummy.c
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2,
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/meta-monitor-manager-dummy.c
*/
#include "config.h"
#include "gf-monitor-manager-dummy-private.h"
struct
_GfMonitorManagerDummy
{
GfMonitorManager
parent
;
};
G_DEFINE_TYPE
(
GfMonitorManagerDummy
,
gf_monitor_manager_dummy
,
GF_TYPE_MONITOR_MANAGER
)
static
void
gf_monitor_manager_dummy_class_init
(
GfMonitorManagerDummyClass
*
dummy_class
)
{
}
static
void
gf_monitor_manager_dummy_init
(
GfMonitorManagerDummy
*
dummy
)
{
}
backends/gf-monitor-manager-kms-private.h
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/native/meta-monitor-manager-kms.h
*/
#ifndef GF_MONITOR_MANAGER_KMS_PRIVATE_H
#define GF_MONITOR_MANAGER_KMS_PRIVATE_H
#include "gf-monitor-manager-private.h"
G_BEGIN_DECLS
#define GF_TYPE_MONITOR_MANAGER_KMS (gf_monitor_manager_kms_get_type ())
G_DECLARE_FINAL_TYPE
(
GfMonitorManagerKms
,
gf_monitor_manager_kms
,
GF
,
MONITOR_MANAGER_KMS
,
GfMonitorManager
)
G_END_DECLS
#endif
backends/gf-monitor-manager-kms.c
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Alberts Muktupāvels <alberts.muktupavels@gmail.com>
* Giovanni Campagna <gcampagn@redhat.com>
*
* Adapted from mutter:
* - src/backends/native/meta-monitor-manager-kms.c
*/
#include "config.h"
#include "gf-monitor-manager-kms-private.h"
struct
_GfMonitorManagerKms
{
GfMonitorManager
parent
;
};
G_DEFINE_TYPE
(
GfMonitorManagerKms
,
gf_monitor_manager_kms
,
GF_TYPE_MONITOR_MANAGER
)
static
void
gf_monitor_manager_kms_class_init
(
GfMonitorManagerKmsClass
*
kms_class
)
{
}
static
void
gf_monitor_manager_kms_init
(
GfMonitorManagerKms
*
kms
)
{
}
backends/gf-monitor-manager-private.h
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/meta-monitor-manager-private.h
*/
#ifndef GF_MONITOR_MANAGER_PRIVATE_H
#define GF_MONITOR_MANAGER_PRIVATE_H
#include "gf-backend-private.h"
#include "gf-dbus-display-config.h"
#include "gf-monitor-manager.h"
G_BEGIN_DECLS
typedef
struct
_GfMonitorManagerClass
GfMonitorManagerClass
;
#define GF_TYPE_MONITOR_MANAGER (gf_monitor_manager_get_type ())
#define GF_MONITOR_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GF_TYPE_MONITOR_MANAGER, GfMonitorManager))
#define GF_MONITOR_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GF_TYPE_MONITOR_MANAGER, GfMonitorManagerClass))
#define GF_IS_MONITOR_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GF_TYPE_MONITOR_MANAGER))
#define GF_IS_MONITOR_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GF_TYPE_MONITOR_MANAGER))
#define GF_MONITOR_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GF_TYPE_MONITOR_MANAGER, GfMonitorManagerClass))
G_DEFINE_AUTOPTR_CLEANUP_FUNC
(
GfMonitorManager
,
g_object_unref
)
struct
_GfMonitorManager
{
GfDBusDisplayConfigSkeleton
parent
;
};
struct
_GfMonitorManagerClass
{
GfDBusDisplayConfigSkeletonClass
parent_class
;
};
GType
gf_monitor_manager_get_type
(
void
);
G_END_DECLS
#endif
backends/gf-monitor-manager-xrandr-private.h
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/x11/meta-monitor-manager-xrandr.h
*/
#ifndef GF_MONITOR_MANAGER_XRANDR_PRIVATE_H
#define GF_MONITOR_MANAGER_XRANDR_PRIVATE_H
#include <X11/Xlib.h>
#include "gf-monitor-manager-private.h"
G_BEGIN_DECLS
#define GF_TYPE_MONITOR_MANAGER_XRANDR (gf_monitor_manager_xrandr_get_type ())
G_DECLARE_FINAL_TYPE
(
GfMonitorManagerXrandr
,
gf_monitor_manager_xrandr
,
GF
,
MONITOR_MANAGER_XRANDR
,
GfMonitorManager
)
gboolean
gf_monitor_manager_xrandr_handle_xevent
(
GfMonitorManagerXrandr
*
xrandr
,
XEvent
*
event
);
G_END_DECLS
#endif
backends/gf-monitor-manager-xrandr.c
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2,
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/x11/meta-monitor-manager-xrandr.c
*/
#include "config.h"
#include "gf-monitor-manager-xrandr-private.h"
struct
_GfMonitorManagerXrandr
{
GfMonitorManager
parent
;
};
G_DEFINE_TYPE
(
GfMonitorManagerXrandr
,
gf_monitor_manager_xrandr
,
GF_TYPE_MONITOR_MANAGER
)
static
void
gf_monitor_manager_xrandr_class_init
(
GfMonitorManagerXrandrClass
*
xrandr_class
)
{
}
static
void
gf_monitor_manager_xrandr_init
(
GfMonitorManagerXrandr
*
xrandr
)
{
}
gboolean
gf_monitor_manager_xrandr_handle_xevent
(
GfMonitorManagerXrandr
*
xrandr
,
XEvent
*
event
)
{
return
FALSE
;
}
backends/gf-monitor-manager.c
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2,
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
* Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc.
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/backends/meta-monitor-manager.c
*/
#include "config.h"
#include "gf-monitor-manager-private.h"
typedef
struct
{
GfBackend
*
backend
;
}
GfMonitorManagerPrivate
;
enum
{
PROP_0
,
PROP_BACKEND
,
LAST_PROP
};
static
GParamSpec
*
manager_properties
[
LAST_PROP
]
=
{
NULL
};
static
void
gf_monitor_manager_display_config_init
(
GfDBusDisplayConfigIface
*
iface
);
G_DEFINE_ABSTRACT_TYPE_WITH_CODE
(
GfMonitorManager
,
gf_monitor_manager
,
GF_DBUS_TYPE_DISPLAY_CONFIG_SKELETON
,
G_ADD_PRIVATE
(
GfMonitorManager
)
G_IMPLEMENT_INTERFACE
(
GF_DBUS_TYPE_DISPLAY_CONFIG
,
gf_monitor_manager_display_config_init
))
static
void
gf_monitor_manager_display_config_init
(
GfDBusDisplayConfigIface
*
iface
)
{
}
static
void
gf_monitor_manager_dispose
(
GObject
*
object
)
{
GfMonitorManager
*
manager
;
GfMonitorManagerPrivate
*
priv
;
manager
=
GF_MONITOR_MANAGER
(
object
);
priv
=
gf_monitor_manager_get_instance_private
(
manager
);
priv
->
backend
=
NULL
;
G_OBJECT_CLASS
(
gf_monitor_manager_parent_class
)
->
dispose
(
object
);
}
static
void
gf_monitor_manager_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
)
{
GfMonitorManager
*
manager
;
GfMonitorManagerPrivate
*
priv
;
manager
=
GF_MONITOR_MANAGER
(
object
);
priv
=
gf_monitor_manager_get_instance_private
(
manager
);
switch
(
property_id
)
{
case
PROP_BACKEND
:
g_value_set_object
(
value
,
priv
->
backend
);
break
;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
break
;
}
}
static
void
gf_monitor_manager_set_property
(
GObject
*
object
,
guint
property_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
)
{
GfMonitorManager
*
manager
;
GfMonitorManagerPrivate
*
priv
;
manager
=
GF_MONITOR_MANAGER
(
object
);
priv
=
gf_monitor_manager_get_instance_private
(
manager
);
switch
(
property_id
)
{
case
PROP_BACKEND
:
priv
->
backend
=
g_value_get_object
(
value
);
break
;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
break
;
}
}
static
void
gf_monitor_manager_install_properties
(
GObjectClass
*
object_class
)
{
manager_properties
[
PROP_BACKEND
]
=
g_param_spec_object
(
"backend"
,
"GfBackend"
,
"GfBackend"
,
GF_TYPE_BACKEND
,
G_PARAM_WRITABLE
|
G_PARAM_CONSTRUCT_ONLY
|
G_PARAM_STATIC_STRINGS
);
g_object_class_install_properties
(
object_class
,
LAST_PROP
,
manager_properties
);
}
static
void
gf_monitor_manager_class_init
(
GfMonitorManagerClass
*
manager_class
)
{
GObjectClass
*
object_class
;
object_class
=
G_OBJECT_CLASS
(
manager_class
);
object_class
->
dispose
=
gf_monitor_manager_dispose
;
object_class
->
get_property
=
gf_monitor_manager_get_property
;
object_class
->
set_property
=
gf_monitor_manager_set_property
;
gf_monitor_manager_install_properties
(
object_class
);
}
static
void
gf_monitor_manager_init
(
GfMonitorManager
*
manager
)
{
}
backends/gf-monitor-manager.h
0 → 100644
View file @
55e758e2
/*
* Copyright (C) 2015 Red Hat
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Adapted from mutter:
* - src/meta/meta-monitor-manager.h
*/
#ifndef GF_MONITOR_MANAGER_H
#define GF_MONITOR_MANAGER_H
#include <glib-object.h>
G_BEGIN_DECLS
typedef
struct
_GfMonitorManager
GfMonitorManager
;
G_END_DECLS
#endif