mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
uppsrc: Removed legacy .iml support, fixed clang warnings
git-svn-id: svn://ultimatepp.org/upp/trunk@13522 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1bd6b2c6f3
commit
f8760ec1a2
7 changed files with 6 additions and 49 deletions
|
|
@ -23,11 +23,6 @@ void TagSyntax::Put0(int ink, int n, int paper)
|
|||
hout->Put(n, hl_style[ink], hl_style[paper]);
|
||||
}
|
||||
|
||||
inline static bool IsXmlNameChar(int c)
|
||||
{
|
||||
return IsAlNum(c) || c == '.' || c == '-' || c == '_' || c == ':';
|
||||
}
|
||||
|
||||
const wchar *TagSyntax::Spaces(const wchar *s, const wchar *e)
|
||||
{
|
||||
while(s < e && IsSpace(*s)) {
|
||||
|
|
|
|||
|
|
@ -227,10 +227,6 @@ void SizeTextDisplayCls::Paint(Draw& w, const Rect& r, const Value& q,
|
|||
|
||||
const Display& SizeTextDisplay() { return Single<SizeTextDisplayCls>(); }
|
||||
|
||||
static inline int NScale(int sz, int r) {
|
||||
return sz ? sz < r ? r / sz * sz : r : 0;
|
||||
}
|
||||
|
||||
class CenteredImageDisplayCls : public Display {
|
||||
public:
|
||||
virtual void Paint(Draw& w, const Rect& r, const Value& q,
|
||||
|
|
|
|||
|
|
@ -321,24 +321,6 @@ Image::~Image()
|
|||
data->Release();
|
||||
}
|
||||
|
||||
Image::Image(const Init& init)
|
||||
{ // Legacy (before cca 2008) iml support
|
||||
ASSERT(init.info[0] >= 1);
|
||||
Size sz;
|
||||
sz.cx = Peek32le(init.info + 1);
|
||||
sz.cy = Peek32le(init.info + 5);
|
||||
ImageBuffer b(sz);
|
||||
int i = 0;
|
||||
while(i < init.scan_count) {
|
||||
UnpackRLE(b[i], (const byte *)init.scans[i], sz.cx);
|
||||
i++;
|
||||
}
|
||||
while(i < sz.cy)
|
||||
memset(b[i++], 0, sizeof(RGBA) * sz.cx);
|
||||
b.SetHotSpot(Point(Peek32le(init.info + 9), Peek32le(init.info + 13)));
|
||||
Set(b);
|
||||
}
|
||||
|
||||
String Image::ToString() const
|
||||
{
|
||||
return String("Image ").Cat() << GetSize();
|
||||
|
|
|
|||
|
|
@ -246,14 +246,6 @@ public:
|
|||
|
||||
uint64 GetAuxData() const;
|
||||
|
||||
// IML support ("private"), deprecated - legacy .iml
|
||||
struct Init {
|
||||
const char *const *scans;
|
||||
int16 scan_count;
|
||||
char info[24];
|
||||
};
|
||||
explicit Image(const Init& init);
|
||||
|
||||
// required by system image cache managemenent
|
||||
|
||||
int GetRefCount() const { return data ? (int)data->refcount : 0; }
|
||||
|
|
@ -298,7 +290,6 @@ class Iml {
|
|||
};
|
||||
Vector<Data> data[4]; // 0 normal, 1 HiDPI - HD, 2 DK - Dark, 3 HDK - HiDPI + dark
|
||||
VectorMap<String, IImage> map;
|
||||
const Image::Init *img_init;
|
||||
const char **name;
|
||||
dword global_flags = 0;
|
||||
bool premultiply;
|
||||
|
|
@ -323,7 +314,7 @@ public:
|
|||
ImageIml GetRaw(int mode, const String& id); // tries to get image for mode by id, can return Null
|
||||
|
||||
// these methods serve for .iml import
|
||||
Iml(const Image::Init *img_init, const char **name, int n);//Deprecated - legacy .iml
|
||||
Iml(const char **name, int n);//Deprecated - legacy .iml
|
||||
void AddData(const byte *data, int len, int count, int mode = 0);
|
||||
void AddId(int mode1, const char *name);
|
||||
void Premultiplied() { premultiply = false; }
|
||||
|
|
|
|||
|
|
@ -155,9 +155,8 @@ int Iml::GetBinSize() const
|
|||
}
|
||||
#endif
|
||||
|
||||
Iml::Iml(const Image::Init *img_init, const char **name, int n)
|
||||
: img_init(img_init),
|
||||
name(name)
|
||||
Iml::Iml(const char **name, int n)
|
||||
: name(name)
|
||||
{
|
||||
premultiply = true;
|
||||
Init(n);
|
||||
|
|
|
|||
|
|
@ -31,13 +31,6 @@
|
|||
|
||||
|
||||
UPP::Iml& IMAGECLASS::Iml() {
|
||||
static UPP::Image::Init init[] = { // legacy format
|
||||
#define IMAGE_PACKED(n, d) { COMBINE(COMBINE(IMAGECLASS, _), n##__scans__), __countof(COMBINE(COMBINE(IMAGECLASS, _), n##__scans__)), d },
|
||||
#include IMAGEFILE
|
||||
{ NULL }
|
||||
#undef IMAGE_PACKED
|
||||
};
|
||||
|
||||
static const char *name[IMAGECLASS::COUNT] = {
|
||||
#define IMAGE_PACKED(n, d) #n,
|
||||
#undef IMAGE_ID
|
||||
|
|
@ -45,7 +38,7 @@ UPP::Iml& IMAGECLASS::Iml() {
|
|||
#include IMAGEFILE
|
||||
};
|
||||
|
||||
static UPP::Iml iml(init, name, COUNT);
|
||||
static UPP::Iml iml(name, COUNT);
|
||||
|
||||
#ifdef FIXED_COLORS
|
||||
#undef FIXED_COLORS
|
||||
|
|
|
|||
|
|
@ -50,11 +50,12 @@ PatchDiff::PatchDiff()
|
|||
return;
|
||||
String h = patch.GetPatchedFile(i);
|
||||
String p = patch.GetPath(i);
|
||||
if(!h.IsVoid())
|
||||
if(!h.IsVoid()) {
|
||||
if(IsNull(h))
|
||||
FileDelete(p);
|
||||
else
|
||||
SaveFile(p, h);
|
||||
}
|
||||
}
|
||||
Break(IDOK);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue