summaryrefslogtreecommitdiffstats
path: root/kdeprint/foomatic
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:56:40 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:56:40 -0600
commite16866e072f94410321d70daedbcb855ea878cac (patch)
treeee3f52eabde7da1a0e6ca845fb9c2813cf1558cf /kdeprint/foomatic
parenta58c20c1a7593631a1b50213c805507ebc16adaf (diff)
downloadtdelibs-e16866e072f94410321d70daedbcb855ea878cac.tar.gz
tdelibs-e16866e072f94410321d70daedbcb855ea878cac.zip
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'kdeprint/foomatic')
-rw-r--r--kdeprint/foomatic/Makefile.am20
-rw-r--r--kdeprint/foomatic/foomatic.print17
-rw-r--r--kdeprint/foomatic/kfoomaticprinterimpl.cpp53
-rw-r--r--kdeprint/foomatic/kfoomaticprinterimpl.h37
-rw-r--r--kdeprint/foomatic/kmfoomaticfactory.cpp27
-rw-r--r--kdeprint/foomatic/kmfoomaticmanager.cpp197
-rw-r--r--kdeprint/foomatic/kmfoomaticmanager.h42
-rw-r--r--kdeprint/foomatic/make_driver_db_foomatic.c192
8 files changed, 0 insertions, 585 deletions
diff --git a/kdeprint/foomatic/Makefile.am b/kdeprint/foomatic/Makefile.am
deleted file mode 100644
index 7a57fd40e..000000000
--- a/kdeprint/foomatic/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-INCLUDES = -I$(top_srcdir)/tdeprint $(all_includes)
-
-kde_module_LTLIBRARIES = tdeprint_foomatic.la
-
-tdeprint_foomatic_la_SOURCES = kmfoomaticfactory.cpp \
- kmfoomaticmanager.cpp \
- kfoomaticprinterimpl.cpp
-tdeprint_foomatic_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-tdeprint_foomatic_la_LIBADD = $(top_builddir)/tdeprint/management/libtdeprint_management.la
-tdeprint_foomatic_la_METASOURCES = AUTO
-
-noinst_HEADERS = kmfoomaticmanager.h \
- kfoomaticprinterimpl.h
-
-bin_PROGRAMS = make_driver_db_foomatic
-
-make_driver_db_foomatic_SOURCES = make_driver_db_foomatic.c
-
-entry_DATA = foomatic.print
-entrydir = $(kde_datadir)/tdeprint/plugins
diff --git a/kdeprint/foomatic/foomatic.print b/kdeprint/foomatic/foomatic.print
deleted file mode 100644
index 0ead9632c..000000000
--- a/kdeprint/foomatic/foomatic.print
+++ /dev/null
@@ -1,17 +0,0 @@
-[KDE Print Entry]
-PrintSystem=foomatic
-Comment=Foomatic (CUPS, LPRng, PDQ)
-Comment[af]=Foomaties (Cups, Lprng, Pdq)
-Comment[ar]= Foomatic (CUPS, LPRng, PDQ)
-Comment[bn]=ফুম্যাটিক (CUPS, LPRng, PDQ)
-Comment[cy]=Foomatic (CUPS, LPRng, PDQ)
-Comment[eo]=Presprogramo "Foomatic" (CUPS, LPRng, PDQ)
-Comment[fa]=)Foomatic (CUPS,LPRng,PDQ
-Comment[hi]=फूमेटिक (CUPS, LPRng, PDQ)
-Comment[ne]=फुम्याटिक (CUPS, LPRng, PDQ)
-Comment[rw]=Fumatike (CUPS, LPRng, PDQ)
-Comment[sq]=Foomatik (CUPS, LPRng, PDQ)
-Comment[sv]=Foomatic (Cups, LPRng, PDQ)
-Comment[te]=ఫూమెటిక్ (సియుపిఎస్, ఎల్ పి ఆర్ అన్ జి,పిడిక్యు)
-DetectUris=exec:/foomatic-configure,config:/foomatic/
-DetectPrecedence=0
diff --git a/kdeprint/foomatic/kfoomaticprinterimpl.cpp b/kdeprint/foomatic/kfoomaticprinterimpl.cpp
deleted file mode 100644
index d47a5e134..000000000
--- a/kdeprint/foomatic/kfoomaticprinterimpl.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#include "kfoomaticprinterimpl.h"
-#include "kprinter.h"
-
-#include <kstandarddirs.h>
-#include <klocale.h>
-
-KFoomaticPrinterImpl::KFoomaticPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/)
-: KPrinterImpl(parent,name)
-{
-}
-
-KFoomaticPrinterImpl::~KFoomaticPrinterImpl()
-{
-}
-
-// look for executable
-TQString KFoomaticPrinterImpl::executable()
-{
- QString exe = KStandardDirs::findExe("foomatic-printjob");
- return exe;
-}
-
-bool KFoomaticPrinterImpl::setupCommand(TQString& cmd, KPrinter *printer)
-{
- QString exe = executable();
- if (!exe.isEmpty())
- {
- cmd = exe + TQString::tqfromLatin1(" -P %1 -# %2").arg(quote(printer->printerName())).arg(printer->numCopies());
- return true;
- }
- else
- printer->setErrorMessage(i18n("No valid print executable was found in your path. Check your installation."));
- return false;
-}
diff --git a/kdeprint/foomatic/kfoomaticprinterimpl.h b/kdeprint/foomatic/kfoomaticprinterimpl.h
deleted file mode 100644
index 9d4a27155..000000000
--- a/kdeprint/foomatic/kfoomaticprinterimpl.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#ifndef KFOOMATICPRINTERIMPL_H
-#define KFOOMATICPRINTERIMPL_H
-
-#include "kprinterimpl.h"
-
-class KFoomaticPrinterImpl : public KPrinterImpl
-{
-public:
- KFoomaticPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/);
- ~KFoomaticPrinterImpl();
-
- bool setupCommand(TQString&, KPrinter*);
-
-protected:
- TQString executable();
-};
-
-#endif
diff --git a/kdeprint/foomatic/kmfoomaticfactory.cpp b/kdeprint/foomatic/kmfoomaticfactory.cpp
deleted file mode 100644
index 660e5faff..000000000
--- a/kdeprint/foomatic/kmfoomaticfactory.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#include "kmfoomaticfactory.h"
-#include "kmfoomaticmanager.h"
-#include "kfoomaticprinterimpl.h"
-
-#include <kgenericfactory.h>
-typedef K_TYPELIST_2( KMFoomaticManager, KFoomaticPrinterImpl ) Products;
-K_EXPORT_COMPONENT_FACTORY( tdeprint_foomatic, KGenericFactory< Products > )
-
diff --git a/kdeprint/foomatic/kmfoomaticmanager.cpp b/kdeprint/foomatic/kmfoomaticmanager.cpp
deleted file mode 100644
index 53049852b..000000000
--- a/kdeprint/foomatic/kmfoomaticmanager.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#include "kmfoomaticmanager.h"
-#include "kpipeprocess.h"
-#include "driver.h"
-
-#include <tqdom.h>
-#include <klocale.h>
-#include <kdebug.h>
-#include <kprocess.h>
-
-#include <unistd.h>
-
-KMFoomaticManager::KMFoomaticManager(TQObject *parent, const char *name, const TQStringList & /*args*/)
-: KMManager(parent,name)
-{
- setHasManagement(getuid() == 0);
- setPrinterOperationMask(KMManager::PrinterConfigure);
-}
-
-KMFoomaticManager::~KMFoomaticManager()
-{
-}
-
-void KMFoomaticManager::listPrinters()
-{
- KPipeProcess proc("foomatic-configure -Q -q -r");
- QDomDocument doc;
-
- doc.setContent(&proc);
- QDomElement docElem = doc.documentElement();
- if (docElem.isNull() || docElem.tagName() != "queues")
- return;
-
- QDomNode queueNode = docElem.firstChild();
- while (!queueNode.isNull())
- {
- QDomElement queueElem = queueNode.toElement();
- if (!queueElem.isNull() && queueElem.tagName() == "queue")
- {
- KMPrinter *printer = createPrinterFromElement(&queueElem);
- if (printer)
- addPrinter(printer);
- }
- queueNode = queueNode.nextSibling();
- }
-}
-
-DrMain* KMFoomaticManager::loadPrinterDriver(KMPrinter *printer, bool)
-{
- if (printer->option("foomatic") != "1")
- {
- setErrorMsg(i18n("This is not a Foomatic printer"));
- return NULL;
- }
- else if (printer->option("driver").isEmpty() || printer->option("printer").isEmpty())
- {
- setErrorMsg(i18n("Some printer information are missing"));
- return NULL;
- }
-
- QString cmd = "foomatic-combo-xml -p ";
- cmd += KProcess::quote(printer->option("printer"));
- cmd += " -d ";
- cmd += KProcess::quote(printer->option("driver"));
- KPipeProcess proc(cmd);
- QDomDocument doc;
- doc.setContent(&proc);
- QDomElement docElem = doc.documentElement();
- return createDriverFromXML(&docElem);
-}
-
-KMPrinter* KMFoomaticManager::createPrinterFromElement(TQDomElement *elem)
-{
- QDomElement e = elem->namedItem("name").toElement();
- if (!e.isNull())
- {
- KMPrinter *printer = new KMPrinter;
- printer->setType(KMPrinter::Printer);
- printer->setName(e.text());
- printer->setPrinterName(e.text());
- printer->setState(KMPrinter::Idle);
- /*if (printer->name().find('/') != -1)
- {
- QString s(printer->name());
- int p = s.find('/');
- printer->setPrinterName(s.left(p));
- printer->setInstanceName(s.mid(p+1));
- printer->addType(KMPrinter::Virtual);
- }*/
-
- if (!(e=elem->namedItem("description").toElement()).isNull())
- printer->setDescription(e.text());
- if (!(e=elem->namedItem("location").toElement()).isNull())
- printer->setLocation(e.text());
- if (!(e=elem->namedItem("connect").toElement()).isNull())
- printer->setDevice(e.text());
-
- printer->setOption("foomatic", elem->attribute("foomatic"));
- printer->setOption("spooler", elem->attribute("spooler"));
- if (elem->attribute("foomatic") == "1")
- {
- if (!(e=elem->namedItem("printer").toElement()).isNull())
- printer->setOption("printer", e.text());
- if (!(e=elem->namedItem("driver").toElement()).isNull())
- printer->setOption("driver", e.text());
- }
-
- return printer;
- }
- return NULL;
-}
-
-DrMain* KMFoomaticManager::createDriverFromXML(TQDomElement *elem)
-{
- DrMain *driver = new DrMain();
- QDomElement pelem = elem->namedItem("printer").toElement(), delem = elem->namedItem("driver").toElement();
- if (!pelem.isNull() && !delem.isNull())
- {
- driver->set("manufacturer", pelem.namedItem("make").toElement().text());
- driver->set("model", pelem.namedItem("model").toElement().text());
- QString s = TQString::tqfromLatin1("%1 %2 (%3)").arg(driver->get("manufacturer")).arg(driver->get("model")).arg(delem.namedItem("name").toElement().text());
- driver->set("description", s);
- driver->set("text", s);
-
- QDomElement opts = elem->namedItem("options").toElement();
- if (!opts.isNull())
- {
- QDomElement o = opts.firstChild().toElement();
- while (!o.isNull())
- {
- if (o.tagName() == "option")
- {
- QString type = o.attribute("type");
- DrBase *dropt(0);
-
- if (type == "bool" || type == "enum")
- {
- if (type == "bool") dropt = new DrBooleanOption();
- else dropt = new DrListOption();
- QString defval = o.namedItem("arg_defval").toElement().text(), valuetext;
- QDomNode val = o.namedItem("enum_vals").firstChild();
- while (!val.isNull())
- {
- DrBase *choice = new DrBase();
- choice->setName(val.namedItem("ev_shortname").namedItem("en").toElement().text());
- choice->set("text", i18n(val.namedItem("ev_longname").namedItem("en").toElement().text().latin1()));
- static_cast<DrListOption*>(dropt)->addChoice(choice);
- if (val.toElement().attribute("id") == defval)
- valuetext = choice->name();
-
- val = val.nextSibling();
- }
- dropt->set("default", valuetext);
- dropt->setValueText(valuetext);
- }
- else if (type == "int" || type == "float")
- {
- if (type == "int") dropt = new DrIntegerOption();
- else dropt = new DrFloatOption();
- dropt->set("minval", o.namedItem("arg_min").toElement().text());
- dropt->set("maxval", o.namedItem("arg_max").toElement().text());
- QString defval = o.namedItem("arg_defval").toElement().text();
- dropt->set("default", defval);
- dropt->setValueText(defval);
- }
-
- if (dropt)
- {
- dropt->setName(o.namedItem("arg_shortname").namedItem("en").toElement().text());
- dropt->set("text", i18n(o.namedItem("arg_longname").namedItem("en").toElement().text().latin1()));
- driver->addOption(dropt);
- }
- }
- o = o.nextSibling().toElement();
- }
- }
- }
- return driver;
-}
diff --git a/kdeprint/foomatic/kmfoomaticmanager.h b/kdeprint/foomatic/kmfoomaticmanager.h
deleted file mode 100644
index f3796904a..000000000
--- a/kdeprint/foomatic/kmfoomaticmanager.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#ifndef KMFOOMATICMANAGER_H
-#define KMFOOMATICMANAGER_H
-
-#include "kmmanager.h"
-
-class TQDomElement;
-class KMPrinter;
-
-class KMFoomaticManager : public KMManager
-{
-public:
- KMFoomaticManager(TQObject *parent, const char *name, const TQStringList & /*args*/);
- virtual ~KMFoomaticManager();
-
- DrMain* loadPrinterDriver(KMPrinter *p, bool config = false);
-
-protected:
- void listPrinters();
- KMPrinter* createPrinterFromElement(TQDomElement*);
- DrMain* createDriverFromXML(TQDomElement*);
-};
-
-#endif
diff --git a/kdeprint/foomatic/make_driver_db_foomatic.c b/kdeprint/foomatic/make_driver_db_foomatic.c
deleted file mode 100644
index 986a24447..000000000
--- a/kdeprint/foomatic/make_driver_db_foomatic.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#define BUFFER_SIZE 1024
-#define WORD_SIZE 256
-
-int parseOverview(const char *dbdir, FILE *out);
-
-int main(int argc, char *argv[])
-{
- FILE *out;
-
- if (argc != 3)
- {
- fprintf(stderr,"usage: make_driver_db_foomatic <dbdirectory> <dbfilename>\n");
- exit(-1);
- }
- out = fopen(argv[2],"w");
- if (out == NULL)
- {
- fprintf(stderr,"Unable to open DB file: %s\n",argv[2]);
- exit(-1);
- }
- /* first parse RHS driver DB */
- if (!parseOverview(argv[1], out))
- fprintf(stderr,"Unable to parse printer DB\n");
- return 0;
-}
-
-char* skipSpaces(char *c)
-{
- char *cc = c;
- while (cc && *cc && isspace(*cc)) cc++;
- return cc;
-}
-
-int nextEntity(char *s, FILE *in)
-{
- char c, p[WORD_SIZE] = {0};
- int index, istag;
-
- index = 0;
- do
- {
- c = fgetc(in);
- } while (isspace(c) && c != EOF);
- if (c == EOF)
- return -1;
- if (c == '<')
- {
- istag = 1;
- c = fgetc(in);
- if (c != '/')
- ungetc(c, in);
- }
- else
- {
- istag = 0;
- p[index++] = c;
- }
- while (index < WORD_SIZE)
- {
- c = fgetc(in);
- if (c != '>' && c != '<')
- p[index++] = c;
- else
- {
- if (c == '<')
- ungetc(c, in);
- break;
- }
- }
-
- p[WORD_SIZE - 1] = 0;
- strcpy(s, p);
- return istag;
-}
-
-void discardTag(const char *tagname, FILE *in)
-{
- char entity[WORD_SIZE];
- int istag;
-
- while ((istag=nextEntity(entity, in)) != -1)
- {
- if (istag == 1 && strcmp(tagname, entity) == 0)
- break;
- }
-}
-
-void clearDrivers(char **d)
-{
- int index = 0;
-
- while (d[index])
- {
- free(d[index]);
- d[index++] = 0;
- }
-}
-
-int parseOverview(const char *dbdir, FILE *out)
-{
- FILE *in;
- char printerid[WORD_SIZE], manu[WORD_SIZE], model[WORD_SIZE], tag[WORD_SIZE], driver[WORD_SIZE];
- char *drivers[20] = {0};
- int index = 0;
- char cmd[BUFFER_SIZE] = {0};
-
- snprintf(cmd, BUFFER_SIZE, "foomatic-combo-xml -O -l %s", dbdir);
- in = popen(cmd, "r");
- if (in == NULL)
- return 0;
- if (nextEntity(tag, in) == 1 && strcmp(tag, "overview") == 0)
- {
- printf("-1\n");
- while (nextEntity(tag, in) == 1)
- {
- if (strcmp(tag, "overview") == 0 || strcmp(tag, "printer") != 0)
- break;
- strcpy(printerid, "");
- strcpy(manu, "");
- strcpy(model, "");
- clearDrivers(drivers);
- while (nextEntity(tag, in) == 1)
- {
- if (strcmp(tag, "id") == 0) nextEntity(printerid, in);
- else if (strcmp(tag, "make") == 0) nextEntity(manu, in);
- else if (strcmp(tag, "model") == 0) nextEntity(model, in);
- else if (strcmp(tag, "drivers") == 0)
- {
- index = 0;
- while (nextEntity(tag, in) == 1 && strcmp(tag, "driver") == 0 && index < 20)
- {
- nextEntity(driver, in);
- drivers[index++] = strdup(driver);
- nextEntity(driver, in);
- }
- continue;
- }
- else if (strcmp(tag, "printer") == 0)
- {
- printf("%s %s\n", manu, model);
- index = 0;
- while (drivers[index])
- {
- fprintf(out, "FILE=%s|%s\n", printerid, drivers[index]);
- fprintf(out, "MANUFACTURER=%s\n", manu);
- fprintf(out, "MODELNAME=%s\n", model);
- fprintf(out, "MODEL=%s\n", model);
- fprintf(out, "DESCRIPTION=%s %s (%s)\n", manu, model, drivers[index]);
- fprintf(out, "\n");
- index++;
- }
- break;
- }
- else
- {
- discardTag(tag, in);
- continue;
- }
- nextEntity(tag, in);
- }
- }
- }
- if (pclose(in) == 0)
- index = 1;
- else
- index = 0;
- return index;
-}