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 Oct 14, 2022
1 parent 5e7ac5d commit 98224fa
Show file tree
Hide file tree
Showing 7 changed files with 669 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmake/ConkyBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,14 @@ 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)
if(BUILD_X11 OR BUILD_SDL)
set(BUILD_GUI true)
endif(BUILD_X11)
endif(BUILD_X11 OR 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 @@ -393,6 +393,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
2 changes: 2 additions & 0 deletions cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@

#cmakedefine BUILD_HTTP 1

#cmakedefine BUILD_SDL 1

#cmakedefine BUILD_GUI 1

#cmakedefine BUILD_ICONV 1
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,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
lua-config.cc
Expand Down
2 changes: 2 additions & 0 deletions src/display-output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern void init_ncurses_output();
extern void init_file_output();
extern void init_http_output();
extern void init_x11_output();
extern void init_sdl_output();

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

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

0 comments on commit 98224fa

Please sign in to comment.