~ubuntu-branches/ubuntu/trusty/gnome-shell/trusty-proposed

« back to all changes in this revision

Viewing changes to src/st/st-theme-node.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-03-14 13:47:20 UTC
  • mfrom: (1.1.36) (18.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20120314134720-202sbjbu4a3z1fru
Tags: 3.3.90-0ubuntu1
* Sync with Debian experimental svn packaging (LP: #941755, #937709).
  Remaining changes:
  - debian/gnome-shell.gsettings-override: Update for Ubuntu defaults
  - debian/control.in: Recommend cups-pk-helper
  - debian/patches/10-make-NetworkManager-optional.patch: Disabled
  - Don't run dh-autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Copyright 2009, 2010 Florian Müllner
8
8
 * Copyright 2010 Adel Gadllah
9
9
 * Copyright 2010 Giovanni Campagna
 
10
 * Copyright 2011 Quentin "Sardem FF7" Glidic
10
11
 *
11
12
 * This program is free software; you can redistribute it and/or modify
12
13
 * it under the terms of the GNU Lesser General Public License as
1482
1483
 * @node: a #StThemeNode
1483
1484
 * @color: (out caller-allocates): location to store the color
1484
1485
 *
1485
 
 * Returns the color of @node's outline.
 
1486
 * Gets the color of @node's outline.
1486
1487
 */
1487
1488
void
1488
1489
st_theme_node_get_outline_color (StThemeNode  *node,
1579
1580
  node->background_color = TRANSPARENT_COLOR;
1580
1581
  node->background_gradient_type = ST_GRADIENT_NONE;
1581
1582
  node->background_position_set = FALSE;
 
1583
  node->background_size = ST_BACKGROUND_SIZE_AUTO;
1582
1584
 
1583
1585
  ensure_properties (node);
1584
1586
 
1606
1608
          g_free (node->background_image);
1607
1609
          node->background_image = NULL;
1608
1610
          node->background_position_set = FALSE;
 
1611
          node->background_size = ST_BACKGROUND_SIZE_AUTO;
1609
1612
 
1610
1613
          for (term = decl->value; term; term = term->next)
1611
1614
            {
1662
1665
          else
1663
1666
            node->background_position_set = TRUE;
1664
1667
        }
 
1668
      else if (strcmp (property_name, "-size") == 0)
 
1669
        {
 
1670
          if (decl->value->type == TERM_IDENT)
 
1671
            {
 
1672
              if (strcmp (decl->value->content.str->stryng->str, "contain") == 0)
 
1673
                node->background_size = ST_BACKGROUND_SIZE_CONTAIN;
 
1674
              else if (strcmp (decl->value->content.str->stryng->str, "cover") == 0)
 
1675
                node->background_size = ST_BACKGROUND_SIZE_COVER;
 
1676
              else if ((strcmp (decl->value->content.str->stryng->str, "auto") == 0) && (decl->value->next) && (decl->value->next->type == TERM_NUMBER))
 
1677
                {
 
1678
                  GetFromTermResult result = get_length_from_term_int (node, decl->value->next, FALSE, &node->background_size_h);
 
1679
 
 
1680
                  node->background_size_w = -1;
 
1681
                  node->background_size = (result == VALUE_FOUND) ? ST_BACKGROUND_SIZE_FIXED : ST_BACKGROUND_SIZE_AUTO;
 
1682
                }
 
1683
              else
 
1684
                node->background_size = ST_BACKGROUND_SIZE_AUTO;
 
1685
            }
 
1686
          else if (decl->value->type == TERM_NUMBER)
 
1687
            {
 
1688
              GetFromTermResult result = get_length_from_term_int (node, decl->value, FALSE, &node->background_size_w);
 
1689
              if (result == VALUE_NOT_FOUND)
 
1690
                continue;
 
1691
 
 
1692
              node->background_size = ST_BACKGROUND_SIZE_FIXED;
 
1693
 
 
1694
              if ((decl->value->next) && (decl->value->next->type == TERM_NUMBER))
 
1695
                {
 
1696
                  result = get_length_from_term_int (node, decl->value->next, FALSE, &node->background_size_h);
 
1697
 
 
1698
                  if (result == VALUE_FOUND)
 
1699
                    continue;
 
1700
                }
 
1701
              node->background_size_h = -1;
 
1702
            }
 
1703
          else
 
1704
            node->background_size = ST_BACKGROUND_SIZE_AUTO;
 
1705
        }
1665
1706
      else if (strcmp (property_name, "-color") == 0)
1666
1707
        {
1667
1708
          GetFromTermResult result;
1751
1792
 * @node: a #StThemeNode
1752
1793
 * @color: (out caller-allocates): location to store the color
1753
1794
 *
1754
 
 * Returns @node's background color.
 
1795
 * Gets @node's background color.
1755
1796
 */
1756
1797
void
1757
1798
st_theme_node_get_background_color (StThemeNode  *node,
1779
1820
 * @node: a #StThemeNode
1780
1821
 * @color: (out caller-allocates): location to store the color
1781
1822
 *
1782
 
 * Returns @node's foreground color.
 
1823
 * Gets @node's foreground color.
1783
1824
 */
1784
1825
void
1785
1826
st_theme_node_get_foreground_color (StThemeNode  *node,
1853
1894
 * @side: a #StSide
1854
1895
 * @color: (out caller-allocates): location to store the color
1855
1896
 *
1856
 
 * Returns the color of @node's border on @side
 
1897
 * Gets the color of @node's border on @side
1857
1898
 */
1858
1899
void
1859
1900
st_theme_node_get_border_color (StThemeNode  *node,