# vim:set ft=gtkrc ts=2 sw=2 sts=2 ai et:
#
# This is the main theme file, handling all the default widgets and theme
# properties. Since GTK+ 2 is old, we need to overcome some of its limitations,
# which is also mostly done in this file. Sadly not all of them can be overcome
# so there will always be a visible difference between the GTK+ 2 and 3 theme.

style "default" {
  xthickness = 1
  ythickness = 1

  ####################
  # Style Properties #
  ####################

  GtkWidget::focus-padding      = 0
  GtkWidget::focus-line-width   = 2
  GtkWidget::focus-line-pattern = "\2\1"

  GtkToolbar::space-size       = 5 # 1 + 2*2 (separator + margins)
  GtkToolbar::internal-padding = 2
  GtkToolButton::icon-spacing  = 4

  GtkWidget::tooltip-radius    = 2
  GtkWidget::tooltip-alpha     = 230
  GtkWidget::new-tooltip-style = 1 #for compatibility

  GtkWidget::link-color              = @link_color
  GtkWidget::visited-link-color      = @visited_link_color
  GnomeHRef::link_color              = @link_color
  GtkHTML::link-color                = @link_color
  GtkHTML::vlink-color               = @visited_link_color
  GtkIMHtml::hyperlink-color         = @link_color
  GtkIMHtml::hyperlink-visited-color = @visited_link_color

  GtkSeparatorMenuItem::horizontal-padding = 0
  GtkSeparatorMenuItem::wide-separators    = 1
  GtkSeparatorMenuItem::separator-height   = 3

  GtkButton::child-displacement-y = 0

  GtkButton::default-border         = {0, 0, 0, 0}
  GtkButton::default-outside-border = {0, 0, 0, 0}
  GtkButton::inner-border           = {4, 4, 4, 4}

  GtkEntry::state-hint   = 1
  GtkEntry::inner-border = {4, 4, 4, 4}

  GtkPaned::handle-size  = 8
  GtkHPaned::handle-size = 8
  GtkVPaned::handle-size = 8

  GtkScrollbar::trough-border = 0
  GtkRange::trough-border     = 0
  GtkRange::slider-width      = 17
  GtkRange::stepper-size      = 0
  GtkRange::activate-slider   = 1

  GtkScrollbar::activate-slider              = 1
  GtkScrollbar::stepper-size                 = 0
  GtkScrollbar::has-backward-stepper         = 0
  GtkScrollbar::has-forward-stepper          = 0
  GtkScrollbar::min-slider-length            = 32 # 24 + 2*4 (margins)
  GtkScrolledWindow::scrollbar-spacing       = 0
  GtkScrolledWindow::scrollbars-within-bevel = 1

  GtkScale::slider_length       = 24
  GtkScale::slider_width        = 24
  GtkScale::trough-side-details = 1

  GtkProgressBar::min-horizontal-bar-height = 4
  GtkProgressBar::min-vertical-bar-width    = 4
  GtkProgressBar::xspacing                  = 4
  GtkProgressBar::yspacing                  = 4

  GtkStatusbar::shadow_type    = GTK_SHADOW_NONE
  GtkSpinButton::shadow_type   = GTK_SHADOW_NONE
  GtkMenuBar::shadow-type      = GTK_SHADOW_NONE
  GtkToolbar::shadow-type      = GTK_SHADOW_NONE
  # TODO: find out what this comment means:
  # ( every window is misaligned for the sake of menus ):
  GtkMenuBar::internal-padding = 0
  GtkMenu::horizontal-padding  = 0
  GtkMenu::vertical-padding    = 4
  GtkMenu::double-arrows       = 0
  GtkMenuItem::arrow-scaling   = 1
  GtkMenuItem::toggle-spacing  = 12

  GtkCheckButton::indicator-size    = 24
  GtkCheckButton::indicator_spacing = 2
  GtkOptionMenu::indicator_spacing  = {10, 10, 6, 6}

  GtkTreeView::expander-size        = 16
  GtkTreeView::vertical-separator   = 0
  GtkTreeView::horizontal-separator = 4
  GtkTreeView::allow-rules          = 0
  # Set this because some apps read it
  GtkTreeView::odd-row-color        = @base_color
  GtkTreeView::even-row-color       = @base_color

  GtkExpander::expander-size = 16

  GtkNotebook::tab-overlap = 0

  ##########
  # Colors #
  ##########

  bg[NORMAL]      = @bg_color
  bg[PRELIGHT]    = @bg_color
  bg[SELECTED]    = @selected_bg_color
  bg[INSENSITIVE] = @bg_color
  bg[ACTIVE]      = @bg_color

  fg[NORMAL]      = @fg_color
  fg[PRELIGHT]    = @fg_color
  fg[SELECTED]    = @selected_fg_color
  fg[INSENSITIVE] = mix (0.4, @fg_color, @bg_color)
  fg[ACTIVE]      = @fg_color

  text[NORMAL]      = @text_color
  text[PRELIGHT]    = @text_color
  text[SELECTED]    = @selected_fg_color
  text[INSENSITIVE] = mix (0.4, @text_color, @base_color)
  text[ACTIVE]      = @selected_fg_color

  base[NORMAL]      = @base_color
  base[PRELIGHT]    = mix (0.05, @text_color, @base_color)
  base[SELECTED]    = @selected_bg_color
  base[INSENSITIVE] = mix (0.5, @base_color, @bg_color)
  base[ACTIVE]      = @selected_bg_color

  # For succinctness, all reasonable pixmap options remain here

  # Draw frame around menu in a non-compositied environment
  # This needs to go before pixmap because we need to override some stuff
  engine "adwaita" {}

  engine "pixmap" {

    #################
    # Check Buttons #
    #################

    image {
      function        = CHECK
      state           = NORMAL
      shadow          = OUT
      overlay_file    = "assets/checkbox-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = PRELIGHT
      shadow          = OUT
      overlay_file    = "assets/checkbox-unchecked-hover.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = ACTIVE
      shadow          = OUT
      overlay_file    = "assets/checkbox-unchecked-active.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = SELECTED
      shadow          = OUT
      overlay_file    = "assets/checkbox-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = INSENSITIVE
      shadow          = OUT
      overlay_file    = "assets/checkbox-unchecked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = NORMAL
      shadow          = IN
      overlay_file    = "assets/checkbox-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = PRELIGHT
      shadow          = IN
      overlay_file    = "assets/checkbox-checked-hover.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = ACTIVE
      shadow          = IN
      overlay_file    = "assets/checkbox-checked-active.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = SELECTED
      shadow          = IN
      overlay_file    = "assets/checkbox-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = INSENSITIVE
      shadow          = IN
      overlay_file    = "assets/checkbox-checked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = NORMAL
      shadow          = ETCHED_IN
      overlay_file    = "assets/checkbox-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = PRELIGHT
      shadow          = ETCHED_IN
      overlay_file    = "assets/checkbox-mixed-hover.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = ACTIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/checkbox-mixed-active.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = SELECTED
      shadow          = ETCHED_IN
      overlay_file    = "assets/checkbox-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = INSENSITIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/checkbox-mixed-insensitive.png"
      overlay_stretch = FALSE
    }

    #################
    # Radio Buttons #
    #################

    image {
      function        = OPTION
      state           = NORMAL
      shadow          = OUT
      overlay_file    = "assets/radio-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = PRELIGHT
      shadow          = OUT
      overlay_file    = "assets/radio-unchecked-hover.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = ACTIVE
      shadow          = OUT
      overlay_file    = "assets/radio-unchecked-active.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = SELECTED
      shadow          = OUT
      overlay_file    = "assets/radio-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = INSENSITIVE
      shadow          = OUT
      overlay_file    = "assets/radio-unchecked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = NORMAL
      shadow          = IN
      overlay_file    = "assets/radio-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = PRELIGHT
      shadow          = IN
      overlay_file    = "assets/radio-checked-hover.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = ACTIVE
      shadow          = IN
      overlay_file    = "assets/radio-checked-active.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = SELECTED
      shadow          = IN
      overlay_file    = "assets/radio-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = INSENSITIVE
      shadow          = IN
      overlay_file    = "assets/radio-checked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = NORMAL
      shadow          = ETCHED_IN
      overlay_file    = "assets/radio-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = PRELIGHT
      shadow          = ETCHED_IN
      overlay_file    = "assets/radio-mixed-hover.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = ACTIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/radio-mixed-active.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = SELECTED
      shadow          = ETCHED_IN
      overlay_file    = "assets/radio-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = INSENSITIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/radio-mixed-insensitive.png"
      overlay_stretch = FALSE
    }

    ##########
    # Arrows #
    ##########

    # Overrides

    # Disable arrows in spinbuttons
    image {
      function = ARROW
      detail   = "spinbutton"
    }

    # Disable arrows for qt in scrollbars

    image {
      function = ARROW
      detail   = "vscrollbar"
    }

    image {
      function = ARROW
      detail   = "hscrollbar"
    }

    # Menu arrows

    image {
      function        = ARROW
      state           = NORMAL
      detail          = "menuitem"
      overlay_file    = "assets/pan-left.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      detail          = "menuitem"
      overlay_file    = "assets/pan-left.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      detail          = "menuitem"
      overlay_file    = "assets/pan-left-insensitive.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = NORMAL
      detail          = "menuitem"
      overlay_file    = "assets/pan-right.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      detail          = "menuitem"
      overlay_file    = "assets/pan-right.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      detail          = "menuitem"
      overlay_file    = "assets/pan-right-insensitive.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      detail          = "menu_scroll_arrow_up"
      overlay_file    = "assets/pan-up-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = ARROW
      detail          = "menu_scroll_arrow_up"
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      detail          = "menu_scroll_arrow_down"
      overlay_file    = "assets/pan-down-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = ARROW
      detail          = "menu_scroll_arrow_down"
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
    }

    # Regular arrows

    image {
      function        = ARROW
      state           = NORMAL
      overlay_file    = "assets/pan-up-alt.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = ACTIVE
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      overlay_file    = "assets/pan-up-alt-insensitive.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = NORMAL
      overlay_file    = "assets/pan-down-alt.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }

    image {
      function        = ARROW
      state           = ACTIVE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      overlay_file    = "assets/pan-down-alt-insensitive.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }

    image {
      function        = ARROW
      state           = NORMAL
      overlay_file    = "assets/pan-left-alt.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      overlay_file    = "assets/pan-left.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = ACTIVE
      overlay_file    = "assets/pan-left.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      overlay_file    = "assets/pan-left-alt-insensitive.png"
      overlay_stretch = FALSE
      arrow_direction = LEFT
    }

    image {
      function        = ARROW
      state           = NORMAL
      overlay_file    = "assets/pan-right-alt.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      overlay_file    = "assets/pan-right.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    image {
      function        = ARROW
      state           = ACTIVE
      overlay_file    = "assets/pan-right.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    image {
      function        = ARROW
      state           = INSENSITIVE
      overlay_file    = "assets/pan-right-alt-insensitive.png"
      overlay_stretch = FALSE
      arrow_direction = RIGHT
    }

    ######################
    # Option Menu Arrows #
    ######################

    image {
      function        = TAB
      state           = NORMAL
      overlay_file    = "assets/pan-down-alt.png"
      overlay_stretch = FALSE
    }

    image {
      function        = TAB
      state           = PRELIGHT
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
    }

    image {
      function        = TAB
      state           = ACTIVE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
    }

    image {
      function        = TAB
      state           = INSENSITIVE
      overlay_file    = "assets/pan-down-alt-insensitive.png"
      overlay_stretch = FALSE
    }

    #########
    # Lines #
    #########

    image {
      function = VLINE
      file     = "assets/border.png"
      border   = {1, 0, 0, 0}
    }

    image {
      function = HLINE
      file     = "assets/border.png"
      border   = {0, 0, 1, 0}
    }

    #########
    # Focus #
    #########

    image {
      function = FOCUS
      file     = "assets/focus.png"
      border   = {2, 2, 2, 2}
      stretch  = TRUE
    }

    ###########
    # Handles #
    ###########

    image {
      function        = HANDLE
      detail          = "handlebox"
      overlay_file    = "assets/handle-vert.png"
      overlay_stretch = FALSE
    }

    image {
      function        = HANDLE
      state           = NORMAL
      overlay_file    = "assets/handle-horz.png"
      overlay_stretch = FALSE
      orientation     = HORIZONTAL
    }

    image {
      function        = HANDLE
      state           = PRELIGHT
      overlay_file    = "assets/handle-horz-hover.png"
      overlay_stretch = FALSE
      orientation     = HORIZONTAL
    }

    image {
      function        = HANDLE
      state           = ACTIVE
      overlay_file    = "assets/handle-horz-active.png"
      overlay_stretch = FALSE
      orientation     = HORIZONTAL
    }

    image {
      function        = HANDLE
      state           = NORMAL
      overlay_file    = "assets/handle-vert.png"
      overlay_stretch = FALSE
      orientation     = VERTICAL
    }

    image {
      function        = HANDLE
      state           = PRELIGHT
      overlay_file    = "assets/handle-vert-hover.png"
      overlay_stretch = FALSE
      orientation     = VERTICAL
    }

    image {
      function        = HANDLE
      state           = ACTIVE
      overlay_file    = "assets/handle-vert-active.png"
      overlay_stretch = FALSE
      orientation     = VERTICAL
    }

    image {
      function = RESIZE_GRIP
    }

    #############
    # Expanders #
    #############

    image {
      function       = EXPANDER
      expander_style = EXPANDED
      state          = NORMAL
      file           = "assets/pan-down-alt.png"
    }

    image {
      function       = EXPANDER
      expander_style = EXPANDED
      state          = PRELIGHT
      file           = "assets/pan-down.png"
    }

    image {
      function       = EXPANDER
      expander_style = EXPANDED
      state          = ACTIVE
      file           = "assets/pan-down.png"
    }

    image {
      function       = EXPANDER
      expander_style = EXPANDED
      state          = INSENSITIVE
      file           = "assets/pan-down-alt-insensitive.png"
    }

    # LTR

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = NORMAL
      file           = "assets/pan-right-alt.png"
      direction      = LTR
    }

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = PRELIGHT
      file           = "assets/pan-right.png"
      direction      = LTR
    }

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = ACTIVE
      file           = "assets/pan-right.png"
      direction      = LTR
    }

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = INSENSITIVE
      file           = "assets/pan-right-alt-insensitive.png"
      direction      = LTR
    }

    image {
      function       = EXPANDER
      expander_style = SEMI_COLLAPSED
      file           = "assets/pan-right-semi.png"
      direction      = LTR
    }

    image {
      function       = EXPANDER
      expander_style = SEMI_EXPANDED
      file           = "assets/pan-right-semi.png"
      direction      = LTR
    }

    # RTL

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = NORMAL
      file           = "assets/pan-left-alt.png"
      direction      = RTL
    }

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = PRELIGHT
      file           = "assets/pan-left.png"
      direction      = RTL
    }

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = ACTIVE
      file           = "assets/pan-left.png"
      direction      = RTL
    }

    image {
      function       = EXPANDER
      expander_style = COLLAPSED
      state          = INSENSITIVE
      file           = "assets/pan-left-alt-insensitive.png"
      direction      = RTL
    }

    image {
      function       = EXPANDER
      expander_style = SEMI_COLLAPSED
      file           = "assets/pan-left-semi.png"
      direction      = RTL
    }

    image {
      function       = EXPANDER
      expander_style = SEMI_EXPANDED
      file           = "assets/pan-left-semi.png"
      direction      = RTL
    }

    #############
    # Notebooks #
    #############

    # Left

    image {
      function = EXTENSION
      state    = NORMAL
      file     = "assets/tab-indigo.png"
      border   = {0, 1, 0, 0}
      stretch  = TRUE
      gap_side = RIGHT
    }

    image {
      function = EXTENSION
      gap_side = RIGHT
    }

    # Right

    image {
      function = EXTENSION
      state    = NORMAL
      file     = "assets/tab-indigo.png"
      border   = {1, 0, 0, 0}
      stretch  = TRUE
      gap_side = LEFT
    }

    image {
      function = EXTENSION
      gap_side = LEFT
    }

    # Up

    image {
      function = EXTENSION
      state    = NORMAL
      file     = "assets/tab-indigo.png"
      border   = {0, 0, 0, 1}
      stretch  = TRUE
      gap_side = BOTTOM
    }

    image {
      function = EXTENSION
      gap_side = BOTTOM
    }

    # Down

    image {
      function = EXTENSION
      state    = NORMAL
      file     = "assets/tab-indigo.png"
      border   = {0, 0, 1, 0}
      stretch  = TRUE
      gap_side = TOP
    }

    image {
      function = EXTENSION
      gap_side = TOP
    }

    # Inner frame

    image {
      function   = BOX_GAP
      detail     = "notebook"
      file       = "assets/frame-notebook.png"
      border     = {1, 1, 1, 1}
      stretch    = TRUE
      gap_file   = "assets/tab-indigo.png"
      gap_border = {1, 0, 0, 0}
      gap_side   = LEFT
    }

    image {
      function   = BOX_GAP
      detail     = "notebook"
      file       = "assets/frame-notebook.png"
      border     = {1, 1, 1, 1}
      stretch    = TRUE
      gap_file   = "assets/tab-indigo.png"
      gap_border = {0, 1, 0, 0}
      gap_side   = RIGHT
    }

    image {
      function   = BOX_GAP
      detail     = "notebook"
      file       = "assets/frame-notebook.png"
      border     = {1, 1, 1, 1}
      stretch    = TRUE
      gap_file   = "assets/tab-indigo.png"
      gap_border = {0, 0, 1, 0}
      gap_side   = TOP
    }

    image {
      function   = BOX_GAP
      detail     = "notebook"
      file       = "assets/frame-notebook.png"
      border     = {1, 1, 1, 1}
      stretch    = TRUE
      gap_file   = "assets/tab-indigo.png"
      gap_border = {0, 0, 0, 1}
      gap_side   = BOTTOM
    }

    # Standalone frame
    image {
      function = BOX
      detail   = "notebook"
      file     = "assets/frame-notebook.png"
      border   = {1, 1, 1, 1}
      stretch  = TRUE
    }

    ##############
    # Scrollbars #
    ##############

    image {
      function    = BOX
      detail      = "trough"
      file        = "assets/scrollbar-horz-trough.png"
      border      = {0, 0, 1, 0}
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      detail      = "trough"
      file        = "assets/scrollbar-vert-ltr-trough.png"
      border      = {1, 0, 0, 0}
      orientation = VERTICAL
      direction   = LTR
    }

    image {
      function    = BOX
      detail      = "trough"
      file        = "assets/scrollbar-vert-rtl-trough.png"
      border      = {0, 1, 0, 0}
      orientation = VERTICAL
      direction   = RTL
    }

    # Horizontal sliders

    image {
      function    = SLIDER
      state       = NORMAL
      detail      = "slider"
      file        = "assets/scrollbar-horz-slider.png"
      border      = {8, 8, 9, 8 }
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = SLIDER
      state       = PRELIGHT
      detail      = "slider"
      file        = "assets/scrollbar-horz-slider-hover.png"
      border      = {8, 8, 9, 8 }
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = SLIDER
      state       = ACTIVE
      detail      = "slider"
      file        = "assets/scrollbar-horz-slider-active.png"
      border      = {8, 8, 9, 8 }
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = SLIDER
      state       = INSENSITIVE
      detail      = "slider"
      file        = "assets/scrollbar-horz-slider-insensitive.png"
      border      = {8, 8, 9, 8 }
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    # Vertical sliders

    image {
      function    = SLIDER
      state       = NORMAL
      detail      = "slider"
      file        = "assets/scrollbar-vert-ltr-slider.png"
      border      = {9, 8, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = LTR
    }

    image {
      function    = SLIDER
      state       = PRELIGHT
      detail      = "slider"
      file        = "assets/scrollbar-vert-ltr-slider-hover.png"
      border      = {9, 8, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = LTR
    }

    image {
      function    = SLIDER
      state       = ACTIVE
      detail      = "slider"
      file        = "assets/scrollbar-vert-ltr-slider-active.png"
      border      = {9, 8, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = LTR
    }

    image {
      function    = SLIDER
      state       = INSENSITIVE
      detail      = "slider"
      file        = "assets/scrollbar-vert-ltr-slider-insensitive.png"
      border      = {9, 8, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = LTR
    }

    # RTL

    image {
      function    = SLIDER
      state       = NORMAL
      detail      = "slider"
      file        = "assets/scrollbar-vert-rtl-slider.png"
      border      = {8, 9, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = RTL
    }

    image {
      function    = SLIDER
      state       = PRELIGHT
      detail      = "slider"
      file        = "assets/scrollbar-vert-rtl-slider-hover.png"
      border      = {8, 9, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = RTL
    }

    image {
      function    = SLIDER
      state       = ACTIVE
      detail      = "slider"
      file        = "assets/scrollbar-vert-rtl-slider-active.png"
      border      = {8, 9, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = RTL
    }

    image {
      function    = SLIDER
      state       = INSENSITIVE
      detail      = "slider"
      file        = "assets/scrollbar-vert-rtl-slider-insensitive.png"
      border      = {8, 9, 8, 8}
      stretch     = TRUE
      orientation = VERTICAL
      direction   = RTL
    }

    ##########
    # Scales #
    ##########

    # Troughs, overrided later on. We set them here too because some widgets
    # don't specify their orientation.

    image {
      function    = BOX
      detail      = "trough-upper"
      file        = "assets/scale-horz-trough.png"
      border      = {6, 6, 0, 0}
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      state       = INSENSITIVE
      detail      = "trough-upper"
      file        = "assets/scale-horz-trough-insensitive.png"
      border      = {6, 6, 0, 0}
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      detail      = "trough-lower"
      file        = "assets/scale-horz-trough-active.png"
      border      = {6, 6, 0, 0}
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      state       = INSENSITIVE
      detail      = "trough-lower"
      file        = "assets/scale-horz-trough-insensitive.png"
      border      = {6, 6, 0, 0}
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      detail      = "trough-upper"
      file        = "assets/scale-vert-trough.png"
      border      = {0, 0, 6, 6}
      stretch     = TRUE
      orientation = VERTICAL
    }

    image {
      function    = BOX
      state       = INSENSITIVE
      detail      = "trough-upper"
      file        = "assets/scale-vert-trough-insensitive.png"
      border      = {0, 0, 6, 6}
      stretch     = TRUE
      orientation = VERTICAL
    }

    image {
      function    = BOX
      detail      = "trough-lower"
      file        = "assets/scale-vert-trough-active.png"
      border      = {0, 0, 6, 6}
      stretch     = TRUE
      orientation = VERTICAL
    }

    image {
      function    = BOX
      state       = INSENSITIVE
      detail      = "trough-lower"
      file        = "assets/scale-vert-trough-insensitive.png"
      border      = {0, 0, 6, 6}
      stretch     = TRUE
      orientation = VERTICAL
    }

    # Sliders

    image {
      function = SLIDER
      state    = NORMAL
      detail   = "hscale"
      file     = "assets/scale-slider.png"
    }

    image {
      function = SLIDER
      state    = PRELIGHT
      detail   = "hscale"
      file     = "assets/scale-slider-hover.png"
    }

    image {
      function = SLIDER
      state    = ACTIVE
      detail   = "hscale"
      file     = "assets/scale-slider-active.png"
    }

    image {
      function = SLIDER
      state    = INSENSITIVE
      detail   = "hscale"
      file     = "assets/scale-slider-insensitive.png"
    }

    image {
      function = SLIDER
      state    = NORMAL
      detail   = "vscale"
      file     = "assets/scale-slider.png"
    }

    image {
      function = SLIDER
      state    = PRELIGHT
      detail   = "vscale"
      file     = "assets/scale-slider-hover.png"
    }

    image {
      function = SLIDER
      state    = ACTIVE
      detail   = "vscale"
      file     = "assets/scale-slider-active.png"
    }

    image {
      function = SLIDER
      state    = INSENSITIVE
      detail   = "vscale"
      file     = "assets/scale-slider-insensitive.png"
    }

    ###########
    # Menubar #
    ###########

    # image {
    #   function = BOX
    #   detail   = "menubar"
    #   file     = "assets/border.png"
    #   border   = {0, 0, 0, 1}
    # }

    #########
    # Menus #
    #########

    image {
      function = BOX
      state    = PRELIGHT
      detail   = "menu_scroll_arrow_up"
      file     = "assets/border.png"
    }

    image {
      function = BOX
      detail   = "menu_scroll_arrow_up"
      file     = "assets/border.png"
      border   = {0, 0, 0, 1}
    }

    image {
      function = BOX
      state    = PRELIGHT
      detail   = "menu_scroll_arrow_down"
      file     = "assets/border.png"
    }

    image {
      function = BOX
      detail   = "menu_scroll_arrow_down"
      file     = "assets/border.png"
      border   = {0, 0, 1, 0}
    }

    ###########
    # Entries #
    ###########

    image {
      function = SHADOW
      state    = ACTIVE
      detail   = "entry"
      file     = "assets/entry-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = SHADOW
      state    = INSENSITIVE
      detail   = "entry"
      file     = "assets/entry-insensitive.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = SHADOW
      detail   = "entry"
      file     = "assets/entry.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = FLAT_BOX
      state    = ACTIVE
      detail   = "entry_bg"
      file     = "assets/entry-background.png"
    }

    image {
      function = FLAT_BOX
      state    = INSENSITIVE
      detail   = "entry_bg"
      file     = "assets/entry-background-insensitive.png"
    }

    image {
      function = FLAT_BOX
      detail   = "entry_bg"
      file     = "assets/entry-background.png"
    }

    #########
    # Spins #
    #########

    # Spin-Up LTR

    image {
      function        = BOX
      state           = NORMAL
      detail          = "spinbutton_up"
      file            = "assets/spin-ltr-up.png"
      border          = {0, 8, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up-alt.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    image {
      function        = BOX
      state           = PRELIGHT
      detail          = "spinbutton_up"
      file            = "assets/spin-ltr-up-hover.png"
      border          = {0, 8, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    image {
      function        = BOX
      state           = ACTIVE
      detail          = "spinbutton_up"
      file            = "assets/spin-ltr-up-active.png"
      border          = {0, 8, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    image {
      function        = BOX
      state           = INSENSITIVE
      detail          = "spinbutton_up"
      file            = "assets/spin-ltr-up-insensitive.png"
      border          = {0, 8, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up-alt-insensitive.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    # Spin-Up RTL

    image {
      function        = BOX
      state           = NORMAL
      detail          = "spinbutton_up"
      file            = "assets/spin-rtl-up.png"
      border          = {8, 0, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up-alt.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    image {
      function        = BOX
      state           = PRELIGHT
      detail          = "spinbutton_up"
      file            = "assets/spin-rtl-up-hover.png"
      border          = {8, 0, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    image {
      function        = BOX
      state           = ACTIVE
      detail          = "spinbutton_up"
      file            = "assets/spin-rtl-up-hover.png"
      border          = {8, 0, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    image {
      function        = BOX
      state           = INSENSITIVE
      detail          = "spinbutton_up"
      file            = "assets/spin-rtl-up-insensitive.png"
      border          = {8, 0, 8, 0}
      stretch         = TRUE
      overlay_file    = "assets/pan-up-alt-insensitive.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    # Spin-Down LTR

    image {
      function        = BOX
      state           = NORMAL
      detail          = "spinbutton_down"
      file            = "assets/spin-ltr-down.png"
      border          = {0, 8, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down-alt.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    image {
      function        = BOX
      state           = PRELIGHT
      detail          = "spinbutton_down"
      file            = "assets/spin-ltr-down-hover.png"
      border          = {0, 8, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    image {
      function        = BOX
      state           = ACTIVE
      detail          = "spinbutton_down"
      file            = "assets/spin-ltr-down-active.png"
      border          = {0, 8, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    image {
      function        = BOX
      state           = INSENSITIVE
      detail          = "spinbutton_down"
      file            = "assets/spin-ltr-down-insensitive.png"
      border          = {0, 8, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down-alt-insensitive.png"
      overlay_stretch = FALSE
      direction       = LTR
    }

    # Spin-Down RTL

    image {
      function        = BOX
      state           = NORMAL
      detail          = "spinbutton_down"
      file            = "assets/spin-rtl-down.png"
      border          = {8, 0, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down-alt.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    image {
      function        = BOX
      state           = PRELIGHT
      detail          = "spinbutton_down"
      file            = "assets/spin-rtl-down-hover.png"
      border          = {8, 0, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    image {
      function        = BOX
      state           = ACTIVE
      detail          = "spinbutton_down"
      file            = "assets/spin-rtl-down-active.png"
      border          = {8, 0, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    image {
      function        = BOX
      state           = INSENSITIVE
      detail          = "spinbutton_down"
      file            = "assets/spin-rtl-down-insensitive.png"
      border          = {8, 0, 0, 8}
      stretch         = TRUE
      overlay_file    = "assets/pan-down-alt-insensitive.png"
      overlay_stretch = FALSE
      direction       = RTL
    }

    ##############
    # Scrollbars #
    ##############

    image {
      function    = BOX
      detail      = "bar"
      file        = "assets/progressbar-progress-indigo.png"
      stretch     = TRUE
      border      = {0, 0, 0, 0}
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      detail      = "bar"
      file        = "assets/progressbar-progress-indigo.png"
      stretch     = TRUE
      border      = {0, 0, 0, 0}
      orientation = VERTICAL
    }

    #############
    # Treeviews #
    #############

    # Disable active the column highlight
    # We need to match specific cells or we break stuff
    # Looking at you deadbeef

    image {
      function = FLAT_BOX
      detail   = "cell_even_sorted"
      state    = NORMAL
    }

    image {
      function = FLAT_BOX
      detail   = "cell_odd_sorted"
      state    = NORMAL
    }

    # Disable all the other shadows
    # This prevents the Raleigh effect
    image {
      function = SHADOW
    }
  }
}

style "menubar" {
  bg[NORMAL]      = @titlebar_bg_color
  fg[NORMAL]      = mix(0.7, @titlebar_fg_color, @titlebar_bg_color)
  fg[PRELIGHT]    = @titlebar_fg_color
  fg[INSENSITIVE] = mix(0.3, @titlebar_fg_color, @titlebar_bg_color)
  # Needed to fix Firefox's menubar text
  bg[SELECTED]    = mix(0.15, @titlebar_fg_color, @titlebar_bg_color)
  fg[SELECTED]    = @titlebar_fg_color
}

style "menubar_item" {
  xthickness = 3
  ythickness = 4

  fg[NORMAL]      = mix(0.7, @titlebar_fg_color, @titlebar_bg_color)
  bg[PRELIGHT]    = mix(0.15, @titlebar_fg_color, @titlebar_bg_color)
  fg[PRELIGHT]    = @titlebar_fg_color
  fg[INSENSITIVE] = mix(0.3, @titlebar_fg_color, @titlebar_bg_color)
}

style "menu" {
  xthickness = 0
  ythickness = 0

  bg[NORMAL]      = @base_color
  bg[INSENSITIVE] = @base_color
  bg[PRELIGHT]    = @base_color
  bg[SELECTED]    = mix(0.15, @fg_color, @base_color)
}

style "menu_item" {
  xthickness = 4
  ythickness = 4

  bg[PRELIGHT]   = @selected_bg_color
  fg[PRELIGHT]   = @selected_fg_color
  # Chromium uses this setting
  bg[SELECTED]   = @selected_bg_color
  text[SELECTED] = @selected_fg_color
  # Some widgets use text, we need to handle that
  text[NORMAL]   = @fg_color
  text[PRELIGHT] = @selected_fg_color

  # Unfortunately we can't tell regular and menu checks/radios apart
  # Without the heirarchy
  engine "pixmap" {

    #################
    # Check Buttons #
    #################

    image {
      function        = CHECK
      state           = NORMAL
      shadow          = OUT
      overlay_file    = "assets/menu-checkbox-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = PRELIGHT
      shadow          = OUT
      overlay_file    = "assets/menu-checkbox-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = ACTIVE
      shadow          = OUT
      overlay_file    = "assets/menu-checkbox-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = INSENSITIVE
      shadow          = OUT
      overlay_file    = "assets/menu-checkbox-unchecked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = NORMAL
      shadow          = IN
      overlay_file    = "assets/menu-checkbox-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = PRELIGHT
      shadow          = IN
      overlay_file    = "assets/menu-checkbox-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = ACTIVE
      shadow          = IN
      overlay_file    = "assets/menu-checkbox-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = INSENSITIVE
      shadow          = IN
      overlay_file    = "assets/menu-checkbox-checked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = NORMAL
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-checkbox-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = PRELIGHT
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-checkbox-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = ACTIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-checkbox-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = CHECK
      state           = INSENSITIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-checkbox-mixed-insensitive.png"
      overlay_stretch = FALSE
    }

    #################
    # Radio Buttons #
    #################

    image {
      function        = OPTION
      state           = NORMAL
      shadow          = OUT
      overlay_file    = "assets/menu-radio-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = PRELIGHT
      shadow          = OUT
      overlay_file    = "assets/menu-radio-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = ACTIVE
      shadow          = OUT
      overlay_file    = "assets/menu-radio-unchecked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = INSENSITIVE
      shadow          = OUT
      overlay_file    = "assets/menu-radio-unchecked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = NORMAL
      shadow          = IN
      overlay_file    = "assets/menu-radio-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = PRELIGHT
      shadow          = IN
      overlay_file    = "assets/menu-radio-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = ACTIVE
      shadow          = IN
      overlay_file    = "assets/menu-radio-checked.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = INSENSITIVE
      shadow          = IN
      overlay_file    = "assets/menu-radio-checked-insensitive.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = NORMAL
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-radio-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = PRELIGHT
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-radio-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = ACTIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-radio-mixed.png"
      overlay_stretch = FALSE
    }

    image {
      function        = OPTION
      state           = INSENSITIVE
      shadow          = ETCHED_IN
      overlay_file    = "assets/menu-radio-mixed-insensitive.png"
      overlay_stretch = FALSE
    }
  }
}

style "separator_menu_item" {
  xthickness = 0
  ythickness = 2

  engine "pixmap" {
    image {
      function = BOX
      file     = "assets/border.png"
      border   = {0, 0, 0, 1}
    }
  }
}

style "button_label" {
  fg[NORMAL] = mix(0.75, @fg_color, @bg_color)
  # fg[INSENSITIVE] = mix(0.3, @fg_color, @bg_color)

  font_name = "Medium"
}

style "checkbutton_label" {
  fg[NORMAL] = @fg_color
  # fg[INSENSITIVE] = mix(0.4, @fg_color, @bg_color)

  font_name = "Regular"
}

style "button" {
  xthickness = 4
  ythickness = 4

  # For the sake of sanity style buttons this way
  engine "pixmap" {

    ###########
    # Buttons #
    ###########

    image {
      function = BOX
      state    = NORMAL
      file     = "assets/button.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = PRELIGHT
      shadow   = OUT
      file     = "assets/button-hover.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    # Don't add hover effect on pressed buttons
    image {
      function = BOX
      state    = PRELIGHT
      shadow   = IN
      file     = "assets/button-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = ACTIVE
      file     = "assets/button-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = INSENSITIVE
      file     = "assets/button-insensitive.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }
  }
}

style "link_button" {
  # Disable the button effect, leave just the link
  engine "pixmap" {
    image {
      function = BOX
    }
  }
}

style "entry" {
  # We set this same as the border of the border of the entry
  # This way there's no overlap
  xthickness = 6
  ythickness = 6
}

style "combobox" {
  xthickness = 6
  ythickness = 6

  # This affects only the button beside an entry
  GtkButton::inner-border = {0, 0, 0, 0}
}

style "combobox_cellview" {
  text[NORMAL] = mix(0.75, @fg_color, @bg_color)
  # text[INSENSITIVE] = mix(0.3, @fg_color, @bg_color)

  font_name = "Medium"
}

style "combobox_entry" {
  # Since one side of the button is missing, we need to shift the arrow a little to the right
  GtkButton::inner-border = {0, 2, 0, 0}

  engine "pixmap" {

    #############
    # LTR entry #
    #############

    image {
      function  = SHADOW
      state     = NORMAL
      detail    = "entry"
      file      = "assets/combo-ltr-entry.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = SHADOW
      state     = ACTIVE
      detail    = "entry"
      file      = "assets/combo-ltr-entry-active.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = SHADOW
      state     = INSENSITIVE
      detail    = "entry"
      file      = "assets/combo-ltr-entry-insensitive.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    #############
    # RTL entry #
    #############

    image {
      function  = SHADOW
      state     = NORMAL
      detail    = "entry"
      file      = "assets/combo-rtl-entry.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = SHADOW
      state     = ACTIVE
      detail    = "entry"
      file      = "assets/combo-rtl-entry-active.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = SHADOW
      state     = INSENSITIVE
      detail    = "entry"
      file      = "assets/combo-rtl-entry-insensitive.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    ##############
    # LTR button #
    ##############

    image {
      function  = BOX
      state     = NORMAL
      detail    = "button"
      file      = "assets/combo-ltr-button.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = BOX
      state     = PRELIGHT
      detail    = "button"
      file      = "assets/combo-ltr-button-hover.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = BOX
      state     = ACTIVE
      detail    = "button"
      file      = "assets/combo-ltr-button-active.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = BOX
      state     = INSENSITIVE
      detail    = "button"
      file      = "assets/combo-ltr-button-insensitive.png"
      border    = {0, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    ##############
    # RTL button #
    ##############

    image {
      function  = BOX
      state     = NORMAL
      detail    = "button"
      file      = "assets/combo-rtl-button.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = BOX
      state     = PRELIGHT
      detail    = "button"
      file      = "assets/combo-rtl-button-hover.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = BOX
      state     = ACTIVE
      detail    = "button"
      file      = "assets/combo-rtl-button-active.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = BOX
      state     = INSENSITIVE
      detail    = "button"
      file      = "assets/combo-rtl-button-insensitive.png"
      border    = {8, 0, 8, 8}
      stretch   = TRUE
      direction = RTL
    }
  }
}

style "combo_button_padding" {
  # Since one side of the button is missing, we need to shift the arrow a
  # little to the right.
  # This is the same thing we've done above but the combo, unlike the combobox,
  # uses padding the same way as a button.
  GtkButton::inner-border = {3, 6, 3, 3}
}

style "notebook" {
  xthickness = 3
  ythickness = 3
}

style "notebook_tab_label" {
  fg[ACTIVE] = mix(0.75, @fg_color, @bg_color)

  font_name = "Medium"
}

style "notebook_viewport" {
  bg[NORMAL] = @base_color
}

style "notebook_bg" {
  bg[NORMAL]      = @base_color
  bg[PRELIGHT]    = @base_color
  bg[INSENSITIVE] = @base_color
}

style "notebook_entry" {
  engine "pixmap" {
    image {
      function = SHADOW
      state    = ACTIVE
      detail   = "entry"
      file     = "assets/notebook-entry-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = SHADOW
      state    = INSENSITIVE
      detail   = "entry"
      file     = "assets/notebook-entry-insensitive.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = SHADOW
      detail   = "entry"
      file     = "assets/notebook-entry.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }
  }
}

style "normal_bg" {
  bg[NORMAL]      = @bg_color
  bg[PRELIGHT]    = @bg_color
  bg[INSENSITIVE] = @bg_color
}

style "normal_entry" {
  engine "pixmap" {
    image {
      function = SHADOW
      state    = ACTIVE
      detail   = "entry"
      file     = "assets/entry-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = SHADOW
      state    = INSENSITIVE
      detail   = "entry"
      file     = "assets/entry-insensitive.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = SHADOW
      detail   = "entry"
      file     = "assets/entry.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }
  }
}

style "notebook_combo" {
  engine "pixmap" {

    #############
    # LTR entry #
    #############

    image {
      function  = SHADOW
      state     = NORMAL
      detail    = "entry"
      file      = "assets/notebook-combo-ltr-entry.png"
      border    = {8, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = SHADOW
      state     = ACTIVE
      detail    = "entry"
      file      = "assets/notebook-combo-ltr-entry-active.png"
      border    = {8, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = SHADOW
      state     = INSENSITIVE
      detail    = "entry"
      file      = "assets/notebook-combo-ltr-entry-insensitive.png"
      border    = {8, 8, 8, 8}
      stretch   = TRUE
      direction = LTR
    }

    #############
    # RTL entry #
    #############

    image {
      function  = SHADOW
      state     = NORMAL
      detail    = "entry"
      file      = "assets/notebook-combo-rtl-entry.png"
      border    = {8, 8, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = SHADOW
      state     = ACTIVE
      detail    = "entry"
      file      = "assets/notebook-combo-rtl-entry-active.png"
      border    = {8, 8, 8, 8}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = SHADOW
      state     = INSENSITIVE
      detail    = "entry"
      file      = "assets/notebook-combo-rtl-entry-insensitive.png"
      border    = {8, 8, 8, 8}
      stretch   = TRUE
      direction = RTL
    }
  }
}

style "textview" {
  bg[NORMAL] = @base_color
}

style "scale_horz" {
  engine "pixmap" {
    image {
      function    = BOX
      detail      = "trough-upper"
      file        = "assets/scale-horz-trough.png"
      border      = {6, 6, 0, 0}
      stretch     = TRUE
    }

    image {
      function    = BOX
      detail      = "trough-lower"
      file        = "assets/scale-horz-trough-active.png"
      border      = {6, 6, 0, 0}
      stretch     = TRUE
    }
  }
}

style "scale_vert" {
  engine "pixmap" {
    image {
      function    = BOX
      detail      = "trough-upper"
      file        = "assets/scale-vert-trough.png"
      border      = {0, 0, 6, 6}
      stretch     = TRUE
    }

    image {
      function    = BOX
      detail      = "trough-lower"
      file        = "assets/scale-vert-trough-active.png"
      border      = {0, 0, 6, 6}
      stretch     = TRUE
    }
  }
}

style "progressbar" {
  xthickness = 0
  ythickness = 0

  fg[PRELIGHT] = @selected_fg_color

  engine "pixmap" {
    image {
      function    = BOX
      detail      = "trough"
      file        = "assets/progressbar-trough-indigo.png"
      border      = {0, 0, 0, 0}
      stretch     = TRUE
      orientation = HORIZONTAL
    }

    image {
      function    = BOX
      detail      = "trough"
      file        = "assets/progressbar-trough-indigo.png"
      border      = {0, 0, 0, 0}
      stretch     = TRUE
      orientation = VERTICAL
    }
  }
}

style "treeview_header" {
  xthickness = 2
  ythickness = 2

  fg[NORMAL]   = mix(0.75, @fg_color, @base_color)
  fg[PRELIGHT] = @fg_color

  font_name = "Medium"

  GtkButton::inner-border = {4, 4, 0, 2}

  engine "pixmap" {
    image {
      function  = BOX
      state     = NORMAL
      file      = "assets/treeview-ltr-button.png"
      border    = {0, 1, 0, 1}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = BOX
      state     = PRELIGHT
      file      = "assets/treeview-ltr-button-hover.png"
      border    = {0, 1, 0, 1}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = BOX
      state     = ACTIVE
      file      = "assets/treeview-ltr-button-active.png"
      border    = {0, 1, 0, 1}
      stretch   = TRUE
      direction = LTR
    }

    image {
      function  = BOX
      state     = NORMAL
      file      = "assets/treeview-rtl-button.png"
      border    = {1, 0, 0, 1}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = BOX
      state     = PRELIGHT
      file      = "assets/treeview-rtl-button-hover.png"
      border    = {1, 0, 0, 1}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function  = BOX
      state     = ACTIVE
      file      = "assets/treeview-rtl-button-active.png"
      border    = {1, 0, 0, 1}
      stretch   = TRUE
      direction = RTL
    }

    image {
      function        = ARROW
      state           = NORMAL
      overlay_file    = "assets/pan-up-alt.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = ACTIVE
      overlay_file    = "assets/pan-up.png"
      overlay_stretch = FALSE
      arrow_direction = UP
    }

    image {
      function        = ARROW
      state           = NORMAL
      overlay_file    = "assets/pan-down-alt.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }

    image {
      function        = ARROW
      state           = PRELIGHT
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }

    image {
      function        = ARROW
      state           = ACTIVE
      overlay_file    = "assets/pan-down.png"
      overlay_stretch = FALSE
      arrow_direction = DOWN
    }
  }
}

style "scrolled_window" {
  engine "pixmap" {
    image {
      function = SHADOW
      file     = "assets/frame.png"
      border   = {1, 1, 1, 1}
      stretch  = TRUE
    }
  }
}

style "frame" {
  engine "pixmap" {
    image {
      function = SHADOW
      shadow   = NONE
    }

    image {
      function = SHADOW
      file     = "assets/frame.png"
      border   = {1, 1, 1, 1}
      stretch  = TRUE
    }

    image {
      function       = SHADOW_GAP
      file           = "assets/frame.png"
      border         = {1, 1, 1, 1}
      stretch        = TRUE
      gap_start_file = "assets/border.png"
      gap_end_file   = "assets/border.png"
    }
  }
}

style "tool_button" {
  GtkButton::inner-border = {2, 2, 2, 2}

  # For the sake of sanity style buttons this way
  engine "pixmap" {
    image {
      function = BOX
      state    = NORMAL
      file     = "assets/flat-button.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = PRELIGHT
      shadow   = OUT
      file     = "assets/flat-button-hover.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    # Don't add hover effect on pressed buttons
    image {
      function = BOX
      state    = PRELIGHT
      shadow   = IN
      file     = "assets/flat-button-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = ACTIVE
      file     = "assets/flat-button-active.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = INSENSITIVE
      shadow   = OUT
      file     = "assets/flat-button-insensitive.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }

    image {
      function = BOX
      state    = INSENSITIVE
      shadow   = IN
      file     = "assets/button-insensitive.png"
      border   = {8, 8, 8, 8}
      stretch  = TRUE
    }
  }
}

style "toolbar_separator" {
  GtkWidget::wide-separators  = 1
  GtkWidget::separator-width  = 1
  GtkWidget::separator-height = 1

  engine "pixmap" {
    image {
      function = BOX
      file     = "assets/border.png"
    }
  }
}

style "inline_toolbar" {
  # GtkToolbar::button-relief = GTK_RELIEF_NORMAL

  engine "pixmap" {
    image {
      function = BOX
      file     = "assets/frame-inline.png"
      border   = {1, 1, 0, 1}
      stretch  = TRUE
    }
  }
}

style "tooltip" {
  xthickness = 8
  ythickness = 8

  bg[NORMAL]   = @base_color
  fg[NORMAL]   = @fg_color
  bg[SELECTED] = @base_color
}

style "disable_text_shadow" {
  engine "murrine" {
    textstyle = 0
  }
}

style "disable_separator" {
  xthickness = 0
  ythickness = 0

  GtkWidget::wide-separators = 1
}

style "panel-launchers"
{
  xthickness = 0
  ythickness = 0
  GtkButton::inner-border = {1, 2, 1, 2}
}

# Default style, containing theme properties and trying to match every widget as
# much as possible, which is not only faster than trying to match every widget
# by its own but also less bug-prune and more consistent. However there is some
# widget specific stuff that needs to be taken care of, which is the point of
# every other style below.
class "GtkWidget" style "default"

######################################
# Override padding, style and colour #
######################################

class "GtkButton"                                                  style "button"
class "GtkLinkButton"                                              style "link_button"
class "GtkEntry"                                                   style "entry"
class "GtkOldEditable"                                             style "entry"
class "GtkNotebook"                                                style "notebook"
class "GtkHScale"                                                  style "scale_horz"
class "GtkVScale"                                                  style "scale_vert"
class "GtkProgressBar"                                             style "progressbar"
class "GtkScrolledWindow"                                          style "scrolled_window"
class "GtkFrame"                                                   style "frame"
class "GtkSeparatorToolItem"                                       style "toolbar_separator"
class "GtkMenuBar"                                                 style "menubar"
class "GtkMenu"                                                    style "menu"
class "GtkTextView"                                                style "textview"

# Menu and menubar items
widget_class "*<GtkMenuItem>*"                                     style "menu_item"
widget_class "*<GtkMenuBar>.<GtkMenuItem>*"                        style "menubar_item"
widget_class "*<GtkSeparatorMenuItem>*"                            style "separator_menu_item"

# Treeview buttons
widget_class "*<GtkTreeView>*<GtkButton>*"                         style "treeview_header"

# Give the file chooser toolbar a border
widget_class "*<GtkFileChooserDefault>*<GtkToolbar>"               style "inline_toolbar"

# Fix padding on regular comboboxes
widget_class "*<GtkComboBox>.<GtkButton>"                          style "combobox"

# And disable separators on them
widget_class "*<GtkComboBox>.<GtkButton>*<GtkSeparator>"           style "disable_separator"
widget_class "*<GtkFontButton>*<GtkSeparator>"                     style "disable_separator"
widget_class "*<GtkFileChooserButton>*<GtkSeparator>"              style "disable_separator"

# Join together the ComboBoxEntry entry and button
widget_class "*<GtkComboBoxEntry>*"                                style "combobox_entry"

# Join the Combo entry and button
widget_class "*<GtkCombo>*"                                        style "combobox_entry"

# Tweak the padding on the button a little bit because it
# uses it a bit differently
widget_class "*<GtkCombo>.<GtkButton>"                             style "combo_button_padding"

# Alas we cannot do the same for ComboBoxText because there
# isn't a way to apply the style to only the comboboxes that
# have an entry inside

# Tool buttons have different styles
widget_class "*<GtkToolButton>*<GtkButton>"                        style "tool_button"
widget_class "*<GtkVBox>*<GtkEventBox>.<GtkToolbar>*<GtkButton>"   style "tool_button"

# Notebooks
widget_class "*<GtkNotebook>.<GtkLabel>"                           style "notebook_tab_label"
widget_class "*<GtkNotebook>.<GtkHBox>.<GtkLabel>"                 style "notebook_tab_label"

# Notebooks are white, act accordingly
widget_class "*<GtkNotebook>*<GtkEntry>"                           style "notebook_entry"
widget_class "*<GtkNotebook>*<GtkProgressBar>"                     style "notebook_bg"
widget_class "*<GtkNotebook>*<GtkSpinButton>"                      style "notebook_bg"
widget_class "*<GtkNotebook>*<GtkScrolledWindow>*<GtkViewport>"    style "notebook_bg"
widget_class "*<GtkNotebook>*<GimpRuler>"                          style "notebook_bg"
widget_class "*<GtkNotebook>.<GimpDisplayShell>*<GtkEventBox>"     style "notebook_bg"
widget_class "*<GtkNotebook>*<GtkComboBoxEntry>*"                  style "notebook_combo"
widget_class "*<GtkNotebook>*<GtkCombo>*"                          style "notebook_combo"

# However, stuff inside eventboxes inside notebooks is grey
# again, react
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkEntry>"             style "normal_entry"
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkProgressBar>"       style "normal_bg"
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkSpinButton>"        style "normal_bg"
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkComboBoxEntry>*"    style "combobox_entry"
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkCombo>*"            style "combobox_entry"
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkCombo>.<GtkButton>" style "combo_button_padding"

# Button labels
widget_class "*<GtkButton>*<GtkLabel>"                             style "button_label"

# Checkbutton labels
widget_class "*<GtkCheckButton>.<GtkLabel>"                        style "checkbutton_label"

# ComboBoxes tend to draw the button label with text[]
# instead of fg[], we need to fix that
widget_class "*<GtkComboBox>*<GtkCellView>"                        style "combobox_cellview"

# Disable white text shadows
widget_class "*<GtkLabel>"                                         style "disable_text_shadow"
widget_class "*<GtkCellView>"                                      style "disable_text_shadow"

# GTK tooltips
widget "gtk-tooltip*"                                              style "tooltip"

# Xfce4 panel launchers
widget "*launcher*" style "panel-launchers"

{'repo_name': 'vinceliuice/Canta-theme', 'stars': '564', 'repo_language': 'CSS', 'file_name': 'index.theme', 'mime_type': 'text/plain', 'hash': 297966769199642275, 'source_dataset': 'data'}


// This file was procedurally generated from the following sources:
// - src/class-elements/rs-private-setter-alt.case
// - src/class-elements/productions/cls-decl-after-same-line-async-method.template
/*---
description: Valid PrivateName as private setter (field definitions after an async method in the same line)
esid: prod-FieldDefinition
features: [class-methods-private, class-fields-private, class, class-fields-public, async-functions]
flags: [generated, async]
includes: [propertyHelper.js]
info: |
    ClassElement :
      MethodDefinition
      ...
      ;

    MethodDefinition :
      ...
      set ClassElementName ( PropertySetParameterList ) { FunctionBody }

    ClassElementName :
      PropertyName
      PrivateName

    PrivateName ::
      # IdentifierName

    IdentifierName ::
      IdentifierStart
      IdentifierName IdentifierPart

    IdentifierStart ::
      UnicodeIDStart
      $
      _
      \ UnicodeEscapeSequence

    IdentifierPart::
      UnicodeIDContinue
      $
      \ UnicodeEscapeSequence
      <ZWNJ> <ZWJ>

    UnicodeIDStart::
      any Unicode code point with the Unicode property "ID_Start"

    UnicodeIDContinue::
      any Unicode code point with the Unicode property "ID_Continue"

    NOTE 3
    The sets of code points with Unicode properties "ID_Start" and
    "ID_Continue" include, respectively, the code points with Unicode
    properties "Other_ID_Start" and "Other_ID_Continue".

---*/

class C {
  async m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW__NJ_; #ZW__J_;
  set #$(value) {
    this.#$_ = value;
  }
  set #_(value) {
    this.#__ = value;
  }
  set #\u{6F}(value) {
    this.#\u{6F}_ = value;
  }
  set #℘(value) {
    this.#℘_ = value;
  }
  set #ZW__NJ(value) {
    this.#ZW__NJ_ = value;
  }
  set #ZW__J(value) {
    this.#ZW__J_ = value;
  }
;
  $(value) {
    this.#$ = value;
    return this.#$_;
  }
  _(value) {
    this.#_ = value;
    return this.#__;
  }
  \u{6F}(value) {
    this.#\u{6F} = value;
    return this.#\u{6F}_;
  }
  ℘(value) {
    this.#℘ = value;
    return this.#℘_;
  }
  ZW__NJ(value) {
    this.#ZW__NJ = value;
    return this.#ZW__NJ_;
  }
  ZW__J(value) {
    this.#ZW__J = value;
    return this.#ZW__J_;
  }

}

var c = new C();

assert.sameValue(Object.hasOwnProperty.call(c, "m"), false);
assert.sameValue(c.m, C.prototype.m);

verifyProperty(C.prototype, "m", {
  enumerable: false,
  configurable: true,
  writable: true,
}, {restore: true});

c.m().then(function(v) {
  assert.sameValue(v, 42);

  function assertions() {
    // Cover $DONE handler for async cases.
    function $DONE(error) {
      if (error) {
        throw new Test262Error('Test262:AsyncTestFailure')
      }
    }
    assert.sameValue(c.$(1), 1);
    assert.sameValue(c._(1), 1);
    assert.sameValue(c.\u{6F}(1), 1);
    assert.sameValue(c.℘(1), 1);
    assert.sameValue(c.ZW__NJ(1), 1);
    assert.sameValue(c.ZW__J(1), 1);
  }

  return Promise.resolve(assertions());
}).then($DONE, $DONE);

{'repo_name': 'tc39/test262', 'stars': '1439', 'repo_language': 'JavaScript', 'file_name': 'S11.8.4_A3.2_T1.1.js', 'mime_type': 'text/plain', 'hash': -7574322174734451037, 'source_dataset': 'data'}


package com.lwkandroid.rcvadapter;

import android.content.Context;

import com.lwkandroid.rcvadapter.base.RcvBaseItemView;
import com.lwkandroid.rcvadapter.bean.RcvSectionWrapper;
import com.lwkandroid.rcvadapter.holder.RcvHolder;

import java.util.List;

/**
 * Created by LWK
 * TODO 支持单种Section、多种Data类型的适配器
 * 【可以与RcvStickyLayout联用】
 */
public abstract class RcvSectionSingleLabelAdapter<S, D> extends RcvSectionMultiLabelAdapter<S, D>
{
    public RcvSectionSingleLabelAdapter(Context context, List<RcvSectionWrapper<S, D>> datas)
    {
        super(context, datas);
    }

    @Override
    protected RcvBaseItemView<RcvSectionWrapper<S, D>>[] createLabelItemViews()
    {
        return new RcvBaseItemView[]{new RcvSectionLabelItemView()};
    }

    private class RcvSectionLabelItemView extends RcvBaseItemView<RcvSectionWrapper<S, D>>
    {
        @Override
        public int getItemViewLayoutId()
        {
            return getSectionLabelLayoutId();
        }

        @Override
        public boolean isForViewType(RcvSectionWrapper<S, D> item, int position)
        {
            return item.isSection();
        }

        @Override
        public void onBindView(RcvHolder holder, RcvSectionWrapper<S, D> wrapper, int position)
        {
            onBindSectionLabelView(holder, wrapper.getSection(), position);
        }
    }

    /************************************ 子类需要实现的抽象方法 ****************************************************************/

    /**
     * 设置Section的布局id
     */
    public abstract int getSectionLabelLayoutId();

    /**
     * 绑定Section 数据和UI
     */
    public abstract void onBindSectionLabelView(RcvHolder holder, S section, int position);
}

{'repo_name': 'Vanish136/RecyclerViewAdapter', 'stars': '118', 'repo_language': 'Java', 'file_name': 'RcvSectionWrapper.java', 'mime_type': 'text/plain', 'hash': 6546947703599023684, 'source_dataset': 'data'}


// +build fixtures

package pools

import (
	"fmt"
	"net/http"
	"testing"

	th "github.com/rackspace/gophercloud/testhelper"
	"github.com/rackspace/gophercloud/testhelper/client"
)

// PoolsListBody contains the canned body of a pool list response.
const PoolsListBody = `
{
	"pools":[
	         {
			"lb_algorithm":"ROUND_ROBIN",
			"protocol":"HTTP",
			"description":"",
			"healthmonitor_id": "466c8345-28d8-4f84-a246-e04380b0461d",
			"members":[{"id": "53306cda-815d-4354-9fe4-59e09da9c3c5"}],
			"listeners":[{"id": "2a280670-c202-4b0b-a562-34077415aabf"}],
			"loadbalancers":[{"id": "79e05663-7f03-45d2-a092-8b94062f22ab"}],
			"id":"72741b06-df4d-4715-b142-276b6bce75ab",
			"name":"web",
			"admin_state_up":true,
			"tenant_id":"83657cfcdfe44cd5920adaf26c48ceea",
			"provider": "haproxy"
		},
		{
			"lb_algorithm":"LEAST_CONNECTION",
			"protocol":"HTTP",
			"description":"",
			"healthmonitor_id": "5f6c8345-28d8-4f84-a246-e04380b0461d",
			"members":[{"id": "67306cda-815d-4354-9fe4-59e09da9c3c5"}],
			"listeners":[{"id": "2a280670-c202-4b0b-a562-34077415aabf"}],
			"loadbalancers":[{"id": "79e05663-7f03-45d2-a092-8b94062f22ab"}],
			"id":"c3741b06-df4d-4715-b142-276b6bce75ab",
			"name":"db",
			"admin_state_up":true,
			"tenant_id":"83657cfcdfe44cd5920adaf26c48ceea",
			"provider": "haproxy"
		}
	]
}
`

// SinglePoolBody is the canned body of a Get request on an existing pool.
const SinglePoolBody = `
{
	"pool": {
		"lb_algorithm":"LEAST_CONNECTION",
		"protocol":"HTTP",
		"description":"",
		"healthmonitor_id": "5f6c8345-28d8-4f84-a246-e04380b0461d",
		"members":[{"id": "67306cda-815d-4354-9fe4-59e09da9c3c5"}],
		"listeners":[{"id": "2a280670-c202-4b0b-a562-34077415aabf"}],
		"loadbalancers":[{"id": "79e05663-7f03-45d2-a092-8b94062f22ab"}],
		"id":"c3741b06-df4d-4715-b142-276b6bce75ab",
		"name":"db",
		"admin_state_up":true,
		"tenant_id":"83657cfcdfe44cd5920adaf26c48ceea",
		"provider": "haproxy"
	}
}
`

// PostUpdatePoolBody is the canned response body of a Update request on an existing pool.
const PostUpdatePoolBody = `
{
	"pool": {
		"lb_algorithm":"LEAST_CONNECTION",
		"protocol":"HTTP",
		"description":"",
		"healthmonitor_id": "5f6c8345-28d8-4f84-a246-e04380b0461d",
		"members":[{"id": "67306cda-815d-4354-9fe4-59e09da9c3c5"}],
		"listeners":[{"id": "2a280670-c202-4b0b-a562-34077415aabf"}],
		"loadbalancers":[{"id": "79e05663-7f03-45d2-a092-8b94062f22ab"}],
		"id":"c3741b06-df4d-4715-b142-276b6bce75ab",
		"name":"db",
		"admin_state_up":true,
		"tenant_id":"83657cfcdfe44cd5920adaf26c48ceea",
		"provider": "haproxy"
	}
}
`

var (
	PoolWeb = Pool{
		LBMethod:      "ROUND_ROBIN",
		Protocol:      "HTTP",
		Description:   "",
		MonitorID:     "466c8345-28d8-4f84-a246-e04380b0461d",
		TenantID:      "83657cfcdfe44cd5920adaf26c48ceea",
		AdminStateUp:  true,
		Name:          "web",
		Members:       []Member{{ID: "53306cda-815d-4354-9fe4-59e09da9c3c5"}},
		ID:            "72741b06-df4d-4715-b142-276b6bce75ab",
		Loadbalancers: []LoadBalancerID{{ID: "79e05663-7f03-45d2-a092-8b94062f22ab"}},
		Listeners:     []ListenerID{{ID: "2a280670-c202-4b0b-a562-34077415aabf"}},
		Provider:      "haproxy",
	}
	PoolDb = Pool{
		LBMethod:      "LEAST_CONNECTION",
		Protocol:      "HTTP",
		Description:   "",
		MonitorID:     "5f6c8345-28d8-4f84-a246-e04380b0461d",
		TenantID:      "83657cfcdfe44cd5920adaf26c48ceea",
		AdminStateUp:  true,
		Name:          "db",
		Members:       []Member{{ID: "67306cda-815d-4354-9fe4-59e09da9c3c5"}},
		ID:            "c3741b06-df4d-4715-b142-276b6bce75ab",
		Loadbalancers: []LoadBalancerID{{ID: "79e05663-7f03-45d2-a092-8b94062f22ab"}},
		Listeners:     []ListenerID{{ID: "2a280670-c202-4b0b-a562-34077415aabf"}},
		Provider:      "haproxy",
	}
	PoolUpdated = Pool{
		LBMethod:      "LEAST_CONNECTION",
		Protocol:      "HTTP",
		Description:   "",
		MonitorID:     "5f6c8345-28d8-4f84-a246-e04380b0461d",
		TenantID:      "83657cfcdfe44cd5920adaf26c48ceea",
		AdminStateUp:  true,
		Name:          "db",
		Members:       []Member{{ID: "67306cda-815d-4354-9fe4-59e09da9c3c5"}},
		ID:            "c3741b06-df4d-4715-b142-276b6bce75ab",
		Loadbalancers: []LoadBalancerID{{ID: "79e05663-7f03-45d2-a092-8b94062f22ab"}},
		Listeners:     []ListenerID{{ID: "2a280670-c202-4b0b-a562-34077415aabf"}},
		Provider:      "haproxy",
	}
)

// HandlePoolListSuccessfully sets up the test server to respond to a pool List request.
func HandlePoolListSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "GET")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)

		w.Header().Add("Content-Type", "application/json")
		r.ParseForm()
		marker := r.Form.Get("marker")
		switch marker {
		case "":
			fmt.Fprintf(w, PoolsListBody)
		case "45e08a3e-a78f-4b40-a229-1e7e23eee1ab":
			fmt.Fprintf(w, `{ "pools": [] }`)
		default:
			t.Fatalf("/v2.0/lbaas/pools invoked with unexpected marker=[%s]", marker)
		}
	})
}

// HandlePoolCreationSuccessfully sets up the test server to respond to a pool creation request
// with a given response.
func HandlePoolCreationSuccessfully(t *testing.T, response string) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "POST")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
		th.TestJSONRequest(t, r, `{
			"pool": {
			        "lb_algorithm": "ROUND_ROBIN",
			        "protocol": "HTTP",
			        "name": "Example pool",
			        "tenant_id": "2ffc6e22aae24e4795f87155d24c896f",
			        "loadbalancer_id": "79e05663-7f03-45d2-a092-8b94062f22ab"
			}
		}`)

		w.WriteHeader(http.StatusAccepted)
		w.Header().Add("Content-Type", "application/json")
		fmt.Fprintf(w, response)
	})
}

// HandlePoolGetSuccessfully sets up the test server to respond to a pool Get request.
func HandlePoolGetSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/c3741b06-df4d-4715-b142-276b6bce75ab", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "GET")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
		th.TestHeader(t, r, "Accept", "application/json")

		fmt.Fprintf(w, SinglePoolBody)
	})
}

// HandlePoolDeletionSuccessfully sets up the test server to respond to a pool deletion request.
func HandlePoolDeletionSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/c3741b06-df4d-4715-b142-276b6bce75ab", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "DELETE")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)

		w.WriteHeader(http.StatusNoContent)
	})
}

// HandlePoolUpdateSuccessfully sets up the test server to respond to a pool Update request.
func HandlePoolUpdateSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/c3741b06-df4d-4715-b142-276b6bce75ab", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "PUT")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
		th.TestHeader(t, r, "Accept", "application/json")
		th.TestHeader(t, r, "Content-Type", "application/json")
		th.TestJSONRequest(t, r, `{
			"pool": {
				"name": "NewPoolName",
                                "lb_algorithm": "LEAST_CONNECTIONS"
			}
		}`)

		fmt.Fprintf(w, PostUpdatePoolBody)
	})
}

// MembersListBody contains the canned body of a member list response.
const MembersListBody = `
{
	"members":[
		{
			"id": "2a280670-c202-4b0b-a562-34077415aabf",
			"address": "10.0.2.10",
			"weight": 5,
			"name": "web",
			"subnet_id": "1981f108-3c48-48d2-b908-30f7d28532c9",
			"tenant_id": "2ffc6e22aae24e4795f87155d24c896f",
			"admin_state_up":true,
			"protocol_port": 80
		},
		{
			"id": "fad389a3-9a4a-4762-a365-8c7038508b5d",
			"address": "10.0.2.11",
			"weight": 10,
			"name": "db",
			"subnet_id": "1981f108-3c48-48d2-b908-30f7d28532c9",
			"tenant_id": "2ffc6e22aae24e4795f87155d24c896f",
			"admin_state_up":false,
			"protocol_port": 80
		}
	]
}
`

// SingleMemberBody is the canned body of a Get request on an existing member.
const SingleMemberBody = `
{
	"member": {
		"id": "fad389a3-9a4a-4762-a365-8c7038508b5d",
		"address": "10.0.2.11",
		"weight": 10,
		"name": "db",
		"subnet_id": "1981f108-3c48-48d2-b908-30f7d28532c9",
		"tenant_id": "2ffc6e22aae24e4795f87155d24c896f",
		"admin_state_up":false,
		"protocol_port": 80
	}
}
`

// PostUpdateMemberBody is the canned response body of a Update request on an existing member.
const PostUpdateMemberBody = `
{
	"member": {
		"id": "fad389a3-9a4a-4762-a365-8c7038508b5d",
		"address": "10.0.2.11",
		"weight": 10,
		"name": "db",
		"subnet_id": "1981f108-3c48-48d2-b908-30f7d28532c9",
		"tenant_id": "2ffc6e22aae24e4795f87155d24c896f",
		"admin_state_up":false,
		"protocol_port": 80
	}
}
`

var (
	MemberWeb = Member{
		SubnetID:     "1981f108-3c48-48d2-b908-30f7d28532c9",
		TenantID:     "2ffc6e22aae24e4795f87155d24c896f",
		AdminStateUp: true,
		Name:         "web",
		ID:           "2a280670-c202-4b0b-a562-34077415aabf",
		Address:      "10.0.2.10",
		Weight:       5,
		ProtocolPort: 80,
	}
	MemberDb = Member{
		SubnetID:     "1981f108-3c48-48d2-b908-30f7d28532c9",
		TenantID:     "2ffc6e22aae24e4795f87155d24c896f",
		AdminStateUp: false,
		Name:         "db",
		ID:           "fad389a3-9a4a-4762-a365-8c7038508b5d",
		Address:      "10.0.2.11",
		Weight:       10,
		ProtocolPort: 80,
	}
	MemberUpdated = Member{
		SubnetID:     "1981f108-3c48-48d2-b908-30f7d28532c9",
		TenantID:     "2ffc6e22aae24e4795f87155d24c896f",
		AdminStateUp: false,
		Name:         "db",
		ID:           "fad389a3-9a4a-4762-a365-8c7038508b5d",
		Address:      "10.0.2.11",
		Weight:       10,
		ProtocolPort: 80,
	}
)

// HandleMemberListSuccessfully sets up the test server to respond to a member List request.
func HandleMemberListSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/332abe93-f488-41ba-870b-2ac66be7f853/members", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "GET")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)

		w.Header().Add("Content-Type", "application/json")
		r.ParseForm()
		marker := r.Form.Get("marker")
		switch marker {
		case "":
			fmt.Fprintf(w, MembersListBody)
		case "45e08a3e-a78f-4b40-a229-1e7e23eee1ab":
			fmt.Fprintf(w, `{ "members": [] }`)
		default:
			t.Fatalf("/v2.0/lbaas/pools/332abe93-f488-41ba-870b-2ac66be7f853/members invoked with unexpected marker=[%s]", marker)
		}
	})
}

// HandleMemberCreationSuccessfully sets up the test server to respond to a member creation request
// with a given response.
func HandleMemberCreationSuccessfully(t *testing.T, response string) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/332abe93-f488-41ba-870b-2ac66be7f853/members", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "POST")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
		th.TestJSONRequest(t, r, `{
			"member": {
			        "address": "10.0.2.11",
			        "weight": 10,
			        "name": "db",
			        "subnet_id": "1981f108-3c48-48d2-b908-30f7d28532c9",
			        "tenant_id": "2ffc6e22aae24e4795f87155d24c896f",
			        "protocol_port": 80
			}
		}`)

		w.WriteHeader(http.StatusAccepted)
		w.Header().Add("Content-Type", "application/json")
		fmt.Fprintf(w, response)
	})
}

// HandleMemberGetSuccessfully sets up the test server to respond to a member Get request.
func HandleMemberGetSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/332abe93-f488-41ba-870b-2ac66be7f853/members/2a280670-c202-4b0b-a562-34077415aabf", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "GET")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
		th.TestHeader(t, r, "Accept", "application/json")

		fmt.Fprintf(w, SingleMemberBody)
	})
}

// HandleMemberDeletionSuccessfully sets up the test server to respond to a member deletion request.
func HandleMemberDeletionSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/332abe93-f488-41ba-870b-2ac66be7f853/members/2a280670-c202-4b0b-a562-34077415aabf", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "DELETE")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)

		w.WriteHeader(http.StatusNoContent)
	})
}

// HandleMemberUpdateSuccessfully sets up the test server to respond to a member Update request.
func HandleMemberUpdateSuccessfully(t *testing.T) {
	th.Mux.HandleFunc("/v2.0/lbaas/pools/332abe93-f488-41ba-870b-2ac66be7f853/members/2a280670-c202-4b0b-a562-34077415aabf", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "PUT")
		th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
		th.TestHeader(t, r, "Accept", "application/json")
		th.TestHeader(t, r, "Content-Type", "application/json")
		th.TestJSONRequest(t, r, `{
			"member": {
				"name": "newMemberName",
                                "weight": 4
			}
		}`)

		fmt.Fprintf(w, PostUpdateMemberBody)
	})
}

{'repo_name': 'rackspace/gophercloud', 'stars': '453', 'repo_language': 'Go', 'file_name': 'bootstrap', 'mime_type': 'text/x-shellscript', 'hash': -7059838333258089255, 'source_dataset': 'data'}


import React, {Component} from 'react'
import {Route, Switch} from 'react-router-dom'
import Home from './core/Home'
import Users from './user/Users'
import Signup from './user/Signup'
import Signin from './auth/Signin'
import EditProfile from './user/EditProfile'
import Profile from './user/Profile'
import PrivateRoute from './auth/PrivateRoute'
import Menu from './core/Menu'

const MainRouter = () => {
    return (<div>
      <Menu/>
      <Switch>
        <Route exact path="/" component={Home}/>
        <Route path="/users" component={Users}/>
        <Route path="/signup" component={Signup}/>
        <Route path="/signin" component={Signin}/>
        <PrivateRoute path="/user/edit/:userId" component={EditProfile}/>
        <Route path="/user/:userId" component={Profile}/>
      </Switch>
    </div>)
}

export default MainRouter

{'repo_name': 'shamahoque/mern-social', 'stars': '136', 'repo_language': 'JavaScript', 'file_name': 'post.model.js', 'mime_type': 'text/plain', 'hash': -1009566735998334577, 'source_dataset': 'data'}


--TEST--
"date" filter
--TEMPLATE--
{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }}
{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }}
{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }}
--DATA--
date_default_timezone_set('UTC');
return array('date' => mktime(13, 45, 0, 10, 4, 2010))
--EXPECT--
04/10/2010 08:45:00 -05:00
04/10/2010 08:45:00 -05:00
04/10/2010 08:45:00 -05:00

{'repo_name': 'opencall/opencall', 'stars': '246', 'repo_language': 'JavaScript', 'file_name': 'alert.html.twig', 'mime_type': 'text/plain', 'hash': -3840018824864091296, 'source_dataset': 'data'}


/*
 * MPEG-1/2 VLC
 * copyright (c) 2000,2001 Fabrice Bellard
 * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/**
 * @file
 * MPEG-1/2 VLC.
 */

#ifndef AVCODEC_MPEG12VLC_H
#define AVCODEC_MPEG12VLC_H

#include "vlc.h"

#define DC_VLC_BITS 9
#define MV_VLC_BITS 9
#define TEX_VLC_BITS 9

#define MBINCR_VLC_BITS 9
#define MB_PAT_VLC_BITS 9
#define MB_PTYPE_VLC_BITS 6
#define MB_BTYPE_VLC_BITS 6

extern VLC ff_dc_lum_vlc;
extern VLC ff_dc_chroma_vlc;
extern VLC ff_mbincr_vlc;
extern VLC ff_mb_ptype_vlc;
extern VLC ff_mb_btype_vlc;
extern VLC ff_mb_pat_vlc;
extern VLC ff_mv_vlc;

void ff_mpeg12_init_vlcs(void);

#endif /* AVCODEC_MPEG12VLC_H */

{'repo_name': 'fengbingchun/OpenCV_Test', 'stars': '101', 'repo_language': 'C', 'file_name': 'build.sh', 'mime_type': 'text/x-shellscript', 'hash': -6069802522949843402, 'source_dataset': 'data'}


Audio complex for Eukrea boards with tlv320aic23 codec.

Required properties:

  - compatible		: "eukrea,asoc-tlv320"

  - eukrea,model	: The user-visible name of this sound complex.

  - ssi-controller	: The phandle of the SSI controller.

  - fsl,mux-int-port	: The internal port of the i.MX audio muxer (AUDMUX).

  - fsl,mux-ext-port	: The external port of the i.MX audio muxer.

Note: The AUDMUX port numbering should start at 1, which is consistent with
hardware manual.

Example:

	sound {
		compatible = "eukrea,asoc-tlv320";
		eukrea,model = "imx51-eukrea-tlv320aic23";
		ssi-controller = <&ssi2>;
		fsl,mux-int-port = <2>;
		fsl,mux-ext-port = <3>;
	};

{'repo_name': 'Xilinx/linux-xlnx', 'stars': '714', 'repo_language': 'C', 'file_name': 'ltc3815.rst', 'mime_type': 'text/plain', 'hash': 1994405984426969102, 'source_dataset': 'data'}


//
//     Generated by class-dump 3.5 (64 bit).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//

#import "NSObject.h"

@class NSArray;

@protocol WCCardPkgBatchGetCardItemByTpInfoMgrDelegate <NSObject>

@optional
- (void)onGetCardsItemByTpInfo:(NSArray *)arg1 ErrCode:(int)arg2;
@end

{'repo_name': 'yulingtianxia/FishChat', 'stars': '1129', 'repo_language': 'Objective-C', 'file_name': 'control.txt', 'mime_type': 'text/plain', 'hash': -4187746738883912582, 'source_dataset': 'data'}


# Consultas a la base de datos

* Esto será una tabla de contenidos (este texto será pegado).
{:toc}

En esta sección se explicará en detalles cada una de las acciones
que su aplicación puede utilizar para manipular datos guardados en
su base de datos de elección.

Para más información, por favor referirse a la página [acciones en DataMapper][].

## Crear
A fin de crear una nueva entrada en su base de datos,
se recomendable seguir la siguiente secuencia:

### Instancia nueva
Primero, usted debe crear una nueva instancia de su modelo.

    nombre_modelo = NombreModelo.new
{:lang=ruby html_use_syntax=true}

### Definir sus atributos
Luego, usted debe definir los atributos
referentes a la instancia creada en una colección:

    nombre_modelo.attributes = {:atributo_1 => valor_1, :atributo_2 => valor_2}
{:lang=ruby html_use_syntax=true}

Alternativamente, usted puede definirlos uno a uno si así lo desea:

    nombre_modelo.atributo_1 = valor_1
    nombre_modelo.atributo_2 = valor_2
{:lang=ruby html_use_syntax=true}

### Salvar la instancia
Ahora, usted debe guardarla de la siguiente manera:

     nombre_modelo.save
{:lang=ruby html_use_syntax=true}

### Resultado de la validación
El interprete retornará el valor ``true`` en el caso que la instancia
haya sido guardada correctamente en la base de datos,
luego de haber pasado todas las validaciones de datos definidas,

    nombre_modelo.save
	# => true
{:lang=ruby html_use_syntax=true}

En el caso en el cual una o mas validaciones no hayan sido exitosas,
El interprete retornará el valor ``false`` .

    nombre_modelo.save
	# => false
{:lang=ruby html_use_syntax=true}

#### Errores
Ante el caso de falla, el siguiente método le brindará una lista
que contendrá los mensaje de error relacionados a cada falla encontrada.

    nombre_modelo.errors
{:lang=ruby html_use_syntax=true}

## Leer

Para más información, por favor referirse a la página [buscadores en DataMapper][].

A fin de obtener entradas desde su base de datos,
se recomendable que tenga en cuenta las diferentes maneras que
[DataMapper][] provee a fin de realizar esta tarea:

### Obtener una sola entrada
#### A través de la llave primaria
Usted puede recuperar una entrada desde la base de datos
utilizando un valor que la define.

Ya sea un valor identificador de tipo Serial:

    NombreModelo.get(1)
{:lang=ruby html_use_syntax=true}

O una cadena de caracteres:

    NombreModelo.get("foobar")
{:lang=ruby html_use_syntax=true}

Al existir otras posibilidades para las llaves primarias,
es recomendable que se refiera a la pagina [buscadores en DataMapper][]
con el fin de obtener mas información al respecto.

#### A través de uno o mas atributos
Usted puede obtener la primera ocurrencia de una entrada
que se encuentra en la base de datos al seguir el siguiente criterio:

    NombreModelo.first(:atributo_1 => valor_1, :atributo_2 => valor_2)
{:lang=ruby html_use_syntax=true}

O simplemente usted puede utilizar un solo atributo:

    NombreModelo.first(:atributo => valor)
{:lang=ruby html_use_syntax=true}

A la hora de definir las condiciones de búsqueda,
usted puede hacer uso de los condicionales existentes tales como:

    NombreModelo.first(:atributo.gt => valor)
{:lang=ruby html_use_syntax=true}

En el caso en particular, usted obtendrá la primera ocurrencia de
``nombre_modelo`` que cumpla con la condición ``nombre_modelo.atributo > valor``.

Usted puede encontrar la lista completa de condiciones
en la pagina [condiciones para los buscadores en DataMapper][].

### Obtener varias entradas
Para obtener varias entradas desde la base de datos, usted debe aplicar la
misma lógica de la seguida para obtener una sola entrada de la base de datos.
Usted debe implementar lo siguiente:

    NombreModelo.all(argumentos)
{:lang=ruby html_use_syntax=true}

en lugar de lo siguiente:

    NombreModelo.first(argumentos)
{:lang=ruby html_use_syntax=true}

Por ejemplo,

    NombreModelo.all(price.gt => 5)
{:lang=ruby html_use_syntax=true}

obtendrá todas las entradas existente en la tabla ``NombreModelo``
cuyo precios sean mayor a 5, de la misma manera que

    NombreModelo.first(price.gt => 5)
{:lang=ruby html_use_syntax=true}

obtendrá la primera entrada de la base de datos cuyo precio es mayor a 5.

## Actualizar
Para modificar la información existente en una entrada en la base de datos,
usted debe seguir con atención las siguientes opciones.

### Modificar los atributos, para luego actualizar la entrada
#### Modificar los atributos
Para realizar los cambios a una instancia.

    nombre_modelo.atributo = foo
{:lang=ruby html_use_syntax=true}

#### Actualizar la entrada
Luego, usted debe actualizarla en la base de datos.

    nombre_modelo.update
{:lang=ruby html_use_syntax=true}

Esta acción actúa de la misma manera que la acción ``nombre_modelo_.save`` explicada previamente.
En el caso en que la actualización de la información y su respectiva validación
hayan sido exitosas, el interprete retornará el valor ``true``.
En el caso de encontrar uno o mas errores durante este proceso,
entonces el interprete retornará el valor ``false``
y hará disponible todos los mensajes de error generadores a través de

     nombre_modelo.errors
{:lang=ruby html_use_syntax=true}

### Modificar los atributos y actualizar la instancia en un solo paso
En el caso de tener una colección de atributos,
usted puede modificarlos y actualizarlos en un solo paso a través de

    nombre_modelo.update_attributes(coleccion)
{:lang=ruby html_use_syntax=true}

Esta acción actúa como las acciones ``save`` y ``update`` explicadas previamente.

### Suciedad
Usted puede verificar si una instancia esta "sucia",
o mejor dicho tiene uno o mas atributos modificados, a través de

    nombre_modelo.dirty?
{:lang=ruby html_use_syntax=true}

El interprete retornara el valor ``true`` en el caso que la instancia haya sido modificada.
Pero si su instancia no fue modificada, el interprete retornara el valor ``false``.

Debido a que este método es inteligente, esto es sumamente útil a la hora de verificar
si su instancia ha sido realmente modificada o no.

En el siguiente ejemplo, se obtendrá de la base de datos
la primera ocurrencia de ``NombreModelo`` cuyo ``atributo_1`` contenga el valor 3.

     foo = NombreModelo.first(:atributo_1 => 3)
     foo.atributo_1 = 3
     puts foo.dirty? # => false
{:lang=ruby html_use_syntax=true}

Es importante remarcar que, cuando se le asigna al atributo de la instancia el mismo valor,
este método entiende que en este caso particular no haya habido modificación alguna.

## Destruir
Esta acción es sumamente sencilla, y hay solamente una manera de realizarla.

     foo = NombreModelo.get(42)
     foo.destroy
{:lang=ruby html_use_syntax=true}

El interprete retornará el valor ``true`` en el caso de suprimir exitosamente
la entrada determinada de la base de datos.
En el caso de fallas, este retornará el valor ``false``.

[acciones en DataMapper]: http://datamapper.org/doku.php?id=docs:crud
[buscadores en DataMapper]: http://datamapper.org/doku.php?id=docs:finders
[condiciones para los buscadores en DataMapper]: http://datamapper.org/doku.php?id=docs:finders#conditions

{'repo_name': 'mattetti/merb-book', 'stars': '187', 'repo_language': 'Ruby', 'file_name': 'merb_book.css', 'mime_type': 'text/plain', 'hash': -6082883104328371583, 'source_dataset': 'data'}