From: Michael R Sweet Date: Mon, 2 May 2022 12:18:06 +0000 (-0400) Subject: Do some web interface cleanup and restore the generic printer icon file. X-Git-Tag: v2.4.2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9225080c278a856420d51990e9307802056ccd95;p=thirdparty%2Fcups.git Do some web interface cleanup and restore the generic printer icon file. Fix a few old references to www.cups.org. --- diff --git a/CHANGES.md b/CHANGES.md index 3f158feffd..d4af6211c0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,10 @@ Changes in CUPS v2.4.2 (TBA) - Re-added LibreSSL/OpenSSL support (Issue #362) - Updated the Solaris smf service file (Issue #368) - `cupsGetResponse` did not always set the last error. +- Fixed a number of old references to the Apple CUPS web page. +- Restored the default/generic printer icon file for the web interface. +- Removed old stylesheet classes that are no longer used by the web + interface. Changes in CUPS v2.4.1 (27th January 2020) diff --git a/backend/Makefile b/backend/Makefile index 33ba7e72bd..e5dd7619e2 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -20,7 +20,7 @@ include ../Makedefs # UBACKENDS are installed mode 0755 so cupsd will run them as an unprivileged # user... # -# See http://www.cups.org/doc/api-filter.html for more info... +# See for more info... RBACKENDS = \ ipp \ lpd \ diff --git a/backend/pseudo b/backend/pseudo index fb7facdcc6..e64c9465a6 100644 --- a/backend/pseudo +++ b/backend/pseudo @@ -2,15 +2,11 @@ # # Psuedo-backend for CUPS testing purposes. # -# Copyright 2011 by Apple Inc. +# Copyright © 2022 by OpenPrinting. +# Copyright © 2011 by Apple Inc. # -# These coded instructions, statements, and computer programs are the -# property of Apple Inc. and are protected by Federal copyright -# law. Distribution and use rights are outlined in the file "LICENSE.txt" -# which should have been included with this file. If this file is -# file is missing or damaged, see the license at "http://www.cups.org/". -# -# This file is subject to the Apple OS-Developed Software exception. +# Licensed under Apache License v2.0. See the file "LICENSE" for more +# information. # if test $# = 0; then diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile index e76012b9de..803dc6266a 100644 --- a/cgi-bin/Makefile +++ b/cgi-bin/Makefile @@ -1,6 +1,7 @@ # # CGI makefile for CUPS. # +# Copyright © 2022 by OpenPrinting. # Copyright © 2007-2019 by Apple Inc. # Copyright © 1997-2006 by Easy Software Products. # @@ -23,7 +24,6 @@ OBJS = \ classes.o \ help.o \ jobs.o \ - makedocset.o \ printers.o \ testcgi.o \ testhi.o \ @@ -73,7 +73,7 @@ unittests: $(UNITTARGETS) # clean: - $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset + $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) # diff --git a/cgi-bin/makedocset.c b/cgi-bin/makedocset.c deleted file mode 100644 index 079b856dd4..0000000000 --- a/cgi-bin/makedocset.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Xcode documentation set generator. - * - * Copyright 2007-2012 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products. - * - * Licensed under Apache License v2.0. See the file "LICENSE" for more information. - * - * Usage: - * - * makedocset directory *.tokens - */ - -/* - * Include necessary headers... - */ - -#include "cgi-private.h" -#include - - -/* - * Local structures... - */ - -typedef struct _cups_html_s /**** Help file ****/ -{ - char *path; /* Path to help file */ - char *title; /* Title of help file */ -} _cups_html_t; - -typedef struct _cups_section_s /**** Help section ****/ -{ - char *name; /* Section name */ - cups_array_t *files; /* Files in this section */ -} _cups_section_t; - - -/* - * Local functions... - */ - -static int compare_html(_cups_html_t *a, _cups_html_t *b); -static int compare_sections(_cups_section_t *a, _cups_section_t *b); -static int compare_sections_files(_cups_section_t *a, _cups_section_t *b); -static void write_index(const char *path, help_index_t *hi); -static void write_info(const char *path, const char *revision); -static void write_nodes(const char *path, help_index_t *hi); - - -/* - * 'main()' - Test the help index code. - */ - -int /* O - Exit status */ -main(int argc, /* I - Number of command-line args */ - char *argv[]) /* I - Command-line arguments */ -{ - int i; /* Looping var */ - char path[1024], /* Path to documentation */ - line[1024]; /* Line from file */ - help_index_t *hi; /* Help index */ - cups_file_t *tokens, /* Tokens.xml file */ - *fp; /* Current file */ - - - if (argc < 4) - { - puts("Usage: makedocset directory revision *.tokens"); - return (1); - } - - /* - * Index the help documents... - */ - - snprintf(path, sizeof(path), "%s/Contents/Resources/Documentation", argv[1]); - if ((hi = helpLoadIndex(NULL, path)) == NULL) - { - fputs("makedocset: Unable to index help files!\n", stderr); - return (1); - } - - snprintf(path, sizeof(path), "%s/Contents/Resources/Documentation/index.html", - argv[1]); - write_index(path, hi); - - snprintf(path, sizeof(path), "%s/Contents/Resources/Nodes.xml", argv[1]); - write_nodes(path, hi); - - /* - * Write the Info.plist file... - */ - - snprintf(path, sizeof(path), "%s/Contents/Info.plist", argv[1]); - write_info(path, argv[2]); - - /* - * Merge the Tokens.xml files... - */ - - snprintf(path, sizeof(path), "%s/Contents/Resources/Tokens.xml", argv[1]); - if ((tokens = cupsFileOpen(path, "w")) == NULL) - { - fprintf(stderr, "makedocset: Unable to create \"%s\": %s\n", path, - strerror(errno)); - return (1); - } - - cupsFilePuts(tokens, "\n"); - cupsFilePuts(tokens, "\n"); - - for (i = 3; i < argc; i ++) - { - if ((fp = cupsFileOpen(argv[i], "r")) == NULL) - { - fprintf(stderr, "makedocset: Unable to open \"%s\": %s\n", argv[i], - strerror(errno)); - return (1); - } - - if (!cupsFileGets(fp, line, sizeof(line)) || strncmp(line, "")) - cupsFilePrintf(tokens, "%s\n", line); - } - - cupsFileClose(fp); - } - - cupsFilePuts(tokens, "\n"); - - cupsFileClose(tokens); - - /* - * Return with no errors... - */ - - return (0); -} - - -/* - * 'compare_html()' - Compare the titles of two HTML files. - */ - -static int /* O - Result of comparison */ -compare_html(_cups_html_t *a, /* I - First file */ - _cups_html_t *b) /* I - Second file */ -{ - return (_cups_strcasecmp(a->title, b->title)); -} - - -/* - * 'compare_sections()' - Compare the names of two help sections. - */ - -static int /* O - Result of comparison */ -compare_sections(_cups_section_t *a, /* I - First section */ - _cups_section_t *b) /* I - Second section */ -{ - return (_cups_strcasecmp(a->name, b->name)); -} - - -/* - * 'compare_sections_files()' - Compare the number of files and section names. - */ - -static int /* O - Result of comparison */ -compare_sections_files( - _cups_section_t *a, /* I - First section */ - _cups_section_t *b) /* I - Second section */ -{ - int ret = cupsArrayCount(b->files) - cupsArrayCount(a->files); - - if (ret) - return (ret); - else - return (_cups_strcasecmp(a->name, b->name)); -} - - -/* - * 'write_index()' - Write an index file for the CUPS help. - */ - -static void -write_index(const char *path, /* I - File to write */ - help_index_t *hi) /* I - Index of files */ -{ - cups_file_t *fp; /* Output file */ - help_node_t *node; /* Current help node */ - _cups_section_t *section, /* Current section */ - key; /* Section search key */ - _cups_html_t *html; /* Current HTML file */ - cups_array_t *sections, /* Sections in index */ - *sections_files,/* Sections sorted by size */ - *columns[3]; /* Columns in final HTML file */ - int column, /* Current column */ - lines[3], /* Number of lines in each column */ - min_column, /* Smallest column */ - min_lines; /* Smallest number of lines */ - - - /* - * Build an array of sections and their files. - */ - - sections = cupsArrayNew((cups_array_func_t)compare_sections, NULL); - - for (node = (help_node_t *)cupsArrayFirst(hi->nodes); - node; - node = (help_node_t *)cupsArrayNext(hi->nodes)) - { - if (node->anchor) - continue; - - key.name = node->section ? node->section : "Miscellaneous"; - if ((section = (_cups_section_t *)cupsArrayFind(sections, &key)) == NULL) - { - section = (_cups_section_t *)calloc(1, sizeof(_cups_section_t)); - section->name = key.name; - section->files = cupsArrayNew((cups_array_func_t)compare_html, NULL); - - cupsArrayAdd(sections, section); - } - - html = (_cups_html_t *)calloc(1, sizeof(_cups_html_t)); - html->path = node->filename; - html->title = node->text; - - cupsArrayAdd(section->files, html); - } - - /* - * Build a sorted list of sections based on the number of files in each section - * and the section name... - */ - - sections_files = cupsArrayNew((cups_array_func_t)compare_sections_files, - NULL); - for (section = (_cups_section_t *)cupsArrayFirst(sections); - section; - section = (_cups_section_t *)cupsArrayNext(sections)) - cupsArrayAdd(sections_files, section); - - /* - * Then build three columns to hold everything, trying to balance the number of - * lines in each column... - */ - - for (column = 0; column < 3; column ++) - { - columns[column] = cupsArrayNew((cups_array_func_t)compare_sections, NULL); - lines[column] = 0; - } - - for (section = (_cups_section_t *)cupsArrayFirst(sections_files); - section; - section = (_cups_section_t *)cupsArrayNext(sections_files)) - { - for (min_column = 0, min_lines = lines[0], column = 1; - column < 3; - column ++) - { - if (lines[column] < min_lines) - { - min_column = column; - min_lines = lines[column]; - } - } - - cupsArrayAdd(columns[min_column], section); - lines[min_column] += cupsArrayCount(section->files) + 2; - } - - /* - * Write the HTML file... - */ - - if ((fp = cupsFileOpen(path, "w")) == NULL) - { - fprintf(stderr, "makedocset: Unable to create %s: %s\n", path, - strerror(errno)); - exit(1); - } - - cupsFilePuts(fp, "\n" - "\n" - "\n" - "CUPS Documentation\n" - "\n" - "\n" - "\n" - "

CUPS Documentation

\n" - "\n" - "\n"); - - for (column = 0; column < 3; column ++) - { - if (column) - cupsFilePuts(fp, "\n"); - - cupsFilePuts(fp, "\n"); - } - cupsFilePuts(fp, "\n" - "
     "); - for (section = (_cups_section_t *)cupsArrayFirst(columns[column]); - section; - section = (_cups_section_t *)cupsArrayNext(columns[column])) - { - cupsFilePrintf(fp, "

%s

\n", section->name); - for (html = (_cups_html_t *)cupsArrayFirst(section->files); - html; - html = (_cups_html_t *)cupsArrayNext(section->files)) - cupsFilePrintf(fp, "

%s

\n", - html->path, html->title); - } - cupsFilePuts(fp, "
\n" - "\n" - "\n"); - cupsFileClose(fp); -} - - -/* - * 'write_info()' - Write the Info.plist file. - */ - -static void -write_info(const char *path, /* I - File to write */ - const char *revision) /* I - Subversion revision number */ -{ - cups_file_t *fp; /* File */ - - - if ((fp = cupsFileOpen(path, "w")) == NULL) - { - fprintf(stderr, "makedocset: Unable to create %s: %s\n", path, - strerror(errno)); - exit(1); - } - - cupsFilePrintf(fp, "\n" - "\n" - "\n" - "\n" - "\tCFBundleIdentifier\n" - "\torg.cups.docset\n" - "\tCFBundleName\n" - "\tCUPS Documentation\n" - "\tCFBundleVersion\n" - "\t%d.%d.%s\n" - "\tCFBundleShortVersionString\n" - "\t%d.%d.%d\n" - "\tDocSetFeedName\n" - "\tcups.org\n" - "\tDocSetFeedURL\n" - "\thttp://www.cups.org/org.cups.docset.atom" - "\n" - "\tDocSetPublisherIdentifier\n" - "\torg.cups\n" - "\tDocSetPublisherName\n" - "\tCUPS\n" - "\n" - "\n", - CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, revision, - CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, CUPS_VERSION_PATCH); - - cupsFileClose(fp); -} - - -/* - * 'write_nodes()' - Write the Nodes.xml file. - */ - -static void -write_nodes(const char *path, /* I - File to write */ - help_index_t *hi) /* I - Index of files */ -{ - cups_file_t *fp; /* Output file */ - int id; /* Current node ID */ - help_node_t *node; /* Current help node */ - int subnodes; /* Currently in Subnodes for file? */ - int needclose; /* Need to close the current node? */ - - - if ((fp = cupsFileOpen(path, "w")) == NULL) - { - fprintf(stderr, "makedocset: Unable to create %s: %s\n", path, - strerror(errno)); - exit(1); - } - - cupsFilePuts(fp, "\n" - "\n" - "\n" - "\n" - "CUPS Documentation\n" - "Documentation/index.html\n" - "\n"); - - for (node = (help_node_t *)cupsArrayFirst(hi->nodes), id = 1, subnodes = 0, - needclose = 0; - node; - node = (help_node_t *)cupsArrayNext(hi->nodes), id ++) - { - if (node->anchor) - { - if (!subnodes) - { - cupsFilePuts(fp, "\n"); - subnodes = 1; - } - - cupsFilePrintf(fp, "\n" - "Documentation/%s\n" - "%s\n" - "%s\n" - "\n", id, node->filename, node->anchor, - node->text); - } - else - { - if (subnodes) - { - cupsFilePuts(fp, "\n"); - subnodes = 0; - } - - if (needclose) - cupsFilePuts(fp, "\n"); - - cupsFilePrintf(fp, "\n" - "Documentation/%s\n" - "%s\n", id, node->filename, node->text); - needclose = 1; - } - } - - if (subnodes) - cupsFilePuts(fp, "\n"); - - if (needclose) - cupsFilePuts(fp, "\n"); - - cupsFilePuts(fp, "\n" - "\n"); - - cupsFileClose(fp); -} diff --git a/doc/cups.css b/doc/cups.css index 379489a174..a51d123bfc 100644 --- a/doc/cups.css +++ b/doc/cups.css @@ -213,31 +213,6 @@ td.cups-body { vertical-align: top; } -td.sel, td.unsel { - border-left: thin solid #cccccc; - padding: 0 5px; - text-align: center; - vertical-align: middle; - width: 14%; -} - -td.sel { - background: url(images/sel.gif); -} - -td.unsel { - background: url(images/unsel.gif); -} - -td.sel a, td.sel a:hover, td.unsel a:link:hover, td.unsel a:visited:hover, -td.unsel a:active, td.unsel a, td.unsel a:visited { - color: #666666; - display: block; - font-weight: normal; - padding: 8px; - text-decoration: none; -} - td.trailer { background: #f0f0f0; border: solid thin #e0e0e0; diff --git a/doc/help/sharing.html b/doc/help/sharing.html index a46f393bf2..ad08f5ca47 100644 --- a/doc/help/sharing.html +++ b/doc/help/sharing.html @@ -80,7 +80,7 @@ The user client.conf file takes precedence over the system one.

override the default server for a single process, for example:

-CUPS_SERVER=server:port firefox http://www.cups.org
+CUPS_SERVER=server:port firefox https://openprinting.github.io/cups
 

will run the Firefox web browser pointed to the specified server and diff --git a/doc/help/spec-banner.html b/doc/help/spec-banner.html index 855a569efc..6db2fa0e12 100644 --- a/doc/help/spec-banner.html +++ b/doc/help/spec-banner.html @@ -10,6 +10,7 @@