[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp |
Date: |
Fri, 11 Apr 2008 07:27:46 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/04/11 07:27:46
Modified files:
. : ChangeLog
gui : Player.cpp gtk.cpp
Log message:
* gui/gtk.cpp: a way of getting pixel aspect ratio.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6245&r2=1.6246
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.164&r2=1.165
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6245
retrieving revision 1.6246
diff -u -b -r1.6245 -r1.6246
--- ChangeLog 11 Apr 2008 06:59:42 -0000 1.6245
+++ ChangeLog 11 Apr 2008 07:27:45 -0000 1.6246
@@ -1,5 +1,9 @@
2008-04-11 Benjamin Wolsey <address@hidden>
+ * gui/gtk.cpp: a way of getting pixel aspect ratio.
+
+2008-04-11 Benjamin Wolsey <address@hidden>
+
* gui/gtk.cpp: cleaner way to get screen size.
2008-04-10 Sandro Santilli <address@hidden>
Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- gui/Player.cpp 9 Apr 2008 11:57:34 -0000 1.99
+++ gui/Player.cpp 11 Apr 2008 07:27:45 -0000 1.100
@@ -46,6 +46,7 @@
#include "log.h"
#include <iostream>
#include <sstream>
+#include <iomanip>
using std::endl;
using std::cerr;
@@ -553,7 +554,9 @@
if (event == "System.capabilities.pixelAspectRatio")
{
std::ostringstream ss;
- ss << _gui->getPixelAspectRatio();
+ // Whether the pp actively limits the precision or simply
+ // gets a slightly different result isn't clear.
+ ss << std::setprecision(7) << _gui->getPixelAspectRatio();
return ss.str();
}
Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -b -r1.164 -r1.165
--- gui/gtk.cpp 11 Apr 2008 06:59:43 -0000 1.164
+++ gui/gtk.cpp 11 Apr 2008 07:27:45 -0000 1.165
@@ -415,7 +415,15 @@
double
GtkGui::getPixelAspectRatio()
{
- return 0;
+ GdkScreen* screen = gdk_screen_get_default();
+
+ // Screen size / number of pixels = pixel size.
+ // The physical size of the screen may be reported wrongly by gdk (from X),
+ // but it's the best we have. This method agrees with the pp in my case.
+ double pixelAspectRatio =
+ (gdk_screen_get_height_mm(screen) /
static_cast<double>(getScreenResY())) /
+ (gdk_screen_get_width_mm(screen) /
static_cast<double>(getScreenResX()));
+ return pixelAspectRatio;
}
int
- [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp,
Benjamin Wolsey <=