Skip to content

Commit

Permalink
WIP: SDL display support
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuman committed Aug 4, 2023
1 parent fc8be98 commit 65a388d
Show file tree
Hide file tree
Showing 7 changed files with 635 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/ConkyBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,20 @@ else(BUILD_X11)
set(BUILD_NVIDIA false)
endif(BUILD_X11)

option(BUILD_SDL "Build SDL 1.2 support" false)
if(BUILD_SDL)
endif(BUILD_SDL)

# if we build with any GUI support
if(BUILD_X11)
set(BUILD_GUI true)
endif(BUILD_X11)
if(BUILD_WAYLAND)
set(BUILD_GUI true)
endif(BUILD_WAYLAND)
if(BUILD_SDL)
set(BUILD_GUI true)
endif(BUILD_SDL)

if(OWN_WINDOW)
option(BUILD_ARGB "Build ARGB (real transparency) support" true)
Expand Down
23 changes: 23 additions & 0 deletions cmake/ConkyPlatformChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,29 @@ if(BUILD_X11)
endif(BUILD_LUA_RSVG)
endif(BUILD_X11)

# check for SDL
if(BUILD_SDL)
include(FindSDL)
include(FindSDL_ttf)
find_package(SDL)
if(SDL_FOUND)
set(conky_includes ${conky_includes} ${SDL_INCLUDE_DIR})
set(conky_libs ${conky_libs} ${SDL_LIBRARIES})
find_package(SDL_ttf)
if(SDLTTF_FOUND)
set(conky_includes ${conky_includes} ${SDL_TTF_INCLUDE_DIR})
set(conky_libs ${conky_libs} ${SDL_TTF_LIBRARIES})
else(SDLTTL_FOUND)
message(FATAL_ERROR "Unable to find SDL_ttf library")
endif(SDLTTF_FOUND)
check_include_files(SDL_gfxPrimitives.h HAVE_SDL_GFXPRIMITIVES_H)
find_library(SDLGFX_LIBRARY SDL_gfx)
else(SDL_FOUND)
message(FATAL_ERROR "Unable to find SDL library")
endif(SDL_FOUND)
check_include_files(ftw.h HAVE_FTW_H)
endif(BUILD_SDL)

if(BUILD_AUDACIOUS)
set(WANT_GLIB true)
pkg_check_modules(NEW_AUDACIOUS audacious>=1.4.0)
Expand Down
4 changes: 4 additions & 0 deletions cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#cmakedefine HAVE_SYS_INOTIFY_H 1
#cmakedefine HAVE_DIRENT_H 1

#cmakedefine HAVE_FTW_H 1

#cmakedefine HAVE_SOME_SOUNDCARD_H 1
#cmakedefine HAVE_LINUX_SOUNDCARD_H 1

Expand Down Expand Up @@ -117,6 +119,8 @@

#cmakedefine BUILD_HTTP 1

#cmakedefine BUILD_SDL 1

#cmakedefine BUILD_GUI 1

#cmakedefine BUILD_ICONV 1
Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ set(conky_sources
display-ncurses.hh
display-http.cc
display-http.hh
display-sdl.cc
display-sdl.hh
display-x11.cc
display-x11.hh
display-wayland.cc
Expand Down Expand Up @@ -251,6 +253,11 @@ if(BUILD_GUI)
set(optional_sources ${optional_sources} ${gui})
endif(BUILD_GUI)

if(BUILD_SDL)
set(sdl_srcs )
set(optional_sources ${optional_sources} ${sdl_srcs})
endif(BUILD_SDL)

if(BUILD_WAYLAND)
set(wl_srcs wl.cc wl.h xdg-shell-protocol.c wlr-layer-shell-protocol.c)
set(optional_sources ${optional_sources} ${wl_srcs})
Expand Down
2 changes: 2 additions & 0 deletions src/display-output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern void init_file_output();
extern void init_http_output();
extern void init_x11_output();
extern void init_wayland_output();
extern void init_sdl_output();

/*
* The selected and active display output.
Expand Down Expand Up @@ -113,6 +114,7 @@ bool initialize_display_outputs() {
init_http_output();
init_x11_output();
init_wayland_output();
init_sdl_output();

std::vector<display_output_base *> outputs;
outputs.reserve(display_outputs->size());
Expand Down
Loading

0 comments on commit 65a388d

Please sign in to comment.