From c5f853e494e0460e91f73131f8cee737eea5af86 Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Feb 13 2008 15:48:32 +0000 Subject: Update randrwrap --- diff --git a/add-randr-12.patch b/add-randr-12.patch index e84d745..a372540 100644 --- a/add-randr-12.patch +++ b/add-randr-12.patch @@ -1,6 +1,6 @@ diff -up gnome-desktop-2.21.91/configure.in.add-randr-12 gnome-desktop-2.21.91/configure.in --- gnome-desktop-2.21.91/configure.in.add-randr-12 2008-02-11 13:38:20.000000000 -0500 -+++ gnome-desktop-2.21.91/configure.in 2008-02-12 11:55:35.000000000 -0500 ++++ gnome-desktop-2.21.91/configure.in 2008-02-13 10:36:07.000000000 -0500 @@ -51,10 +51,10 @@ AC_SUBST(GNOME_MICRO) AC_SUBST(GNOME_DISTRIBUTOR) AC_SUBST(GNOME_DATE) @@ -18,7 +18,7 @@ diff -up gnome-desktop-2.21.91/configure.in.add-randr-12 gnome-desktop-2.21.91/c diff -up gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am --- gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am.add-randr-12 2008-02-11 13:35:11.000000000 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am 2008-02-12 11:55:35.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am 2008-02-13 10:36:07.000000000 -0500 @@ -2,4 +2,7 @@ libgnomeui_desktopdir = $(includedir)/gn libgnomeui_desktop_HEADERS = \ gnome-ditem-edit.h \ @@ -29,13 +29,16 @@ diff -up gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am.add-randr + monitor-db.h + diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db.h ---- /dev/null 2008-02-12 08:56:47.229685651 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db.h 2008-02-12 11:56:43.000000000 -0500 -@@ -0,0 +1,47 @@ +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db.h 2008-02-13 10:36:07.000000000 -0500 +@@ -0,0 +1,51 @@ ++#ifndef I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA ++#error This is not for general consumption yet. ++#endif ++ +#ifndef MONITOR_DB_H +#define MONITOR_DB_H + -+#define I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#include +#include + @@ -61,6 +64,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db. + double aspect; + int pref_width; + int pref_height; ++ char * display_name; +}; + +struct Configuration @@ -80,8 +84,8 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db. + +#endif diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h ---- /dev/null 2008-02-12 08:56:47.229685651 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h 2008-02-12 11:56:43.000000000 -0500 +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h 2008-02-13 10:36:07.000000000 -0500 @@ -0,0 +1,100 @@ +#ifndef I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#error This is not yet for general consumption. @@ -184,48 +188,16 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h + +#endif diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c ---- /dev/null 2008-02-12 08:56:47.229685651 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c 2008-02-12 11:56:43.000000000 -0500 -@@ -0,0 +1,1200 @@ +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c 2008-02-13 10:36:07.000000000 -0500 +@@ -0,0 +1,1174 @@ +#include +#include +#include ++#define I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#include "libgnomeui/monitor-db.h" +#include "edid.h" + -+/* Code to load and save monitor configurations -+ * -+ * A monitor configuration is a list of monitors and associated -+ * outputs, along with information about mode and rotation. -+ * -+ * A monitor is identified by a string like EDID-SUN-0x0567 -+ * which is decoded as "We got this information from EDID" - the manufacturer -+ * was "SUN" and the product code was 0x0567. -+ * -+ * Do we put this in gconf? -+ * -+ * The database itself is an XML file with entries like this: -+ * -+ * -+ * -+ * EDID-SUN-0x0567-12341234 -+ * -+ * on -+ * 1024 -+ * 768 -+ * 0 -+ * -+ * -+ * -+ * EDID-CMO-0x1210 -+ * -+ * <...> -+ * -+ * -+ * -+ * -+ */ -+ +/* A helper wrapper around the GMarkup parser stuff */ +static gboolean parse_file_gmarkup (const gchar *file, + const GMarkupParser *parser, @@ -238,7 +210,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c +static CrtcAssignment *crtc_assignment_new (RWScreen *screen, + Output **outputs); +static void crtc_assignment_free (CrtcAssignment *assign); -+ ++static void output_free (Output *output); + +typedef struct Parser Parser; + @@ -477,21 +449,6 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c +} + +static void -+output_free (Output *output) -+{ -+ g_free (output); -+} -+ -+void -+configuration_free (Configuration *config) -+{ -+ int i; -+ -+ for (i = 0; config->outputs[i] != NULL; ++i) -+ output_free (config->outputs[i]); -+} -+ -+static void +parser_free (Parser *parser) +{ + int i; @@ -608,6 +565,8 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c + output->product = info->product_code; + output->serial = info->serial_number; + output->aspect = info->aspect_ratio; ++ output->display_name = make_display_name ( ++ rw_output_get_name (rw_output), info); + + g_free (info); + } @@ -616,6 +575,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c + strcpy (output->vendor, "???"); + output->product = 0; + output->serial = 0; ++ output->display_name = g_strdup ("Unknown"); + } + + crtc = rw_output_get_crtc (rw_output); @@ -684,6 +644,24 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c +} + +static void ++output_free (Output *output) ++{ ++ if (output->display_name) ++ g_free (output->display_name); ++ ++ g_free (output); ++} ++ ++void ++configuration_free (Configuration *config) ++{ ++ int i; ++ ++ for (i = 0; config->outputs[i] != NULL; ++i) ++ output_free (config->outputs[i]); ++} ++ ++static void +configurations_free (Configuration **configurations) +{ + int i; @@ -1388,8 +1366,8 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c + } +} diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c ---- /dev/null 2008-02-12 08:56:47.229685651 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c 2008-02-12 11:56:43.000000000 -0500 +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c 2008-02-13 10:36:07.000000000 -0500 @@ -0,0 +1,1042 @@ +#define I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#include "libgnomeui/randrwrap.h" @@ -2435,13 +2413,14 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +#endif diff -up gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/Makefile.am --- gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 2008-02-11 13:35:11.000000000 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/Makefile.am 2008-02-12 11:58:06.000000000 -0500 -@@ -20,7 +20,11 @@ libgnome_desktop_2_la_SOURCES = \ ++++ gnome-desktop-2.21.91/libgnome-desktop/Makefile.am 2008-02-13 10:37:10.000000000 -0500 +@@ -20,7 +20,12 @@ libgnome_desktop_2_la_SOURCES = \ gnome-desktop-item.c \ gnome-ditem-edit.c \ gnome-hint.c \ - gnome-bg.c + gnome-bg.c \ ++ display-name.c \ + randrwrap.c \ + monitor-db.c \ + edid-parse.c \ @@ -2449,9 +2428,9 @@ diff -up gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 gnome-d libgnome_desktop_2_la_LIBADD = \ $(XLIB_LIBS) \ -diff -up gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c ---- gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c.add-randr-12 2008-02-12 11:57:54.000000000 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c 2008-02-12 11:56:43.000000000 -0500 +diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c 2008-02-13 10:36:07.000000000 -0500 @@ -0,0 +1,551 @@ +/* + * Copyright 2007 Red Hat, Inc. @@ -3004,10 +2983,10 @@ diff -up gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c.add-randr-12 gnome- + + return info; +} -diff -up gnome-desktop-2.21.91/libgnome-desktop/edid.h.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/edid.h ---- gnome-desktop-2.21.91/libgnome-desktop/edid.h.add-randr-12 2008-02-12 11:57:47.000000000 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/edid.h 2008-02-12 11:56:43.000000000 -0500 -@@ -0,0 +1,169 @@ +diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid.h +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/edid.h 2008-02-13 10:36:07.000000000 -0500 +@@ -0,0 +1,170 @@ +typedef unsigned char uchar; +typedef struct MonitorInfo MonitorInfo; +typedef struct Timing Timing; @@ -3176,4 +3155,202 @@ diff -up gnome-desktop-2.21.91/libgnome-desktop/edid.h.add-randr-12 gnome-deskto +}; + +MonitorInfo *decode_edid (const uchar *data); -+char * make_display_name (const MonitorInfo *info); ++char * make_display_name (const char *output_name, ++ const MonitorInfo *info); +diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/display-name.c +--- /dev/null 2008-02-13 09:53:53.228642516 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/display-name.c 2008-02-13 10:36:07.000000000 -0500 +@@ -0,0 +1,193 @@ ++/* ++ * Copyright 2007 Red Hat, Inc. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * on the rights to use, copy, modify, merge, publish, distribute, sub ++ * license, and/or sell copies of the Software, and to permit persons to whom ++ * the Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER ++ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* Author: Soren Sandmann */ ++ ++#include ++#include ++#include ++#include ++#include ++#include "edid.h" ++ ++typedef struct Vendor Vendor; ++struct Vendor ++{ ++ const char vendor_id[4]; ++ const char vendor_name[28]; ++}; ++ ++/* This list of vendor codes derived from lshw ++ * ++ * http://ezix.org/project/wiki/HardwareLiSter ++ */ ++static const struct Vendor vendors[] = ++{ ++ { "AIC", "AG Neovo" }, ++ { "ACR", "Acer" }, ++ { "DEL", "DELL" }, ++ { "SAM", "SAMSUNG" }, ++ { "SNY", "SONY" }, ++ { "SEC", "Epson" }, ++ { "WAC", "Wacom" }, ++ { "NEC", "NEC" }, ++ { "CMO", "CMO" }, /* Chi Mei */ ++ ++ { "ABP", "Advansys" }, ++ { "ACC", "Accton" }, ++ { "ACE", "Accton" }, ++ { "ADP", "Adaptec" }, ++ { "ADV", "AMD" }, ++ { "AIR", "AIR" }, ++ { "AMI", "AMI" }, ++ { "ASU", "ASUS" }, ++ { "ATI", "ATI" }, ++ { "ATK", "Allied Telesyn" }, ++ { "AZT", "Aztech" }, ++ { "BAN", "Banya" }, ++ { "BRI", "Boca Research" }, ++ { "BUS", "Buslogic" }, ++ { "CCI", "Cache Computers Inc." }, ++ { "CHA", "Chase" }, ++ { "CMD", "CMD Technology, Inc." }, ++ { "COG", "Cogent" }, ++ { "CPQ", "Compaq" }, ++ { "CRS", "Crescendo" }, ++ { "CSC", "Crystal" }, ++ { "CSI", "CSI" }, ++ { "CTL", "Creative Labs" }, ++ { "DBI", "Digi" }, ++ { "DEC", "Digital Equipment" }, ++ { "DBK", "Databook" }, ++ { "EGL", "Eagle Technology" }, ++ { "ELS", "ELSA" }, ++ { "ESS", "ESS" }, ++ { "FAR", "Farallon" }, ++ { "FDC", "Future Domain" }, ++ { "HWP", "Hewlett-Packard" }, ++ { "IBM", "IBM" }, ++ { "INT", "Intel" }, ++ { "ISA", "Iomega" }, ++ { "MDG", "Madge" }, ++ { "MDY", "Microdyne" }, ++ { "MET", "Metheus" }, ++ { "MIC", "Micronics" }, ++ { "MLX", "Mylex" }, ++ { "NVL", "Novell" }, ++ { "OLC", "Olicom" }, ++ { "PRO", "Proteon" }, ++ { "RII", "Racal" }, ++ { "RTL", "Realtek" }, ++ { "SCM", "SCM" }, ++ { "SKD", "SysKonnect" }, ++ { "SGI", "SGI" }, ++ { "SMC", "SMC" }, ++ { "SNI", "Siemens Nixdorf" }, ++ { "STL", "Stallion Technologies" }, ++ { "SUN", "Sun" }, ++ { "SUP", "SupraExpress" }, ++ { "SVE", "SVEC" }, ++ { "TCC", "Thomas-Conrad" }, ++ { "TCI", "Tulip" }, ++ { "TCM", "3Com" }, ++ { "TCO", "Thomas-Conrad" }, ++ { "TEC", "Tecmar" }, ++ { "TRU", "Truevision" }, ++ { "TOS", "Toshiba" }, ++ { "TYN", "Tyan" }, ++ { "UBI", "Ungermann-Bass" }, ++ { "USC", "UltraStor" }, ++ { "VDM", "Vadem" }, ++ { "VMI", "Vermont" }, ++ { "WDC", "Western Digital" }, ++ { "ZDS", "Zeos" }, ++ { "???", "Unknown" }, ++}; ++ ++static const char * ++find_vendor (const char *code) ++{ ++ int i; ++ ++ for (i = 0; i < sizeof (vendors) / sizeof (vendors[0]); ++i) ++ { ++ const Vendor *v = &(vendors[i]); ++ ++ if (strcmp (v->vendor_id, code) == 0) ++ return v->vendor_name; ++ } ++ ++ return code; ++}; ++ ++char * ++make_display_name (const char *output_name, ++ const MonitorInfo *info) ++{ ++ const char *vendor = find_vendor (info->manufacturer_code); ++ int width_mm, height_mm, inches; ++ ++ /* This is a bit of a hack - it would be better to have X ++ * just report whether the output is a laptop panel ++ */ ++ if (output_name) ++ { ++ if (strstr ("lvds", output_name) || ++ strstr ("LVDS", output_name) || ++ strstr ("Lvds", output_name)) ++ { ++ vendor = "Laptop"; ++ } ++ } ++ ++ if (info->width_mm != -1 && info->height_mm) ++ { ++ width_mm = info->width_mm; ++ height_mm = info->height_mm; ++ } ++ else if (info->n_detailed_timings) ++ { ++ width_mm = info->detailed_timings[0].width_mm; ++ height_mm = info->detailed_timings[0].height_mm; ++ } ++ else ++ { ++ width_mm = -1; ++ height_mm = -1; ++ } ++ ++ if (width_mm != -1 && height_mm != -1) ++ { ++ double d = sqrt (width_mm * width_mm + height_mm * height_mm); ++ ++ inches = (int)(d / 25.4 + 0.5); ++ } ++ else ++ { ++ inches = -1; ++ } ++ ++ if (inches > 0) ++ return g_strdup_printf ("%s %d\"", vendor, inches); ++ else ++ return g_strdup_printf ("%s\n", vendor); ++} diff --git a/gnome-desktop.spec b/gnome-desktop.spec index e572643..ed05f98 100644 --- a/gnome-desktop.spec +++ b/gnome-desktop.spec @@ -13,7 +13,7 @@ Summary: Package containing code shared among gnome-panel, gnome-session, nautilus, etc Name: gnome-desktop Version: 2.21.91 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-desktop/2.21/%{name}-%{version}.tar.bz2 License: GPLv2+ and LGPLv2+ @@ -120,6 +120,9 @@ rm -rf $RPM_BUILD_ROOT %doc %{_datadir}/gtk-doc/html/gnome-desktop/ %changelog +* Wed Feb 13 2008 Soren Sandmann - 2.21.91-4 +- Update randrwrap + * Wed Feb 13 2008 Ray Strode - 2.21.91-3 - Get rid of gnome-vfs BuildRequires