OSDN Git Service

Commit DialogBox compile Okay
[tortoisegit/TortoiseGitJp.git] / ext / scintilla / src / XPM.h
diff --git a/ext/scintilla/src/XPM.h b/ext/scintilla/src/XPM.h
new file mode 100644 (file)
index 0000000..60d30fb
--- /dev/null
@@ -0,0 +1,80 @@
+// Scintilla source code edit control\r
+/** @file XPM.h\r
+ ** Define a class that holds data in the X Pixmap (XPM) format.\r
+ **/\r
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>\r
+// The License.txt file describes the conditions under which this software may be distributed.\r
+\r
+#ifndef XPM_H\r
+#define XPM_H\r
+\r
+#ifdef SCI_NAMESPACE\r
+namespace Scintilla {\r
+#endif\r
+\r
+/**\r
+ * Hold a pixmap in XPM format.\r
+ */\r
+class XPM {\r
+       int id;         // Assigned by container\r
+       int height;\r
+       int width;\r
+       int nColours;\r
+       char *data;\r
+       char codeTransparent;\r
+       char *codes;\r
+       ColourPair *colours;\r
+       ColourAllocated ColourFromCode(int ch);\r
+       void FillRun(Surface *surface, int code, int startX, int y, int x);\r
+       char **lines;\r
+       ColourPair *colourCodeTable[256];\r
+public:\r
+       XPM(const char *textForm);\r
+       XPM(const char * const *linesForm);\r
+       ~XPM();\r
+       void Init(const char *textForm);\r
+       void Init(const char * const *linesForm);\r
+       void Clear();\r
+       /// Similar to same named method in ViewStyle:\r
+       void RefreshColourPalette(Palette &pal, bool want);\r
+       /// No palette used, so just copy the desired colours to the allocated colours\r
+       void CopyDesiredColours();\r
+       /// Decompose image into runs and use FillRectangle for each run\r
+       void Draw(Surface *surface, PRectangle &rc);\r
+       char **InLinesForm() { return lines; }\r
+       void SetId(int id_) { id = id_; }\r
+       int GetId() { return id; }\r
+       int GetHeight() { return height; }\r
+       int GetWidth() { return width; }\r
+       static const char **LinesFormFromTextForm(const char *textForm);\r
+};\r
+\r
+/**\r
+ * A collection of pixmaps indexed by integer id.\r
+ */\r
+class XPMSet {\r
+       XPM **set;      ///< The stored XPMs.\r
+       int len;        ///< Current number of XPMs.\r
+       int maximum;    ///< Current maximum number of XPMs, increased by steps if reached.\r
+       int height;     ///< Memorize largest height of the set.\r
+       int width;      ///< Memorize largest width of the set.\r
+public:\r
+       XPMSet();\r
+       ~XPMSet();\r
+       /// Remove all XPMs.\r
+       void Clear();\r
+       /// Add a XPM.\r
+       void Add(int id, const char *textForm);\r
+       /// Get XPM by id.\r
+       XPM *Get(int id);\r
+       /// Give the largest height of the set.\r
+       int GetHeight();\r
+       /// Give the largest width of the set.\r
+       int GetWidth();\r
+};\r
+\r
+#ifdef SCI_NAMESPACE\r
+}\r
+#endif\r
+\r
+#endif\r