
=== modified file 'gui/Kde4Gui.cpp'
--- gui/Kde4Gui.cpp	2009-01-22 20:10:39 +0000
+++ gui/Kde4Gui.cpp	2009-02-15 21:59:51 +0000
@@ -112,7 +112,8 @@
 
 
 bool
-Kde4Gui::createWindow(const char* windowtitle, int width, int height)
+KdeGui::createWindow(const char* windowtitle, int width, int height,
+                     int xPosition, int yPosition)
 {
 
     _width = width;

=== modified file 'gui/Kde4Gui.h'
--- gui/Kde4Gui.h	2009-01-22 20:10:39 +0000
+++ gui/Kde4Gui.h	2009-02-15 21:11:15 +0000
@@ -95,7 +95,8 @@
     Kde4Gui(unsigned long xid, float scale, bool loop, unsigned int depth);
     virtual ~Kde4Gui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char* windowtitle, int width, int height);
+    virtual bool createWindow(const char* windowtitle, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual void renderBuffer();
     virtual void setInterval(unsigned int interval);

=== modified file 'gui/NullGui.h'
--- gui/NullGui.h	2008-03-29 10:13:54 +0000
+++ gui/NullGui.h	2009-02-02 20:58:27 +0000
@@ -50,7 +50,8 @@
 		_timeout=to;
 	}
 	bool init(int, char ***) { return true; }
-	bool createWindow(const char* /*title*/, int /*width*/, int /*height*/)
+	bool createWindow(const char* /*title*/, int /*width*/, int /*height*/,
+	                  int /*yPosition*/, int /*xPosition*/)
 	{
 		return true;
 	}

=== modified file 'gui/Player.cpp'
--- gui/Player.cpp	2008-12-04 10:21:27 +0000
+++ gui/Player.cpp	2009-02-02 21:37:13 +0000
@@ -86,6 +86,8 @@
     _delay(0),
     _width(0),
     _height(0),
+    _xPosition(-1),
+    _yPosition(-1),
     _windowID(0),
     _doLoop(true),
     _doRender(true),
@@ -405,7 +407,7 @@
     _gui->setMovieDefinition(_movieDef.get());
 
     // Now that we know about movie size, create gui window.
-    _gui->createWindow(_url.c_str(), _width, _height);
+    _gui->createWindow(_url.c_str(), _width, _height, _xPosition, _yPosition);
 
     SystemClock clock; // use system clock here...
     movie_root root(*_movieDef, clock, *_runInfo);

=== modified file 'gui/Player.h'
--- gui/Player.h	2008-11-04 01:14:26 +0000
+++ gui/Player.h	2009-02-02 20:45:57 +0000
@@ -101,6 +101,12 @@
 	void setHeight(size_t h) { _height = h; }
 	size_t getHeight() { return _height; }
 
+	void setXPosition(int xPos) { _xPosition = xPos; }
+	size_t getXPosition() { return _xPosition; }
+
+	void setYPosition(int yPos) { _yPosition = yPos; }
+	size_t getYPosition() { return _yPosition; }
+	
 	void setWindowId(unsigned long x) { _windowID = x; }
 
 	void setDoLoop(bool b) { _doLoop = b; }
@@ -220,6 +226,10 @@
 
 	size_t _height;
 
+	int _xPosition;
+
+	int _yPosition;
+
 	unsigned long _windowID;
 
 	bool _doLoop;

=== modified file 'gui/aqua.cpp'
--- gui/aqua.cpp	2008-11-21 15:15:25 +0000
+++ gui/aqua.cpp	2009-02-02 20:51:03 +0000
@@ -151,7 +151,8 @@
 }
 
 
-bool AquaGui::createWindow(const char* title, int width, int height)
+bool AquaGui::createWindow(const char* title, int width, int height,
+                           int xPosition, int yPosition)
 {
 	CFStringRef	windowTitle = NULL;
 	OSStatus	result;

=== modified file 'gui/aquasup.h'
--- gui/aquasup.h	2008-03-05 03:55:48 +0000
+++ gui/aquasup.h	2009-02-02 20:50:51 +0000
@@ -61,7 +61,8 @@
     virtual ~AquaGui();
     virtual bool init(int argc, char ***argv);
     virtual void setCursor(gnash_cursor_type newcursor);
-    virtual bool createWindow(const char* title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/fb.cpp'
--- gui/fb.cpp	2008-11-21 15:15:25 +0000
+++ gui/fb.cpp	2009-02-02 20:51:15 +0000
@@ -433,7 +433,8 @@
 #endif
 }
 
-bool FBGui::createWindow(const char* /*title*/, int /*width*/, int /*height*/)
+bool FBGui::createWindow(const char* /*title*/, int /*width*/, int /*height*/,
+                     int /*xPosition*/, int /*yPosition*/)
 {
   // Framebuffer has no windows... :-)
 

=== modified file 'gui/fbsup.h'
--- gui/fbsup.h	2008-04-07 20:44:55 +0000
+++ gui/fbsup.h	2009-02-02 20:51:30 +0000
@@ -193,7 +193,8 @@
 		FBGui(unsigned long xid, float scale, bool loop, unsigned int depth);
     virtual ~FBGui();
     virtual bool init(int argc, char ***argv);
-    virtual bool createWindow(const char* title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/fltk.cpp'
--- gui/fltk.cpp	2008-09-24 07:44:50 +0000
+++ gui/fltk.cpp	2009-02-02 21:00:38 +0000
@@ -228,7 +228,8 @@
 }
 
 bool
-FltkGui::createWindow(const char* title, int width, int height)
+FltkGui::createWindow(const char* title, int width, int height,
+                      int xPosition, int yPosition)
 {
     resize(width, _menu_height + height);
 

=== modified file 'gui/fltksup.h'
--- gui/fltksup.h	2008-01-21 20:55:39 +0000
+++ gui/fltksup.h	2009-02-02 21:00:59 +0000
@@ -48,7 +48,8 @@
 
     virtual void setInterval(unsigned int);
     virtual void setTimeout(unsigned int) { }
-    virtual bool createWindow(const char* title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual void renderBuffer();
 
     virtual bool run();

=== modified file 'gui/gnash.cpp'
--- gui/gnash.cpp	2008-12-28 09:40:28 +0000
+++ gui/gnash.cpp	2009-02-02 20:46:33 +0000
@@ -106,6 +106,8 @@
     << _("  -w,  --writelog          Produce the disk based debug log") << endl
     << _("  -j,  --width <width>     Set window width") << endl
     << _("  -k,  --height <height>   Set window height") << endl
+    << _("  -X,  --x-pos <x-pos>     Set window x position") << endl
+    << _("  -Y,  --y-pos <y-pos>     Set window y position") << endl
     << _("  -1,  --once              Exit when/if movie reaches the last frame") << endl
     << _("  -g,  --debugger          Turn on the SWF debugger") << endl
     << _("  -r,  --render-mode <0|1|2|3>") << endl
@@ -205,6 +207,8 @@
         { 'w', "writelog",      Arg_parser::no  },
         { 'j', "width",         Arg_parser::yes },
         { 'k', "height",        Arg_parser::yes },
+        { 'X', "x-position",    Arg_parser::yes },
+        { 'Y', "y-position",    Arg_parser::yes },
         { 'u', "real-url",      Arg_parser::yes },
         { 'P', "param",         Arg_parser::yes },
         { 'U', "base-url",      Arg_parser::yes },  
@@ -228,7 +232,7 @@
     bool renderflag = false;
     bool plugin = false;
     bool widthGiven = false, heightGiven = false;
-
+    bool xPosGiven = false, yPosGiven = false;
 
     for( int i = 0; i < parser.arguments(); ++i )
     {
@@ -328,6 +332,18 @@
                     gnash::log_debug(_("Setting height to %d"),
                             player.getHeight());
                     break;
+                case 'X':
+                    xPosGiven = true;
+                    player.setXPosition ( parser.argument<int>(i));
+                    gnash::log_debug (_("Setting x position to %d"), 
+                            player.getXPosition());
+                    break;
+                case 'Y':
+                    yPosGiven = true;
+                    player.setYPosition ( parser.argument<int>(i));
+                    gnash::log_debug (_("Setting x position to %d"), 
+                            player.getYPosition());
+                    break;
                 case 'x':
                     plugin = true;
                     player.setWindowId(parser.argument<long>(i));

=== modified file 'gui/gtk.cpp'
--- gui/gtk.cpp	2009-01-22 20:10:39 +0000
+++ gui/gtk.cpp	2009-02-15 22:20:51 +0000
@@ -628,12 +628,20 @@
 }
 
 bool
-GtkGui::createWindow(const char *title, int width, int height)
+GtkGui::createWindow(const char *title, int width, int height,
+                     int xPosition, int yPosition)
 {
 // First call the old createWindow function and then set the title.
 // In case there's some need to not setting the title.
     bool ret = createWindow(width, height);
     gtk_window_set_title(GTK_WINDOW(_window), title);
+    
+    // Move the window to correct position if requested by user.
+    int x, y;
+    gtk_window_get_position(GTK_WINDOW(_window), &x, &y);
+    if (xPosition > -1) x = xPosition; // -1 so we can tell if user requested window move
+    if (yPosition > -1) y = yPosition; // as 0 is also a valid coordinate.
+    gtk_window_move(GTK_WINDOW(_window), x, y);
 
     if (!_xid) {
     

=== modified file 'gui/gtksup.h'
--- gui/gtksup.h	2009-01-22 20:10:39 +0000
+++ gui/gtksup.h	2009-02-02 20:49:31 +0000
@@ -50,8 +50,8 @@
     virtual ~GtkGui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(int width, int height);
-    virtual bool createWindow(const char *title, int width, int height);
-
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
 
     void quit();

=== modified file 'gui/gui.h'
--- gui/gui.h	2009-01-22 20:10:39 +0000
+++ gui/gui.h	2009-02-02 21:02:10 +0000
@@ -110,8 +110,11 @@
      * @param title The window title.
      * @param width The desired window width in pixels.
      * @param height The desired window height in pixels.
+     * @param xPosition The desired window X position from the top left corner.
+     * @param yPosition The desired window Y position from the top left corner.
      */   
-    virtual bool createWindow(const char* title, int width, int height) = 0;
+    virtual bool createWindow(const char* title, int width, int height,
+                       int xPosition = 0, int yPosition = 0) = 0;
 
     /// Start main rendering loop.
     virtual bool run() = 0;

=== modified file 'gui/kde.cpp'
--- gui/kde.cpp	2008-11-14 22:39:17 +0000
+++ gui/kde.cpp	2009-02-02 22:09:52 +0000
@@ -79,11 +79,23 @@
 }
 
 bool
-KdeGui::createWindow(const char* windowtitle, int width, int height)
+KdeGui::createWindow(const char* windowtitle, int width, int height,
+                     int xPosition, int yPosition)
 {
 //    GNASH_REPORT_FUNCTION;
 
-    _qwidget->setGeometry(0, 0, width, height);
+    // Move the window to correct position if requested by user.
+    if (xPosition > 1) {
+        if (yPosition > 1) {
+            _qwidget->setGeometry(xPosition, yPosition, width, height);
+            }
+        else {  // If only given X position by user
+            _qwidget->setGeometry(xPosition, 0, width, height);
+            }
+        }
+    else if (yPosition > 1) { // If only given Y position by user
+        _qwidget->setGeometry(0, yPosition, width, height);
+    }
     _qwidget->setCaption(windowtitle);
 
     _qapp->setMainWidget(_qwidget.get());

=== modified file 'gui/kdesup.h'
--- gui/kdesup.h	2008-03-29 10:13:54 +0000
+++ gui/kdesup.h	2009-02-02 20:49:47 +0000
@@ -91,7 +91,8 @@
     KdeGui(unsigned long xid, float scale, bool loop, unsigned int depth);
     virtual ~KdeGui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char* windowtitle, int width, int height);
+    virtual bool createWindow(const char* windowtitle, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/riscos.cpp'
--- gui/riscos.cpp	2008-03-05 03:55:48 +0000
+++ gui/riscos.cpp	2009-02-02 20:55:40 +0000
@@ -116,7 +116,8 @@
 
 
 bool
-RiscosGui::createWindow(const char *title, int width, int height)
+RiscosGui::createWindow(const char *title, int width, int height,
+                     int xPosition, int yPosition)
 {
 //First call the old createWindow function and then set the title.
 //In case there's some need to not setting the title.

=== modified file 'gui/riscossup.h'
--- gui/riscossup.h	2008-03-29 10:13:54 +0000
+++ gui/riscossup.h	2009-02-02 20:56:37 +0000
@@ -44,7 +44,8 @@
     virtual ~RiscosGui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(int width, int height);
-    virtual bool createWindow(const char *title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/sdl.cpp'
--- gui/sdl.cpp	2008-11-21 15:15:25 +0000
+++ gui/sdl.cpp	2009-02-02 20:51:59 +0000
@@ -191,7 +191,8 @@
 
 
 bool
-SDLGui::createWindow(const char *title, int width, int height)
+SDLGui::createWindow(const char *title, int width, int height,
+                     int xPosition, int yPosition)
 {
     GNASH_REPORT_FUNCTION;
     _width = width;

=== modified file 'gui/sdlsup.h'
--- gui/sdlsup.h	2008-03-29 10:13:54 +0000
+++ gui/sdlsup.h	2009-02-02 20:54:20 +0000
@@ -50,7 +50,8 @@
     SDLGui(unsigned long xid, float scale, bool loop, unsigned int depth);
     virtual ~SDLGui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char *title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

