The following commit has been merged in the master branch:
commit 5b247a550d5c9329ffee5d41bee0912b307c3926
Author: Andrei Zavada <[email protected]>
Date:   Fri Mar 15 16:18:19 2013 +0200

    distinguish hdpmm and vdpmm

diff --git a/src/ui/globals.hh b/src/ui/globals.hh
index 368798c..f487318 100644
--- a/src/ui/globals.hh
+++ b/src/ui/globals.hh
@@ -43,7 +43,8 @@ extern GString
        *__ss__;
 
 extern double
-       __dpi__;
+       __hdpmm__,
+       __vdpmm__;
 
 
 int prepare_for_expdesign();
diff --git a/src/ui/libcommon.cc b/src/ui/libcommon.cc
index 56a79d6..459dafd 100644
--- a/src/ui/libcommon.cc
+++ b/src/ui/libcommon.cc
@@ -33,7 +33,8 @@ UniqueApp
 GtkWindow
        *aghui::__main_window__;
 
-double aghui::__dpi__;
+double aghui::__hdpmm__,
+       aghui::__vdpmm__;
 
 #define AGH_UI_GRESOURCE_FILE "aghermann.gresource"
 
@@ -63,17 +64,10 @@ prepare_for_expdesign()
 
        {
                auto scr = gdk_screen_get_default();
-               double  hdpi = (double)gdk_screen_get_width ( scr) / 
gdk_screen_get_width_mm ( scr),
-                       vdpi = (double)gdk_screen_get_height( scr) / 
gdk_screen_get_height_mm( scr);
-               if ( hdpi != vdpi ) {
-                       __dpi__ = (hdpi + vdpi)/2;
-                       printf( "Calculated screen dpi is avg of (%g v, %g h) 
%g\n", hdpi, vdpi, __dpi__);
-               } else {
-                       __dpi__ = hdpi;
-                       printf( "Screen dpi is %g\n", __dpi__);
-               }
-
-               gdk_screen_set_resolution( scr, __dpi__);
+               __hdpmm__ = (double)gdk_screen_get_width ( scr) / 
gdk_screen_get_width_mm ( scr);
+               __vdpmm__ = (double)gdk_screen_get_height( scr) / 
gdk_screen_get_height_mm( scr);
+               printf( "Screen xdpmm is %g v, %g h\n", __hdpmm__, __vdpmm__);
+               gdk_screen_set_resolution( scr, (__hdpmm__ + __vdpmm__)/2);
        }
 
        GResource
diff --git a/src/ui/ui.hh b/src/ui/ui.hh
index 7c6ab2f..02bee43 100644
--- a/src/ui/ui.hh
+++ b/src/ui/ui.hh
@@ -33,9 +33,13 @@ using namespace std;
 
 namespace aghui {
 
-inline int operator"" _mm( long double v)
+inline int operator"" _hmm( long double v)
 {
-       return v * aghui::__dpi__;
+       return v * aghui::__hdpmm__;
+}
+inline int operator"" _vmm( long double v)
+{
+       return v * aghui::__vdpmm__;
 }
 
 struct SGeometry {

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to