oilfltrs.cpp

Go to the documentation of this file.
00001 // $Id: oilfltrs.cpp 1679 2006-08-08 09:47:27Z gerry $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 // The module that controls the OIL side of import/export filters.
00100 
00101 
00102 #include "camtypes.h"
00103 
00104 //#include "pathname.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 //#include "document.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00106 //#include "ensure.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 //#include "errors.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00108 //#include "tim.h"
00109 //#include "rik.h"
00110 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00111 //#include "accures.h"      // General Accusoft DLL strings
00112 //#include "nev.h"          // _R(IDN_USER_CANCELLED), _R(IDN_FILTERNOTPRESENT), _R(IDS_OPMENUIMPORT_ONE), _R(IDS_OPMENUEXPORT_ONE)
00113 #ifndef WEBSTER
00114 //#include "extfilts.h"     // Accusoft filters
00115 #endif //WEBSTER
00116 //#include "giffiltr.h"     // Transparent and interlaced GIF filter - now in filters.cpp
00117 #include "optsmsgs.h"       // options messages IMPORTWITHLAYERS
00118 //#include "mainfrm.h"
00119 #include "camelot.h"
00120 #include "coplfilr.h"       // !!! this MUST occur before any JPEG stuff 'cos of MAX_COMPONENTS define/enum clash
00121 #include "freeeps.h"
00122 //#include "ben.h"
00123 #include "cameleps.h"
00124 //#include "richard.h"      // for sprite ID's
00125 //#include "peter.h"
00126 //#include "sprfilt.h"      // for sprite filter class
00127 #include "ppmfiltr.h"       // for PPM filter class
00128 #include "textfltr.h"
00129 #include "textfuns.h"
00130 #include "unicdman.h"
00131 #include "fontman.h"
00132 //#include "mario.h"
00133 //#include "filtrres.h"     // for WEB and PNG names
00134 #include "pngfiltr.h"       // for PNG filter class
00135 #include "imjpeg.h"         // for JPEGImportFilter
00136 //#include "exjpeg.h"           // for JPEGExportFilter
00137 #include "filtimag.h"       // Imagemap filter
00138 //#include "resimmap.h"     //Imagemap resources
00139 #include "prvwflt.h"        // for preview filters
00140 
00141 //#include "oilfltrs.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00142 //#include "metafilt.h"
00143 //#include "enhmeta.h"
00144 
00145 //#include "filedlgs.h"     // for ImportFileDialog & ExportFileDialog
00146 #include "helpuser.h"
00147 
00148 #include "xpfilter.h"
00149 //#include <atlbase.h>
00150 
00151 #include "xmlutils.h"
00152 
00153 CC_IMPLEMENT_MEMDUMP(OILFilter, CC_CLASS_MEMDUMP)
00154 CC_IMPLEMENT_MEMDUMP(OILFilterFamily, OILFilter)
00155 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
00156 CC_IMPLEMENT_MEMDUMP(MetaFileFilter, Filter)
00157 //CC_IMPLEMENT_MEMDUMP(AldusFormatFilter, MetaFileFilter )
00158 #endif
00159 
00160 // Declare smart memory handling in Debug builds
00161 #define new CAM_DEBUG_NEW
00162 
00163 /********************************************************************************************
00164 
00165 >   OILFilter::OILFilter(Filter *pFilter)
00166 
00167     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00168     Created:    28/07/94
00169     Inputs:     pFilter - the filter that this OILFilter object belongs to.
00170     Purpose:    Initialise an OILFilter object, and link it to its parent Filter.
00171     Errors:     ENSURe failure if pFilter is NULL
00172     SeeAlso:    -
00173 
00174 ********************************************************************************************/
00175 
00176 OILFilter::OILFilter(Filter *pFilter)
00177 {
00178     ENSURE(pFilter != NULL, "No parent filter for OILFilter object");
00179 
00180     Position = -1; 
00181     Parent = pFilter;
00182 }
00183 
00184 
00185 /********************************************************************************************
00186 // Macro borrowed from Filters.cpp
00187 ********************************************************************************************/
00188 #define ADD_FILTER(Classname) \
00189     /* Create, initialise and install the Generic import filter */                  \
00190     pFilter = new Classname;                                                        \
00191     /* Error state already set by new */                                            \
00192     if (pFilter == NULL) return FALSE;                                              \
00193                                                                                     \
00194     if (!pFilter->Init())                                                           \
00195     {                                                                               \
00196         /* Error occured - report it and stop trying to initialise filters. */      \
00197         if (Error::GetErrorNumber() != _R(IDN_FILTERNOTPRESENT))                        \
00198             InformError();                                                          \
00199         return TRUE;                                                                \
00200     }                                                                               \
00201                                                                                     \
00202     FilterList.AddTail(pFilter);
00203 
00204 /********************************************************************************************
00205 
00206 >   BOOL OILFilter::InitFilters(List& FilterList)
00207 
00208     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00209     Created:    22/02/94
00210     Inputs:     The list of filters to which the OILy filters should be added.
00211     Outputs:    The updated list of filters.
00212     Returns:    TRUE if initialised ok, FALSE if not.
00213     Purpose:    Scans all OILy filters to find out which filters are available for use, and
00214                 instantiates one of each, and holds them in a list.
00215     Errors:     Out of memory (if a filter fails to initialise for other reasons then an 
00216                 error is reported, but Camelot will still start up ok, i.e. TRUE is 
00217                 returned).
00218     SeeAlso:    Filter::InitFilters
00219 
00220 ********************************************************************************************/
00221 
00222 BOOL OILFilter::InitFilters(List& FilterList)
00223 {
00224     // Find the OILy filters
00225     Filter *pFilter;
00226 
00227 #if !defined(EXCLUDE_FROM_RALPH)
00228 
00229     if (!CreatePluginFilters(FilterList))
00230     {
00231         // Error has already been set
00232         return(FALSE);
00233     }
00234 
00235 #if !defined(EXCLUDE_FROM_XARALX)
00236     // Create, initialise and install the Windows MetaFile import filter
00237     ADD_FILTER(MetaFileFilter)
00238 
00239     // If the OS can do enhanced metafiles then do them
00240     if (IsWin32NT() || IsWin32c())
00241     {
00242         ADD_FILTER(EnhancedMetaFilter)
00243     }
00244 
00245     ADD_FILTER(MSPaletteFilter)
00246     ADD_FILTER(PaintShopProPaletteFilter)
00247 
00248 //  AldusFormatFilter::InitAll(FilterList);
00249 
00250     // Call the init function of the main external filters class so that the Accusoft DLL
00251     // gets loaded. Acts as a dummy filter that can neither import nor export.
00252     // If it gets the DLL then it initialises each of the filters otherwise it will exit
00253     // from the function immediately.
00254 
00255     // WEBSTER-Martin-19/12/96 no Accusoft
00256 #ifndef WEBSTER
00257     ADD_FILTER(AccusoftFilters)
00258 
00259     // Create, initialise and install the external filters supplied by the Accusoft software.
00260     // These are at present supplied in the Intel and Mac directories as we have Intel versions
00261     // but no MAC versions. The Mac versions just do nothing at present except return FALSE.
00262     // Hence the first filter will fail and we will immediately return TRUE to the caller.
00263     ADD_FILTER(AccusoftBMPFilter)                   // Mac version fails and returns here
00264     ADD_FILTER(BrookTroutFilter)                    
00265     ADD_FILTER(CALSFilter)
00266     ADD_FILTER(DCXFilter)
00267     ADD_FILTER(GX2Filter)
00268     ADD_FILTER(IFFFilter)
00269     ADD_FILTER(IMGFilter)
00270     ADD_FILTER(IOCAFilter)
00271     ADD_FILTER(HaloCUTFilter)
00272     ADD_FILTER(KOFAXFilter)
00273     ADD_FILTER(LaserDataFilter)
00274     ADD_FILTER(MacPaintFilter)
00275     ADD_FILTER(MSIconsFilter)               
00276     ADD_FILTER(MSPaintFilter)
00277     ADD_FILTER(PCXFilter)
00278     ADD_FILTER(PICTFilter)
00279     ADD_FILTER(PhotoCDFilter)
00280     ADD_FILTER(PhotoShopFilter)
00281     ADD_FILTER(SUNFilter)
00282     ADD_FILTER(TARGAFilter)
00283     ADD_FILTER(WPGFilter)
00284     ADD_FILTER(XWindowsFilter)
00285 
00286     // Preview filters
00287     ADD_FILTER(AccPreviewFilter)
00288     ADD_FILTER(PreviewFilterTIFF)   //this is still an Accusoft filter
00289 
00290 #endif //WEBSTER
00291 
00292 #endif  // EXCLUDE_FROM_XARALX
00293 
00294     ADD_FILTER(PPMFilter)
00295     ADD_FILTER(PGMFilter)
00296     ADD_FILTER(PBMFilter)
00297 #if !defined(EXCLUDE_FROM_XARALX)
00298     ADD_FILTER(SpriteFilter)
00299 #endif
00300 
00301 //WEBSTER-Martin-19/12/96
00302 // possibly these next ones should now be in Filter::InitFilters as it's native code now
00303 
00304 #if defined(EXCLUDE_FROM_XARALX)
00305     ADD_FILTER(JPEGImportFilter)
00306 #endif
00307 
00308     // Add the Preview Bitmap Filter
00309     // Tricky one this. Don't really need this any more (14/3/97)- its only use is the 
00310     // PreviewFilter::PreviewBitmapSize static that has historically been used all over the place
00311     ADD_FILTER(PreviewFilter)
00312 
00313     // Add the preview bitmap filters that we can use in the new native/web format
00314     ADD_FILTER(PreviewFilterBMP)
00315     ADD_FILTER(PreviewFilterGIF)
00316     ADD_FILTER(PreviewFilterJPEG)
00317     ADD_FILTER(PreviewFilterPNG)
00318     ADD_FILTER(ThumbnailFilterPNG)
00319 
00320 #endif
00321 
00322     // All ok
00323     return TRUE;
00324 }
00325 
00326 
00327 
00328 /****************************************************************************
00329 
00330 >   BOOL OILFilter::CreatePluginFilters(List& FilterList)
00331 
00332     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
00333     Created:    26/01/2005
00334 
00335     Inputs:     FilterList  - 
00336     Returns:    TRUE if ok, FALSE if bother
00337     Purpose:    Creates a filter object for each installed plugin filter
00338 
00339 ****************************************************************************/
00340 
00341 BOOL OILFilter::CreatePluginFilters(List& FilterList)
00342 {
00343     PORTNOTETRACE("filters","OILFilter::CreatePluginFilters - bodged");
00344 #if 0
00345     PluginNativeFilter* pFilter = new PluginNativeFilter;
00346     if (pFilter == NULL)
00347         return FALSE;
00348 
00349     if (pFilter->Init( (xmlNode*)NULL ))
00350         FilterList.AddTail(pFilter);
00351     else
00352         delete pFilter;
00353 #endif
00354 
00355     // Check the config dir exists, if not bomb out
00356     wxString    strConfigPath( (TCHAR*)CCamApp::GetResourceDirectory() );
00357     strConfigPath += _T("/filters");
00358     TRACEUSER( "jlh92", _T("Using filter discovery directory \"%s\"\n"), PCTSTR(strConfigPath) );
00359     if( !wxDir::Exists( strConfigPath ) )
00360     {
00361         // We'll try default location under debug to make life easier
00362 #if defined(_DEBUG)
00363         strConfigPath = _T("/usr/share/xaralx/filters");
00364         if( !wxDir::Exists( strConfigPath ) )
00365 #endif
00366             return TRUE;
00367     }
00368 
00369     TRACEUSER( "luke", _T("Using %s as filter store\n"), PCTSTR(strConfigPath) );
00370 
00371     // Setup the directory scan
00372     wxDir   dir( strConfigPath );
00373     if( !dir.IsOpened() )
00374     {
00375         // wxDir is susposed to explain why this failed, so we can just 
00376         // bomb-out
00377         return FALSE;
00378     }
00379     
00380     // Scan all files in directory
00381     wxString    strFilename;
00382     bool        fOk = dir.GetFirst( &strFilename, _T("*"), wxDIR_FILES );
00383     while( fOk )
00384     {
00385         strFilename = strConfigPath + _T("/") + strFilename;
00386         
00387         // Convert the filename to ASCII
00388         size_t  cchFile = strFilename.Length();
00389         PSTR    pszFile = (PSTR)alloca( sizeof(char) * ( cchFile + 1 ) );
00390         camWcstombs( pszFile, (PCTSTR)strFilename, cchFile );
00391         pszFile[cchFile] = '\0';
00392         
00393         // Open the xml file
00394         xmlDoc*     pDoc = xmlReadFile( pszFile, NULL, 0 );
00395         if( NULL != pDoc )
00396         {
00397             // Scan the root elements for FilterConfig element
00398             xmlNode* pRootElement = xmlDocGetRootElement( pDoc );
00399             xmlNode* pConfigElem  = NULL;
00400             for( xmlNode* pNode = pRootElement; NULL != pNode; pNode = pNode->next )
00401             {
00402                 if( XML_ELEMENT_NODE == pNode->type &&
00403                     0 == strcmp( "FilterConfig", PCSTR(pNode->name) ) )
00404                 {
00405                     pConfigElem = pNode;
00406                     break;
00407                 }
00408             }
00409             
00410             if( NULL != pConfigElem )
00411             {
00412                 // Scan the elements below FilterConfig for filters
00413                 for( xmlNode* pNode = pConfigElem->children; NULL != pNode; pNode = pNode->next )
00414                 {
00415                     if( XML_ELEMENT_NODE == pNode->type &&
00416                         0 == strcmp( "Filter", PCSTR(pNode->name) ) )
00417                     {
00418                         // Create a new filter, Init it and add to list if success
00419                         // Note will be auto deleted if not added
00420                         std::auto_ptr<PluginNativeFilter> pFilter( new PluginNativeFilter );
00421                         if( pFilter->Init( pNode ) )
00422                             FilterList.AddTail( pFilter.release() );
00423                     }
00424                 }
00425             }
00426 
00427             xmlFreeDoc( pDoc );
00428             pDoc = NULL;
00429         }
00430         
00431         fOk = dir.GetNext( &strFilename );
00432     }
00433     
00434     return TRUE;
00435 }
00436 
00437 
00438 
00439 /********************************************************************************************
00440 
00441 >   char *OILFilter::ConstructFilterString(UINT32 NumberToExport = 1)
00442 
00443     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00444     Created:    26/07/94
00445     Inputs:     NumberToExport - The number of files being exported (allows different names)
00446     Returns:    Pointer to the string for this filter.  This is a pointer to a static
00447                 buffer, so it should be used immediately, and the caller should not
00448                 attempt to deallocate this string.
00449     Purpose:    Construct a COMMDLG filter definition string to put in the drop-down
00450                 list of filters in the dialog box.
00451     SeeAlso:    OILFilter; OpMenuImport; OpMenuExport
00452 
00453 ********************************************************************************************/
00454 
00455 TCHAR *OILFilter::ConstructFilterString(UINT32 NumberToExport)
00456 {
00457     // Load in the filter name and extensions...
00458     static String_128 FilterStr;
00459     String_32 Extensions;
00460 
00461     FilterStr = GetFilterName(NumberToExport);
00462 
00463     // Construct the filter string from these two strings:
00464     FilterStr += _T(" (");
00465 
00466     // Extract each extension and see if we need to add it
00467     String_32 ExtStr;
00468     ExtStr = FilterExt;
00469 
00470     TCHAR*  pPointer;
00471     TCHAR*  pExt = camStrtok( (TCHAR*)ExtStr, _T(","), &pPointer );
00472     BOOL NoneFound = TRUE;
00473 
00474     while (pExt != NULL)
00475     {
00476         if (camStrstr((TCHAR *) Extensions, pExt) == NULL)
00477         {
00478             // Not already present - add the string.
00479             if (!NoneFound)
00480                 // Don't add a semi-colon if this is the first one we find.
00481                 Extensions += _T(";");
00482             
00483             String_16 Ext( pExt );
00484             Extensions += _T("*.");
00485             Ext.toLower();
00486             Extensions += Ext;
00487             
00488             Extensions += _T(";*.");
00489             Ext.toUpper();
00490             Extensions += Ext;
00491 
00492             NoneFound = FALSE;
00493         }
00494 
00495         pExt = camStrtok( NULL, _T(","), &pPointer );
00496     }
00497 
00498     FilterStr += Extensions;
00499     FilterStr += _T(")|");
00500     FilterStr += Extensions;
00501 
00502     // Return a pointer to the string.
00503     return (TCHAR *) FilterStr;
00504 }
00505 
00506 
00507 
00508 /********************************************************************************************
00509 >   String_64 OILFilter::GetFilterName(UINT32 NumberToExport)
00510 
00511     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
00512     Created:    12/6/96
00513     Inputs:     NumberToExport - the number of files being exported.
00514     Returns:    The name of the filter
00515     Purpose:    Allows derived classes to supply differnt filter names
00516 ********************************************************************************************/
00517 String_64 OILFilter::GetFilterName(UINT32 NumberToExport)
00518 {
00519     return FilterName;
00520 }
00521 
00522 
00523 
00524 /********************************************************************************************
00525 
00526 >   OILFilterFamily::OILFilterFamily(Filter *pFilter, UINT32 NameID)
00527 
00528     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00529     Created:    28/07/94
00530     Inputs:     pFilter - the parent filter of this OILFilter
00531                 NameID - the string that describes this filter family.
00532     Purpose:    Construct the OIL part of a filter family.  This is basically the
00533                 string resource that is the name of the filter, that appears in the
00534                 COMMDLG import dialog box.
00535     SeeAlso:    OILFilter
00536 
00537 ********************************************************************************************/
00538 
00539 OILFilterFamily::OILFilterFamily(Filter *pFilter, UINT32 NameID) : OILFilter(pFilter)
00540 {
00541     FilterName.Load( NameID );
00542 }
00543 
00544 
00545 /********************************************************************************************
00546 
00547 >   char *OILFilterFamily::ConstructFilterString(UINT32 NumberToExport = 1)
00548 
00549     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00550     Created:    26/07/94
00551     Returns:    Pointer to the string for this filter.  This is a pointer to a static
00552                 buffer, so it should be used immediately, and the caller should not
00553                 attempt to deallocate this string.
00554     Purpose:    Construct a COMMDLG filter definition string to put in the drop-down
00555                 list of filters in the dialog box. This version gathers together all the 
00556                 extensions for a filter family.
00557     SeeAlso:    OILFilter; OpMenuImport; OpMenuExport
00558 
00559 ********************************************************************************************/
00560 
00561 TCHAR *OILFilterFamily::ConstructFilterString(UINT32 NumberToExport)
00562 {
00563 #if !defined(EXCLUDE_FROM_RALPH)
00564     // Load in the filter name and extensions...
00565     static String_256 FilterStr;
00566     String_256 Extensions;
00567     FilterStr = FilterName;
00568 
00569     // Go through the filters and find out which ones to put in this family.
00570     ENSURE(Parent->IsKindOf(CC_RUNTIME_CLASS(FilterFamily)), "Bad parent filter");
00571 
00572     if (IS_A(Parent, GenericFilter))
00573     {
00574         // It's the generic filter - just use "*.*" as the extension mask.
00575         Extensions = _T("*.*");
00576     }
00577     else
00578     {
00579         // Run through all the filters and gather up all their extensions into a list.
00580         CCRuntimeClass *pFilterType = ((FilterFamily *) Parent)->pFilterType;
00581 
00582         Filter *pFilter = Filter::GetFirst();
00583 
00584         BOOL NoneFound = TRUE;
00585 
00586         while (pFilter != NULL)
00587         {
00588             if (pFilter->GetFlags().CanImport && pFilter->JoinFamily(pFilterType) &&
00589                 pFilter->GetFlags().ShowFilter)
00590             {
00591                 // This is an import filter which belongs to our family - add its
00592                 // extension list (unless it is already in out list).
00593                 String_32 ExtStr;
00594                 ExtStr = pFilter->pOILFilter->FilterExt;
00595 
00596                 // Extract each extension and see if we need to add it
00597                 TCHAR* pTemp = NULL;
00598                 TCHAR* pExt = camStrtok((TCHAR *) ExtStr, _T(","), &pTemp);
00599 
00600                 while (pExt != NULL)
00601                 {
00602                     if (camStrstr((TCHAR *) Extensions, pExt) == NULL)
00603                     {
00604                         // Not already present - add the string.
00605                         if (!NoneFound)
00606                             // Don't add a semi-colon if this is the first one we find.
00607                             Extensions += _T(";");
00608                         Extensions += _T("*.");
00609                         Extensions += pExt;
00610                         NoneFound = FALSE;
00611                     }
00612 
00613                     pExt = camStrtok(NULL, _T(","), &pTemp);
00614                 }
00615             }
00616 
00617             // Get the next filter.
00618             pFilter = Filter::GetNext(pFilter);
00619         }
00620     }
00621 
00622 
00623     // Construct the filter string from these two strings:
00624     FilterStr += _T("|");
00625     FilterStr += Extensions;
00626 
00627     // Return a pointer to the string.
00628     return (TCHAR *) FilterStr;
00629 #else
00630     return NULL;
00631 #endif
00632 }
00633 
00634 
00635 
00636 
00637 /********************************************************************************************
00638 
00639 >   BOOL OILFilter::DoesExtensionOfFileMatch(CCLexFile *File)
00640 
00641     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
00642     Created:    31/03/95
00643     Purpose:    Sees if the extension of the given file matches one of the extensions
00644                 given in the filter extension string. Used for ensuring a good match in
00645                 filters.cpp
00646 
00647 ********************************************************************************************/
00648 
00649 BOOL OILFilter::DoesExtensionOfFileMatch(CCLexFile *File)
00650 {
00651     ERROR2IF(File == NULL,FALSE,"OILFilter::DoesExtensionOfFileMatch File supplied is null");
00652 
00653 TRACEUSER( "Ben", _T("Checking extension for filter %s\n"), (TCHAR *)FilterName);
00654     if(File->IsKindOf(CC_RUNTIME_CLASS(CCDiskFile)))
00655     {
00656         // check the filename
00657         CCDiskFile *pDiskFile = (CCDiskFile *)File;
00658         PathName Path;
00659 
00660         Path = pDiskFile->GetPathName();
00661 
00662         return DoesExtensionOfPathNameMatch(&Path);
00663     }
00664 
00665     return FALSE;
00666 }
00667 
00668 
00669 /********************************************************************************************
00670 
00671 >   BOOL OILFilter::DoesExtensionOfPathNameMatch(PathName *Path)
00672 
00673     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
00674     Created:    16/05/95
00675     Purpose:    Sees if the extension of the given pathname matches one of the extensions
00676                 given in the filter extension string. Used for ensuring a good match in
00677                 filters.cpp and stuff.
00678 
00679 ********************************************************************************************/
00680 
00681 BOOL OILFilter::DoesExtensionOfPathNameMatch(PathName *Path)
00682 {
00683     ERROR2IF(Path == NULL,FALSE,"OILFilter::DoesExtensionOfPathNameMatch Path supplied is null");
00684 
00685     String_256 Ext;
00686     TCHAR *fe;
00687     TCHAR *pex;
00688     TCHAR ex[256];
00689 
00690     Ext = Path->GetType();
00691 
00692     // Retrieve a copy of the filter extension(s) defined to this filter 
00693     fe = FilterExt;
00694     pex = Ext;
00695 
00696     INT32 l = 0;
00697     while(pex[l] != _T('\0'))
00698     {
00699         ex[l] = camTolower(pex[l]);
00700         l++;
00701     }
00702     ex[l] = _T('\0');
00703 
00704 TRACEUSER( "Ben", _T("Checking extension matches, of file = '%s', supported = '%s'\nLard\n"), (TCHAR *)ex, fe);
00705     if(ex[0] == _T('\0'))
00706     {
00707         // it's a blank extension. It can't match then, can it?
00708 TRACEUSER( "Ben", _T("File didn't have an extension\n"));
00709         return FALSE;
00710     }
00711 
00712     // see if the extension is in the list of supported extensions in the filter
00713     if(camStrstr(fe, (ex[0] == _T('.'))?(ex + 1):ex) != NULL)
00714         return TRUE;
00715 
00716     return FALSE;
00717 }
00718 
00719 
00720 
00721 /********************************************************************************************
00722 
00723 >   BOOL OILFilter::FixExtensionOfPathName(PathName *Path)
00724 
00725     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
00726     Created:    04/01/96
00727     Outputs:    Path    the pathname of the file to be fixed
00728     Returns:    True if replace the extension ok, False otherwise.
00729     Purpose:    Replace the extension in the pathname supplied with one for this filter.
00730                 If more than one extension exists then replace with the first available one.
00731 
00732 ********************************************************************************************/
00733 BOOL OILFilter::FixExtensionOfPathName(PathName *Path)
00734 {
00735     ERROR2IF(Path == NULL,FALSE,"OILFilter::FixExtensionOfPathName Path supplied is null");
00736 
00737     // Retrieve a copy of the filter extension(s) defined to this filter 
00738     String_256 ExtStr = FilterExt;
00739         
00740     // If there is no filter extension string then all we can do is return False
00741     if (ExtStr.IsEmpty())
00742         return FALSE;
00743 
00744     // Filters might have multiple extensions listed separated by commas
00745     // so use first e.g. AI eps filter has ai and eps.
00746     // Work out the position of the first separator character, - 1 if none
00747     INT32   Position;
00748     String_8 SepMark = _T(",");
00749     Position = ExtStr.Sub(SepMark);
00750     // If comma separator was found use up to the separator 
00751     if (Position > 0)
00752         ExtStr.Left(&ExtStr, Position);
00753 
00754     // Put the found extension string in the path we were told to fix
00755     Path->SetType(ExtStr);
00756     
00757     return FALSE;
00758 }
00759 
00760 
00761 #if !defined(EXCLUDE_FROM_RALPH)
00762 
00763 /********************************************************************************************
00764 ***** Definition of the OILy parts for individual filters                               *****
00765 ********************************************************************************************/
00766 
00767 
00768 
00769 /********************************************************************************************
00770 
00771 >   AIEPSOILFilter::AIEPSOILFilter()
00772 
00773     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00774     Created:    22/02/94
00775     Purpose:    Sets up the list of filename extensions that this filter understands.
00776 
00777 ********************************************************************************************/
00778 
00779 AIEPSOILFilter::AIEPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00780 {
00781     FilterName.Load(_R(IDT_FILTERNAME_AIEPS));
00782     FilterExt.Load(_R(IDT_FILTEREXT_AIEPS));
00783 }
00784 
00785 /********************************************************************************************
00786 
00787 >   AI5EPSOILFilter::AI5EPSOILFilter()
00788 
00789     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00790     Created:    22/02/94
00791     Purpose:    Sets up the list of filename extensions that this filter understands.
00792 
00793 ********************************************************************************************/
00794 
00795 AI5EPSOILFilter::AI5EPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00796 {
00797     FilterName.Load(_R(IDT_FILTERNAME_AI5EPS));
00798     FilterExt.Load(_R(IDT_FILTEREXT_AIEPS));
00799 }
00800 
00801 /********************************************************************************************
00802 
00803 >   AI8EPSOILFilter::AI8EPSOILFilter()
00804 
00805     Author:     Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
00806     Created:    28/03/00
00807     Purpose:    Sets up the list of filename extensions that this filter understands.
00808 
00809 ********************************************************************************************/
00810 AI8EPSOILFilter::AI8EPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00811 {
00812     FilterName.Load(_R(IDT_FILTERNAME_AI8EPS));
00813     FilterExt.Load(_R(IDT_FILTEREXT_AIEPS));
00814 }
00815 
00816 #endif
00817 
00818 
00819 
00820 /********************************************************************************************
00821 
00822 >   ArtWorksEPSOILFilter::EPSOILFilter()
00823 
00824     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00825     Created:    22/02/94
00826     Purpose:    Sets up the list of filename extensions that this filter understands.
00827 
00828 ********************************************************************************************/
00829 
00830 ArtWorksEPSOILFilter::ArtWorksEPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00831 {
00832     FilterName.Load(_R(IDT_FILTERNAME_AWEPS));
00833     FilterExt.Load(_R(IDT_FILTEREXT_EPS));
00834 }
00835 
00836 /********************************************************************************************
00837 
00838 >   CamelotEPSOILFilter::EPSOILFilter()
00839 
00840     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00841     Created:    22/02/94
00842     Purpose:    Sets up the list of filename extensions that this filter understands.
00843 
00844 ********************************************************************************************/
00845 
00846 CamelotEPSOILFilter::CamelotEPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00847 {
00848     FilterName.Load(_R(IDT_FILTERNAME_CAMEPS));
00849     FilterExt.Load(_R(IDT_FILTEREXT_EPS));
00850 }
00851 
00852 
00853 
00854 /********************************************************************************************
00855 
00856 >   NativeEPSOILFilter::NativeEPSOILFilter(Filter* pFilter)
00857 
00858     Author:     Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
00859     Created:    15/12/94
00860     Inputs:     pFilter - The Filter
00861     Purpose:    Constructs to oily parts of the Native File Format Filter (ie the list of
00862                 File Extensions that this filter understands)
00863 
00864 ********************************************************************************************/
00865 
00866 NativeEPSOILFilter::NativeEPSOILFilter(Filter* pFilter) : CamelotEPSOILFilter(pFilter)
00867 {
00868     FilterName.Load(_R(IDS_FILTERNAME_NATIVE_EPS));
00869     FilterExt.Load(_R(IDS_FILTEREXT_NATIVE));
00870 }
00871 
00872 
00873 
00874 
00875 #if !defined(EXCLUDE_FROM_RALPH)
00876 
00877 /********************************************************************************************
00878 
00879 >   Corel3EPSOILFilter::EPSOILFilter()
00880 
00881     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00882     Created:    22/02/94
00883     Purpose:    Sets up the list of filename extensions that this filter understands.
00884 
00885 ********************************************************************************************/
00886 
00887 Corel3EPSOILFilter::Corel3EPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00888 {
00889     FilterName.Load(_R(IDT_FILTERNAME_COREL3EPS));
00890     FilterExt.Load(_R(IDT_FILTEREXT_EPS));
00891 }
00892 
00893 /********************************************************************************************
00894 
00895 >   Corel4EPSOILFilter::EPSOILFilter()
00896 
00897     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00898     Created:    22/02/94
00899     Purpose:    Sets up the list of filename extensions that this filter understands.
00900 
00901 ********************************************************************************************/
00902 
00903 Corel4EPSOILFilter::Corel4EPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00904 {
00905     FilterName.Load(_R(IDT_FILTERNAME_COREL4EPS));
00906     FilterExt.Load(_R(IDT_FILTEREXT_EPS));
00907 }
00908 
00909 /********************************************************************************************
00910 
00911 >   DrawOILFilter::DrawOILFilter()
00912 
00913     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00914     Created:    22/02/94
00915     Purpose:    Sets up the list of filename extensions that this filter understands.
00916 
00917 ********************************************************************************************/
00918 
00919 DrawOILFilter::DrawOILFilter(Filter *pFilter) : OILFilter(pFilter)
00920 {
00921     FilterName.Load(_R(IDT_FILTERNAME_ACORNDRAW));
00922     FilterExt.Load(_R(IDT_FILTEREXT_ACORNDRAW));
00923 }
00924 
00925 /********************************************************************************************
00926 
00927 >   FlashOILFilter::FlashOILFilter()
00928 
00929     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00930     Created:    17/8/99
00931     Purpose:    Sets up the list of filename extensions that this filter understands.
00932 
00933 ********************************************************************************************/
00934 
00935 FlashOILFilter::FlashOILFilter(Filter *pFilter) : OILFilter(pFilter)
00936 {
00937     FilterName.Load(_R(IDT_FILTERNAME_FLASH));
00938     FilterExt.Load(_R(IDT_FILTEREXT_FLASH));
00939 }
00940 
00941 /********************************************************************************************
00942 
00943 >   PhotoShopEPSOILFilter::PhotoShopEPSOILFilter()
00944 
00945     Author:     Chris_Gallimore (Xara Group Ltd) <camelotdev@xara.com>
00946     Created:    9/11/00
00947     Purpose:    Sets up the list of filename extensions that this filter understands.
00948 
00949 ********************************************************************************************/
00950 
00951 PhotoShopEPSOILFilter::PhotoShopEPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
00952 {
00953     FilterName.Load(_R(IDT_PHOTOSHOPEPS_FILTERNAME));
00954     FilterExt.Load(_R(IDT_FILTEREXT_PHOTOSHOPEPS));
00955 }
00956 
00957 
00958 #endif
00959 
00960 /********************************************************************************************
00961 
00962 >   CorelPaletteFileOILFilter::CorelPaletteFileOILFilter(Filter *pFilter)
00963 
00964     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
00965     Created:    15 03 95
00966     Purpose:    Sets up the list of filename extensions that this filter understands.
00967 
00968 ********************************************************************************************/
00969 
00970 CorelPaletteFileOILFilter::CorelPaletteFileOILFilter(Filter *pFilter) : OILFilter(pFilter)
00971 {
00972     FilterName.Load(_R(IDT_FILTERNAME_CORELPALETTEFILE));
00973     FilterExt.Load(_R(IDT_FILTEREXT_CORELPALETTEFILE));
00974 }
00975 
00976 /********************************************************************************************
00977 >   MSPaletteOILFilter::MSPaletteOILFilter(Filter *pFilter)
00978 
00979     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
00980     Created:    30/4/96
00981     Purpose:    Sets up the list of filename extensions that this filter understands.
00982 ********************************************************************************************/
00983 MSPaletteOILFilter::MSPaletteOILFilter(Filter *pFilter) : OILFilter(pFilter)
00984 {
00985     FilterName.Load(_R(IDT_FILTERNAME_WINDOWSPALETTE));
00986     FilterExt.Load(_R(IDT_FILTEREXT_WINDOWSPALETTE));
00987 }
00988 
00989 
00990 
00991 /********************************************************************************************
00992 >   AdobeColourTableOILFilter::AdobeColourTableOILFilter(Filter *pFilter)
00993 
00994     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
00995     Created:    1/5/96
00996     Purpose:    Sets up the list of filename extensions that this filter understands.
00997 ********************************************************************************************/
00998 AdobeColourTableOILFilter::AdobeColourTableOILFilter(Filter *pFilter) : OILFilter(pFilter)
00999 {
01000     FilterName.Load(_R(IDT_FILTERNAME_ADOBECOLOURTABLE));
01001     FilterExt.Load(_R(IDT_FILTEREXT_ADOBECOLOURTABLE));
01002 }
01003 
01004 /********************************************************************************************
01005 >   INT32 AdobeColourTableOILFilter::HowCompatible(PathName& Filename)
01006 
01007     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01008     Created:    1/5/96
01009     Purpose:    Retuns a compatibility number based on the file extension
01010 ********************************************************************************************/
01011 INT32 AdobeColourTableOILFilter::HowCompatible(PathName& Filename)
01012 {
01013 PORTNOTE("byteorder", "TODO: Check byte ordering")
01014     if (DoesExtensionOfPathNameMatch(&Filename))
01015         return 9;
01016     else
01017         return 0;
01018 }
01019 
01020 /********************************************************************************************
01021 >   AdobeColourSwatchOILFilter::AdobeColourSwatchOILFilter(Filter *pFilter)
01022 
01023     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01024     Created:    2/5/96
01025     Purpose:    Sets up the list of filename extensions that this filter understands.
01026 ********************************************************************************************/
01027 AdobeColourSwatchOILFilter::AdobeColourSwatchOILFilter(Filter *pFilter) : OILFilter(pFilter)
01028 {
01029     FilterName.Load(_R(IDT_FILTERNAME_ADOBECOLOURSWATCH));
01030     FilterExt.Load(_R(IDT_FILTEREXT_ADOBECOLOURSWATCH));
01031 }
01032 
01033 /********************************************************************************************
01034 >   INT32 AdobeColourSwatchOILFilter::HowCompatible(PathName& Filename)
01035 
01036     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01037     Created:    2/5/96
01038     Purpose:    Retuns a compatibility number based on the file extension
01039 ********************************************************************************************/
01040 INT32 AdobeColourSwatchOILFilter::HowCompatible(PathName& Filename)
01041 {
01042 PORTNOTE("byteorder", "TODO: Check byte ordering")
01043     if (DoesExtensionOfPathNameMatch(&Filename))
01044         return 9;
01045     else
01046         return 0;
01047 }
01048 
01049 
01050 
01051 
01052 
01053 /********************************************************************************************
01054 >   PSPPaletteOILFilter::PSPPaletteOILFilter(Filter *pFilter)
01055 
01056     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01057     Created:    9/5/96
01058     Purpose:    Sets up the list of filename extensions that this filter understands.
01059 ********************************************************************************************/
01060 PSPPaletteOILFilter::PSPPaletteOILFilter(Filter *pFilter) : OILFilter(pFilter)
01061 {
01062     FilterName.Load(_R(IDT_FILTERNAME_PSPPALETTE));
01063     FilterExt.Load(_R(IDT_FILTEREXT_PSPPALETTE));
01064 }
01065 
01066 /********************************************************************************************
01067 >   JCWColourOILFilter::JCWColourOILFilter(Filter *pFilter)
01068 
01069     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01070     Created:    2/5/96
01071     Purpose:    Sets up the list of filename extensions that this filter understands.
01072 ********************************************************************************************/
01073 JCWColourOILFilter::JCWColourOILFilter(Filter *pFilter) : OILFilter(pFilter)
01074 {
01075     FilterName.Load(_R(IDT_FILTERNAME_JCWPALETTE));
01076     FilterExt.Load(_R(IDT_FILTEREXT_JCWPALETTE));
01077 }
01078 
01079 /********************************************************************************************
01080 >   INT32 JCWColourOILFilter::HowCompatible(PathName& Filename)
01081 
01082     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01083     Created:    2/5/96
01084     Purpose:    Retuns a compatibility number based on the file extension
01085 ********************************************************************************************/
01086 INT32 JCWColourOILFilter::HowCompatible(PathName& Filename)
01087 {
01088 PORTNOTE("byteorder", "TODO: Check byte ordering")
01089     if (DoesExtensionOfPathNameMatch(&Filename))
01090         return 9;
01091     else
01092         return 0;
01093 }
01094 
01095 
01096 /********************************************************************************************
01097 
01098 >   CDROILFilter::CDROILFilter(Filter *pFilter)
01099 
01100     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
01101     Created:    21 03 95
01102     Purpose:    Sets up the list of filename extensions that this filter understands.
01103 
01104 ********************************************************************************************/
01105 
01106 CDROILFilter::CDROILFilter(Filter *pFilter) : OILFilter(pFilter)
01107 {
01108     FilterName.Load(_R(IDT_FILTERNAME_CDR));
01109     FilterExt.Load(_R(IDT_FILTEREXT_CDR));
01110 }
01111 
01112 /********************************************************************************************
01113 
01114 >   CMX32OILFilter::CMXOILFilter(Filter *pFilter)
01115 
01116     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
01117     Created:    17/06/96
01118     Purpose:    Sets up the list of filename extensions that this filter understands.
01119 
01120 ********************************************************************************************/
01121 
01122 CMXImportOILFilter::CMXImportOILFilter(Filter *pFilter) : OILFilter(pFilter)
01123 {
01124     PORTNOTETRACE("filters","CMXImportOILFilter::CMXImportOILFilter - do nothing");
01125 #ifndef EXCLUDE_FROM_XARALX
01126     FilterName.Load(_R(IDT_FILTERNAME_CMXIMPORT));
01127     FilterExt.Load(_R(IDT_FILTEREXT_CMX));
01128 #endif
01129 }
01130 
01131 #if !defined(EXCLUDE_FROM_RALPH)
01132 
01133 /********************************************************************************************
01134 
01135 >   CMX16OILFilter::CMXOILFilter(Filter *pFilter)
01136 
01137     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
01138     Created:    17/06/96
01139     Purpose:    Sets up the list of filename extensions that this filter understands.
01140 
01141 ********************************************************************************************/
01142 
01143 CMX16OILFilter::CMX16OILFilter(Filter *pFilter) : OILFilter(pFilter)
01144 {
01145     FilterName.Load(_R(IDT_FILTERNAME_CMX16));
01146     FilterExt.Load(_R(IDT_FILTEREXT_CMX));
01147 }
01148 
01149 /********************************************************************************************
01150 
01151 >   CMX32OILFilter::CMXOILFilter(Filter *pFilter)
01152 
01153     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
01154     Created:    17/06/96
01155     Purpose:    Sets up the list of filename extensions that this filter understands.
01156 
01157 ********************************************************************************************/
01158 
01159 CMX32OILFilter::CMX32OILFilter(Filter *pFilter) : OILFilter(pFilter)
01160 {
01161     FilterName.Load(_R(IDT_FILTERNAME_CMX32));
01162     FilterExt.Load(_R(IDT_FILTEREXT_CMX));
01163 }
01164 
01165 /********************************************************************************************
01166 
01167 >   FreeHandEPSOILFilter::FreeHandEPSOILFilter(Filter *pFilter)
01168 
01169     Author:     Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
01170     Created:    31/05/95
01171     Purpose:    Sets up the list of filename extensions that this filter understands.
01172 
01173 ********************************************************************************************/
01174 
01175 FreeHandEPSOILFilter::FreeHandEPSOILFilter(Filter *pFilter) : OILFilter(pFilter)
01176 {
01177     FilterName.Load(_R(IDT_FREEHANDEPS_FILTERNAME));
01178     FilterExt.Load(_R(IDT_FILTEREXT_FREEHANDEPS));
01179 }
01180 
01181 /********************************************************************************************
01182 
01183 >   MetaFileOILFilter::MetaOILFilter()
01184 
01185     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
01186     Created:    22/02/94
01187     Purpose:    Sets up the list of filename extensions that this filter understands.
01188 
01189 ********************************************************************************************/
01190 
01191 MetaFileOILFilter::MetaFileOILFilter(Filter *pFilter) : OILFilter(pFilter)
01192 {
01193     FilterName.Load(_R(IDT_FILTERNAME_METAFILE));
01194     FilterExt.Load(_R(IDT_FILTEREXT_METAFILE));
01195 }
01196 
01197 /********************************************************************************************
01198 
01199 >   EnhancedMetaFileOILFilter::EnhancedMetaFileOILFilter()
01200 
01201     Author:     Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
01202     Created:    31/5/95
01203     Purpose:    Sets up the list of filename extensions that this filter understands.
01204 
01205 ********************************************************************************************/
01206 
01207 EnhancedMetaFileOILFilter::EnhancedMetaFileOILFilter(Filter *pFilter) : OILFilter(pFilter)
01208 {
01209     FilterName.Load(_R(IDS_ENHMETA_FILTERNAME));
01210     FilterExt.Load(_R(IDS_FILTEREXT_ENHMETA));
01211 }
01212 
01213 /********************************************************************************************
01214 
01215 >   AldusFormatOILFilter::AldusFormatOILFilter()
01216 
01217     Author:     Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
01218     Created:    10/3/95
01219     Purpose:    Sets up the list of filename extensions that this filter understands.
01220 
01221 ********************************************************************************************/
01222 
01223 AldusFormatOILFilter::AldusFormatOILFilter(Filter *pFilter, LPTCHAR UserName, LPTCHAR Extension) : OILFilter(pFilter)
01224 {
01225     FilterName = UserName;
01226     FilterExt = Extension;
01227 }
01228 
01229 #endif // EXCLUDE_FROM_RALPH
01230 
01231 /********************************************************************************************
01232 
01233 >   BMPOILFilter::BMPOILFilter()
01234 
01235     Author:     Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
01236     Created:    28/6/94
01237     Purpose:    Sets up the list of filename extensions that this filter understands.
01238 
01239 ********************************************************************************************/
01240 
01241 BMPOILFilter::BMPOILFilter(Filter *pFilter) : OILFilter(pFilter)
01242 {
01243     FilterName.Load(_R(IDT_FILTERNAME_BMP));
01244     FilterExt.Load(_R(IDT_FILTEREXT_BMP));
01245 }
01246 
01247 #if !defined(EXCLUDE_FROM_RALPH)
01248 
01249 /********************************************************************************************
01250 
01251 >   AccusoftOILFilter::AccusoftOILFilter()
01252 
01253     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01254     Created:    1/11/94
01255     Purpose:    Sets up the list of filename extensions that this filter understands.
01256 
01257 ********************************************************************************************/
01258 
01259 AccusoftOILFilter::AccusoftOILFilter(Filter *pFilter) : OILFilter(pFilter)
01260 {
01261     FilterName.Load(_R(IDN_FILTERNAME_ACCUSOFT));
01262     FilterExt.Load(_R(IDN_FILTEREXT_ACCUSOFT));
01263 }
01264 
01265 /********************************************************************************************
01266 
01267 >   AccusoftBMPOILFilter::AccusoftBMPOILFilter()
01268 
01269     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01270     Created:    27/1/95
01271     Purpose:    Sets up the list of filename extensions that this filter understands.
01272 
01273 ********************************************************************************************/
01274 
01275 AccusoftBMPOILFilter::AccusoftBMPOILFilter(Filter *pFilter) : OILFilter(pFilter)
01276 {
01277     FilterName.Load(_R(IDN_FILTERNAME_ACCUSOFTBMP));
01278     FilterExt.Load(_R(IDN_FILTEREXT_ACCUSOFTBMP));
01279 }
01280 
01281 /********************************************************************************************
01282 
01283 >   BrookTroutOILFilter::BrookTroutOILFilter()
01284 
01285     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01286     Created:    1/11/94
01287     Purpose:    Sets up the list of filename extensions that this filter understands.
01288 
01289 ********************************************************************************************/
01290 
01291 BrookTroutOILFilter::BrookTroutOILFilter(Filter *pFilter) : OILFilter(pFilter)
01292 {
01293     FilterName.Load(_R(IDN_FILTERNAME_BROOKTROUT));
01294     FilterExt.Load(_R(IDN_FILTEREXT_BROOKTROUT));
01295 }
01296 
01297 /********************************************************************************************
01298 
01299 >   CALSOILFilter::CALSOILFilter()
01300 
01301     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01302     Created:    1/11/94
01303     Purpose:    Sets up the list of filename extensions that this filter understands.
01304 
01305 ********************************************************************************************/
01306 
01307 CALSOILFilter::CALSOILFilter(Filter *pFilter) : OILFilter(pFilter)
01308 {
01309     FilterName.Load(_R(IDN_FILTERNAME_CALS));
01310     FilterExt.Load(_R(IDN_FILTEREXT_CALS));
01311 }
01312 
01313 /********************************************************************************************
01314 
01315 >   DCXOILFilter::DCXOILFilter()
01316 
01317     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01318     Created:    1/11/94
01319     Purpose:    Sets up the list of filename extensions that this filter understands.
01320 
01321 ********************************************************************************************/
01322 
01323 DCXOILFilter::DCXOILFilter(Filter *pFilter) : OILFilter(pFilter)
01324 {
01325     FilterName.Load(_R(IDN_FILTERNAME_DCX));
01326     FilterExt.Load(_R(IDN_FILTEREXT_DCX));
01327 }
01328 #endif
01329 
01330 /********************************************************************************************
01331 
01332 >   GIFOILFilter::GIFOILFilter()
01333 
01334     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01335     Created:    1/11/94
01336     Purpose:    Sets up the list of filename extensions that this filter understands.
01337 
01338 ********************************************************************************************/
01339 
01340 GIFOILFilter::GIFOILFilter(Filter *pFilter) : OILFilter(pFilter)
01341 {
01342     FilterName.Load(_R(IDN_FILTERNAME_GIF));
01343     FilterExt.Load(_R(IDN_FILTEREXT_GIF));
01344 }
01345 
01346 String_64 GIFOILFilter::GetFilterName(UINT32 NumberToExport)
01347 {
01348     if (NumberToExport > 1)
01349         return String_64(_R(IDS_FILTERNAME_ANIMGIF));
01350     else
01351         return FilterName;
01352 }
01353 
01354 #if !defined(EXCLUDE_FROM_RALPH)
01355 
01356 /********************************************************************************************
01357 
01358 >   GX2OILFilter::GX2OILFilter()
01359 
01360     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01361     Created:    1/11/94
01362     Purpose:    Sets up the list of filename extensions that this filter understands.
01363 
01364 ********************************************************************************************/
01365 
01366 GX2OILFilter::GX2OILFilter(Filter *pFilter) : OILFilter(pFilter)
01367 {
01368     FilterName.Load(_R(IDN_FILTERNAME_GX2));
01369     FilterExt.Load(_R(IDN_FILTEREXT_GX2));
01370 }
01371 
01372 /********************************************************************************************
01373 
01374 >   HaloCUTOILFilter::HaloCUTOILFilter()
01375 
01376     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01377     Created:    1/11/94
01378     Purpose:    Sets up the list of filename extensions that this filter understands.
01379 
01380 ********************************************************************************************/
01381 
01382 HaloCUTOILFilter::HaloCUTOILFilter(Filter *pFilter) : OILFilter(pFilter)
01383 {
01384     FilterName.Load(_R(IDN_FILTERNAME_HALOCUT));
01385     FilterExt.Load(_R(IDN_FILTEREXT_HALOCUT));
01386 }
01387 
01388 /********************************************************************************************
01389 
01390 >   IFFOILFilter::IFFOILFilter()
01391 
01392     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01393     Created:    1/11/94
01394     Purpose:    Sets up the list of filename extensions that this filter understands.
01395 
01396 ********************************************************************************************/
01397 
01398 IFFOILFilter::IFFOILFilter(Filter *pFilter) : OILFilter(pFilter)
01399 {
01400     FilterName.Load(_R(IDN_FILTERNAME_IFF));
01401     FilterExt.Load(_R(IDN_FILTEREXT_IFF));
01402 }
01403 
01404 /********************************************************************************************
01405 
01406 >   IMGOILFilter::IMGOILFilter()
01407 
01408     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01409     Created:    1/11/94
01410     Purpose:    Sets up the list of filename extensions that this filter understands.
01411 
01412 ********************************************************************************************/
01413 
01414 IMGOILFilter::IMGOILFilter(Filter *pFilter) : OILFilter(pFilter)
01415 {
01416     FilterName.Load(_R(IDN_FILTERNAME_IMG));
01417     FilterExt.Load(_R(IDN_FILTEREXT_IMG));
01418 }
01419 
01420 /********************************************************************************************
01421 
01422 >   IOCAOILFilter::IOCAOILFilter()
01423 
01424     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01425     Created:    1/11/94
01426     Purpose:    Sets up the list of filename extensions that this filter understands.
01427 
01428 ********************************************************************************************/
01429 
01430 IOCAOILFilter::IOCAOILFilter(Filter *pFilter) : OILFilter(pFilter)
01431 {
01432     FilterName.Load(_R(IDN_FILTERNAME_IOCA));
01433     FilterExt.Load(_R(IDN_FILTEREXT_IOCA));
01434 }
01435 
01436 
01437 
01438 #endif // EXCLUDE_FROM_RALPH
01439 
01440 
01441 /********************************************************************************************
01442 
01443 >   JPEGImportOILFilter::JPEGImportOILFilter(Filter *pFilter)
01444 
01445     Author:     Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
01446     Created:    09/08/96
01447     Purpose:    Sole constructor for JPEG Import Filter (non-Accusoft version).
01448                 Sets up the list of filename extensions that this filter understands.
01449 
01450 ********************************************************************************************/
01451 JPEGImportOILFilter::JPEGImportOILFilter(Filter *pFilter) : OILFilter(pFilter)
01452 {
01453     FilterName.Load(_R(IDS_JPG_IMP_FILTERNAME));
01454     FilterExt.Load(_R(IDN_FILTEREXT_JPEG));
01455 }
01456 
01457 
01458 
01459 /********************************************************************************************
01460 
01461 >   JPEGExportOILFilter::JPEGExportOILFilter(Filter *pFilter)
01462 
01463     Author:     Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
01464     Created:    29/10/96
01465     Purpose:    Sole constructor for JPEG Export Filter (non-Accusoft version).
01466                 Sets up the list of filename extensions that this filter understands.
01467 
01468 ********************************************************************************************/
01469 JPEGExportOILFilter::JPEGExportOILFilter(Filter *pFilter) : OILFilter(pFilter)
01470 {
01471     FilterName.Load(_R(IDS_JPG_EXP_FILTERNAME));
01472     FilterExt.Load(_R(IDN_FILTEREXT_JPEG));
01473 }
01474 
01475 
01476 
01477 /********************************************************************************************
01478 
01479 >   JPEGOILFilter::JPEGOILFilter()
01480 
01481     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01482     Created:    1/11/94
01483     Purpose:    Sets up the list of filename extensions that this filter understands.
01484 
01485 ********************************************************************************************/
01486 
01487 JPEGOILFilter::JPEGOILFilter(Filter *pFilter) : OILFilter(pFilter)
01488 {
01489     FilterName.Load(_R(IDN_FILTERNAME_JPEG));
01490     FilterExt.Load(_R(IDN_FILTEREXT_JPEG));
01491 }
01492 
01493 /********************************************************************************************
01494 
01495 >   PNGOILFilter::PNGOILFilter(Filter* pFilter)
01496 
01497     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01498     Created:    25/4/96
01499     Inputs:     pFilter - The Filter
01500     Purpose:    Constructs the oily parts of the PNG File Format Filter (ie the list of
01501                 File Extensions that this filter understands)
01502 
01503 ********************************************************************************************/
01504 
01505 PNGOILFilter::PNGOILFilter(Filter* pFilter) : OILFilter(pFilter)
01506 {
01507     FilterName.Load(_R(IDS_FILTERNAME_PNG));
01508     FilterExt.Load(_R(IDS_FILTEREXT_PNG));
01509 } 
01510 
01511 #if !defined(EXCLUDE_FROM_RALPH) 
01512 
01513 
01514 /********************************************************************************************
01515 
01516 >   KOFAXOILFilter::KOFAXOILFilter()
01517 
01518     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01519     Created:    1/11/94
01520     Purpose:    Sets up the list of filename extensions that this filter understands.
01521 
01522 ********************************************************************************************/
01523 
01524 KOFAXOILFilter::KOFAXOILFilter(Filter *pFilter) : OILFilter(pFilter)
01525 {
01526     FilterName.Load(_R(IDN_FILTERNAME_KOFAX));
01527     FilterExt.Load(_R(IDN_FILTEREXT_KOFAX));
01528 }
01529 
01530 /********************************************************************************************
01531 
01532 >   LaserDataOILFilter::LaserDataOILFilter()
01533 
01534     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01535     Created:    1/11/94
01536     Purpose:    Sets up the list of filename extensions that this filter understands.
01537 
01538 ********************************************************************************************/
01539 
01540 LaserDataOILFilter::LaserDataOILFilter(Filter *pFilter) : OILFilter(pFilter)
01541 {
01542     FilterName.Load(_R(IDN_FILTERNAME_LASERDATA));
01543     FilterExt.Load(_R(IDN_FILTEREXT_LASERDATA));
01544 }
01545 
01546 /********************************************************************************************
01547 
01548 >   MacPaintOILFilter::MacPaintOILFilter()
01549 
01550     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01551     Created:    18/11/94
01552     Purpose:    Sets up the list of filename extensions that this filter understands.
01553 
01554 ********************************************************************************************/
01555 
01556 MacPaintOILFilter::MacPaintOILFilter(Filter *pFilter) : OILFilter(pFilter)
01557 {
01558     FilterName.Load(_R(IDN_FILTERNAME_MACPAINT));
01559     FilterExt.Load(_R(IDN_FILTEREXT_MACPAINT));
01560 }
01561 
01562 /********************************************************************************************
01563 
01564 >   MSIconsOILFilter::MSIconsOILFilter()
01565 
01566     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01567     Created:    18/11/94
01568     Purpose:    Sets up the list of filename extensions that this filter understands.
01569 
01570 ********************************************************************************************/
01571 
01572 MSIconsOILFilter::MSIconsOILFilter(Filter *pFilter) : OILFilter(pFilter)
01573 {
01574     FilterName.Load(_R(IDN_FILTERNAME_MSICONS));
01575     FilterExt.Load(_R(IDN_FILTEREXT_MSICONS));
01576 }
01577 
01578 /********************************************************************************************
01579 
01580 >   MSPaintOILFilter::MSPaintOILFilter()
01581 
01582     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01583     Created:    18/11/94
01584     Purpose:    Sets up the list of filename extensions that this filter understands.
01585 
01586 ********************************************************************************************/
01587 
01588 MSPaintOILFilter::MSPaintOILFilter(Filter *pFilter) : OILFilter(pFilter)
01589 {
01590     FilterName.Load(_R(IDN_FILTERNAME_MSPAINT));
01591     FilterExt.Load(_R(IDN_FILTEREXT_MSPAINT));
01592 }
01593 
01594 /********************************************************************************************
01595 
01596 >   PCXOILFilter::PCXOILFilter()
01597 
01598     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01599     Created:    1/11/94
01600     Purpose:    Sets up the list of filename extensions that this filter understands.
01601 
01602 ********************************************************************************************/
01603 
01604 PCXOILFilter::PCXOILFilter(Filter *pFilter) : OILFilter(pFilter)
01605 {
01606     FilterName.Load(_R(IDN_FILTERNAME_PCX));
01607     FilterExt.Load(_R(IDN_FILTEREXT_PCX));
01608 }
01609 
01610 /********************************************************************************************
01611 
01612 >   PHOTOCDOILFilter::PHOTOCDOILFilter()
01613 
01614     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01615     Created:    18/11/94
01616     Purpose:    Sets up the list of filename extensions that this filter understands.
01617 
01618 ********************************************************************************************/
01619 
01620 PhotoCDOILFilter::PhotoCDOILFilter(Filter *pFilter) : OILFilter(pFilter)
01621 {
01622     FilterName.Load(_R(IDN_FILTERNAME_PHOTOCD));
01623     FilterExt.Load(_R(IDN_FILTEREXT_PHOTOCD));
01624 }
01625 
01626 /********************************************************************************************
01627 
01628 >   PhotoShopOILFilter::PhotoShopOILFilter()
01629 
01630     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01631     Created:    18/11/94
01632     Purpose:    Sets up the list of filename extensions that this filter understands.
01633 
01634 ********************************************************************************************/
01635 
01636 PhotoShopOILFilter::PhotoShopOILFilter(Filter *pFilter) : OILFilter(pFilter)
01637 {
01638     FilterName.Load(_R(IDN_FILTERNAME_PHOTOSHOP));
01639     FilterExt.Load(_R(IDN_FILTEREXT_PHOTOSHOP));
01640 }
01641 
01642 /********************************************************************************************
01643 
01644 >   PICTOILFilter::PICTOILFilter()
01645 
01646     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01647     Created:    1/11/94
01648     Purpose:    Sets up the list of filename extensions that this filter understands.
01649 
01650 ********************************************************************************************/
01651 
01652 PICTOILFilter::PICTOILFilter(Filter *pFilter) : OILFilter(pFilter)
01653 {
01654     FilterName.Load(_R(IDN_FILTERNAME_PICT));
01655     FilterExt.Load(_R(IDN_FILTEREXT_PICT));
01656 }
01657 
01658 /********************************************************************************************
01659 
01660 >   SUNOILFilter::SUNOILFilter()
01661 
01662     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01663     Created:    1/11/94
01664     Purpose:    Sets up the list of filename extensions that this filter understands.
01665 
01666 ********************************************************************************************/
01667 
01668 SUNOILFilter::SUNOILFilter(Filter *pFilter) : OILFilter(pFilter)
01669 {
01670     FilterName.Load(_R(IDN_FILTERNAME_SUN));
01671     FilterExt.Load(_R(IDN_FILTEREXT_SUN));
01672 }
01673 
01674 /********************************************************************************************
01675 
01676 >   TARGAOILFilter::TARGAOILFilter()
01677 
01678     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01679     Created:    1/11/94
01680     Purpose:    Sets up the list of filename extensions that this filter understands.
01681 
01682 ********************************************************************************************/
01683 
01684 TARGAOILFilter::TARGAOILFilter(Filter *pFilter) : OILFilter(pFilter)
01685 {
01686     FilterName.Load(_R(IDN_FILTERNAME_TARGA));
01687     FilterExt.Load(_R(IDN_FILTEREXT_TARGA));
01688 }
01689 
01690 /********************************************************************************************
01691 
01692 >   TIFFOILFilter::TIFFOILFilter()
01693 
01694     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01695     Created:    1/11/94
01696     Purpose:    Sets up the list of filename extensions that this filter understands.
01697 
01698 ********************************************************************************************/
01699 
01700 TIFFOILFilter::TIFFOILFilter(Filter *pFilter) : OILFilter(pFilter)
01701 {
01702     FilterName.Load(_R(IDN_FILTERNAME_TIFF));
01703     FilterExt.Load(_R(IDN_FILTEREXT_TIFF));
01704 }
01705 
01706 /********************************************************************************************
01707 
01708 >   WPGOILFilter::WPGOILFilter()
01709 
01710     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01711     Created:    1/11/94
01712     Purpose:    Sets up the list of filename extensions that this filter understands.
01713 
01714 ********************************************************************************************/
01715 
01716 WPGOILFilter::WPGOILFilter(Filter *pFilter) : OILFilter(pFilter)
01717 {
01718     FilterName.Load(_R(IDN_FILTERNAME_WPG));
01719     FilterExt.Load(_R(IDN_FILTEREXT_WPG));
01720 }
01721 
01722 /********************************************************************************************
01723 
01724 >   XWindowsOILFilter::XWindowsOILFilter()
01725 
01726     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01727     Created:    1/11/94
01728     Purpose:    Sets up the list of filename extensions that this filter understands.
01729 
01730 ********************************************************************************************/
01731 
01732 XWindowsOILFilter::XWindowsOILFilter(Filter *pFilter) : OILFilter(pFilter)
01733 {
01734     FilterName.Load(_R(IDN_FILTERNAME_XWINDOWS));
01735     FilterExt.Load(_R(IDN_FILTEREXT_XWINDOWS));
01736 }
01737 
01738 /********************************************************************************************
01739 
01740 >   SpriteOILFilter::SpriteOILFilter()
01741 
01742     Author:     Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
01743     Created:    18/8/95
01744     Purpose:    Sets up the list of filename extensions that this filter understands.
01745 
01746 ********************************************************************************************/
01747 
01748 SpriteOILFilter::SpriteOILFilter(Filter *pFilter) : OILFilter(pFilter)
01749 {
01750     FilterName.Load(_R(IDN_FILTERNAME_SPRITE));
01751     FilterExt.Load(_R(IDN_FILTEREXT_SPRITE));
01752 }
01753 
01754 #endif
01755 
01756 /********************************************************************************************
01757 
01758 >   NativeOILFilter::NativeOILFilter(Filter* pFilter)
01759 
01760     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01761     Created:    25/4/96
01762     Inputs:     pFilter - The Filter
01763     Purpose:    Constructs the oily parts of the Native File Format Filter (ie the list of
01764                 File Extensions that this filter understands)
01765 
01766 ********************************************************************************************/
01767 
01768 NativeOILFilter::NativeOILFilter(Filter* pFilter) : OILFilter(pFilter)
01769 {
01770     FilterName.Load(_R(IDS_FILTERNAME_NATIVE));
01771     FilterExt.Load(_R(IDS_FILTEREXT_NATIVE_NEW));
01772 } 
01773 
01774 /********************************************************************************************
01775 
01776 >   WebOILFilter::WebOILFilter(Filter* pFilter)
01777 
01778     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
01779     Created:    25/4/96
01780     Inputs:     pFilter - The Filter
01781     Purpose:    Constructs the oily parts of the Web File Format Filter (ie the list of
01782                 File Extensions that this filter understands)
01783 
01784 ********************************************************************************************/
01785 
01786 WebOILFilter::WebOILFilter(Filter* pFilter) : OILFilter(pFilter)
01787 {
01788     FilterName.Load(_R(IDS_FILTERNAME_WEB));
01789     FilterExt.Load(_R(IDS_FILTEREXT_WEB));
01790 } 
01791 
01792 /********************************************************************************************
01793 
01794 >   FlareTemplateOILFilter::FlareTemplateOILFilter(Filter* pFilter)
01795 
01796     Author:     Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
01797     Created:    12/06/97
01798     Inputs:     pFilter - The Filter
01799     Purpose:    Constructs the oily parts of the Flare Template File Filter (ie the list of
01800                 File Extensions that this filter understands)
01801 
01802 ********************************************************************************************/
01803 
01804 FlareTemplateOILFilter::FlareTemplateOILFilter(Filter* pFilter) : OILFilter(pFilter)
01805 {
01806     FilterName.Load(_R(IDS_FILTERNAME_FLARETEMPLATE));
01807     FilterExt.Load(_R(IDS_FILTEREXT_FLARETEMPLATE));
01808 } 
01809 
01810 
01811 /********************************************************************************************
01812 
01813 >   ImagemapOILFilter::ImagemapOILFilter(Filter* pFilter)
01814 
01815     Author:     Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
01816     Created:    9/4/97
01817     Inputs:     pFilter - The Filter
01818     Purpose:    Constructs the oily parts of the Imagemap Filter (ie the list of
01819                 File Extensions that this filter understands)
01820 
01821 ********************************************************************************************/
01822 
01823 ImagemapOILFilter::ImagemapOILFilter(Filter* pFilter) : OILFilter(pFilter)
01824 {
01825     FilterName.Load(_R(IDS_FILTERNAME_IMAGEMAP));
01826     FilterExt.Load(_R(IDS_FILTEREXT_IMAGEMAP));
01827 } 
01828 
01829 
01830 #if !defined(EXCLUDE_FROM_RALPH)
01831 
01832 // No text filters as the wonderful new system really encourages innovation!
01833 #if BUILD_OTHER_TEXT_FILTERS
01834 /********************************************************************************************
01835 >   ANSITextOILFilter::ANSITextOILFilter()
01836 
01837     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01838     Created:    24/11/95
01839     Purpose:    Sets up the list of filename extensions that this filter understands.
01840 ********************************************************************************************/
01841 ANSITextOILFilter::ANSITextOILFilter(Filter *pFilter) : OILFilter(pFilter)
01842 {
01843     FilterName.Load(_R(IDT_FILTERNAME_ANSITEXT));
01844     FilterExt.Load(_R(IDT_FILTEREXT_ANSITEXT));
01845 }
01846 
01847 
01848 /********************************************************************************************
01849 >   WCHAR ANSITextOILFilter::ReadMultiByteChar(CCLexFile* pFile, UINT32* pBytesRead)
01850 
01851     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01852     Created:    25/11/95
01853     Inputs:     pFile - pointer to file to read from
01854     Outputs:    pBytesRead = Number of bytes read from file
01855     Returns:    Unicode value of character read from file.  0 returned on error.
01856     Purpose:    Reads an 8 or 16 bit character from the current file.  Converts it to Unicode
01857                 using the current code-page.
01858 ********************************************************************************************/
01859 WCHAR ANSITextOILFilter::ReadMultiByteChar(CCLexFile* pFile, UINT32* pBytesRead)
01860 {
01861     CHAR First;
01862     pFile->read(&First);
01863     if (pBytesRead != NULL)
01864         *pBytesRead = 1;
01865 
01866     if (IsDBCSLeadByte(First))
01867     {
01868         UINT32 Both = First << 8;
01869         pFile->read(&First);
01870         if (pBytesRead != NULL)
01871             *pBytesRead = 2;
01872         Both = Both | First;
01873         return UnicodeManager::MultiByteToUnicode(Both);
01874     }
01875     else
01876         return First;
01877 }
01878 
01879 
01880 
01881 /********************************************************************************************
01882 >   UnicodeTextOILFilter::UnicodeTextOILFilter()
01883 
01884     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01885     Created:    24/11/95
01886     Purpose:    Sets up the list of filename extensions that this filter understands.
01887 ********************************************************************************************/
01888 UnicodeTextOILFilter::UnicodeTextOILFilter(Filter *pFilter) : OILFilter(pFilter)
01889 {
01890     FilterName.Load(_R(IDT_FILTERNAME_UNICODETEXT));
01891     FilterExt.Load(_R(IDT_FILTEREXT_UNICODETEXT));
01892 }
01893 
01894 
01895 /********************************************************************************************
01896 >   WCHAR UnicodeTextOILFilter::ReadUnicodeChar(CCLexFile* pFile)
01897 
01898     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01899     Created:    25/11/95
01900     Inputs:     pFile - pointer to file to read from
01901     Outputs:    -
01902     Returns:    Unicode value of character read from file.  0 returned on error.
01903     Purpose:    Reads an Unicode character value from the current file.
01904 ********************************************************************************************/
01905 WCHAR UnicodeTextOILFilter::ReadUnicodeChar(CCLexFile* pFile)
01906 {
01907     BYTE Header[2];
01908     pFile->read(Header, 2);
01909 
01910     return (WCHAR)((Header[1]<<8) | Header[0]);
01911 }
01912 
01913 
01914 /********************************************************************************************
01915 >   RTFTextOILFilter::RTFTextOILFilter()
01916 
01917     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01918     Created:    24/11/95
01919     Purpose:    Sets up the list of filename extensions that this filter understands.
01920 ********************************************************************************************/
01921 RTFTextOILFilter::RTFTextOILFilter(Filter *pFilter) : OILFilter(pFilter)
01922 {
01923     FilterName.Load(_R(IDT_FILTERNAME_RTF));
01924     FilterExt.Load(_R(IDT_FILTEREXT_RTF));
01925 }
01926 
01927 
01928 /********************************************************************************************
01929 >   BOOL RTFTextOILFilter::RegisterWithClipboard(RTFTextFilter* pFilter)
01930 
01931     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01932     Created:    13/12/95
01933     Inputs:     pFilter - pointer to the kernel RTF filter
01934     Outputs:    -
01935     Returns:    TRUE/FALSE for success/failure
01936     Purpose:    Registers with the external clipboard system so we can import RTF from the
01937                 clipboard
01938 ********************************************************************************************/
01939 BOOL RTFTextOILFilter::RegisterWithClipboard(RTFTextFilter* pFilter)
01940 {
01941     UINT32 WindowsFormatID = ::RegisterClipboardFormat("Rich Text Format");
01942 
01943     ERROR2IF(WindowsFormatID==0, FALSE, "Windows denies all knowledge of RTF!")
01944     
01945     InternalClipboardFormat Format(CLIPTYPE_TEXT);
01946     RTFClipMap::CreateAndRegister(CLIPMAP_IMPORTONLY, (Filter*)pFilter, Format, WindowsFormatID, 60);
01947 
01948     return TRUE;
01949 }
01950 
01951 
01952 
01953 /********************************************************************************************
01954 >   BOOL RTFTextOILFilter::GetCurrentEmSize(RTFTextFilter* pFilterMILLIPOINT* pResult)
01955 
01956     Author:     Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
01957     Created:    15/12/95
01958     Inputs:     pFilter - pointer to the RTF filter in action
01959                 pResult - return pointer for the current width of an Em
01960     Outputs:    -
01961     Returns:    TRUE/FALSE for success/failure
01962     Purpose:    Gets the size of an Em given the current font, size, etc, (from the current
01963                 attribute array in the filter)
01964 ********************************************************************************************/
01965 BOOL RTFTextOILFilter::GetCurrentEmSize(RTFTextFilter* pFilter, MILLIPOINT* pResult)
01966 {
01967     ERROR2IF((pFilter == NULL) || (pResult == NULL), FALSE, "NULL parameter");
01968 
01969     // Setup a device context and character description for the font manager to use
01970     CDC DeviceContext;
01971     BOOL Result = DeviceContext.CreateCompatibleDC(NULL);
01972     ERROR1IF(!Result, FALSE, _R(IDE_NOMORE_MEMORY));
01973     CharDescription FontDesc(FONTEMCHAR,
01974                             ((TxtFontTypefaceAttribute *) pFilter->CurrentAttrs[ATTR_TXTFONTTYPEFACE].pAttr)->HTypeface,
01975                             ((TxtBoldAttribute *) pFilter->CurrentAttrs[ATTR_TXTBOLD ].pAttr)->BoldOn ||
01976                                 ((TxtFontTypefaceAttribute *) pFilter->CurrentAttrs[ATTR_TXTFONTTYPEFACE ].pAttr)->IsBold,
01977                             ((TxtItalicAttribute *) pFilter->CurrentAttrs[ATTR_TXTITALIC ].pAttr)->ItalicOn ||
01978                                 ((TxtFontTypefaceAttribute *) pFilter->CurrentAttrs[ATTR_TXTFONTTYPEFACE ].pAttr)->IsItalic);
01979 
01980     // Get info on an M
01981     CharMetrics chMetrics; 
01982     if (!FONTMANAGER->GetCharMetrics(&DeviceContext, FONTEMCHAR, FontDesc, &chMetrics))
01983         return FALSE;
01984                 
01985     // transform the default values by the attribute matrix
01986 //  MILLIPOINT FontSize = RR_TXTFONTSIZE();
01987 //  MILLIPOINT OffsetY  = FontSize * pScriptAttr->Offset;
01988 //  FIXED16    fScaleY  = pScriptAttr->Size * Div32By32(FontSize, TextManager::GetDefaultHeight());
01989 //  FIXED16    fScaleX  = fScaleY * RR_TXTASPECTRATIO();
01990 //  *pAttrMatrix = Matrix(fScaleX,0,0,fScaleY,0,OffsetY);
01991 
01992     
01993     
01994     TxtScriptAttribute* pScriptAttr=(TxtScriptAttribute*) pFilter->CurrentAttrs[ATTR_TXTSCRIPT ].pAttr;
01995     ERROR2IF(pScriptAttr==NULL, FALSE, "pScriptAttr==NULL");
01996     MILLIPOINT FontSize = ((TxtFontSizeAttribute*) pFilter->CurrentAttrs[ATTR_TXTFONTSIZE ].pAttr)->FontSize;
01997     MILLIPOINT OffsetY  = FontSize * pScriptAttr->Offset;
01998     FIXED16    fScaleY  = pScriptAttr->Size * Div32By32(FontSize, TextManager::GetDefaultHeight());
01999     FIXED16    fScaleX  = fScaleY * ((TxtAspectRatioAttribute *) pFilter->CurrentAttrs[ATTR_TXTASPECTRATIO ].pAttr)->AspectRatio;
02000     Matrix AttrMatrix(fScaleX,0,0,fScaleY,0,OffsetY);
02001 
02002     // Get the current size of an Em 
02003     DocCoord pXYValue(chMetrics.FontEmWidth, 0);
02004     AttrMatrix.transform(&pXYValue);
02005     *pResult = pXYValue.x;
02006 
02007     return TRUE;
02008 }
02009 #endif //#if BUILD_OTHER_TEXT_FILTERS
02010 
02011 
02012 
02013 
02014 /********************************************************************************************
02015 >   HTMLOILFilter::HTMLOILFilter(Filter *pFilter) 
02016 
02017     Author:     Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
02018     Created:    27/03/97
02019     Purpose:    Sets up the list of filename extensions that this filter understands.
02020 ********************************************************************************************/
02021 HTMLOILFilter::HTMLOILFilter(Filter *pFilter) : OILFilter(pFilter)
02022 {
02023     FilterName.Load(_R(IDS_FILTERNAME_HTML));
02024     FilterExt.Load(_R(IDS_FILTEREXT_HTML));
02025 }
02026 
02027 
02028 
02029 #endif // EXCLUDE_FROM_RALPH

Generated on Sat Nov 10 03:48:42 2007 for Camelot by  doxygen 1.4.4