rpms/control-center/devel add-randr12-capplet.patch, NONE, 1.1 control-center.spec, 1.327, 1.328

Soren Sandmann Pedersen (ssp) fedora-extras-commits at redhat.com
Tue Jan 29 09:37:39 UTC 2008


Author: ssp

Update of /cvs/pkgs/rpms/control-center/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31756

Modified Files:
	control-center.spec 
Added Files:
	add-randr12-capplet.patch 
Log Message:
Add randr12 capplet

add-randr12-capplet.patch:

--- NEW FILE add-randr12-capplet.patch ---
diff -up gnome-control-center-2.21.5/capplets/appearance/appearance-desktop.c.add-randr12-capplet gnome-control-center-2.21.5/capplets/appearance/appearance-desktop.c
--- gnome-control-center-2.21.5/capplets/appearance/appearance-desktop.c.add-randr12-capplet	2008-01-29 04:18:01.000000000 -0500
+++ gnome-control-center-2.21.5/capplets/appearance/appearance-desktop.c	2008-01-29 04:18:01.000000000 -0500
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <gconf/gconf-client.h>
 #include <libgnomeui/gnome-thumbnail.h>
+#define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnomeui/gnome-bg.h>
 
 typedef enum {
diff -up gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.c.add-randr12-capplet gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.c
--- gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.c.add-randr12-capplet	2008-01-15 06:43:10.000000000 -0500
+++ gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.c	2008-01-29 04:18:01.000000000 -0500
@@ -25,6 +25,7 @@
 #include <gnome.h>
 #include <string.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
+#define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnomeui/gnome-bg.h>
 
 #include "gnome-wp-item.h"
diff -up gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.h.add-randr12-capplet gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.h
--- gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.h.add-randr12-capplet	2008-01-15 06:43:10.000000000 -0500
+++ gnome-control-center-2.21.5/capplets/appearance/gnome-wp-item.h	2008-01-29 04:18:01.000000000 -0500
@@ -24,6 +24,7 @@
 #include <libgnomeui/gnome-thumbnail.h>
 #include <gnome-wp-info.h>
 #include <libgnomevfs/gnome-vfs.h>
+#define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnomeui/gnome-bg.h>
 
 #ifndef _GNOME_WP_ITEM_H_
diff -up /dev/null gnome-control-center-2.21.5/capplets/display/edid.h
--- /dev/null	2008-01-26 11:28:38.229690233 -0500
+++ gnome-control-center-2.21.5/capplets/display/edid.h	2008-01-29 04:18:01.000000000 -0500
@@ -0,0 +1,169 @@
+typedef unsigned char uchar;
+typedef struct MonitorInfo MonitorInfo;
+typedef struct Timing Timing;
+typedef struct DetailedTiming DetailedTiming;
+
+typedef enum
+{
+    UNDEFINED,
+    DVI,
+    HDMI_A,
+    HDMI_B,
+    MDDI,
+    DISPLAY_PORT
+} Interface;
+
+typedef enum
+{
+    UNDEFINED_COLOR,
+    MONOCHROME,
+    RGB,
+    OTHER_COLOR
+} ColorType;
+
+typedef enum
+{
+    NO_STEREO,
+    FIELD_RIGHT,
+    FIELD_LEFT,
+    TWO_WAY_RIGHT_ON_EVEN,
+    TWO_WAY_LEFT_ON_EVEN,
+    FOUR_WAY_INTERLEAVED,
+    SIDE_BY_SIDE
+} StereoType;
+
+struct Timing
+{
+    int width;
+    int height;
+    int frequency;
+};
+
+struct DisplayDescriptor
+{
+};
+
+struct DetailedTiming
+{
+    int		pixel_clock;
+    int		h_addr;
+    int		h_blank;
+    int		h_sync;
+    int		h_front_porch;
+    int		v_addr;
+    int		v_blank;
+    int		v_sync;
+    int		v_front_porch;
+    int		width_mm;
+    int		height_mm;
+    int		right_border;
+    int		top_border;
+    int		interlaced;
+    StereoType	stereo;
+
+    int		digital_sync;
+    union
+    {
+	struct
+	{
+	    int bipolar;
+	    int serrations;
+	    int sync_on_green;
+	} analog;
+
+	struct
+	{
+	    int composite;
+	    int serrations;
+	    int negative_vsync;
+	    int negative_hsync;
+	} digital;
+    };
+};
+
+struct MonitorInfo
+{
+    int			checksum;
+    char		manufacturer_code[4];
+    int			product_code;
+    unsigned int	serial_number;
+    
+    int			production_week;	/* -1 if not specified */
+    int			production_year;	/* -1 if not specified */
+    int			model_year;		/* -1 if not specified */
+
+    int			major_version;
+    int			minor_version;
+
+    int			is_digital;
+    
+    union
+    {
+	struct
+	{
+	    int		bits_per_primary;
+	    Interface	interface;
+	    int		rgb444;
+	    int		ycrcb444;
+	    int		ycrcb422;
+	} digital;
+
+	struct
+	{
+	    double	video_signal_level;
+	    double	sync_signal_level;
+	    double	total_signal_level;
+
+	    int		blank_to_black;
+
+	    int		separate_hv_sync;
+	    int		composite_sync_on_h;
+	    int		composite_sync_on_green;
+	    int		serration_on_vsync;
+	    ColorType	color_type;
+	} analog;
+    };
+
+    int			width_mm;		/* -1 if not specified */
+    int			height_mm;		/* -1 if not specified */
+    double		aspect_ratio;		/* -1.0 if not specififed */
+
+    double		gamma;			/* -1.0 if not specified */
+
+    int			standby;
+    int			suspend;
+    int			active_off;
+
+    int			srgb_is_standard;
+    int			preferred_timing_includes_native;
+    int			continuous_frequency;
+
+    double		red_x;
+    double		red_y;
+    double		green_x;
+    double		green_y;
+    double		blue_x;
+    double		blue_y;
+    double		white_x;
+    double		white_y;
+
+    Timing		established[24];	/* Terminated by 0x0x0 */
+    Timing		standard[8];
+    
+    int			n_detailed_timings;
+    DetailedTiming	detailed_timings[4];	/* If monitor has a preferred
+						 * mode, it is the first one
+						 * (whether it has, is
+						 * determined by the 
+						 * preferred_timing_includes
+						 * bit.
+						 */
+
+    /* Optional product description */
[...5262 lines suppressed...]
+
 bin_PROGRAMS = gnome-display-properties
 
-gnome_display_properties_SOURCES = main.c
+gnome_display_properties_SOURCES = \
+	xrandr-capplet.c	   \
+	monitor-db.c		   \
+	display-name.c		   \
+        edid-parse.c	           \
+        scrollarea.c               \
+        crtc.c                     \
+        apply.c                    \
+        foo-marshal.c		   \
+	monitor-db.h		   \
+	edid.h		           \
+        scrollarea.h               \
+        crtc.h                     \
+        apply.h                    \
+        foo-marshal.h	
+
 gnome_display_properties_LDFLAGS = -export-dynamic
 gnome_display_properties_LDADD = \
 	$(DISPLAY_CAPPLET_LIBS) \
diff -up /dev/null gnome-control-center-2.21.5/capplets/display/apply.c
--- /dev/null	2008-01-26 11:28:38.229690233 -0500
+++ gnome-control-center-2.21.5/capplets/display/apply.c	2008-01-29 04:18:01.000000000 -0500
@@ -0,0 +1,173 @@
+#include "crtc.h"
+#include "monitor-db.h"
+
+/* This file should go in g-s-d eventually */
+
+static void
+push (GPtrArray *a,
+      RWOutput *output,
+      RWMode *mode,
+      int x, int y)
+{
+    Setting *setting = g_new0 (Setting, 1);
+
+    setting->output = output;
+    setting->mode = mode;
+    setting->x = x;
+    setting->y = y;
+    
+    g_ptr_array_add (a, setting);
+}
+
+static void
+pop (GPtrArray *a)
+{
+    g_free (g_ptr_array_remove_index (a, a->len - 1));
+}
+
+typedef gboolean (* ForeachFunc) (Setting **settings, gpointer data);
+
+static gboolean
+foreach_setting_list (RWScreen *screen,
+		      GPtrArray *settings,
+		      Output **outputs,
+		      ForeachFunc func,
+		      gpointer data)
+{
+    gboolean result;
+    
+    if (*outputs == NULL)
+    {
+	g_ptr_array_add (settings, NULL);
+	
+	result = func ((Setting **)settings->pdata, data);
+
+	g_ptr_array_remove_index (settings, settings->len - 1);
+    }
+    else
+    {
+	Output *output = *outputs;	
+	RWOutput *rw_output = rw_screen_get_output_by_name (
+	    screen, output->name);
+	RWMode **modes = rw_output_list_modes (rw_output);
+	int i;
+
+	if (!output->connected)
+	{
+	    push (settings, rw_output, NULL, 0, 0);
+
+	    result = foreach_setting_list (screen, settings, outputs + 1, func, data);
+
+	    pop (settings);
+	}
+	else
+	{
+	    result = FALSE;
+	    
+	    for (i = 0; modes[i] != NULL; ++i)
+	    {
+		RWMode *mode = modes[i];
+		
+#if 0
+		g_print ("%d x %d x %d   match mode   %d x %d x %d\n",
+			 output->width, output->height, output->rate,
+			 rw_mode_get_width (mode),
+			 rw_mode_get_height (mode),
+			 rw_mode_get_freq (mode));
+#endif
+	    
+		if (rw_mode_get_width (mode) == output->width	&&
+		    rw_mode_get_height (mode) == output->height	&&
+		    rw_mode_get_freq (mode) == output->rate)
+		{
+		    push (settings, rw_output, mode, output->x, 0);
+
+		    result = foreach_setting_list (
+			screen, settings, outputs + 1, func, data);
+
+		    pop (settings);
+
+		    if (result)
+			break;
+		}
+	    }
+	}
+    }
+
+    return result;
+}
+
+static gboolean
+try_settings (Setting **settings, gpointer data)
+{
+    RWScreen *screen = data;
+    CrtcAssignment *assignment;
+    int i;
+
+    g_print ("found setting\n");
+    
+    assignment = assign_crtcs (screen, settings);
+
+    for (i = 0; settings[i] != NULL; ++i)
+    {
+	RWMode *mode = settings[i]->mode;
+	
+	g_print ("%s => ", rw_output_get_name (settings[i]->output));
+
+	if (mode)
+	{
+	    g_print ("%d x %d x %d\n",
+		     rw_mode_get_width (mode),
+		     rw_mode_get_height (mode),
+		     rw_mode_get_freq (mode));
+	}
+	else
+	{
+	    g_print ("off\n");
+	}
+    }
+    
+    if (assignment)
+    {
+	crtc_assignment_apply (assignment);
+	    
+	crtc_assignment_free (assignment);
+
+	return TRUE;
+    }
+    else
+    {
+	return FALSE;
+    }
+}
+
+/* This should go in g-s-d eventually */
+void
+apply_stored_configuration (RWScreen *screen)
+{
+    char *file = g_build_filename (
+	g_get_home_dir(), ".gnome2", "monitors.xml", NULL);
+    Configuration **configs = configurations_read (file, NULL);
+    Configuration *current = configuration_new_current (screen);
+    Configuration *found;
+
+    if ((found = configuration_find (configs, current)))
+    {
+	GPtrArray *array = g_ptr_array_new ();
+	
+	foreach_setting_list (
+	    screen, array, found->outputs,
+	    try_settings, screen);
+	
+	g_ptr_array_free (array, TRUE);
+    }
+    else
+    {
+	g_print ("Not found\n");
+    }
+
+    configuration_free (current);
+    configurations_free (configs);
+
+    g_free (file);
+}


Index: control-center.spec
===================================================================
RCS file: /cvs/pkgs/rpms/control-center/devel/control-center.spec,v
retrieving revision 1.327
retrieving revision 1.328
diff -u -r1.327 -r1.328
--- control-center.spec	22 Jan 2008 17:03:44 -0000	1.327
+++ control-center.spec	29 Jan 2008 09:36:44 -0000	1.328
@@ -22,7 +22,7 @@
 Summary: GNOME Control Center
 Name: control-center
 Version: 2.21.5
-Release: 2%{?dist}
+Release: 3%{?dist}
 Epoch: 1
 License: GPLv2+ and GFDL
 Group: User Interface/Desktops
@@ -43,6 +43,8 @@
 # change default preferred apps to programs we ship
 Patch99: default-applications.patch
 
+Patch100: add-randr12-capplet.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 
 URL: http://www.gnome.org
 
@@ -169,6 +171,8 @@
 %patch96 -p1 -b .gecos
 %patch99 -p1 -b .default-apps
 
+%patch100 -p1 -b .add-randr12-capplet
+
 %build
 
 autoreconf
@@ -345,6 +349,9 @@
 %dir %{_datadir}/gnome-control-center/keybindings
 
 %changelog
+* Tue Jan 29 2008 Soren Sandmann <sandmann at redhat.com> - 2.21.5-3
+- Add new randr 1.2 capplet
+
 * Tue Jan 22 2008  Matthias Clasen <mclasen at redhat.com> - 2.21.5-2
 - Disable font folder support
 




More information about the fedora-extras-commits mailing list