Re: screen resolution?
- From: Alexander Larsson <alla lysator liu se>
- To: Owen Taylor <otaylor gtk org>
- cc: gtk-list redhat com
- Subject: Re: screen resolution?
- Date: Sat, 23 May 1998 22:37:51 +0300
> A patch with similar functions to return the screen resolution
> would be gladly accepted.
>
> [ Computed from the Xlib macros Width/HeightMMOfScreen(screen) -
> perhaps just gdk_screen_[width/height]_mm() functions ]
>
Ok... Here goes: (unified diff)
--- gdk.h.orig Sat May 23 22:04:42 1998
+++ gdk.h Sat May 23 22:10:12 1998
@@ -86,6 +86,9 @@
gint gdk_screen_width (void);
gint gdk_screen_height (void);
+gint gdk_screen_width_mm (void);
+gint gdk_screen_height_mm (void);
+
void gdk_flush (void);
void gdk_beep (void);
--- gdk.c.orig Sat May 23 22:04:02 1998
+++ gdk.c Sat May 23 22:09:28 1998
@@ -1497,6 +1497,56 @@
return return_val;
}
+/*
+ *--------------------------------------------------------------
+ * gdk_screen_width_mm
+ *
+ * Return the width of the screen in millimeters.
+ *
+ * Arguments:
+ *
+ * Results:
+ *
+ * Side effects:
+ *
+ *--------------------------------------------------------------
+ */
+
+gint
+gdk_screen_width_mm (void)
+{
+ gint return_val;
+
+ return_val = DisplayWidthMM (gdk_display, gdk_screen);
+
+ return return_val;
+}
+
+/*
+ *--------------------------------------------------------------
+ * gdk_screen_height
+ *
+ * Return the height of the screen in millimeters.
+ *
+ * Arguments:
+ *
+ * Results:
+ *
+ * Side effects:
+ *
+ *--------------------------------------------------------------
+ */
+
+gint
+gdk_screen_height_mm (void)
+{
+ gint return_val;
+
+ return_val = DisplayHeightMM (gdk_display, gdk_screen);
+
+ return return_val;
+}
+
void
gdk_key_repeat_disable (void)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]