00001 /* 00002 * AbiPaint plugin 00003 * 00004 * AbiWord plugin to ease editing embedded images via an 00005 * External Image Editing program. The image editing program 00006 * used and optional image format conversion may be specified, 00007 * though sensible (platform specific) defaults are defined. 00008 * 00009 */ 00010 00011 /* The default image editor and exported image type depends 00012 * on the platform. 00013 * 00014 * For Windows: 00015 * The PNG images by default are converted to BMP files 00016 * and the default image editor is Microsoft's (R) Paint (MSPAINT.EXE) 00017 * PNG to BMP conversion done using: 00018 * PNGDIB - a mini DIB-PNG conversion library for Win32 00019 * By Jason Summers <jason1@pobox.com> 00020 * 00021 * For Unix Systems (and similar) 00022 * The images are exported as PNG files 00023 * and the default image editor is the GIMP (gimp) 00024 * GNU Image Manipulation Program - see http://www.gimp.org/ 00025 */ 00026 00027 /* 00028 * Based on AbiGimp copyright Martin Sevior which in turn 00029 * is based on AiksaurusABI - Abiword plugin for Aiksaurus 00030 * Copyright (C) 2001 by Jared Davis 00031 * Also tidbits taken from ImageMagick plugin, copyright 2002 00032 * by Dom Lachowicz 00033 * 00034 * This program is free software; you can redistribute it and/or 00035 * modify it under the terms of the GNU General Public License 00036 * as published by the Free Software Foundation; either version 2 00037 * of the License, or (at your option) any later version. 00038 * 00039 * This program is distributed in the hope that it will be useful, 00040 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00041 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00042 * GNU General Public License for more details. 00043 * 00044 * You should have received a copy of the GNU General Public License 00045 * along with this program; if not, write to the Free Software 00046 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00047 * 02110-1301 USA. 00048 */ 00049 00050 #ifndef ABIPAINT_H 00051 #define ABIPAINT_H 00052 00053 #include <string> 00054 00055 #include "AbiGeneric.h" 00056 00057 #ifdef _WIN32 00058 #define ENABLE_BMP 00059 const char *szProgramsDesc = "Image Editing Programs (*.exe,*.com)"; 00060 const char *szProgramSuffix= "*.exe; *.com"; 00061 #else /* UNIX */ 00062 const char *szProgramsDesc = "Image Editing Programs (*)"; 00063 const char *szProgramSuffix= "*"; 00064 #endif 00065 00066 #ifndef MAX_PATH 00067 #define MAX_PATH 2048 00068 #endif 00069 00070 // various helper functions 00071 static void getDefaultApp(std::string &imageApp, bool &bLeaveImageAsPNG); 00072 00073 00074 #ifdef ENABLE_BMP 00075 // TODO: FIX bmp support, as the BMP loader is now an optional plugin 00076 // so we now convert to BMP and back to PNG (using pngdib) 00077 // instead of allowing AbiWord's BMP importer to do the conversion 00078 #include "ie_types.h" // for BMP file type 00079 00080 // #include "pngdib.h" 00081 // returns 0 on success, nonzero of failure 00082 int convertPNG2BMP(const char *pngfn, const char *bmpfn); 00083 int convertBMP2PNG(const char *bmpfn, const char *pngfn); 00084 #endif 00085 00086 00087 #endif /* ABIPAINT_H */