Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ PKG_CHECK_MODULES([XF86VM], [xxf86vm], [have_xf86vm=yes], [have_xf86vm=no])
PKG_CHECK_MODULES([XCB], [xcb], [have_xcb=yes], [have_xcb=no])
PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr],
[have_xcb_randr=yes], [have_xcb_randr=no])
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-scanner], [have_wayland=yes], [have_wayland=no])
AC_PATH_PROG([wayland_scanner], [wayland-scanner])
if test x$wayland_scanner = x; then
PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
fi

PKG_CHECK_MODULES([GLIB], [glib-2.0 gobject-2.0], [have_glib=yes], [have_glib=no])
PKG_CHECK_MODULES([GEOCLUE], [geoclue], [have_geoclue=yes], [have_geoclue=no])
Expand Down Expand Up @@ -104,6 +110,30 @@ AS_IF([test "x$enable_drm" != xno], [
])
AM_CONDITIONAL([ENABLE_DRM], [test "x$enable_drm" = xyes])

# Check Wayland method
AC_MSG_CHECKING([whether to enable Wayland method])
AC_ARG_ENABLE([wayland], [AC_HELP_STRING([--enable-wayland],
[enable Wayland method])],
[enable_wayland=$enableval],[enable_wayland=maybe])
AS_IF([test "x$enable_wayland" != xno], [
AS_IF([test $have_wayland = yes], [
AC_DEFINE([ENABLE_WAYLAND], 1,
[Define to 1 to enable Wayland method])
AC_MSG_RESULT([yes])
enable_wayland=yes
], [
AC_MSG_RESULT([missing dependencies])
AS_IF([test "x$enable_wayland" = xyes], [
AC_MSG_ERROR([missing dependencies for Wayland method])
])
enable_wayland=no
])
], [
AC_MSG_RESULT([no])
enable_wayland=no
])
AM_CONDITIONAL([ENABLE_WAYLAND], [test "x$enable_wayland" = xyes])

# Check RANDR method
AC_MSG_CHECKING([whether to enable RANDR method])
AC_ARG_ENABLE([randr], [AC_HELP_STRING([--enable-randr],
Expand Down Expand Up @@ -365,6 +395,7 @@ echo "

Adjustment methods:
DRM: ${enable_drm}
Wayland: ${enable_wayland}
RANDR: ${enable_randr}
VidMode: ${enable_vidmode}
Quartz (OSX): ${enable_quartz}
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ src/redshift.c
src/config-ini.c

src/gamma-drm.c
src/gamma-wl.c
src/gamma-randr.c
src/gamma-vidmode.c
src/gamma-quartz.c
Expand Down
28 changes: 28 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ redshift_SOURCES = \

EXTRA_redshift_SOURCES = \
gamma-drm.c gamma-drm.h \
gamma-wl.c gamma-wl.h \
gamma-control-protocol.c \
gamma-control-client-protocol.h \
orbital-authorizer-protocol.c \
orbital-authorizer-client-protocol.h \
gamma-randr.c gamma-randr.h \
gamma-vidmode.c gamma-vidmode.h \
gamma-quartz.c gamma-quartz.h \
gamma-w32gdi.c gamma-w32gdi.h \
location-geoclue.c location-geoclue.h

BUILT_SOURCES = \
gamma-control-protocol.c \
gamma-control-client-protocol.h \
orbital-authorizer-protocol.c \
orbital-authorizer-client-protocol.h

AM_CFLAGS =
redshift_LDADD = @LIBINTL@
EXTRA_DIST =
Expand All @@ -38,6 +49,17 @@ redshift_LDADD += \
$(DRM_LIBS) $(DRM_CFLAGS)
endif

if ENABLE_WAYLAND
redshift_SOURCES += gamma-wl.c gamma-wl.h \
gamma-control-client-protocol.h \
gamma-control-protocol.c \
orbital-authorizer-protocol.c \
orbital-authorizer-client-protocol.h
AM_CFLAGS += $(WAYLAND_CFLAGS)
redshift_LDADD += \
$(WAYLAND_LIBS) $(WAYLAND_CFLAGS)
endif

if ENABLE_RANDR
redshift_SOURCES += gamma-randr.c gamma-randr.h
AM_CFLAGS += $(XCB_CFLAGS) $(XCB_RANDR_CFLAGS)
Expand Down Expand Up @@ -99,3 +121,9 @@ liblocation_corelocation_la_LIBADD = \
$(CORELOCATION_CFLAGS) $(CORELOCATION_LIBS)
redshift_LDADD += liblocation-corelocation.la
endif

%-protocol.c : $(srcdir)/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@

%-client-protocol.h : $(srcdir)/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
57 changes: 57 additions & 0 deletions src/gamma-control.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="gamma_control">

<copyright>
Copyright © 2015 Giulio camuffo

Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.

THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
</copyright>

<interface name="gamma_control_manager" version="1">
<request name="destroy" type="destructor"/>

<request name="get_gamma_control">
<arg name="id" type="new_id" interface="gamma_control"/>
<arg name="output" type="object" interface="wl_output"/>
</request>
</interface>

<interface name="gamma_control" version="1">
<enum name="error">
<entry name="invalid_gamma" value="0"/>
</enum>

<request name="destroy" type="destructor"/>

<request name="set_gamma">
<arg name="red" type="array"/>
<arg name="green" type="array"/>
<arg name="blue" type="array"/>
</request>

<request name="reset_gamma"/>

<event name="gamma_size">
<arg name="size" type="uint"/>
</event>
</interface>
</protocol>
Loading