~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to krita/core/kis_composite_op.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (c) 2005 Adrian Page <adrian@pagenet.plus.com>
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 2 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
17
 */
 
18
#ifndef KIS_COMPOSITE_OP_H_
 
19
#define KIS_COMPOSITE_OP_H_
 
20
 
 
21
#include <map>
 
22
#include <qvaluelist.h>
 
23
 
 
24
#include "kis_global.h"
 
25
#include "kis_id.h"
 
26
#include "koffice_export.h"
 
27
enum CompositeOp {
 
28
        COMPOSITE_OVER,
 
29
        COMPOSITE_IN,
 
30
        COMPOSITE_OUT,
 
31
        COMPOSITE_ATOP,
 
32
        COMPOSITE_XOR,
 
33
        COMPOSITE_PLUS,
 
34
        COMPOSITE_MINUS,
 
35
        COMPOSITE_ADD,
 
36
        COMPOSITE_SUBTRACT,
 
37
        COMPOSITE_DIFF,
 
38
        COMPOSITE_MULT,
 
39
        COMPOSITE_DIVIDE,
 
40
        COMPOSITE_DODGE,
 
41
        COMPOSITE_BURN,
 
42
        COMPOSITE_BUMPMAP,
 
43
        COMPOSITE_COPY,
 
44
        COMPOSITE_COPY_RED,
 
45
        COMPOSITE_COPY_GREEN,
 
46
        COMPOSITE_COPY_BLUE,
 
47
        COMPOSITE_COPY_OPACITY,
 
48
        COMPOSITE_CLEAR,
 
49
        COMPOSITE_DISSOLVE,
 
50
        COMPOSITE_DISPLACE,
 
51
#if 0
 
52
        COMPOSITE_MODULATE,
 
53
        COMPOSITE_THRESHOLD,
 
54
#endif
 
55
        COMPOSITE_NO,
 
56
        COMPOSITE_DARKEN,
 
57
        COMPOSITE_LIGHTEN,
 
58
        COMPOSITE_HUE,
 
59
        COMPOSITE_SATURATION,
 
60
        COMPOSITE_VALUE,
 
61
        COMPOSITE_COLOR,
 
62
        COMPOSITE_COLORIZE,
 
63
        COMPOSITE_LUMINIZE,
 
64
        COMPOSITE_SCREEN,
 
65
        COMPOSITE_OVERLAY,
 
66
        COMPOSITE_COPY_CYAN,
 
67
        COMPOSITE_COPY_MAGENTA,
 
68
        COMPOSITE_COPY_YELLOW,
 
69
        COMPOSITE_COPY_BLACK,
 
70
        COMPOSITE_ERASE,
 
71
        COMPOSITE_UNDEF
 
72
};
 
73
 
 
74
class KRITACORE_EXPORT KisCompositeOp {
 
75
public:
 
76
        KisCompositeOp();
 
77
        KisCompositeOp(const QString& id);
 
78
        KisCompositeOp(CompositeOp compositeOp);
 
79
 
 
80
        KisID id() const { return m_id; }
 
81
        CompositeOp op() const { return m_op; }
 
82
 
 
83
        bool isValid() const { return m_valid; }
 
84
 
 
85
        bool operator==(const KisCompositeOp& other) const;
 
86
        bool operator!=(const KisCompositeOp& other) const;
 
87
 
 
88
private:
 
89
        void fillMap();
 
90
 
 
91
private:
 
92
        CompositeOp m_op;
 
93
        KisID m_id;
 
94
        bool m_valid;
 
95
 
 
96
        typedef std::map<KisID, CompositeOp> KisIDCompositeOpMap;
 
97
        static KisIDCompositeOpMap s_idOpMap;
 
98
};
 
99
 
 
100
typedef QValueList<KisCompositeOp> KisCompositeOpList;
 
101
 
 
102
#endif // KIS_COMPOSITE_OP_H