[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11628: Patch for window placement f
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11628: Patch for window placement from Kristian Frank Erikson. |
Date: |
Mon, 16 Nov 2009 14:58:06 +0100 |
User-agent: |
Bazaar (1.16.1) |
------------------------------------------------------------
revno: 11628 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2009-11-16 14:58:06 +0100
message:
Patch for window placement from Kristian Frank Erikson.
Minor cleanup in sdl.
modified:
doc/C/preformatted/dumpshm.1.in
doc/C/preformatted/rtmpget.1.in
gui/DESIGN
gui/Kde4Gui.cpp
gui/Kde4Gui.h
gui/NullGui.h
gui/Player.cpp
gui/Player.h
gui/aqua.cpp
gui/aquasup.h
gui/dump.h
gui/fb.cpp
gui/fbsup.h
gui/fltk.cpp
gui/fltksup.h
gui/gnash.cpp
gui/gtk.cpp
gui/gtksup.h
gui/gui.h
gui/kde.cpp
gui/kdesup.h
gui/riscos.cpp
gui/riscossup.h
gui/sdl.cpp
gui/sdlsup.h
=== modified file 'doc/C/preformatted/dumpshm.1.in'
--- a/doc/C/preformatted/dumpshm.1.in 2008-09-12 21:18:45 +0000
+++ b/doc/C/preformatted/dumpshm.1.in 2009-11-16 12:57:54 +0000
@@ -1,11 +1,11 @@
-'\" -*- coding: us-ascii -*-
+.\" -*- coding: us-ascii -*-
.if \n(.g .ds T< \\FC
.if \n(.g .ds T> \\F[\n[.fam]]
.de URL
\\$2 \(la\\$1\(ra\\$3
..
.if \n(.g .mso www.tmac
-.TH dumpshm 1 "20 June 2008" "" ""
+.TH dumpshm 1 "16 November 2009" "" ""
.SH NAME
dumpshm \- Gnash LocalConnection Memory Dumper
.SH Synopsis
@@ -14,7 +14,7 @@
dumpshm (options)... (file)...
.fi
.SH DESCRIPTION
-When any SWF player, including Gnash,
+When any SWF player, including the Gnash player,
plays a SWF "movie", the movie can contain
scripts. These scripts can call ActionScript classes. One such class
is LocalConnection. LocalConnection passes objects from one movie to
=== modified file 'doc/C/preformatted/rtmpget.1.in'
--- a/doc/C/preformatted/rtmpget.1.in 2009-07-07 11:48:05 +0000
+++ b/doc/C/preformatted/rtmpget.1.in 2009-11-16 12:57:54 +0000
@@ -1,51 +1,35 @@
-.\" Title: rtmpget
-.\" Author:
-.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\" Date: 07/07/2009
-.\" Manual:
-.\" Source:
-.\"
-.TH "RTMPGET" "1" "07/07/2009" "" ""
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.SH "NAME"
-rtmpget - Gnash Utility For Fetching RTMP-data
-.SH "SYNOPSIS"
-.sp
-.RS 4
+.\" -*- coding: us-ascii -*-
+.if \n(.g .ds T< \\FC
+.if \n(.g .ds T> \\F[\n[.fam]]
+.de URL
+\\$2 \(la\\$1\(ra\\$3
+..
+.if \n(.g .mso www.tmac
+.TH rtmpget 1 "16 November 2009" "" ""
+.SH NAME
+rtmpget \- Gnash Utility For Fetching RTMP-data
+.SH Synopsis
.nf
-rtmpget [options\.\.\.] [url\.\.\.]
+
+rtmpget [options...] [url...]
.fi
-.RE
-.SH "DESCRIPTION"
-.PP
-RTMP is a protocol for streaming/communicating SWF\-data over networks\.
RTMPGet is a proof of concept utility for fetching a RTMP\-stream\.
-.PP
-RTMPGet fetch an url containing RTMP\-data for saving it to disk\.
-.PP
-\-h
-.RS 4
-Print usage info\.
-.RE
-.PP
-\-V
-.RS 4
-Print version information\.
-.RE
-.PP
-\-d
-.RS 4
-Display init file to the terminal\.
-.RE
-.PP
-\-n
-.RS 4
-Verbose networking debug info\.
-.RE
-.PP
-\-v
-.RS 4
-Verbose output\.
-.RE
+.SH DESCRIPTION
+RTMP is a protocol for streaming/communicating SWF-data over networks.
+RTMPGet is a proof of concept utility for fetching a RTMP-stream.
+.PP
+RTMPGet fetch an url containing RTMP-data for saving it to disk.
+.TP
+-h
+Print usage info.
+.TP
+-V
+Print version information.
+.TP
+-d
+Display init file to the terminal.
+.TP
+-n
+Verbose networking debug info.
+.TP
+-v
+Verbose output.
=== modified file 'gui/DESIGN'
--- a/gui/DESIGN 2008-03-05 03:55:48 +0000
+++ b/gui/DESIGN 2009-11-16 12:57:54 +0000
@@ -19,7 +19,7 @@
init(int argc, char **argv[]):
This funtion is run first to initialize GUI-specific parameters/variables.
-createWindow(const char* title, int width, int height):
+createWindow(const char* title, int width, int height, int xPosition, int
yPosition):
Here we create a window-widget with calling parameters.
setCursor(gnash_cursor_type newcursor):
=== modified file 'gui/Kde4Gui.cpp'
--- a/gui/Kde4Gui.cpp 2009-07-13 09:15:53 +0000
+++ b/gui/Kde4Gui.cpp 2009-11-16 12:57:54 +0000
@@ -123,9 +123,9 @@
bool
-Kde4Gui::createWindow(const char* windowtitle, int width, int height)
+Kde4Gui::createWindow(const char* windowtitle, int width, int height,
+ int xPosition, int yPosition)
{
-
_width = width;
_height = height;
=== modified file 'gui/Kde4Gui.h'
--- a/gui/Kde4Gui.h 2009-07-13 09:15:53 +0000
+++ b/gui/Kde4Gui.h 2009-11-16 12:57:54 +0000
@@ -125,7 +125,8 @@
Kde4Gui(unsigned long xid, float scale, bool loop, RunResources& r);
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'
--- a/gui/NullGui.h 2009-07-13 09:15:53 +0000
+++ b/gui/NullGui.h 2009-11-16 12:57:54 +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'
--- a/gui/Player.cpp 2009-09-14 10:25:45 +0000
+++ b/gui/Player.cpp 2009-11-16 12:57:54 +0000
@@ -90,6 +90,8 @@
_delay(0),
_width(0),
_height(0),
+ _xPosition(-1),
+ _yPosition(-1),
_windowID(0),
_doLoop(true),
_doRender(true),
@@ -418,7 +420,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);
movie_root root(*_movieDef, _gui->getClock(), *_runResources);
=== modified file 'gui/Player.h'
--- a/gui/Player.h 2009-09-14 09:31:10 +0000
+++ b/gui/Player.h 2009-11-16 12:57:54 +0000
@@ -102,6 +102,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; }
@@ -235,6 +241,10 @@
size_t _width;
size_t _height;
+
+ int _xPosition;
+
+ int _yPosition;
unsigned long _windowID;
=== modified file 'gui/aqua.cpp'
--- a/gui/aqua.cpp 2009-08-30 23:20:00 +0000
+++ b/gui/aqua.cpp 2009-11-16 12:57:54 +0000
@@ -156,7 +156,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'
--- a/gui/aquasup.h 2009-08-30 00:47:07 +0000
+++ b/gui/aquasup.h 2009-11-16 12:57:54 +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/dump.h'
--- a/gui/dump.h 2009-10-01 13:19:43 +0000
+++ b/gui/dump.h 2009-11-16 12:57:54 +0000
@@ -41,7 +41,8 @@
bool createMenu() { return true; }
bool createMenuBar() { return true; }
bool createWindow(int width, int height);
- bool createWindow(const char* /*title*/, int width, int height)
+ bool createWindow(const char* /*title*/, int width, int height,
+ int /*x*/, int /*y*/)
{ return createWindow(width, height); }
bool init(int argc, char **argv[]);
void quit();
=== modified file 'gui/fb.cpp'
--- a/gui/fb.cpp 2009-10-03 21:16:21 +0000
+++ b/gui/fb.cpp 2009-11-16 12:57:54 +0000
@@ -429,7 +429,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'
--- a/gui/fbsup.h 2009-07-13 10:43:39 +0000
+++ b/gui/fbsup.h 2009-11-16 12:57:54 +0000
@@ -192,7 +192,8 @@
FBGui(unsigned long xid, float scale, bool loop, RunResources&
r);
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'
--- a/gui/fltk.cpp 2009-07-14 13:40:32 +0000
+++ b/gui/fltk.cpp 2009-11-16 12:57:54 +0000
@@ -229,7 +229,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'
--- a/gui/fltksup.h 2009-07-13 09:15:53 +0000
+++ b/gui/fltksup.h 2009-11-16 12:57:54 +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'
--- a/gui/gnash.cpp 2009-11-16 11:16:48 +0000
+++ b/gui/gnash.cpp 2009-11-16 12:57:54 +0000
@@ -108,6 +108,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
@@ -212,6 +214,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 },
@@ -235,6 +239,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 )
@@ -338,6 +343,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'
--- a/gui/gtk.cpp 2009-10-01 13:20:16 +0000
+++ b/gui/gtk.cpp 2009-11-16 12:57:54 +0000
@@ -749,12 +749,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'
--- a/gui/gtksup.h 2009-07-21 21:54:27 +0000
+++ b/gui/gtksup.h 2009-11-16 12:57:54 +0000
@@ -61,7 +61,8 @@
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();
=== modified file 'gui/gui.h'
--- a/gui/gui.h 2009-10-01 13:19:43 +0000
+++ b/gui/gui.h 2009-11-16 12:57:54 +0000
@@ -115,8 +115,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'
--- a/gui/kde.cpp 2009-07-14 13:41:56 +0000
+++ b/gui/kde.cpp 2009-11-16 12:57:54 +0000
@@ -80,11 +80,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'
--- a/gui/kdesup.h 2009-07-13 09:15:53 +0000
+++ b/gui/kdesup.h 2009-11-16 12:57:54 +0000
@@ -87,7 +87,8 @@
KdeGui(unsigned long xid, float scale, bool loop, RunResources& r);
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'
--- a/gui/riscos.cpp 2009-10-01 13:19:43 +0000
+++ b/gui/riscos.cpp 2009-11-16 12:57:54 +0000
@@ -119,7 +119,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'
--- a/gui/riscossup.h 2009-10-01 13:19:43 +0000
+++ b/gui/riscossup.h 2009-11-16 12:57:54 +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'
--- a/gui/sdl.cpp 2009-09-21 02:49:55 +0000
+++ b/gui/sdl.cpp 2009-11-16 13:58:06 +0000
@@ -194,7 +194,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;
@@ -212,7 +213,7 @@
_glue.prepDrawingArea(_width, _height, sdl_flags);
- _runResources.setRenderer(boost::shared_ptr<Renderer>(_renderer));
+ _runResources.setRenderer(_renderer);
SDL_WM_SetCaption( title, title);
=== modified file 'gui/sdlsup.h'
--- a/gui/sdlsup.h 2009-07-13 09:15:53 +0000
+++ b/gui/sdlsup.h 2009-11-16 12:57:54 +0000
@@ -50,7 +50,8 @@
SDLGui(unsigned long xid, float scale, bool loop, RunResources& r);
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();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11628: Patch for window placement from Kristian Frank Erikson.,
Benjamin Wolsey <=