diff options
author | nyamatongwe <unknown> | 2013-05-02 15:41:05 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-05-02 15:41:05 +1000 |
commit | 446852f3610b7390f6ca4376f6661aa4bf1b2f88 (patch) | |
tree | e66be4df290b2ed01a25e6040812d89910fbd844 /src | |
parent | 23e42e320f2957a97d1a23c88e60c7cddb79fa01 (diff) | |
download | scintilla-mirror-446852f3610b7390f6ca4376f6661aa4bf1b2f88.tar.gz |
Removing XPMSet class as no longer used.
Diffstat (limited to 'src')
-rw-r--r-- | src/XPM.cxx | 83 | ||||
-rw-r--r-- | src/XPM.h | 24 |
2 files changed, 0 insertions, 107 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx index 7188c2465..4dcf439f5 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -236,89 +236,6 @@ const char **XPM::LinesFormFromTextForm(const char *textForm) { return linesForm; } -// In future, may want to minimize search time by sorting and using a binary search. - -XPMSet::XPMSet() : set(0), len(0), maximum(0), height(-1), width(-1) { -} - -XPMSet::~XPMSet() { - Clear(); -} - -void XPMSet::Clear() { - for (int i = 0; i < len; i++) { - delete set[i]; - } - delete []set; - set = 0; - len = 0; - maximum = 0; - height = -1; - width = -1; -} - -void XPMSet::Add(int ident, const char *textForm) { - // Invalidate cached dimensions - height = -1; - width = -1; - - // Replace if this id already present - for (int i = 0; i < len; i++) { - if (set[i]->GetId() == ident) { - set[i]->Init(textForm); - return; - } - } - - // Not present, so add to end - XPM *pxpm = new XPM(textForm); - if (pxpm) { - pxpm->SetId(ident); - if (len == maximum) { - maximum += 64; - XPM **setNew = new XPM *[maximum]; - for (int i = 0; i < len; i++) { - setNew[i] = set[i]; - } - delete []set; - set = setNew; - } - set[len] = pxpm; - len++; - } -} - -XPM *XPMSet::Get(int ident) { - for (int i = 0; i < len; i++) { - if (set[i]->GetId() == ident) { - return set[i]; - } - } - return 0; -} - -int XPMSet::GetHeight() { - if (height < 0) { - for (int i = 0; i < len; i++) { - if (height < set[i]->GetHeight()) { - height = set[i]->GetHeight(); - } - } - } - return (height > 0) ? height : 0; -} - -int XPMSet::GetWidth() { - if (width < 0) { - for (int i = 0; i < len; i++) { - if (width < set[i]->GetWidth()) { - width = set[i]->GetWidth(); - } - } - } - return (width > 0) ? width : 0; -} - RGBAImage::RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_) : height(height_), width(width_), scale(scale_) { if (pixels_) { @@ -48,30 +48,6 @@ public: }; /** - * A collection of pixmaps indexed by integer id. - */ -class XPMSet { - XPM **set; ///< The stored XPMs. - int len; ///< Current number of XPMs. - int maximum; ///< Current maximum number of XPMs, increased by steps if reached. - int height; ///< Memorize largest height of the set. - int width; ///< Memorize largest width of the set. -public: - XPMSet(); - ~XPMSet(); - /// Remove all XPMs. - void Clear(); - /// Add a XPM. - void Add(int ident, const char *textForm); - /// Get XPM by id. - XPM *Get(int ident); - /// Give the largest height of the set. - int GetHeight(); - /// Give the largest width of the set. - int GetWidth(); -}; - -/** * An translucent image stoed as a sequence of RGBA bytes. */ class RGBAImage { |