Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more nothrow

  • Loading branch information...
commit fe604e977e804b96d34bbf1d91ec0244f813b8b3 1 parent acce05b
@shoo shoo authored
View
16 win32/dfl/application.d
@@ -78,7 +78,7 @@ class ApplicationContext // docmain
}
/// ditto
- final @property Form mainForm() // getter
+ final @property Form mainForm() nothrow // getter
{
return mform;
}
@@ -285,7 +285,7 @@ final class Application // docmain
/+
// ///
- @property bool visualStyles() // getter
+ @property bool visualStyles() nothrow // getter
{
// IsAppThemed:
// "Do not call this function during DllMain or global objects contructors.
@@ -336,7 +336,7 @@ final class Application // docmain
///
- @property bool messageLoop() // getter
+ @property bool messageLoop() nothrow // getter
{
return (threadFlags & TF.RUNNING) != 0;
}
@@ -595,7 +595,7 @@ final class Application // docmain
// Will be null if not in a successful Application.run.
- package @property ApplicationContext context() // getter
+ package @property ApplicationContext context() nothrow // getter
{
return ctx;
}
@@ -1349,7 +1349,7 @@ final class Application // docmain
}
/// ditto
- @property bool autoCollect() // getter
+ @property bool autoCollect() nothrow // getter
{
return gcinfo > 0;
}
@@ -1556,7 +1556,7 @@ final class Application // docmain
}
- @property IMessageFilter[] filters() // getter
+ @property IMessageFilter[] filters() nothrow // getter
{
TlsFilterValue* val = cast(TlsFilterValue*)TlsGetValue(tlsFilter);
if(!val)
@@ -1574,7 +1574,7 @@ final class Application // docmain
}
- @property HHOOK msghook() // getter
+ @property HHOOK msghook() nothrow // getter
{
return cast(HHOOK)TlsGetValue(tlsHook);
}
@@ -1596,7 +1596,7 @@ final class Application // docmain
}
- @property TF threadFlags() // getter
+ @property TF threadFlags() nothrow // getter
{
return cast(TF)cast(DWORD)TlsGetValue(tlsThreadFlags);
}
View
76 win32/dfl/base.d
@@ -46,7 +46,7 @@ class StringObject: DObject
///
- this(Dstring str)
+ this(Dstring str) pure nothrow
{
this.value = str;
}
@@ -328,7 +328,7 @@ struct Message // docmain
/// Construct a Message struct.
- this(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) nothrow
+ this(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) pure nothrow
{
hWnd = hWnd;
msg = msg;
@@ -369,7 +369,7 @@ abstract class WaitHandle
}
- @property HANDLE handle() // getter
+ @property HANDLE handle() nothrow // getter
{
return h;
}
@@ -703,7 +703,7 @@ enum ColorDepth: ubyte
class PaintEventArgs: EventArgs
{
///
- this(Graphics graphics, Rect clipRect)
+ this(Graphics graphics, Rect clipRect) pure nothrow
{
g = graphics;
cr = clipRect;
@@ -711,14 +711,14 @@ class PaintEventArgs: EventArgs
///
- final @property Graphics graphics() // getter
+ final @property Graphics graphics() pure nothrow // getter
{
return g;
}
///
- final @property Rect clipRectangle() // getter
+ final @property Rect clipRectangle() pure nothrow // getter
{
return cr;
}
@@ -735,26 +735,26 @@ class CancelEventArgs: EventArgs
{
///
// Initialize cancel to false.
- this()
+ this() pure nothrow
{
cncl = false;
}
/// ditto
- this(bool cancel)
+ this(bool cancel) pure nothrow
{
cncl = cancel;
}
///
- final @property void cancel(bool byes) // setter
+ final @property void cancel(bool byes) pure nothrow // setter
{
cncl = byes;
}
/// ditto
- final @property bool cancel() // getter
+ final @property bool cancel() pure nothrow // getter
{
return cncl;
}
@@ -769,48 +769,48 @@ class CancelEventArgs: EventArgs
class KeyEventArgs: EventArgs
{
///
- this(Keys keys)
+ this(Keys keys) pure nothrow
{
ks = keys;
}
///
- final @property bool alt() // getter
+ final @property bool alt() pure nothrow // getter
{
return (ks & Keys.ALT) != 0;
}
///
- final @property bool control() // getter
+ final @property bool control() pure nothrow // getter
{
return (ks & Keys.CONTROL) != 0;
}
///
- final @property void handled(bool byes) // setter
+ final @property void handled(bool byes) pure nothrow // setter
{
hand = byes;
}
///
- final @property bool handled() // getter
+ final @property bool handled() pure nothrow // getter
{
return hand;
}
///
- final @property Keys keyCode() // getter
+ final @property Keys keyCode() pure nothrow // getter
{
return ks & Keys.KEY_CODE;
}
///
- final @property Keys keyData() // getter
+ final @property Keys keyData() pure nothrow // getter
{
return ks;
}
@@ -818,28 +818,28 @@ class KeyEventArgs: EventArgs
///
// -keyData- as an int.
- final @property int keyValue() // getter
+ final @property int keyValue() pure nothrow // getter
{
return cast(int)ks;
}
///
- final @property Keys modifiers() // getter
+ final @property Keys modifiers() pure nothrow // getter
{
return ks & Keys.MODIFIERS;
}
///
- final @property bool shift() // getter
+ final @property bool shift() pure nothrow // getter
{
return (ks & Keys.SHIFT) != 0;
}
///
- final @property bool windows() // getter
+ final @property bool windows() pure nothrow // getter
{
return (ks & Keys.WINDOWS) != 0;
}
@@ -897,7 +897,7 @@ class MouseEventArgs: EventArgs
{
///
// -delta- is mouse wheel rotations.
- this(MouseButtons button, int clicks, int x, int y, int delta)
+ this(MouseButtons button, int clicks, int x, int y, int delta) pure nothrow
{
btn = button;
clks = clicks;
@@ -908,35 +908,35 @@ class MouseEventArgs: EventArgs
///
- final @property MouseButtons button() // getter
+ final @property MouseButtons button() pure nothrow // getter
{
return btn;
}
///
- final @property int clicks() // getter
+ final @property int clicks() pure nothrow // getter
{
return clks;
}
///
- final @property int delta() // getter
+ final @property int delta() pure nothrow // getter
{
return dlt;
}
///
- final @property int x() // getter
+ final @property int x() pure nothrow // getter
{
return _x;
}
///
- final @property int y() // getter
+ final @property int y() pure nothrow // getter
{
return _y;
}
@@ -1009,14 +1009,14 @@ class LabelEditEventArgs: EventArgs
class ColumnClickEventArgs: EventArgs
{
///
- this(int col)
+ this(int col) pure nothrow
{
this.col = col;
}
///
- final @property int column() // getter
+ final @property int column() pure nothrow // getter
{
return col;
}
@@ -1031,13 +1031,13 @@ class ColumnClickEventArgs: EventArgs
class DrawItemEventArgs: EventArgs
{
///
- this(Graphics g, Font f, Rect r, int i, DrawItemState dis)
+ this(Graphics g, Font f, Rect r, int i, DrawItemState dis) pure nothrow
{
this(g, f, r, i , dis, Color.empty, Color.empty);
}
/// ditto
- this(Graphics g, Font f, Rect r, int i, DrawItemState dis, Color fc, Color bc)
+ this(Graphics g, Font f, Rect r, int i, DrawItemState dis, Color fc, Color bc) pure nothrow
{
gpx = g;
fnt = f;
@@ -1050,49 +1050,49 @@ class DrawItemEventArgs: EventArgs
///
- final @property Color backColor() // getter
+ final @property Color backColor() pure nothrow // getter
{
return bcolor;
}
///
- final @property Rect bounds() // getter
+ final @property Rect bounds() pure nothrow // getter
{
return rect;
}
///
- final @property Font font() // getter
+ final @property Font font() pure nothrow // getter
{
return fnt;
}
///
- final @property Color foreColor() // getter
+ final @property Color foreColor() pure nothrow // getter
{
return fcolor;
}
///
- final @property Graphics graphics() // getter
+ final @property Graphics graphics() pure nothrow // getter
{
return gpx;
}
///
- final @property int index() // getter
+ final @property int index() pure nothrow // getter
{
return idx;
}
///
- final @property DrawItemState state() // getter
+ final @property DrawItemState state() pure nothrow // getter
{
return distate;
}
View
74 win32/dfl/drawing.d
@@ -481,24 +481,24 @@ unittest
struct Color // docmain
{
/// Red, green, blue and alpha channel color values.
- @property ubyte r() // getter
+ @property ubyte r() nothrow // getter
{ validateColor(); return color.red; }
/// ditto
- @property ubyte g() // getter
+ @property ubyte g() nothrow // getter
{ validateColor(); return color.green; }
/// ditto
- @property ubyte b() // getter
+ @property ubyte b() nothrow // getter
{ validateColor(); return color.blue; }
/// ditto
- @property ubyte a() // getter
+ @property ubyte a() nothrow // getter
{ /+ validateColor(); +/ return color.alpha; }
/// Return the numeric color value.
- COLORREF toArgb()
+ COLORREF toArgb() nothrow
{
validateColor();
return color.cref;
@@ -506,7 +506,7 @@ struct Color // docmain
/// Return the numeric red, green and blue color value.
- COLORREF toRgb()
+ COLORREF toRgb() nothrow
{
validateColor();
return color.cref & 0x00FFFFFF;
@@ -514,7 +514,7 @@ struct Color // docmain
// Used internally.
- HBRUSH createBrush() // package
+ HBRUSH createBrush() nothrow // package
{
HBRUSH hbr;
if(_systemColorIndex == Color.INVAILD_SYSTEM_COLOR_INDEX)
@@ -525,10 +525,10 @@ struct Color // docmain
}
- Color* Dthisptr(Color* t) { return t; }
- Color* Dthisptr(ref Color t) { return &t; }
- Color Dthisval(Color* t) { return *t; }
- Color Dthisval(Color t) { return t; }
+ Color* Dthisptr(Color* t) pure nothrow { return t; }
+ Color* Dthisptr(ref Color t) pure nothrow { return &t; }
+ Color Dthisval(Color* t) pure nothrow { return *t; }
+ Color Dthisval(Color t) pure nothrow { return t; }
deprecated static Color opCall(COLORREF argb)
@@ -540,36 +540,32 @@ struct Color // docmain
/// Construct a new color.
- static Color opCall(ubyte alpha, Color c)
+ this(ubyte alpha, Color c) pure nothrow
{
- Color nc;
- nc.color.blue = c.color.blue;
- nc.color.green = c.color.green;
- nc.color.red = c.color.red;
- nc.color.alpha = alpha;
- return nc;
+ color.blue = c.color.blue;
+ color.green = c.color.green;
+ color.red = c.color.red;
+ color.alpha = alpha;
}
/// ditto
- static Color opCall(ubyte red, ubyte green, ubyte blue)
+ this(ubyte red, ubyte green, ubyte blue) pure nothrow
{
- Color nc;
- nc.color.blue = blue;
- nc.color.green = green;
- nc.color.red = red;
- nc.color.alpha = 0xFF;
- return nc;
+ color.blue = blue;
+ color.green = green;
+ color.red = red;
+ color.alpha = 0xFF;
}
/// ditto
- static Color opCall(ubyte alpha, ubyte red, ubyte green, ubyte blue)
+ this(ubyte alpha, ubyte red, ubyte green, ubyte blue) pure nothrow
{
- return fromArgb(alpha, red, green, blue);
+ this = fromArgb(alpha, red, green, blue);
}
/// ditto
//alias opCall fromArgb;
- static Color fromArgb(ubyte alpha, ubyte red, ubyte green, ubyte blue)
+ static Color fromArgb(ubyte alpha, ubyte red, ubyte green, ubyte blue) pure nothrow
{
Color nc;
nc.color.blue = blue;
@@ -580,7 +576,7 @@ struct Color // docmain
}
/// ditto
- static Color fromRgb(COLORREF rgb)
+ static Color fromRgb(COLORREF rgb) pure nothrow
{
if(CLR_NONE == rgb)
return empty;
@@ -591,7 +587,7 @@ struct Color // docmain
}
/// ditto
- static Color fromRgb(ubyte alpha, COLORREF rgb)
+ static Color fromRgb(ubyte alpha, COLORREF rgb) pure nothrow
{
Color nc;
nc.color.cref = rgb | ((cast(COLORREF)alpha) << 24);
@@ -599,14 +595,14 @@ struct Color // docmain
}
/// ditto
- static @property Color empty() // getter
+ static @property Color empty() pure nothrow // getter
{
return Color(0, 0, 0, 0);
}
/// Return a completely transparent color value.
- static @property Color transparent() // getter
+ static @property Color transparent() nothrow // getter
{
return Color.fromArgb(0, 0xFF, 0xFF, 0xFF);
}
@@ -619,7 +615,7 @@ struct Color // docmain
// Blends the color channels half way.
// Does not consider alpha channels and discards them.
// The new blended color is returned; -this- Color is not modified.
- Color blendColor(Color wc)
+ Color blendColor(Color wc) nothrow
{
if(Dthisval(this) == Color.empty)
return wc;
@@ -640,7 +636,7 @@ struct Color // docmain
// Returns the new solid color, or the original color if no opacity.
// If backColor has opacity, it is ignored.
// The new blended color is returned; -this- Color is not modified.
- Color solidColor(Color backColor)
+ Color solidColor(Color backColor) nothrow
{
//if(0x7F == this.color.alpha)
// return blendColor(backColor);
@@ -669,7 +665,7 @@ struct Color // docmain
}
- package static Color systemColor(int colorIndex)
+ package static Color systemColor(int colorIndex) pure nothrow
{
Color c;
c.sysIndex = cast(ubyte)colorIndex;
@@ -679,13 +675,13 @@ struct Color // docmain
// Gets color index or INVAILD_SYSTEM_COLOR_INDEX.
- package @property int _systemColorIndex() // getter
+ package @property int _systemColorIndex() pure nothrow // getter
{
return sysIndex;
}
- package const ubyte INVAILD_SYSTEM_COLOR_INDEX = ubyte.max;
+ package enum ubyte INVAILD_SYSTEM_COLOR_INDEX = ubyte.max;
private:
@@ -707,7 +703,7 @@ struct Color // docmain
ubyte sysIndex = INVAILD_SYSTEM_COLOR_INDEX;
- void validateColor()
+ void validateColor() nothrow
{
if(sysIndex != INVAILD_SYSTEM_COLOR_INDEX)
{
@@ -2222,7 +2218,7 @@ class Screen
version(DFL_MULTIPLE_SCREENS)
{
private extern(Windows) BOOL _gettingScreens(HMONITOR hmonitor,
- HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
+ HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) nothrow
{
for(int i = 0; i < Screen._screens.length; i++)
{
View
19 win32/dfl/event.d
@@ -174,18 +174,25 @@ template Event(T1, T2) // docmain
///
- @property bool hasHandlers() // getter
+ @property bool hasHandlers() pure nothrow // getter
{
return _array.length > 1;
}
// Use opApply and hasHandlers instead.
- deprecated @property Handler[] handlers() // getter
+ deprecated @property Handler[] handlers() pure nothrow // getter
{
if(!hasHandlers)
return null;
- return _array[1 .. _array.length].dup; // Because _array can be modified. Function is deprecated anyway.
+ try
+ {
+ return _array[1 .. _array.length].dup; // Because _array can be modified. Function is deprecated anyway.
+ }
+ catch (DThrowable e)
+ {
+ return null;
+ }
}
@@ -290,7 +297,7 @@ class EventArgs // docmain
/// Property: get a reusable, _empty EventArgs.
- static @property EventArgs empty() // getter
+ static @property EventArgs empty() nothrow // getter
{
return _e;
}
@@ -306,14 +313,14 @@ class ThreadExceptionEventArgs: EventArgs
{
///
// The exception that occured.
- this(DThrowable theException)
+ this(DThrowable theException) pure nothrow
{
except = theException;
}
///
- final @property DThrowable exception() // getter
+ final @property DThrowable exception() pure nothrow // getter
{
return except;
}
View
2  win32/dfl/filedialog.d
@@ -718,7 +718,7 @@ abstract class FileDialog: CommonDialog // docmain
}
-private extern(Windows)
+private extern(Windows) nothrow
{
alias BOOL function(LPOPENFILENAMEW lpofn) GetOpenFileNameWProc;
alias BOOL function(LPOPENFILENAMEW lpofn) GetSaveFileNameWProc;
View
2  win32/dfl/folderdialog.d
@@ -11,7 +11,7 @@ private import dfl.commondialog, dfl.base, dfl.internal.winapi, dfl.internal.win
private import dfl.internal.utf, dfl.application;
-private extern(Windows)
+private extern(Windows) nothrow
{
alias LPITEMIDLIST function(LPBROWSEINFOW lpbi) SHBrowseForFolderWProc;
alias BOOL function(LPCITEMIDLIST pidl, LPWSTR pszPath) SHGetPathFromIDListWProc;
View
2  win32/dfl/fontdialog.d
@@ -10,7 +10,7 @@ private import dfl.base, dfl.commondialog, dfl.internal.winapi, dfl.application,
dfl.internal.dlib;
-private extern(Windows)
+private extern(Windows) nothrow
{
alias BOOL function(LPCHOOSEFONTW lpcf) ChooseFontWProc;
}
View
10 win32/dfl/internal/utf.d
@@ -106,7 +106,7 @@ else
HMODULE _user32, _kernel32, _advapi32, _gdi32;
-package @property HMODULE advapi32() // getter
+package @property HMODULE advapi32() nothrow // getter
{
// advapi32 generally always delay loads.
if(!_advapi32)
@@ -114,7 +114,7 @@ package @property HMODULE advapi32() // getter
return _advapi32;
}
-package @property HMODULE gdi32() // getter
+package @property HMODULE gdi32() nothrow // getter
{
// gdi32 sometimes delay loads.
version(DFL_GET_INTERNAL_LIBS)
@@ -125,7 +125,7 @@ package @property HMODULE gdi32() // getter
return _gdi32;
}
-package @property HMODULE user32() // getter
+package @property HMODULE user32() nothrow // getter
{
version(DFL_GET_INTERNAL_LIBS)
{
@@ -135,7 +135,7 @@ package @property HMODULE user32() // getter
return _user32;
}
-package @property HMODULE kernel32() // getter
+package @property HMODULE kernel32() nothrow // getter
{
version(DFL_GET_INTERNAL_LIBS)
{
@@ -197,7 +197,7 @@ template _getlen(T)
public:
-Dstringz unsafeStringz(Dstring s)
+Dstringz unsafeStringz(Dstring s) nothrow
{
if(!s.length)
return "";
Please sign in to comment.
Something went wrong with that request. Please try again.