Skip to content

Commit 71e1de2

Browse files
authored
Merge pull request #500 from jonls/continuous-location
Continuous location updates
2 parents 25451b1 + c129e59 commit 71e1de2

14 files changed

+843
-283
lines changed

.travis.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,28 @@ addons:
2828
# GUI
2929
- python3
3030

31-
install: |
31+
before_install: |
3232
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
3333
brew install gettext
3434
brew link --force gettext
3535
brew install intltool
3636
brew install python3
3737
fi
3838
39-
script:
39+
install:
4040
- ./bootstrap
41+
- mkdir "$TRAVIS_BUILD_DIR/root"
4142
- |
4243
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
43-
./configure --enable-drm --enable-vidmode --enable-randr --enable-geoclue2 --enable-gui
44+
./configure --prefix="$TRAVIS_BUILD_DIR/root" --enable-drm --enable-vidmode --enable-randr --enable-geoclue2 --enable-gui
4445
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
45-
./configure --enable-corelocation --enable-quartz --enable-gui
46+
./configure --prefix="$TRAVIS_BUILD_DIR/root" --enable-corelocation --enable-quartz --enable-gui
4647
fi
48+
- make -j2 install
4749
- make -j2 distcheck
50+
51+
script:
52+
- |
53+
"$TRAVIS_BUILD_DIR"/root/bin/redshift -l 12:-34 -pv
54+
- |
55+
"$TRAVIS_BUILD_DIR"/root/bin/redshift -l 12:-34 -m dummy -vo

appveyor.yml

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ build_script:
2525
- C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER && make distcheck DISTCHECK_CONFIGURE_FLAGS=\"$CONFIGURE_FLAGS\""
2626
- C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER && make install"
2727

28+
test_script:
29+
- |
30+
%APPVEYOR_BUILD_FOLDER%\root\bin\redshift.exe -l 12:-34 -pv
31+
%APPVEYOR_BUILD_FOLDER%\root\bin\redshift.exe -l 12:-34 -m dummy -vo
32+
2833
after_build:
2934
- ps: |
3035
$ZIP_NAME = "redshift-windows-$env:arch"

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ AC_ARG_ENABLE([corelocation], [AC_HELP_STRING([--enable-corelocation],
257257
AS_IF([test "x$enable_corelocation" != xno], [
258258
AS_IF([test "x$have_corelocation_h" = xyes], [
259259
CORELOCATION_CFLAGS=""
260-
CORELOCATION_LIBS="-framework Foundation -framework CoreLocation"
260+
CORELOCATION_LIBS="-framework Foundation -framework Cocoa -framework CoreLocation"
261261
AC_DEFINE([ENABLE_CORELOCATION], 1,
262262
[Define to 1 to enable CoreLocation provider])
263263
AC_MSG_RESULT([yes])

src/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ redshift_SOURCES = \
1414
gamma-dummy.c gamma-dummy.h \
1515
hooks.c hooks.h \
1616
location-manual.c location-manual.h \
17+
pipeutils.c pipeutils.h \
1718
redshift.c redshift.h \
1819
signals.c signals.h \
1920
solar.c solar.h \

src/location-corelocation.h

+25-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
You should have received a copy of the GNU General Public License
1515
along with Redshift. If not, see <http://www.gnu.org/licenses/>.
1616
17-
Copyright (c) 2014 Jon Lund Steffense <[email protected]>
17+
Copyright (c) 2014-2017 Jon Lund Steffense <[email protected]>
1818
*/
1919

2020
#ifndef REDSHIFT_LOCATION_CORELOCATION_H
@@ -24,17 +24,33 @@
2424

2525
#include "redshift.h"
2626

27+
typedef struct location_corelocation_private location_corelocation_private_t;
2728

28-
int location_corelocation_init(void *state);
29-
int location_corelocation_start(void *state);
30-
void location_corelocation_free(void *state);
29+
typedef struct {
30+
location_corelocation_private_t *private;
31+
int pipe_fd_read;
32+
int pipe_fd_write;
33+
int available;
34+
int error;
35+
float latitude;
36+
float longitude;
37+
} location_corelocation_state_t;
3138

32-
void location_corelocation_print_help(FILE *f);
33-
int location_corelocation_set_option(void *state,
34-
const char *key, const char *value);
3539

36-
int location_corelocation_get_location(void *state,
37-
location_t *location);
40+
int location_corelocation_init(location_corelocation_state_t *state);
41+
int location_corelocation_start(location_corelocation_state_t *state);
42+
void location_corelocation_free(location_corelocation_state_t *state);
43+
44+
void location_corelocation_print_help(FILE *f);
45+
int location_corelocation_set_option(
46+
location_corelocation_state_t *state,
47+
const char *key, const char *value);
48+
49+
int location_corelocation_get_fd(
50+
location_corelocation_state_t *state);
51+
int location_corelocation_handle(
52+
location_corelocation_state_t *state,
53+
location_t *location, int *available);
3854

3955

4056
#endif /* ! REDSHIFT_LOCATION_CORELOCATION_H */

0 commit comments

Comments
 (0)