To: lablgtk at kaba.or.jp Cc: nicolas.francois at free.fr Subject: Re: Aspect Ratio problem In-Reply-To: <20030528202752.GA22120 at clipper.ens.fr> References: <200305281326.22495.stalkern2 at tin.it> <20030529002345.1b4d362d.nicolas.francois@free.fr> <20030528202752.GA22120@clipper.ens.fr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-Id: <20030529090706H.garrigue at kurims.kyoto-u.ac.jp> Date: Thu, 29 May 2003 09:07:06 +0900 From: Jacques Garrigue Lines: 100 From: Nicolas George > Le decadi 10 prairial, an CCXI, Nicolas FRANCOIS a =E9crit=A0: > > No it isn't. Try it by yourself : download my drgeocaml, compile it = and > > run it in say 1280*1024, which is my actual resolution although it d= oesn't > > respect the classical aspect ratio (which would be something like > > 1280*960). The right angles don't look right, and thez circles are > > ellipses. > = > Gdk provides the two functions gdk_screen_width_mm and > gdk_screen_height_mm. LablGtk does not have stubs for them, but it has= > stubs for gdk_screen_width and gdk_screen_height, it should be > straightforward to add the necessary. You're right. LablGTK tries to be exhaustive on GTK functionnality, but not on GDK. This was not so clear what would be useful in GDK, but actually people appear to be using pretty much of it... > Of course, you will need that your X11 server knows the right size of > the screen. Good luck. On my sub-A4 laptop, this returned 347x260. Doesn't seem correct... But if all you want is the aspect ratio, this may work better. Anyway, I join a trivial patch to add this functionality. ------------------------------------------------------------------------= --- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac= .jp JG Index: src/gdk.ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /staff2/garrigue/repos/lablgtk/src/gdk.ml,v retrieving revision 1.57.2.1 diff -c -r1.57.2.1 gdk.ml *** src/gdk.ml 15 May 2003 14:19:22 -0000 1.57.2.1 --- src/gdk.ml 29 May 2003 00:02:02 -0000 *************** *** 121,126 **** --- 121,128 ---- module Screen =3D struct external width : unit -> int =3D "ml_gdk_screen_width" external height : unit -> int =3D "ml_gdk_screen_height" + external width_mm : unit -> int =3D "ml_gdk_screen_width_mm" + external height_mm : unit -> int =3D "ml_gdk_screen_height_mm" end = module Visual =3D struct Index: src/gdk.mli =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /staff2/garrigue/repos/lablgtk/src/gdk.mli,v retrieving revision 1.31.2.1 diff -c -r1.31.2.1 gdk.mli *** src/gdk.mli 15 May 2003 14:19:22 -0000 1.31.2.1 --- src/gdk.mli 29 May 2003 00:02:02 -0000 *************** *** 88,93 **** --- 88,95 ---- sig external width : unit -> int =3D "ml_gdk_screen_width" external height : unit -> int =3D "ml_gdk_screen_height" + external width_mm : unit -> int =3D "ml_gdk_screen_width_mm" + external height_mm : unit -> int =3D "ml_gdk_screen_height_mm" end = module Visual : Index: src/ml_gdk.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /staff2/garrigue/repos/lablgtk/src/ml_gdk.c,v retrieving revision 1.59.2.3 diff -c -r1.59.2.3 ml_gdk.c *** src/ml_gdk.c 15 May 2003 14:19:36 -0000 1.59.2.3 --- src/ml_gdk.c 29 May 2003 00:02:03 -0000 *************** *** 48,53 **** --- 48,55 ---- /* Screen geometry */ ML_0 (gdk_screen_width, Val_int) ML_0 (gdk_screen_height, Val_int) + ML_0 (gdk_screen_width_mm, Val_int) + ML_0 (gdk_screen_height_mm, Val_int) = /* Visual */ CAMLprim value ml_gdk_visual_get_best (value depth, value type)