[gnome-color-manager] Remove the X11 xrandr-output output property, no applications actually use it
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] Remove the X11 xrandr-output output property, no applications actually use it
- Date: Thu, 26 May 2011 09:43:16 +0000 (UTC)
commit 58e41a3d8f12065436dff51f261e44c4de6d7ea4
Author: Richard Hughes <richard hughsie com>
Date: Thu May 26 10:34:46 2011 +0100
Remove the X11 xrandr-output output property, no applications actually use it
src/gcm-inspect.c | 38 -------------
src/gcm-session.c | 17 ------
src/gcm-x11-output.c | 148 --------------------------------------------------
src/gcm-x11-output.h | 13 -----
4 files changed, 0 insertions(+), 216 deletions(-)
---
diff --git a/src/gcm-inspect.c b/src/gcm-inspect.c
index 63cd58d..0ae0315 100644
--- a/src/gcm-inspect.c
+++ b/src/gcm-inspect.c
@@ -72,14 +72,8 @@ gcm_inspect_show_x11_atoms (void)
{
gboolean ret;
guint8 *data = NULL;
- guint8 *data_tmp;
gsize length;
- GPtrArray *outputs;
- GcmX11Output *output;
GcmX11Screen *screen = NULL;
- guint i;
- const gchar *output_name;
- gchar *title;
GError *error = NULL;
guint major;
guint minor;
@@ -116,38 +110,6 @@ gcm_inspect_show_x11_atoms (void)
/* TRANSLATORS: the root window of all the screens */
g_print ("%s %i.%i\n", _("Root window protocol version:"), major, minor);
}
-
- /* coldplug devices */
- outputs = gcm_x11_screen_get_outputs (screen, &error);
- if (outputs == NULL) {
- ret = FALSE;
- g_warning ("failed to get outputs: %s", error->message);
- g_error_free (error);
- goto out;
- }
- for (i=0; i<outputs->len; i++) {
-
- /* get output name */
- output = g_ptr_array_index (outputs, i);
- output_name = gcm_x11_output_get_name (output);
- title = g_strdup_printf (_("Output profile '%s':"), output_name);
-
- /* get profile from XServer */
- ret = gcm_x11_output_get_profile_data (output, &data_tmp, &length, &error);
- if (!ret) {
- g_warning ("failed to get output profile data: %s", error->message);
- /* TRANSLATORS: this is when the profile has not been set */
- g_print ("%s %s\n", title, _("not set"));
- g_error_free (error);
- /* non-fatal */
- error = NULL;
- } else {
- /* TRANSLATORS: the output, i.e. the flat panel */
- gcm_inspect_print_data_info (title, data_tmp, length);
- g_free (data_tmp);
- }
- g_free (title);
- }
out:
g_free (data);
if (screen != NULL)
diff --git a/src/gcm-session.c b/src/gcm-session.c
index 30e0345..1b35a56 100644
--- a/src/gcm-session.c
+++ b/src/gcm-session.c
@@ -452,15 +452,6 @@ gcm_session_device_assign (GcmSessionPrivate *priv, CdDevice *device)
error->message);
g_clear_error (&error);
- /* clear the _ICC_PROFILE atom if not logging in */
- ret = gcm_x11_output_remove_profile (output,
- &error);
- if (!ret) {
- g_warning ("failed to clear screen _ICC_PROFILE: %s",
- error->message);
- g_clear_error (&error);
- }
-
/* the default output? */
if (gcm_x11_output_get_primary (output)) {
ret = gcm_x11_screen_remove_profile (priv->x11_screen,
@@ -516,14 +507,6 @@ gcm_session_device_assign (GcmSessionPrivate *priv, CdDevice *device)
g_clear_error (&error);
}
}
- ret = gcm_x11_output_set_profile (output,
- filename,
- &error);
- if (!ret) {
- g_warning ("failed to set output _ICC_PROFILE: %s",
- error->message);
- g_clear_error (&error);
- }
/* create a vcgt for this icc file */
ret = cd_profile_get_has_vcgt (profile);
diff --git a/src/gcm-x11-output.c b/src/gcm-x11-output.c
index 84b4309..0e34cf9 100644
--- a/src/gcm-x11-output.c
+++ b/src/gcm-x11-output.c
@@ -416,154 +416,6 @@ gcm_x11_output_get_gamma (GcmX11Output *output,
return TRUE;
}
-gboolean
-gcm_x11_output_get_profile_data (GcmX11Output *output,
- guint8 **data,
- gsize *length,
- GError **error)
-{
- gboolean ret = FALSE;
- gchar *data_tmp = NULL;
- gint format;
- gint rc = -1;
- gulong bytes_after;
- gulong nitems = 0;
- Atom atom;
- Atom type;
- GcmX11OutputPrivate *priv = output->priv;
-
- g_return_val_if_fail (GCM_IS_X11_OUTPUT (output), FALSE);
- g_return_val_if_fail (data != NULL, FALSE);
-
- /* get the value */
- gdk_error_trap_push ();
- atom = XInternAtom (priv->display, "_ICC_PROFILE", FALSE);
- rc = XRRGetOutputProperty (priv->display, priv->id,
- atom, 0, ~0, False, False,
- AnyPropertyType, &type, &format, &nitems, &bytes_after,
- (unsigned char **) &data_tmp);
- g_debug ("got %i bytes", (guint) nitems);
- gdk_error_trap_pop_ignored ();
-
- /* did the call fail */
- if (rc != Success) {
- g_set_error (error, 1, 0,
- "failed to get icc profile atom with rc %i", rc);
- goto out;
- }
-
- /* was nothing found */
- if (nitems == 0) {
- g_set_error (error, 1, 0,
- "icc profile atom has not been set");
- goto out;
- }
-
- /* allocate the data using Glib */
- *data = g_new0 (guint8, nitems);
- memcpy (*data, data_tmp, nitems);
-
- /* copy the length */
- if (length != NULL)
- *length = nitems;
-
- /* success */
- ret = TRUE;
-out:
- if (data_tmp != NULL)
- XFree (data_tmp);
- return ret;
-}
-
-gboolean
-gcm_x11_output_set_profile (GcmX11Output *output,
- const gchar *filename,
- GError **error)
-{
- gboolean ret;
- gchar *data = NULL;
- gsize length;
-
- g_return_val_if_fail (GCM_IS_X11_OUTPUT (output), FALSE);
- g_return_val_if_fail (filename != NULL, FALSE);
-
- g_debug ("setting output ICC profile atom from %s", filename);
-
- /* get contents of file */
- ret = g_file_get_contents (filename, &data, &length, error);
- if (!ret)
- goto out;
-
- /* send to the XServer */
- ret = gcm_x11_output_set_profile_data (output, (const guint8 *) data, length, error);
- if (!ret)
- goto out;
-out:
- g_free (data);
- return ret;
-}
-
-gboolean
-gcm_x11_output_set_profile_data (GcmX11Output *output, const guint8 *data, gsize length, GError **error)
-{
- gboolean ret = FALSE;
- gint rc;
- Atom atom = None;
- GcmX11OutputPrivate *priv = output->priv;
-
- g_return_val_if_fail (GCM_IS_X11_OUTPUT (output), FALSE);
- g_return_val_if_fail (data != NULL, FALSE);
- g_return_val_if_fail (length != 0, FALSE);
-
- /* get the value */
- gdk_error_trap_push ();
- atom = XInternAtom (priv->display, "_ICC_PROFILE", FALSE);
- XRRChangeOutputProperty (priv->display, priv->id,
- atom, XA_CARDINAL, 8,
- PropModeReplace,
- (unsigned char*) data, (gint)length);
- rc = gdk_error_trap_pop ();
-
- /* did the call fail */
- if (rc != Success) {
- g_set_error (error, 1, 0, "failed to set output icc profile atom with rc %i", rc);
- goto out;
- }
-
- /* success */
- ret = TRUE;
-out:
- return ret;
-}
-
-gboolean
-gcm_x11_output_remove_profile (GcmX11Output *output, GError **error)
-{
- gboolean ret = FALSE;
- gint rc;
- Atom atom;
- GcmX11OutputPrivate *priv = output->priv;
-
- g_return_val_if_fail (GCM_IS_X11_OUTPUT (output), FALSE);
-
- /* get the value */
- gdk_error_trap_push ();
- atom = XInternAtom (priv->display, "_ICC_PROFILE", FALSE);
- XRRDeleteOutputProperty (priv->display, priv->id, atom);
- rc = gdk_error_trap_pop ();
-
- /* did the call fail */
- if (rc != Success) {
- g_set_error (error, 1, 0, "failed to remove output icc profile atom with rc %i", rc);
- goto out;
- }
-
- /* success */
- ret = TRUE;
-out:
- return ret;
-}
-
static void
gcm_x11_output_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
diff --git a/src/gcm-x11-output.h b/src/gcm-x11-output.h
index cae4b2d..40bc4d7 100644
--- a/src/gcm-x11-output.h
+++ b/src/gcm-x11-output.h
@@ -102,19 +102,6 @@ gboolean gcm_x11_output_set_gamma_from_clut (GcmX11Output *output,
GError **error);
GcmEdid *gcm_x11_output_get_edid (GcmX11Output *output,
GError **error);
-gboolean gcm_x11_output_get_profile_data (GcmX11Output *output,
- guint8 **data,
- gsize *length,
- GError **error);
-gboolean gcm_x11_output_set_profile_data (GcmX11Output *output,
- const guint8 *data,
- gsize length,
- GError **error);
-gboolean gcm_x11_output_set_profile (GcmX11Output *output,
- const gchar *filename,
- GError **error);
-gboolean gcm_x11_output_remove_profile (GcmX11Output *output,
- GError **error);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]