[Gtk-sharp-list] [Patch] Gdk.Screen stuff
Charles Iliya Krempeaux
charles@reptile.ca
21 Apr 2003 08:50:06 -0700
--=-8dqTyBm5X91FVoFGG/U9
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hello,
With Gdk.Screen, right now, we have procedures that tell us the
width and height of the screen. They are:
Gdk.Screen.Width()
Gdk.Screen.Height()
Gdk.Screen.WidthMm()
Gdk.Screen.HeightMm()
To make them more .NET-ish, they should be class properties
instead.
This patch does that. (Ideally though, it would have been nice,
if I could have just told the Gdk.metadata file to turn these
into properties... but I didn't think I could, so I just hid
them, and made a "gdk/Screen.custom" file.
Is it OK to commit this?
See ya
--
Charles Iliya Krempeaux, BSc
charles@reptile.ca
________________________________________________________________________
Reptile Consulting & Services 604-REPTILE http://www.reptile.ca/
--=-8dqTyBm5X91FVoFGG/U9
Content-Disposition: attachment; filename=gtk-sharp-GdkScreen.diff
Content-Type: text/x-patch; name=gtk-sharp-GdkScreen.diff; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Index: ChangeLog
=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: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.382
diff -u -r1.382 ChangeLog
--- ChangeLog 21 Apr 2003 15:31:08 -0000 1.382
+++ ChangeLog 21 Apr 2003 15:45:38 -0000
@@ -1,3 +1,14 @@
+2003-04-21 Charles Iliya Krempeaux <charles@reptile.ca>
+
+ * sources/Gdk.metadata : Made it so the old Screen
+ (static) procedures are hidden.
+ * api/gtk-api.xml : The new one generated from the
+ the new "sources/Gdk.metadata".
+ * gdk/Screen.custom : Added this file, to turn
+ Gdk.Screen.Height, Gdk.Screen.HeightMm,
+ Gdk.Screen.Width, Gdk.Screen.WidthMm into
+ class properties.
+
2003-04-16 Charles Iliya Krempeaux <charles@reptile.ca>
=20
* gdk/EventKey.custom : Created it so that there
Index: api/gdk-api.xml
=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: /cvs/public/gtk-sharp/api/gdk-api.xml,v
retrieving revision 1.17
diff -u -r1.17 gdk-api.xml
--- api/gdk-api.xml 14 Apr 2003 18:01:28 -0000 1.17
+++ api/gdk-api.xml 21 Apr 2003 15:45:40 -0000
@@ -1,4 +1,4 @@
-<?xml version=3D"1.0"?>
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<api>
<!--
=20
@@ -1502,8 +1502,8 @@
<callback cname=3D"child_func">
<return-type type=3D"gboolean"/>
<parameters>
- <parameter type=3D"" name=3D""/>
- <parameter type=3D"" name=3D""/>
+ <parameter type=3D" gboolean " name=3D"child_func"/>
+ <parameter type=3D" gboolean " name=3D"child_func"/>
</parameters>
</callback>
<parameter type=3D"gpointer" name=3D"user_data"/>
@@ -2270,16 +2270,16 @@
</constructor>
</struct>
<struct name=3D"Screen" cname=3D"GdkScreen" opaque=3D"true">
- <method name=3D"Height" cname=3D"gdk_screen_height" shared=3D"true">
+ <method name=3D"Height" cname=3D"gdk_screen_height" shared=3D"true" =
hidden=3D"1">
<return-type type=3D"gint"/>
</method>
- <method name=3D"HeightMm" cname=3D"gdk_screen_height_mm" shared=3D"t=
rue">
+ <method name=3D"HeightMm" cname=3D"gdk_screen_height_mm" shared=3D"t=
rue" hidden=3D"1">
<return-type type=3D"gint"/>
</method>
- <method name=3D"Width" cname=3D"gdk_screen_width" shared=3D"true">
+ <method name=3D"Width" cname=3D"gdk_screen_width" shared=3D"true" hi=
dden=3D"1">
<return-type type=3D"gint"/>
</method>
- <method name=3D"WidthMm" cname=3D"gdk_screen_width_mm" shared=3D"tru=
e">
+ <method name=3D"WidthMm" cname=3D"gdk_screen_width_mm" shared=3D"tru=
e" hidden=3D"1">
<return-type type=3D"gint"/>
</method>
</struct>
Index: gdk/Screen.custom
=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: gdk/Screen.custom
diff -N gdk/Screen.custom
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdk/Screen.custom 21 Apr 2003 15:45:42 -0000
@@ -0,0 +1,61 @@
+//
+// gdk/Screen.custom
+//
+// Author: Charles Iliya Krempeaux <charles@reptile.ca>
+//
+// Copyright (C) 2003 Reptile Consulting & Services Ltd.
+// Copyright (C) 2003 Charles Iliya Krempeaux.
+//
+
+
+ [DllImport("libgdk-win32-2.0-0.dll")]
+ static extern int gdk_screen_height();
+
+ public static int Height {
+ get {
+ int raw_ret =3D gdk_screen_height();
+ int ret =3D raw_ret;
+ return ret;
+ }
+ }
+
+
+
+ [DllImport("libgdk-win32-2.0-0.dll")]
+ static extern int gdk_screen_height_mm();
+
+ public static int HeightMm {
+ get {
+ int raw_ret =3D gdk_screen_height_mm();
+ int ret =3D raw_ret;
+ return ret;
+ }
+ }
+
+
+
+ [DllImport("libgdk-win32-2.0-0.dll")]
+ static extern int gdk_screen_width_mm();
+
+ public static int WidthMm {
+ get {
+ int raw_ret =3D gdk_screen_width_mm();
+ int ret =3D raw_ret;
+ return ret;
+ }
+ }
+
+
+
+ [DllImport("libgdk-win32-2.0-0.dll")]
+ static extern int gdk_screen_width();
+
+ public static int Width {
+ get {
+ int raw_ret =3D gdk_screen_width();
+ int ret =3D raw_ret;
+ return ret;
+ }
+ }
+
+
Index: sources/Gdk.metadata
=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: /cvs/public/gtk-sharp/sources/Gdk.metadata,v
retrieving revision 1.15
diff -u -r1.15 Gdk.metadata
--- sources/Gdk.metadata 14 Apr 2003 18:01:28 -0000 1.15
+++ sources/Gdk.metadata 21 Apr 2003 15:45:42 -0000
@@ -245,4 +245,52 @@
</attribute>
</data>
</rule>
+
+
+
+<rule>
+ <class name=3D"GdkScreen">
+ <method>Height</method>
+ </class>
+ <data>
+ <attribute target=3D"method">
+ <name>hidden</name>
+ <value>1</value>
+ </attribute>
+ </data>
+</rule>
+<rule>
+ <class name=3D"GdkScreen">
+ <method>HeightMm</method>
+ </class>
+ <data>
+ <attribute target=3D"method">
+ <name>hidden</name>
+ <value>1</value>
+ </attribute>
+ </data>
+</rule>
+<rule>
+ <class name=3D"GdkScreen">
+ <method>Width</method>
+ </class>
+ <data>
+ <attribute target=3D"method">
+ <name>hidden</name>
+ <value>1</value>
+ </attribute>
+ </data>
+</rule>
+<rule>
+ <class name=3D"GdkScreen">
+ <method>WidthMm</method>
+ </class>
+ <data>
+ <attribute target=3D"method">
+ <name>hidden</name>
+ <value>1</value>
+ </attribute>
+ </data>
+</rule>
+
</metadata>
--=-8dqTyBm5X91FVoFGG/U9--