summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/pnm
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-01-27 01:03:37 -0600
committerTimothy Pearson <[email protected]>2013-01-27 01:03:37 -0600
commit2e25fa39cd67cca2472d3eabdb478feb517d72a5 (patch)
tree63725962f632d152cbf20709191d39f6fc865966 /kfile-plugins/pnm
parent190d88dfc662f3fc466c9d1f53acbbea65f33c49 (diff)
downloadtdegraphics-2e25fa39cd67cca2472d3eabdb478feb517d72a5.tar.gz
tdegraphics-2e25fa39cd67cca2472d3eabdb478feb517d72a5.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'kfile-plugins/pnm')
-rw-r--r--kfile-plugins/pnm/CMakeLists.txt35
-rw-r--r--kfile-plugins/pnm/Makefile.am22
-rw-r--r--kfile-plugins/pnm/kfile_pnm.cpp137
-rw-r--r--kfile-plugins/pnm/kfile_pnm.desktop60
-rw-r--r--kfile-plugins/pnm/kfile_pnm.h40
5 files changed, 0 insertions, 294 deletions
diff --git a/kfile-plugins/pnm/CMakeLists.txt b/kfile-plugins/pnm/CMakeLists.txt
deleted file mode 100644
index 34e78ddf..00000000
--- a/kfile-plugins/pnm/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-#################################################
-#
-# (C) 2010-2011 Calvin Morrison
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
-
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_BINARY_DIR}
- ${TDE_INCLUDE_DIR}
- ${TQT_INCLUDE_DIRS}
-)
-
-link_directories(
- ${TQT_LIBRARY_DIRS}
-)
-
-
-#### other data #################################
-
-install( FILES kfile_pnm.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
-
-#### kfile_pnm (module) #########################
-
-tde_add_kpart( kfile_pnm AUTOMOC
- SOURCES kfile_pnm.cpp
- LINK kio-shared
- DESTINATION ${PLUGIN_INSTALL_DIR}
-)
diff --git a/kfile-plugins/pnm/Makefile.am b/kfile-plugins/pnm/Makefile.am
deleted file mode 100644
index 7148232a..00000000
--- a/kfile-plugins/pnm/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-## Makefile.am for pnm file meta info plugin
-
-# set the include path for X, qt and KDE
-INCLUDES = $(all_includes)
-
-# these are the headers for your project
-noinst_HEADERS = kfile_pnm.h
-
-kde_module_LTLIBRARIES = kfile_pnm.la
-
-kfile_pnm_la_SOURCES = kfile_pnm.cpp
-kfile_pnm_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
-kfile_pnm_la_LIBADD = $(LIB_KIO)
-
-# let automoc handle all of the meta source files (moc)
-METASOURCES = AUTO
-
-messages:
- $(XGETTEXT) *.cpp -o $(podir)/kfile_pnm.pot
-
-services_DATA = kfile_pnm.desktop
-servicesdir = $(kde_servicesdir)
diff --git a/kfile-plugins/pnm/kfile_pnm.cpp b/kfile-plugins/pnm/kfile_pnm.cpp
deleted file mode 100644
index 6c965e65..00000000
--- a/kfile-plugins/pnm/kfile_pnm.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) 2003 Volker Krause <[email protected]>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation version 2.
- *
- * This program 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "kfile_pnm.h"
-
-#include <math.h>
-#include <kgenericfactory.h>
-#include <tqfile.h>
-#include <tqtextstream.h>
-
-static const char* formats[] = {
- I18N_NOOP("plain"),
- I18N_NOOP("raw")
-};
-
-typedef KGenericFactory<KPnmPlugin> PnmFactory;
-
-K_EXPORT_COMPONENT_FACTORY(kfile_pnm, PnmFactory("kfile_pnm"))
-
-KPnmPlugin::KPnmPlugin(TQObject *parent, const char *name, const TQStringList &args) : KFilePlugin(parent, name, args)
-{
- makeMimeTypeInfo( "image/x-portable-bitmap" );
- makeMimeTypeInfo( "image/x-portable-greymap" );
- makeMimeTypeInfo( "image/x-portable-pixmap" );
-}
-
-void KPnmPlugin::makeMimeTypeInfo(const TQString& mimetype)
-{
- KFileMimeTypeInfo* info = addMimeTypeInfo( mimetype );
-
- KFileMimeTypeInfo::GroupInfo* group = 0;
- KFileMimeTypeInfo::ItemInfo* item = 0;
-
- group = addGroupInfo(info, "General", i18n("General"));
-
- addItemInfo(group, "Format", i18n("Format"), TQVariant::String);
-
- item = addItemInfo(group, "Dimensions", i18n("Dimensions"), TQVariant::Size);
- setUnit(item, KFileMimeTypeInfo::Pixels);
-
- item = addItemInfo(group, "BitDepth", i18n("Bit Depth"), TQVariant::Int);
- setUnit(item, KFileMimeTypeInfo::BitsPerPixel);
-
- addItemInfo(group, "Comment", i18n("Comment"), TQVariant::String);
-}
-
-
-bool KPnmPlugin::readInfo( KFileMetaInfo& info, uint /*what*/)
-{
- TQFile f(info.path());
- if(!f.open(IO_ReadOnly))
- return false;
- if(f.size() <= 2)
- return false;
- TQTextStream stream(&f);
-
- char c;
- stream >> c;
- if(c != 'P')
- return false;
-
- // image format and type
- int n;
- stream >> n;
- int format = (n - 1) / 3;
- if(format != 0 && format != 1)
- return false;
- int type = (n - 1) % 3;
-
- TQString comments, buffer;
- while(!stream.atEnd()) {
- stream >> c;
- // comment
- if( c == '#') {
- buffer = stream.readLine();
- comments += buffer.stripWhiteSpace();
- comments += '\n';
- }
- // image size
- // unfortunately TQt doesn't have some kind of push-back method for
- // TQTextStream, so we need to manually decode the first part of the
- // image size.
- if( c >= '0' && c <= '9' ) {
- buffer = "";
- TQChar tmp(c);
- while(!stream.atEnd() && tmp.isDigit()) {
- buffer += tmp;
- stream >> tmp;
- }
- break;
- }
- }
-
- // image size
- int x, y, max;
- x = buffer.toInt();
- stream >> y;
- stream >> max;
-
- // bit depth
- // PNM doesn't provide a conventional bit depth value, only the highest value
- // per pixel. To have comparable values with other formats, we convert it to
- // a normal bit depth value.
- int bpp = 1;
- if(type != 0)
- bpp = (int)ceil(log((double)max) / log(2.0));
- if(type == 2)
- bpp *= 3;
-
- KFileMetaInfoGroup group = appendGroup(info, "General");
- appendItem(group, "Format", formats[format]);
- appendItem(group, "Dimensions", TQSize(x, y));
- if(!comments.isEmpty())
- appendItem(group, "Comment", comments.stripWhiteSpace());
- appendItem(group, "BitDepth", bpp);
-
- f.close();
- return true;
-}
-
-#include "kfile_pnm.moc"
diff --git a/kfile-plugins/pnm/kfile_pnm.desktop b/kfile-plugins/pnm/kfile_pnm.desktop
deleted file mode 100644
index 4de8e7c1..00000000
--- a/kfile-plugins/pnm/kfile_pnm.desktop
+++ /dev/null
@@ -1,60 +0,0 @@
-[Desktop Entry]
-Type=Service
-Name=PNM Info
-Name[ar]=معلومات PNM
-Name[br]=Titouroù PNM
-Name[ca]=Informació de PNM
-Name[cs]=PNM info
-Name[cy]=Gybodaeth PNM
-Name[da]=PNG-info
-Name[de]=PNM-Info
-Name[el]=Πληροφορίες PNM
-Name[eo]=PNM-informo
-Name[es]=Info PNM
-Name[et]=PNM info
-Name[fa]=اطلاعات PNM
-Name[fi]=PNM-tiedot
-Name[fr]=Informations PNM
-Name[gl]=Inf. PNM
-Name[he]=מידע PNM
-Name[hi]=PNM जानकारी
-Name[hu]=PNM-jellemzők
-Name[is]=PNM upplýsingar
-Name[it]=Informazioni PNM
-Name[ja]=PNM 情報
-Name[kk]=PNM мәліметі
-Name[km]=ព័ត៌មាន PNM
-Name[lt]=PNM informacija
-Name[ms]=Maklumat PNM
-Name[nb]=PNM-info
-Name[nds]=PNM-Info
-Name[ne]=PNM सूचना
-Name[nl]=PNG-info
-Name[nn]=PNM-info
-Name[pa]=PNM ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku PNM
-Name[pt]=Informação do PNM
-Name[pt_BR]=Informação sobre PNG
-Name[ro]=Informaţii PNM
-Name[ru]=Информация о PNM
-Name[se]=PNM-dieđut
-Name[sl]=Podatki o PNM
-Name[sr]=PNM информације
-Name[sr@Latn]=PNM informacije
-Name[sv]=PNM-information
-Name[ta]=PNM தகவல்
-Name[tg]=Иттилоот оиди PNM
-Name[th]=ข้อมูลแฟ้ม PNM
-Name[tr]=PNM Bilgisi
-Name[uk]=Інформація про PNM
-Name[uz]=PNM haqida maʼlumot
-Name[uz@cyrillic]=PNM ҳақида маълумот
-Name[wa]=Informåcion sol imådje PNM
-Name[zh_CN]=PNM 信息
-Name[zh_HK]=PNM 資訊
-Name[zh_TW]=PNM 資訊
-ServiceTypes=KFilePlugin
-X-TDE-Library=kfile_pnm
-MimeType=image/x-portable-bitmap;image/x-portable-greymap;image/x-portable-pixmap
-PreferredGroups=General
-PreferredItems=Format,Dimensions,BitDepth,Comment
diff --git a/kfile-plugins/pnm/kfile_pnm.h b/kfile-plugins/pnm/kfile_pnm.h
deleted file mode 100644
index b033d022..00000000
--- a/kfile-plugins/pnm/kfile_pnm.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) 2003 Volker Krause <[email protected]>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation version 2.
- *
- * This program 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef __KFILE_PNM_H__
-#define __KFILE_PNM_H__
-
-#include <kfilemetainfo.h>
-
-class TQStringList;
-
-class KPnmPlugin: public KFilePlugin
-{
- Q_OBJECT
-
-
-public:
- KPnmPlugin( TQObject *parent, const char *name, const TQStringList& preferredItems );
- virtual bool readInfo( KFileMetaInfo& info, uint );
-
-private:
- void makeMimeTypeInfo( const TQString&);
-};
-
-#endif