Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

da fox

By: a guest on Oct 29th, 2007  |  syntax: None  |  size: 19.85 KB  |  views: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -ur xfdesktop-4.4.1.orig/po/en_GB.po xfdesktop-4.4.1/po/en_GB.po
  2. --- xfdesktop-4.4.1.orig/po/en_GB.po    2007-04-09 16:35:35.000000000 +0200
  3. +++ xfdesktop-4.4.1/po/en_GB.po 2007-10-29 22:01:05.000000000 +0100
  4.  -633,9 +633,22 @@
  5.  msgid "Scaled"
  6.  msgstr "Scaled"
  7.  
  8. -#: ../settings/appearance-settings.c:796
  9. -msgid "A_djust Brightness:"
  10. -msgstr "A_djust Brightness:"
  11. +#: ../settings/appearance-settings.c:741
  12. +msgid "Maxpect"
  13. +msgstr "Maxpect"
  14. +
  15. +
  16. +#: ../settings/appearance-settings.c:845
  17. +msgid "Adjust _Brightness:"
  18. +msgstr "Adjust _Brightness:"
  19. +
  20. +#: ../settings/appearance-settings.c:873
  21. +msgid "Adjust _Saturation:"
  22. +msgstr "Adjust _Saturation:"
  23. +
  24. +#: ../settings/appearance-settings.c:901
  25. +msgid "Adjust _Hue:"
  26. +msgstr "Adjust _Hue:"
  27.  
  28.  #: ../settings/appearance-settings.c:854
  29.  #, c-format
  30. diff -ur xfdesktop-4.4.1.orig/settings/appearance-settings.c xfdesktop-4.4.1/settings/appearance-settings.c
  31. --- xfdesktop-4.4.1.orig/settings/appearance-settings.c 2007-03-11 14:43:58.000000000 +0100
  32. +++ xfdesktop-4.4.1/settings/appearance-settings.c      2007-10-29 20:48:44.000000000 +0100
  33.  -235,6 +235,30 @@
  34.                          BACKDROP_CHANNEL, bp->brightness);
  35.              }
  36.  
  37. +            /* saturation */
  38. +            g_snprintf(setting_name, 128, "saturation_%d_%d", i, j);
  39. +            setting = mcs_manager_setting_lookup(mcs_plugin->manager, setting_name,
  40. +                    BACKDROP_CHANNEL);
  41. +            if(setting)
  42. +                bp->saturation = setting->data.v_int;
  43. +            else {
  44. +                bp->saturation = 0;
  45. +                mcs_manager_set_int(mcs_plugin->manager, setting_name,
  46. +                        BACKDROP_CHANNEL, bp->saturation);
  47. +            }
  48. +
  49. +            /* hue */
  50. +            g_snprintf(setting_name, 128, "hue_%d_%d", i, j);
  51. +            setting = mcs_manager_setting_lookup(mcs_plugin->manager, setting_name,
  52. +                    BACKDROP_CHANNEL);
  53. +            if(setting)
  54. +                bp->hue = setting->data.v_int;
  55. +            else {
  56. +                bp->hue = 0;
  57. +                mcs_manager_set_int(mcs_plugin->manager, setting_name,
  58. +                        BACKDROP_CHANNEL, bp->hue);
  59. +            }
  60. +
  61.              /* color 1 */
  62.              g_snprintf(setting_name, 128, "color1_%d_%d", i, j);
  63.              setting = mcs_manager_setting_lookup(mcs_plugin->manager, setting_name,
  64.  -738,6 +762,7 @@
  65.      gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Tiled"));
  66.      gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Stretched"));
  67.      gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Scaled"));
  68. +    gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Maxpect"));
  69.      gtk_combo_box_set_active(GTK_COMBO_BOX(combo), bp->style);
  70.      gtk_label_set_mnemonic_widget(GTK_LABEL(label), combo);
  71.      gtk_widget_show(combo);
  72.  -768,7 +793,7 @@
  73.  update_brightness(GtkRange *w, BackdropPanel *bp)
  74.  {
  75.      gchar setting_name[128];
  76. -
  77. +
  78.      bp->brightness = gtk_range_get_value(w);
  79.      g_snprintf(setting_name, 128, "brightness_%d_%d", bp->xscreen, bp->monitor);
  80.      mcs_manager_set_int(bp->bd->plugin->manager, setting_name, BACKDROP_CHANNEL,
  81.  -776,6 +801,30 @@
  82.      mcs_manager_notify(bp->bd->plugin->manager, BACKDROP_CHANNEL);
  83.  }
  84.  
  85. +static void
  86. +update_saturation(GtkRange *w, BackdropPanel *bp)
  87. +{
  88. +    gchar setting_name[128];
  89. +
  90. +    bp->saturation = gtk_range_get_value(w);
  91. +    g_snprintf(setting_name, 128, "saturation_%d_%d", bp->xscreen, bp->monitor);
  92. +    mcs_manager_set_int(bp->bd->plugin->manager, setting_name, BACKDROP_CHANNEL,
  93. +            bp->saturation);
  94. +    mcs_manager_notify(bp->bd->plugin->manager, BACKDROP_CHANNEL);
  95. +}
  96. +
  97. +static void
  98. +update_hue(GtkRange *w, BackdropPanel *bp)
  99. +{
  100. +    gchar setting_name[128];
  101. +
  102. +    bp->hue = gtk_range_get_value(w);
  103. +    g_snprintf(setting_name, 128, "hue_%d_%d", bp->xscreen, bp->monitor);
  104. +    mcs_manager_set_int(bp->bd->plugin->manager, setting_name, BACKDROP_CHANNEL,
  105. +            bp->hue);
  106. +    mcs_manager_notify(bp->bd->plugin->manager, BACKDROP_CHANNEL);
  107. +}
  108. +
  109.  /* this is a workaround for a gtk bug.  it seems that if you move the slider
  110.   * around a bit, and try to go back to zero, you often get "-0" displayed */
  111.  static gchar *
  112.  -793,7 +842,7 @@
  113.      gtk_widget_show(hbox);
  114.      gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
  115.  
  116. -    label = gtk_label_new_with_mnemonic(_("A_djust Brightness:"));
  117. +    label = gtk_label_new_with_mnemonic(_("Adjust _Brightness:"));
  118.      gtk_widget_show(label);
  119.      gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 4);
  120.  
  121.  -812,6 +861,62 @@
  122.              G_CALLBACK(hscale_format), NULL);
  123.  }
  124.  
  125. +static void
  126. +add_saturation_slider(GtkWidget *vbox, BackdropPanel *bp)
  127. +{
  128. +    GtkWidget *label, *hbox, *hscale;
  129. +
  130. +    hbox = gtk_hbox_new(FALSE, BORDER);
  131. +    gtk_widget_show(hbox);
  132. +    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
  133. +
  134. +    label = gtk_label_new_with_mnemonic(_("Adjust _Saturation:"));
  135. +    gtk_widget_show(label);
  136. +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 4);
  137. +
  138. +    hscale = gtk_hscale_new_with_range(-128, 127, 1);
  139. +    gtk_label_set_mnemonic_widget(GTK_LABEL(label), hscale);
  140. +    gtk_scale_set_draw_value(GTK_SCALE(hscale), TRUE);
  141. +    gtk_scale_set_value_pos(GTK_SCALE(hscale), GTK_POS_RIGHT);
  142. +    gtk_range_set_increments(GTK_RANGE(hscale), 1, 5);
  143. +    gtk_range_set_value(GTK_RANGE(hscale), bp->saturation);
  144. +    gtk_range_set_update_policy(GTK_RANGE(hscale), GTK_UPDATE_DISCONTINUOUS);
  145. +    gtk_widget_show(hscale);
  146. +    gtk_box_pack_start(GTK_BOX(hbox), hscale, TRUE, TRUE, 4);
  147. +    g_signal_connect(G_OBJECT(hscale), "value-changed",
  148. +            G_CALLBACK(update_saturation), bp);
  149. +    g_signal_connect(G_OBJECT(hscale), "format-value",
  150. +            G_CALLBACK(hscale_format), NULL);
  151. +}
  152. +
  153. +static void
  154. +add_hue_slider(GtkWidget *vbox, BackdropPanel *bp)
  155. +{
  156. +    GtkWidget *label, *hbox, *hscale;
  157. +
  158. +    hbox = gtk_hbox_new(FALSE, BORDER);
  159. +    gtk_widget_show(hbox);
  160. +    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
  161. +
  162. +    label = gtk_label_new_with_mnemonic(_("Adjust _Hue:"));
  163. +    gtk_widget_show(label);
  164. +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 4);
  165. +
  166. +    hscale = gtk_hscale_new_with_range(0, 359, 1);
  167. +    gtk_label_set_mnemonic_widget(GTK_LABEL(label), hscale);
  168. +    gtk_scale_set_draw_value(GTK_SCALE(hscale), TRUE);
  169. +    gtk_scale_set_value_pos(GTK_SCALE(hscale), GTK_POS_RIGHT);
  170. +    gtk_range_set_increments(GTK_RANGE(hscale), 1, 5);
  171. +    gtk_range_set_value(GTK_RANGE(hscale), bp->hue);
  172. +    gtk_range_set_update_policy(GTK_RANGE(hscale), GTK_UPDATE_DISCONTINUOUS);
  173. +    gtk_widget_show(hscale);
  174. +    gtk_box_pack_start(GTK_BOX(hbox), hscale, TRUE, TRUE, 4);
  175. +    g_signal_connect(G_OBJECT(hscale), "value-changed",
  176. +            G_CALLBACK(update_hue), bp);
  177. +    g_signal_connect(G_OBJECT(hscale), "format-value",
  178. +            G_CALLBACK(hscale_format), NULL);
  179. +}
  180. +
  181.  #if 0
  182.  void
  183.  toggle_set_background(GtkToggleButton *tb, BackdropPanel *bp)
  184.  -1218,6 +1323,12 @@
  185.  
  186.              /* image brightness */
  187.              add_brightness_slider(page, bp);
  188. +
  189. +            /* image saturation */
  190. +            add_saturation_slider(page, bp);
  191. +
  192. +            /* image hue */
  193. +            add_hue_slider(page, bp);
  194.  
  195.              add_spacer(GTK_BOX(page));
  196.  
  197. diff -ur xfdesktop-4.4.1.orig/settings/settings-common.h xfdesktop-4.4.1/settings/settings-common.h
  198. --- xfdesktop-4.4.1.orig/settings/settings-common.h     2007-01-25 21:53:23.000000000 +0100
  199. +++ xfdesktop-4.4.1/settings/settings-common.h  2007-10-29 20:39:51.000000000 +0100
  200.  -61,6 +61,8 @@
  201.      gchar *image_path;
  202.      XfceBackdropImageStyle style;
  203.      gint brightness;
  204. +    gint saturation;
  205. +    gint hue;
  206.  
  207.      /* the notebook page */
  208.      GtkWidget *page;
  209. diff -ur xfdesktop-4.4.1.orig/src/xfce-backdrop.c xfdesktop-4.4.1/src/xfce-backdrop.c
  210. --- xfdesktop-4.4.1.orig/src/xfce-backdrop.c    2007-03-11 14:43:58.000000000 +0100
  211. +++ xfdesktop-4.4.1/src/xfce-backdrop.c 2007-10-29 21:49:40.000000000 +0100
  212.  -55,6 +55,8 @@
  213.      gchar *image_path;
  214.  
  215.      gint brightness;
  216. +    gint saturation;
  217. +    gint hue;
  218.  };
  219.  
  220.  enum {
  221.  -113,6 +115,135 @@
  222.  }
  223.  
  224.  static GdkPixbuf *
  225. +adjust_saturation(GdkPixbuf *src, gint amount)
  226. +{
  227. +    g_return_val_if_fail(src != NULL, NULL);
  228. +    if(amount == 0)
  229. +        return src;
  230. +    GdkPixbuf *newpix = gdk_pixbuf_copy(src);
  231. +    gdk_pixbuf_saturate_and_pixelate(src, newpix, ((gdouble)(amount+128))/127.5f, FALSE);
  232. +    g_object_unref(G_OBJECT(src));
  233. +    return newpix;
  234. +}
  235. +
  236. +static GdkPixbuf *
  237. +adjust_hue(GdkPixbuf *src, gint amount)
  238. +{
  239. +    g_return_val_if_fail(src != NULL, NULL);
  240. +    if(amount == 0)
  241. +        return src;
  242. +    GdkPixbuf *newpix;
  243. +    GdkPixdata pdata;
  244. +    gboolean has_alpha = FALSE;
  245. +    gint i, len;
  246. +    GError *err = NULL;
  247. +
  248. +    g_return_val_if_fail(src != NULL, NULL);
  249. +    if(amount == 0)
  250. +        return src;
  251. +
  252. +    gdk_pixdata_from_pixbuf(&pdata, src, FALSE);
  253. +    has_alpha = (pdata.pixdata_type & GDK_PIXDATA_COLOR_TYPE_RGBA);
  254. +    if(pdata.length < 1)
  255. +        len = pdata.width * pdata.height * (has_alpha?4:3);
  256. +    else
  257. +        len = pdata.length - GDK_PIXDATA_HEADER_LENGTH;
  258. +
  259. +    gint iInc=(has_alpha?4:3);
  260. +    for(i = 0; i < len; i+=iInc) {
  261. +        /* Get RGB pixel */
  262. +        gint r,g,b;
  263. +        r = pdata.pixel_data[i+0];
  264. +        g = pdata.pixel_data[i+1];
  265. +        b = pdata.pixel_data[i+2];
  266. +
  267. +        /* Convert into HSV colorspace */
  268. +        gint min, max;
  269. +        min = MIN( r, MIN(g, b));
  270. +        max = MAX( r, MAX(g, b));
  271. +
  272. +        gdouble h,s,v;
  273. +        if(min == max)
  274. +          h = 0; else
  275. +        if(max == r && g >= b )
  276. +          h = 60.0f * ((gdouble)(g - b))/((gdouble)(max - min)) + 0.0f; else
  277. +        if(max == r && g < b )
  278. +          h = 60.0f * ((gdouble)(g - b))/((gdouble)(max - min)) + 360.0f; else
  279. +        if(max == g)
  280. +          h = 60.0f * ((gdouble)(b - r))/((gdouble)(max - min)) + 120.0f; else
  281. +        if(max == b)
  282. +          h = 60.0f * ((gdouble)(r - g))/((gdouble)(max - min)) + 240.0f;
  283. +
  284. +        s = max == 0 ? 0.0f : 1.0f - (((gdouble)min)/((gdouble)max));
  285. +        v = ((gdouble)max)/255.0f;
  286. +
  287. +        /* Shift h by amount */
  288. +        h += amount;
  289. +        while(h>=360.0f) h -= 360.0f;
  290. +
  291. +        /* convert HSV back to RGB */
  292. +        gdouble f, p, q, t;
  293. +        gint hi;
  294. +        hi = ((int)(h/60.0f))%6;
  295. +        f = (h/60.0f) - ((gdouble)hi);
  296. +        p = v * (1.0f - s);
  297. +        q = v * (1.0f - (f * s));
  298. +        t = v * (1.0f - ((1.0f - f) * s));
  299. +
  300. +        switch( hi ) {
  301. +          case 0:
  302. +            r = v * 255.0f;
  303. +            g = t * 255.0f;
  304. +            b = p * 255.0f;
  305. +            break;
  306. +          case 1:
  307. +            r = q * 255.0f;
  308. +            g = v * 255.0f;
  309. +            b = p * 255.0f;
  310. +            break;
  311. +          case 2:
  312. +            r = p * 255.0f;
  313. +            g = v * 255.0f;
  314. +            b = t * 255.0f;
  315. +            break;
  316. +          case 3:
  317. +            r = p * 255.0f;
  318. +            g = q * 255.0f;
  319. +            b = v * 255.0f;
  320. +            break;
  321. +          case 4:
  322. +            r = t * 255.0f;
  323. +            g = p * 255.0f;
  324. +            b = v * 255.0f;
  325. +            break;
  326. +          case 5:
  327. +            r = v * 255.0f;
  328. +            g = p * 255.0f;
  329. +            b = q * 255.0f;
  330. +            break;
  331. +          default:
  332. +               g_return_val_if_fail( (hi >= 0) && (hi < 6), NULL);
  333. +        }
  334. +
  335. +        /* update pixel data */
  336. +        pdata.pixel_data[i + 0] = r;
  337. +        pdata.pixel_data[i + 1] = g;
  338. +        pdata.pixel_data[i + 2] = b;
  339. +    }
  340. +
  341. +    newpix = gdk_pixbuf_from_pixdata(&pdata, TRUE, &err);
  342. +    if(!newpix) {
  343. +        g_warning("%s: Unable to modify image brightness: %s", PACKAGE,
  344. +                err->message);
  345. +        g_error_free(err);
  346. +        return src;
  347. +    }
  348. +    g_object_unref(G_OBJECT(src));
  349. +
  350. +    return newpix;
  351. +}
  352. +
  353. +static GdkPixbuf *
  354.  create_solid(GdkColor *color, gint width, gint height)
  355.  {
  356.      GdkPixbuf *pix;
  357.  -512,6 +643,53 @@
  358.  }
  359.  
  360.  /**
  361. + * xfce_backdrop_set_saturation:
  362. + * @backdrop: An #XfceBackdrop.
  363. + * @saturation: A saturation value.
  364. + *
  365. + * Modifies the saturation of the backdrop using a value between -128 and 127.
  366. + * A value of 0 indicates that the saturation should not be changed.  This value
  367. + * is applied to the entire image, after compositing.
  368. + **/
  369. +void
  370. +xfce_backdrop_set_saturation(XfceBackdrop *backdrop, gint saturation)
  371. +{
  372. +    g_return_if_fail(XFCE_IS_BACKDROP(backdrop));
  373. +
  374. +    if(saturation != backdrop->priv->saturation) {
  375. +        backdrop->priv->saturation = saturation;
  376. +        g_signal_emit(G_OBJECT(backdrop), backdrop_signals[BACKDROP_CHANGED], 0);
  377. +    }
  378. +}
  379. +
  380. +/**
  381. + * xfce_backdrop_set_hue:
  382. + * @backdrop: An #XfceBackdrop.
  383. + * @hue: A hue value.
  384. + *
  385. + * Shifts the hue of the backdrop using a value between 0 and 359 degrees.
  386. + * A value of 0 indicates that the hue should not be changed.  This value
  387. + * is applied to the entire image, after compositing.
  388. + **/
  389. +void
  390. +xfce_backdrop_set_hue(XfceBackdrop *backdrop, gint hue)
  391. +{
  392. +    g_return_if_fail(XFCE_IS_BACKDROP(backdrop));
  393. +
  394. +    if(hue != backdrop->priv->hue) {
  395. +        backdrop->priv->hue = hue;
  396. +        g_signal_emit(G_OBJECT(backdrop), backdrop_signals[BACKDROP_CHANGED], 0);
  397. +    }
  398. +}
  399. +
  400. +gint
  401. +xfce_backdrop_get_hue(XfceBackdrop *backdrop)
  402. +{
  403. +    g_return_val_if_fail(XFCE_IS_BACKDROP(backdrop), 0);
  404. +    return backdrop->priv->hue;
  405. +}
  406. +
  407. +/**
  408.   * xfce_backdrop_get_pixbuf:
  409.   * @backdrop: An #XfceBackdrop.
  410.   *
  411.  -563,6 +741,10 @@
  412.      if(!image) {
  413.          if(backdrop->priv->brightness != 0)
  414.              final_image = adjust_brightness(final_image, backdrop->priv->brightness);
  415. +        if(backdrop->priv->saturation != 0)
  416. +            final_image = adjust_saturation(final_image, backdrop->priv->saturation);
  417. +        if(backdrop->priv->hue != 0)
  418. +            final_image = adjust_hue(final_image, backdrop->priv->hue);
  419.  
  420.          return final_image;
  421.      }
  422.  -571,7 +753,7 @@
  423.          if(ih <= h / 2 && iw <= w / 2)
  424.              istyle = XFCE_BACKDROP_IMAGE_TILED;
  425.          else
  426. -            istyle = XFCE_BACKDROP_IMAGE_SCALED;
  427. +            istyle = XFCE_BACKDROP_IMAGE_MAXPECT;
  428.      } else
  429.          istyle = backdrop->priv->image_style;
  430.  
  431.  -636,6 +818,41 @@
  432.                      0, 0, xscale, yscale, interp, 255);
  433.              break;
  434.  
  435. +        case XFCE_BACKDROP_IMAGE_MAXPECT:
  436. +            /* We cut off that which we don't need, and let XFCE_BACKDROP_IMAGE_SCALED do the scaling.
  437. +             * Scaling is always neccesary, the no-scaling case is taken care of earlier in this code.
  438. +             * If aspect is a perfect match already, we immediately fall-through into regular scaling
  439. +             * Note that is maxpect is always centered!
  440. +             */
  441. +          xscale = (((gdouble)iw)/((gdouble)ih)); // Image aspect
  442. +          yscale = (((gdouble)w) / ((gdouble)h)); // Display aspect
  443. +          if( xscale > yscale ) { // Image too wide, calcute how much we need to take off iw to achieve dy
  444. +            tmp = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, ((gdouble)ih)*yscale, ih);
  445. +            yscale = ((gdouble)ih)*yscale;        // new width
  446. +            xscale = 0.5f*(((gdouble)iw)-yscale); // amount to cut off, halved
  447. +            gdk_pixbuf_copy_area(image, \
  448. +                                 xscale, 0, \
  449. +                                 yscale, ih, \
  450. +                                 tmp, \
  451. +                                 0, 0);
  452. +            g_object_unref(G_OBJECT(image));
  453. +            image = tmp;
  454. +            iw = gdk_pixbuf_get_width(image);
  455. +          } else
  456. +          if( xscale < yscale  ) { // Image too narrow, calcute how much we need to take off ih to achieve dy
  457. +            tmp = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, iw, ((gdouble)iw)/yscale);
  458. +            yscale = ((gdouble)iw)/yscale; // new height
  459. +            xscale = 0.5f*(((gdouble)ih)-yscale); // amount to cut off, halved
  460. +            gdk_pixbuf_copy_area(image, \
  461. +                                 0, xscale, \
  462. +                                 iw, yscale, \
  463. +                                 tmp, \
  464. +                                 0, 0);
  465. +            g_object_unref(G_OBJECT(image));
  466. +            image = tmp;
  467. +            ih = gdk_pixbuf_get_height(image);
  468. +          }
  469. +
  470.          case XFCE_BACKDROP_IMAGE_SCALED:
  471.              xscale = (gdouble)w / iw;
  472.              yscale = (gdouble)h / ih;
  473.  -655,16 +872,19 @@
  474.                      iw * xscale, ih * yscale, xo, yo, xscale, yscale,
  475.                      interp, 255);
  476.              break;
  477. -
  478.          default:
  479.              g_critical("Invalid image style: %d\n", (gint)istyle);
  480.      }
  481.  
  482.      if(image)
  483.          g_object_unref(G_OBJECT(image));
  484. -
  485. +
  486.      if(backdrop->priv->brightness != 0)
  487.          final_image = adjust_brightness(final_image, backdrop->priv->brightness);
  488. -
  489. +    if(backdrop->priv->saturation != 0)
  490. +        final_image = adjust_saturation(final_image, backdrop->priv->saturation);
  491. +    if(backdrop->priv->hue != 0)
  492. +        final_image = adjust_hue(final_image, backdrop->priv->hue);
  493. +
  494.      return final_image;
  495.  }
  496. diff -ur xfdesktop-4.4.1.orig/src/xfce-backdrop.h xfdesktop-4.4.1/src/xfce-backdrop.h
  497. --- xfdesktop-4.4.1.orig/src/xfce-backdrop.h    2007-01-25 21:53:23.000000000 +0100
  498. +++ xfdesktop-4.4.1/src/xfce-backdrop.h 2007-10-29 20:27:56.000000000 +0100
  499.  -48,7 +48,8 @@
  500.      XFCE_BACKDROP_IMAGE_CENTERED,
  501.      XFCE_BACKDROP_IMAGE_TILED,
  502.      XFCE_BACKDROP_IMAGE_STRETCHED,
  503. -    XFCE_BACKDROP_IMAGE_SCALED
  504. +    XFCE_BACKDROP_IMAGE_SCALED,
  505. +    XFCE_BACKDROP_IMAGE_MAXPECT
  506.  } XfceBackdropImageStyle;
  507.  
  508.  typedef enum
  509.  -119,6 +120,10 @@
  510.                                            gint brightness);
  511.  gint xfce_backdrop_get_brightness        (XfceBackdrop *backdrop);
  512.  
  513. +void xfce_backdrop_set_saturation        (XfceBackdrop *backdrop,
  514. +                                          gint saturation);
  515. +gint xfce_backdrop_get_saturation        (XfceBackdrop *backdrop);
  516. +
  517.  GdkPixbuf *xfce_backdrop_get_pixbuf      (XfceBackdrop *backdrop);
  518.  
  519.  G_END_DECLS
  520. diff -ur xfdesktop-4.4.1.orig/src/xfce-desktop-settings.c xfdesktop-4.4.1/src/xfce-desktop-settings.c
  521. --- xfdesktop-4.4.1.orig/src/xfce-desktop-settings.c    2007-01-25 21:53:23.000000000 +0100
  522. +++ xfdesktop-4.4.1/src/xfce-desktop-settings.c 2007-10-29 20:39:43.000000000 +0100
  523.  -364,6 +364,24 @@
  524.              setting = NULL;
  525.          } else
  526.              xfce_backdrop_set_brightness(backdrop, 0);
  527. +        g_snprintf(setting_name, 64, "saturation_%d_%d", screen, i);
  528. +        if(MCS_SUCCESS == mcs_client_get_setting(mcs_client, setting_name,
  529. +                BACKDROP_CHANNEL, &setting))
  530. +        {
  531. +            xfce_backdrop_set_saturation(backdrop, setting->data.v_int);
  532. +            mcs_setting_free(setting);
  533. +            setting = NULL;
  534. +        } else
  535. +            xfce_backdrop_set_saturation(backdrop, 0);
  536. +        g_snprintf(setting_name, 64, "hue_%d_%d", screen, i);
  537. +        if(MCS_SUCCESS == mcs_client_get_setting(mcs_client, setting_name,
  538. +                BACKDROP_CHANNEL, &setting))
  539. +        {
  540. +            xfce_backdrop_set_hue(backdrop, setting->data.v_int);
  541. +            mcs_setting_free(setting);
  542. +            setting = NULL;
  543. +        } else
  544. +            xfce_backdrop_set_hue(backdrop, 0);
  545.      }
  546.  
  547.      xfce_desktop_thaw_updates(desktop);
  548.  -481,6 +499,12 @@
  549.              } else if(strstr(setting->name, "brightness") == setting->name) {
  550.                  xfce_backdrop_set_brightness(backdrop, setting->data.v_int);
  551.                  handled = TRUE;
  552. +            } else if(strstr(setting->name, "saturation") == setting->name) {
  553. +                xfce_backdrop_set_saturation(backdrop, setting->data.v_int);
  554. +                handled = TRUE;
  555. +            } else if(strstr(setting->name, "hue") == setting->name) {
  556. +                xfce_backdrop_set_hue(backdrop, setting->data.v_int);
  557. +                handled = TRUE;
  558.              }
  559.  
  560.              break;
clone this paste RAW Paste Data