]> git.lyx.org Git - features.git/commitdiff
Move loadableImageFormats() to the frontend.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 6 Jun 2008 12:29:58 +0000 (12:29 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 6 Jun 2008 12:29:58 +0000 (12:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25163 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
src/frontends/Application.h
src/frontends/qt4/GuiApplication.cpp
src/graphics/GraphicsCache.cpp
src/support/Makefile.am
src/support/imagetools.cpp [deleted file]
src/support/imagetools.h [deleted file]

index af81ae3ffe99951c280623e44f2d6e031ec717df..2373f53273457d67e014d3f3660b7819410c1c18 100644 (file)
@@ -302,7 +302,6 @@ src_support_header_files = Split('''
     foreach.h
     gettext.h
     gzstream.h
-    imagetools.h
     lassert.h
     limited_stack.h
     lstrings.h
@@ -339,7 +338,6 @@ src_support_files = Split('''
     filetools.cpp
     gettext.cpp
     gzstream.cpp
-    imagetools.cpp
     kill.cpp
     lassert.cpp
     lstrings.cpp
index e6450e3c0ea7cc2f21f539b5dde8aa18f0f7f26f..72173ebe1638b078fff1f6bf826cbe111ce77e75 100644 (file)
@@ -229,6 +229,9 @@ public:
        virtual docstring iconName(FuncRequest const & f, bool unknown) = 0;
 };
 
+/// Return the list of loadable formats.
+std::vector<std::string> loadableImageFormats();
+
 } // namespace frontend
 
 frontend::Application * theApp();
index 161000a5afc4f1e9bb3315af94e1067d5ef1c9db..fa811307f88c12d14eefcf0e0d76229ef76047f5 100644 (file)
 #include "support/linkback/LinkBackProxy.h"
 #endif
 
+#include <QByteArray>
 #include <QClipboard>
 #include <QDir>
 #include <QEventLoop>
 #include <QFileOpenEvent>
 #include <QHash>
 #include <QIcon>
+#include <QImageReader>
 #include <QLocale>
 #include <QLibraryInfo>
 #include <QList>
@@ -129,6 +131,34 @@ frontend::Application * createApplication(int & argc, char * argv[])
 
 namespace frontend {
 
+
+/// Return the list of loadable formats.
+vector<string> loadableImageFormats()
+{
+       vector<string> fmts;
+
+       QList<QByteArray> qt_formats = QImageReader::supportedImageFormats();
+
+       LYXERR(Debug::GRAPHICS,
+               "\nThe image loader can load the following directly:\n");
+
+       if (qt_formats.empty())
+               LYXERR(Debug::GRAPHICS, "\nQt4 Problem: No Format available!");
+
+       for (QList<QByteArray>::const_iterator it = qt_formats.begin(); it != qt_formats.end(); ++it) {
+
+               LYXERR(Debug::GRAPHICS, (const char *) *it << ", ");
+
+               string ext = ascii_lowercase((const char *) *it);
+               // special case
+               if (ext == "jpeg")
+                       ext = "jpg";
+               fmts.push_back(ext);
+       }
+
+       return fmts;
+}
+       
 ////////////////////////////////////////////////////////////////////////
 // Icon loading support code.
 ////////////////////////////////////////////////////////////////////////
index d36de0fbe260257bf88627a8efffe74dd691bc69..d50856389197f057675ebc910068d81ff7c34534 100644 (file)
 
 #include "Format.h"
 
+#include "frontends/Application.h"
+
 #include "support/debug.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
-#include "support/imagetools.h"
 
 #include <map>
 
@@ -74,7 +75,7 @@ vector<string> const & Cache::loadableFormats() const
        Formats::const_iterator end   = formats.end();
 
        // The formats natively loadable.
-       vector<string> nformat = loadableImageFormats();
+       vector<string> nformat = frontend::loadableImageFormats();
        
        vector<string>::const_iterator it = nformat.begin();
        for (; it != nformat.end(); ++it) {
index 983dc36cbfac6e388b7e1864fbf4b534fc02a3bf..1c1f8a038d2216d6395cb2e6fea9a16588fad053 100644 (file)
@@ -62,8 +62,6 @@ liblyxsupport_la_SOURCES = \
        gettext.h \
        gzstream.cpp \
        gzstream.h \
-       imagetools.cpp \
-       imagetools.h \
        kill.cpp \
        lassert.h \
        lassert.cpp \
diff --git a/src/support/imagetools.cpp b/src/support/imagetools.cpp
deleted file mode 100644 (file)
index 00551d1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * \file imagetools.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Abdelrazak Younes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "support/debug.h"
-#include "support/imagetools.h"
-#include "support/lstrings.h"
-
-#include <QByteArray>
-#include <QImageReader>
-#include <QList>
-
-using namespace std;
-
-namespace lyx {
-namespace support {
-
-/// Return the list of loadable formats.
-vector<string> loadableImageFormats()
-{
-       vector<string> fmts;
-
-       QList<QByteArray> qt_formats = QImageReader::supportedImageFormats();
-
-       LYXERR(Debug::GRAPHICS,
-               "\nThe image loader can load the following directly:\n");
-
-       if (qt_formats.empty())
-               LYXERR(Debug::GRAPHICS, "\nQt4 Problem: No Format available!");
-
-       for (QList<QByteArray>::const_iterator it = qt_formats.begin(); it != qt_formats.end(); ++it) {
-
-               LYXERR(Debug::GRAPHICS, (const char *) *it << ", ");
-
-               string ext = ascii_lowercase((const char *) *it);
-               // special case
-               if (ext == "jpeg")
-                       ext = "jpg";
-               fmts.push_back(ext);
-       }
-
-       return fmts;
-}
-
-
-} // namespace support
-} // namespace lyx
diff --git a/src/support/imagetools.h b/src/support/imagetools.h
deleted file mode 100644 (file)
index c9317ef..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// -*- C++ -*-
-/**
- * \file imagetools.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author João Luis M. Assirati
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef IMAGETOOLS_H
-#define IMAGETOOLS_H
-
-#include <string>
-#include <vector>
-
-namespace lyx {
-namespace support {
-
-/// Return the list of loadable formats.
-std::vector<std::string> loadableImageFormats();
-
-} // namespace support
-} // namespace lyx
-
-#endif // IMAGETOOLS_H