Skip to content
Open
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
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ if(WIN32)
set(USE_COLORD OFF)
set(USE_KWALLET OFF)
set(BUILD_CMSTEST OFF)
set(BUILD_PRINT OFF)
set(TESTBUILD_OPENCL_PROGRAMS OFF)
if(BUILD_MSYS2_INSTALL)
add_definitions(-DMSYS2_INSTALL)
Expand Down
35 changes: 25 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -913,24 +913,39 @@ if(USE_COLORD)
endif(USE_COLORD)

if(BUILD_PRINT)
find_package(Cups)
if(CUPS_FOUND)
include_directories(SYSTEM ${CUPS_INCLUDE_DIR})
if(WIN32)
# Windows-native print backend using GDI / WinSpool
FILE(GLOB SOURCE_FILES_PRINT
"common/cups_print.h"
"common/cups_print.c"
"common/win_print.c"
"common/printprof.c"
"common/printing.h"
"common/printing.c"
)
set(SOURCES ${SOURCES} ${SOURCE_FILES_PRINT})
list(APPEND LIBS ${CUPS_LIBRARIES})
list(APPEND LIBS winspool gdi32 shell32)
add_definitions("-DHAVE_PRINT")
message(STATUS "Print mode: enabled")
else(CUPS_FOUND)
set(BUILD_PRINT OFF)
message(STATUS "Print mode: disabled, please install CUPS dev package")
endif(CUPS_FOUND)
message(STATUS "Print mode: enabled (Windows native)")
else(WIN32)
find_package(Cups)
if(CUPS_FOUND)
include_directories(SYSTEM ${CUPS_INCLUDE_DIR})
FILE(GLOB SOURCE_FILES_PRINT
"common/cups_print.h"
"common/cups_print.c"
"common/printprof.c"
"common/printing.h"
"common/printing.c"
)
set(SOURCES ${SOURCES} ${SOURCE_FILES_PRINT})
list(APPEND LIBS ${CUPS_LIBRARIES})
add_definitions("-DHAVE_PRINT")
message(STATUS "Print mode: enabled")
else(CUPS_FOUND)
set(BUILD_PRINT OFF)
message(STATUS "Print mode: disabled, please install CUPS dev package")
endif(CUPS_FOUND)
endif(WIN32)
else(BUILD_PRINT)
message(STATUS "Print mode: disabled")
endif(BUILD_PRINT)
Expand Down
2 changes: 1 addition & 1 deletion src/common/printing.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void dt_printing_setup_image(dt_images_box *imgs,
box->print.width = box->pos.width * imgs->page_width;
box->print.height = box->pos.height * imgs->page_height;

dt_image_pos pos;
dt_image_pos pos = { 0 };
_align_pos(&box->print, box->alignment, box->exp_width, box->exp_height, &pos);

box->print.x = pos.x;
Expand Down
Loading