From 338c7da20796bc29f8a0ba80707b11cada292d3c Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Tue, 5 Apr 2022 23:09:06 +0200 Subject: [PATCH] libcupsfilters: Removed kmdevices.* (Kolor Manager/Oyranos interface) The files cupsfilters/kmdevices.h and cupsfilters/kmdevices.cpp form an interface for Kolor Manager, a KDE system settings component for color management with Oyranos. Kolor Manager is unmaintained for several years, same for Oyranos. The kmdevices.* are not included in the build of libcupsfilters, only shipped for optional use (requires uncommenting a line in colormanager.c) and no one complained about their non-inclusion in the build. They even contain a typo which would prevent them from building. So one can assume that no one cares about them. Therefore they get removed now, before the cups-filters 2.x release. --- Makefile.am | 2 -- cupsfilters/colormanager.c | 1 - cupsfilters/kmdevices.cpp | 65 -------------------------------------- cupsfilters/kmdevices.h | 33 ------------------- 4 files changed, 101 deletions(-) delete mode 100644 cupsfilters/kmdevices.cpp delete mode 100644 cupsfilters/kmdevices.h diff --git a/Makefile.am b/Makefile.am index 46407257e..133f0ef83 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,8 +29,6 @@ EXTRA_DIST = \ filter/braille/filters/TODO.txt EXTRA_DIST += \ - cupsfilters/kmdevices.cpp \ - cupsfilters/kmdevices.h \ cupsfilters/testdriver.c \ data/makePDFfromPS.sh \ data/classified.ps \ diff --git a/cupsfilters/colormanager.c b/cupsfilters/colormanager.c index c06c1a39e..a1ff5aa52 100644 --- a/cupsfilters/colormanager.c +++ b/cupsfilters/colormanager.c @@ -29,7 +29,6 @@ MIT Open Source License - http://www.opensource.org/ #include "colormanager.h" #include #include -//#include #define CM_MAX_FILE_LENGTH 1024 diff --git a/cupsfilters/kmdevices.cpp b/cupsfilters/kmdevices.cpp deleted file mode 100644 index 15ccde876..000000000 --- a/cupsfilters/kmdevices.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#include -#include - -oyConfig_s * get_device(const char * printer_name) -{ - oyConfig_s * device = 0; - oyOptions_s * options = 0; - - oyOptions_SetFromText( &options, "//" OY_TYPE_STD "/config/command", - "properties", OY_CREATE_NEW ); - oyOptions_SetFromText( &options, - "//"OY_TYPE_STD"/config/icc_profile.x_color_region_target", - "yes", OY_CREATE_NEW ); - - oyDeviceGet( OY_TYPE_STD, "PRINTER", printer_name, - options, &device ); - - oyOptions_Release(&options); - - return device; -} - -int kmIsPrinterCmOff(const char * printer_name) -{ - int state = 0; - oyConfig_s * device = 0; - const char* str = 0; - - // Disable CM if invalid - if(printer_name == NULL) - return 1; - - device = get_device(printer_name); - - if (error) - state = 1; - else { - str = oyConfig_FindString(device, "CM_State", 0); - if (!strcmp(str, "Disabled")) - state = 1; - } - - return state; -} - -const char * kmGetPrinterProfile(const char* printer_name) -{ - int state = 0; - oyConfig_s * device = 0; - oyProfile_s * profile = 0; - const char* profile_filepath = 0; - - if(printer_name == NULL) - return 0; - - device = get_device(printer_name); - - if (device != NULL) - profile_filepath = oyGetDeviceProfile( device, options, profile ); - - return profile_filepath; -} diff --git a/cupsfilters/kmdevices.h b/cupsfilters/kmdevices.h deleted file mode 100644 index 9260e68d8..000000000 --- a/cupsfilters/kmdevices.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 2014 Joseph Simon - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -/* Interface for Kolor Manager */ - -/* Get color management state of a printer */ -int kmIsPrinterCMOff(const char * /*printer_name*/); - -/* Get profile from color manager */ -const char * kmGetPrinterProfile(const char* /*printer_name*/); -- 2.47.3