Some better source organization. Removed C++11 STL usage (old OS X).
This commit is contained in:
		
							parent
							
								
									3b6d0ef7c0
								
							
						
					
					
						commit
						b61c0941ef
					
				
					 7 changed files with 542 additions and 552 deletions
				
			
		| 
						 | 
				
			
			@ -383,7 +383,7 @@ to link the code of portions of this program with the OpenSSL library.\n\
 | 
			
		|||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
 | 
			
		||||
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
 | 
			
		||||
*/\n";
 | 
			
		||||
			tout << "#pragma once\n\n#include \"ui/style.h\"\n\nnamespace style {\n";
 | 
			
		||||
			tout << "#pragma once\n\n#include \"ui/style_core.h\"\n\nnamespace style {\n";
 | 
			
		||||
			for (int i = 0, l = byIndex.size(); i < l; ++i) {
 | 
			
		||||
				ClassData &cls(byIndex[i]);
 | 
			
		||||
				classes.insert(cls.name, cls);
 | 
			
		||||
| 
						 | 
				
			
			@ -1544,7 +1544,7 @@ to link the code of portions of this program with the OpenSSL library.\n\
 | 
			
		|||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\
 | 
			
		||||
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\
 | 
			
		||||
*/\n";
 | 
			
		||||
			tout << "#pragma once\n\n#include \"ui/style.h\"\n\nnamespace st {\n";
 | 
			
		||||
			tout << "#pragma once\n\n#include \"ui/style_core.h\"\n\nnamespace st {\n";
 | 
			
		||||
			tcpp << "\
 | 
			
		||||
/*\n\
 | 
			
		||||
Created from \'/Resources/style.txt\' by \'/MetaStyle\' project\n\
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
 | 
			
		|||
 | 
			
		||||
#include "mtproto/facade.h"
 | 
			
		||||
 | 
			
		||||
#include "ui/style_core.h"
 | 
			
		||||
#include "ui/style.h"
 | 
			
		||||
#include "ui/twidget.h"
 | 
			
		||||
#include "ui/animation.h"
 | 
			
		||||
#include "ui/flatinput.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,5 +20,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
 | 
			
		|||
*/
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "../GeneratedFiles/style_classes.h"
 | 
			
		||||
#include "../GeneratedFiles/style_auto.h"
 | 
			
		||||
#include "ui/style_core.h"
 | 
			
		||||
#include "GeneratedFiles/style_classes.h"
 | 
			
		||||
#include "GeneratedFiles/style_auto.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -134,24 +134,13 @@ namespace style {
 | 
			
		|||
		return *this;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void Color::set(const QColor &newv) {
 | 
			
		||||
		if (!owner) {
 | 
			
		||||
			ptr = new ColorData(*ptr);
 | 
			
		||||
			owner = true;
 | 
			
		||||
	namespace {
 | 
			
		||||
	inline uint32 colorKey(uchar r, uchar g, uchar b, uchar a) {
 | 
			
		||||
		return (((((uint32(r) << 8) | uint32(g)) << 8) | uint32(b)) << 8) | uint32(a);
 | 
			
		||||
	}
 | 
			
		||||
		ptr->set(newv);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void Color::set(uchar r, uchar g, uchar b, uchar a) {
 | 
			
		||||
		if (!owner) {
 | 
			
		||||
			ptr = new ColorData(*ptr);
 | 
			
		||||
			owner = true;
 | 
			
		||||
		}
 | 
			
		||||
		ptr->set(QColor(r, g, b, a));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void Color::init(uchar r, uchar g, uchar b, uchar a) {
 | 
			
		||||
		uint32 key = _colorKey(r, g, b, a);
 | 
			
		||||
		uint32 key = colorKey(r, g, b, a);
 | 
			
		||||
		ColorDatas::const_iterator i = _colorsMap.constFind(key);
 | 
			
		||||
		if (i == _colorsMap.cend()) {
 | 
			
		||||
			i = _colorsMap.insert(key, new ColorData(r, g, b, a));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1591,7 +1591,7 @@ public:
 | 
			
		|||
				if (_wLeft < si.width) {
 | 
			
		||||
					lineText = lineText.mid(0, currentBlock->from() - _localFrom) + _Elide;
 | 
			
		||||
					lineLength = currentBlock->from() + _Elide.size() - _lineStart;
 | 
			
		||||
					_selection.to = std::min({ _selection.to, currentBlock->from() });
 | 
			
		||||
					_selection.to = _selection.to = qMin(_selection.to, currentBlock->from());
 | 
			
		||||
					setElideBidi(currentBlock->from(), _Elide.size());
 | 
			
		||||
					elideSaveBlock(blockIndex - 1, _endBlock, currentBlock->from(), elideWidth);
 | 
			
		||||
					return;
 | 
			
		||||
| 
						 | 
				
			
			@ -1623,7 +1623,7 @@ public:
 | 
			
		|||
						if (lineText.size() <= pos || repeat > 3) {
 | 
			
		||||
							lineText += _Elide;
 | 
			
		||||
							lineLength = _localFrom + pos + _Elide.size() - _lineStart;
 | 
			
		||||
							_selection.to = std::min({ _selection.to, uint16(_localFrom + pos) });
 | 
			
		||||
							_selection.to = qMin(_selection.to, uint16(_localFrom + pos));
 | 
			
		||||
							setElideBidi(_localFrom + pos, _Elide.size());
 | 
			
		||||
							_blocksSize = blockIndex;
 | 
			
		||||
							_endBlock = nextBlock;
 | 
			
		||||
| 
						 | 
				
			
			@ -1643,7 +1643,7 @@ public:
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		int32 elideStart = _localFrom + lineText.size();
 | 
			
		||||
		_selection.to = std::min({ _selection.to, uint16(elideStart) });
 | 
			
		||||
		_selection.to = qMin(_selection.to, uint16(elideStart));
 | 
			
		||||
		setElideBidi(elideStart, _Elide.size());
 | 
			
		||||
 | 
			
		||||
		lineText += _Elide;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
	Add table
		
		Reference in a new issue