window: exposed "raise()" function from SDL to bring the specified window to the top of the display stack

This commit is contained in:
Lars A. Doucet
2015-08-20 20:57:49 -05:00
parent ea6cac44a6
commit 36538a4b3e
6 changed files with 31 additions and 0 deletions

View File

@@ -138,6 +138,15 @@ class NativeWindow {
} }
public function raise ():Void {
if (handle != null) {
lime_window_raise (handle);
}
}
public function resize (width:Int, height:Int):Void { public function resize (width:Int, height:Int):Void {
@@ -228,6 +237,7 @@ class NativeWindow {
private static var lime_window_get_x = System.load ("lime", "lime_window_get_x", 1); private static var lime_window_get_x = System.load ("lime", "lime_window_get_x", 1);
private static var lime_window_get_y = System.load ("lime", "lime_window_get_y", 1); private static var lime_window_get_y = System.load ("lime", "lime_window_get_y", 1);
private static var lime_window_move = System.load ("lime", "lime_window_move", 3); private static var lime_window_move = System.load ("lime", "lime_window_move", 3);
private static var lime_window_raise = System.load ("lime", "lime_window_raise", 1);
private static var lime_window_resize = System.load ("lime", "lime_window_resize", 3); private static var lime_window_resize = System.load ("lime", "lime_window_resize", 3);
private static var lime_window_set_enable_text_events = System.load ("lime", "lime_window_set_enable_text_events", 2); private static var lime_window_set_enable_text_events = System.load ("lime", "lime_window_set_enable_text_events", 2);
private static var lime_window_set_fullscreen = System.load ("lime", "lime_window_set_fullscreen", 2); private static var lime_window_set_fullscreen = System.load ("lime", "lime_window_set_fullscreen", 2);

View File

@@ -239,6 +239,11 @@ class Window {
} }
public function raise ():Void {
backend.raise ();
}
public function resize (width:Int, height:Int):Void { public function resize (width:Int, height:Int):Void {

View File

@@ -27,6 +27,7 @@ namespace lime {
virtual int GetX () = 0; virtual int GetX () = 0;
virtual int GetY () = 0; virtual int GetY () = 0;
virtual void Move (int x, int y) = 0; virtual void Move (int x, int y) = 0;
virtual void Raise () = 0;
virtual void Resize (int width, int height) = 0; virtual void Resize (int width, int height) = 0;
virtual void SetEnableTextEvents (bool enable) = 0; virtual void SetEnableTextEvents (bool enable) = 0;
virtual bool SetFullscreen (bool fullscreen) = 0; virtual bool SetFullscreen (bool fullscreen) = 0;

View File

@@ -1172,6 +1172,13 @@ namespace lime {
} }
value lime_window_raise (value window) {
Window* targetWindow = (Window*)(intptr_t)val_float (window);
targetWindow->Raise ();
return alloc_null ();
}
value lime_window_resize (value window, value width, value height) { value lime_window_resize (value window, value width, value height) {
@@ -1316,6 +1323,7 @@ namespace lime {
DEFINE_PRIM (lime_window_get_x, 1); DEFINE_PRIM (lime_window_get_x, 1);
DEFINE_PRIM (lime_window_get_y, 1); DEFINE_PRIM (lime_window_get_y, 1);
DEFINE_PRIM (lime_window_move, 3); DEFINE_PRIM (lime_window_move, 3);
DEFINE_PRIM (lime_window_raise, 1);
DEFINE_PRIM (lime_window_resize, 3); DEFINE_PRIM (lime_window_resize, 3);
DEFINE_PRIM (lime_window_set_enable_text_events, 2); DEFINE_PRIM (lime_window_set_enable_text_events, 2);
DEFINE_PRIM (lime_window_set_fullscreen, 2); DEFINE_PRIM (lime_window_set_fullscreen, 2);

View File

@@ -184,6 +184,12 @@ namespace lime {
} }
void SDLWindow::Raise () {
SDL_RaiseWindow (sdlWindow);
}
void SDLWindow::Resize (int width, int height) { void SDLWindow::Resize (int width, int height) {

View File

@@ -25,6 +25,7 @@ namespace lime {
virtual int GetX (); virtual int GetX ();
virtual int GetY (); virtual int GetY ();
virtual void Move (int x, int y); virtual void Move (int x, int y);
virtual void Raise ();
virtual void Resize (int width, int height); virtual void Resize (int width, int height);
virtual void SetEnableTextEvents (bool enabled); virtual void SetEnableTextEvents (bool enabled);
virtual bool SetFullscreen (bool fullscreen); virtual bool SetFullscreen (bool fullscreen);