comparison dynamin/gui/x_window.d @ 106:acdbb30fee7e

Port to D2. Most of the effort was dealing with immutable and const.
author Jordan Miner <jminer7@gmail.com>
date Mon, 17 Dec 2012 23:41:50 -0600
parents 73060bc3f004
children
comparison
equal deleted inserted replaced
105:97997a544ac0 106:acdbb30fee7e
183 bool shouldMerge(int x1, int y1, int width1, int height1, 183 bool shouldMerge(int x1, int y1, int width1, int height1,
184 int x2, int y2, int width2, int height2) { 184 int x2, int y2, int width2, int height2) {
185 return x2 <= x1 + width1 && y2 <= y1 + height1 && 185 return x2 <= x1 + width1 && y2 <= y1 + height1 &&
186 x2 + width2 >= x1 && y2 + height2 >= y1; 186 x2 + width2 >= x1 && y2 + height2 >= y1;
187 } 187 }
188 void join(inout int x, inout int y, inout int width, inout int height, 188 void join(ref int x, ref int y, ref int width, ref int height,
189 int x2, int y2, int width2, int height2) { 189 int x2, int y2, int width2, int height2) {
190 auto minx = min(x, x2); 190 auto minx = min(x, x2);
191 auto miny = min(y, y2); 191 auto miny = min(y, y2);
192 width = max(x+width, x2+width2)-minx; 192 width = max(x+width, x2+width2)-minx;
193 height = max(y+height, y2+height2)-miny; 193 height = max(y+height, y2+height2)-miny;
693 } 693 }
694 void backend_size(Size size) { 694 void backend_size(Size size) {
695 backend_updateWM_NORMAL_HINTS(); 695 backend_updateWM_NORMAL_HINTS();
696 backend_locationSizeToNative(); 696 backend_locationSizeToNative();
697 } 697 }
698 void backend_text(string str) { 698 void backend_text(mstring str) {
699 //auto tmp = str.ToCharPtr(); 699 //auto tmp = str.ToCharPtr();
700 //XTextProperty strProperty; 700 //XTextProperty strProperty;
701 //if(!XStringListToTextProperty(&tmp, 1, &strProperty)) 701 //if(!XStringListToTextProperty(&tmp, 1, &strProperty))
702 //printf("XStringListToTextProperty() failed - out of memory\n"); 702 //printf("XStringListToTextProperty() failed - out of memory\n");
703 //XSetWMName(display, _handle, &strProperty); 703 //XSetWMName(display, _handle, &strProperty);