filters
ai3handler.cc
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002, Dirk Schönberger <dirk.schoenberger@sz-online.de> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "ai3handler.h" 00021 00022 AI3Handler::AI3Handler(AIParserBase *delegate){ 00023 m_delegate = delegate; 00024 } 00025 AI3Handler::~AI3Handler(){ 00026 } 00027 00028 bool AI3Handler::handleAIOperation (AIOperation op) { 00029 // PathElement pathElement; 00030 // double fval; 00031 int ival; 00032 00033 switch (op) { 00034 case AIO_SetWindingOrder : 00035 ival = m_delegate->getIntValue(); 00036 if (m_delegate->m_gstateHandler) m_delegate->m_gstateHandler->gotWindingOrder (ival); 00037 return true; 00038 break; 00039 case AIO_BeginGroupNoClip : 00040 if (m_delegate->m_structureHandler) m_delegate->m_structureHandler->gotBeginGroup (false); 00041 return true; 00042 break; 00043 case AIO_EndGroupNoClip : 00044 if (m_delegate->m_debug) qDebug ("got end group noclip"); 00045 if (m_delegate->m_structureHandler) m_delegate->m_structureHandler->gotEndGroup (false); 00046 if (m_delegate->m_debug) qDebug ("/got end group noclip"); 00047 return true; 00048 break; 00049 case AIO_BeginCombination : 00050 if (m_delegate->m_structureHandler) m_delegate->m_structureHandler->gotBeginCombination (); 00051 return true; 00052 break; 00053 case AIO_EndCombination : 00054 if (m_delegate->m_structureHandler) m_delegate->m_structureHandler->gotEndCombination (); 00055 return true; 00056 break; 00057 case AIO_BeginGroupClip : 00058 if (m_delegate->m_structureHandler) m_delegate->m_structureHandler->gotBeginGroup (true); 00059 return true; 00060 break; 00061 case AIO_EndGroupClip : 00062 if (m_delegate->m_structureHandler) m_delegate->m_structureHandler->gotEndGroup (true); 00063 return true; 00064 break; 00065 case AIO_SetFillMode : 00066 if (m_delegate->m_pathHandler) m_delegate->m_pathHandler->gotFillMode((FillMode) m_delegate->getIntValue()); 00067 return true; 00068 break; 00069 default : 00070 return false; 00071 } 00072 return false; 00073 } 00074