~ubuntu-branches/ubuntu/wily/mutter/wily

« back to all changes in this revision

Viewing changes to .pc/13_better_support_for_button_layout.patch/src/ui/theme.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-11-30 10:56:20 UTC
  • Revision ID: james.westby@ubuntu.com-20101130105620-5pg8qjx4fn4nt00b
Tags: 2.91.3-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
4992
4992
    }
4993
4993
 
4994
4994
  for (i = 0; i < (int)META_FRAME_TYPE_LAST; i++)
4995
 
    if (theme->style_sets_by_type[i] == NULL)
 
4995
    if (i != (int)META_FRAME_TYPE_ATTACHED && theme->style_sets_by_type[i] == NULL)
4996
4996
      {
4997
4997
        g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED,
4998
4998
                     _("No frame style set for window type \"%s\" in theme \"%s\", add a <window type=\"%s\" style_set=\"whatever\"/> element"),
5074
5074
 
5075
5075
  style_set = theme->style_sets_by_type[type];
5076
5076
 
5077
 
  /* Right now the parser forces a style set for all types,
 
5077
  if (style_set == NULL && type == META_FRAME_TYPE_ATTACHED)
 
5078
    style_set = theme->style_sets_by_type[META_FRAME_TYPE_BORDER];
 
5079
 
 
5080
  /* Right now the parser forces a style set for all other types,
5078
5081
   * but this fallback code is here in case I take that out.
5079
5082
   */
5080
5083
  if (style_set == NULL)
6004
6007
    return META_FRAME_TYPE_MENU;
6005
6008
  else if (strcmp ("border", str) == 0)
6006
6009
    return META_FRAME_TYPE_BORDER;
 
6010
  else if (strcmp ("attached", str) == 0)
 
6011
    return META_FRAME_TYPE_ATTACHED;
6007
6012
#if 0
6008
6013
  else if (strcmp ("toolbar", str) == 0)
6009
6014
    return META_FRAME_TYPE_TOOLBAR;
6012
6017
    return META_FRAME_TYPE_LAST;
6013
6018
}
6014
6019
 
 
6020
/**
 
6021
 * meta_frame_type_to_string:
 
6022
 *
 
6023
 * Converts a frame type enum value to the name string that would
 
6024
 * appear in the theme definition file.
 
6025
 *
 
6026
 * Return value: the string value
 
6027
 */
6015
6028
const char*
6016
6029
meta_frame_type_to_string (MetaFrameType type)
6017
6030
{
6029
6042
      return "menu";
6030
6043
    case META_FRAME_TYPE_BORDER:
6031
6044
      return "border";
 
6045
    case META_FRAME_TYPE_ATTACHED:
 
6046
      return "attached";
6032
6047
#if 0
6033
6048
    case META_FRAME_TYPE_TOOLBAR:
6034
6049
      return "toolbar";