%// These rules should be hardwired and modified in the install
%// so that they work correctly independantly of the pixmaps selected

icon_rules
{
  %$XDESKTOP$/applications/Extras/Demo.ts/.. /DX
  {
    title=Extras;
  }

  Match.obj /0
  {
    picture=rm9.px;
  }

  Match.obj /1
  {
    picture=rm1.px;
  }

  Match.obj /2
  {
    picture=rm2.px;
  }

  Match.obj /3
  {
    picture=rm3.px;
  }

  Match.obj /4
  {
    picture=rm4.px;
  }

  Match.obj /5
  {
    picture=rm5.px;
  }

  Match.obj /6
  {
    picture=rm6.px;
  }

  Match.obj /7
  {
    picture=rm7.px;
  }

  Match.obj /8
  {
    picture=rm8.px;
  }

  Blink.obj /0
  {
    picture=xeyes1.px;
  }

  Blink.obj /1
  {
    picture=xeyes2.px;
  }

  Blink.obj /2
  {
    picture=xeyes3.px;
  }

  Blink.obj /3
  {
    picture=xeyes4.px;
  }

  Blink.obj /4
  {
    picture=xeyes5.px;
  }

  Blink.obj /5
  {
    picture=xeyes6.px;
  }

  Blink.obj /6
  {
    picture=xeyes7.px;
  }

  Blink.obj /7
  {
    picture=xeyes8.px;
  }

  Clock.obj /0
  {
    picture=clock.px;
  }

  Clock.obj /1
  {
    picture=clock1.px;
  }

  Clock.obj /2
  {
    picture=clock2.px;
  }

  Clock.obj /3
  {
    picture=clock3.px;
  }

  Clock.obj /4
  {
    picture=clock4.px;
  }

  Clock.obj /5
  {
    picture=clock5.px;
  }

  Clock.obj /6
  {
    picture=clock6.px;
  }

  Clock.obj /7
  {
    picture=clock7.px;
  }

  Drawer.obj /0
  {
    picture=home.px;

    trigger_action: s1
    {
      cd $static_arg
      . `( canonical close )
    }
  }

  Drawer.obj /1
  {
    picture=home1.px;
  }

  Drawer.obj /2
  {
    picture=home2.px;
  }

  Drawer.obj /3
  {
    picture=home3.px;
  }

  Drawer.obj /4
  {
    picture=home4.px;
  }

  Drawer.obj /5
  {
    picture=home5.px;
  }

  Drawer.obj /6
  {
    picture=home6.px;
  }

  Drawer.obj /7
  {
    picture=home7.px;

    trigger_action: s1
    {
      cd $static_arg
      . `( canonical open )
    }
  }

  Print.obj /0
  {
    picture=dotmatrix.px;
  }

  Print.obj /1
  {
    picture=dotmatrx1.px;
  }

  Print.obj /2
  {
    picture=dotmatrx2.px;
  }

  Print.obj /3
  {
    picture=dotmatrx3.px;
  }

  Print.obj /4
  {
    picture=dotmatrx4.px;
  }

  Print.obj /5
  {
    picture=dotmatrx5.px;
  }

  Folder.obj /0
  {
    picture=dir4.px;

    trigger_action: s1
    {
      cd $static_arg
      . `( canonical close )
    }
  }

  Folder.obj /1
  {
    picture=dir1.px;

    trigger_action: s1
    {
      cd $static_arg
      . `( canonical open )
    }
  }

  Folder.obj /2
  {
    picture=dir2.px;
  }

  Folder.obj /3
  {
    picture=dir3.px;
  }

  Folder.obj /4
  {
    picture=dir4.px;
  }

  Cabinet.obj /0
  {
    picture=root.px;

    trigger_action: s1
    {
      cd $static_arg
      . `( canonical close )
    }
  }

  Cabinet.obj /1
  {
    picture=root2.px;
  }

  Cabinet.obj /2
  {
    picture=root3.px;
  }

  Cabinet.obj /3
  {
    picture=root4.px;
  }

  Cabinet.obj /4
  {
    picture=root5.px;

    trigger_action: s1
    {
      cd $static_arg
      . `( canonical open )
    }
  }
}

%// modify menu panes
menu: DirFileMenu
{
  menu_item: Open          _O_Ctrl<Key>O_Ctrl+O
    {
      open_cmd
    }

  thick_dividing_line;

  menu_item: Close         _l_Ctrl<Key>C_Ctrl+C
    {
      # remove state info so next time dir is opened it is clean
      remove_dir_view_states Names Details Time Size Show
      close_directory $static_arg
    }
}

%// Add new view menu without dot file display

menu: DirViewMenu
{
  menu_item
  {
    ti=Icons   _I_Ctrl<Key>I_Ctrl+I;
    enable_if
    {
      # see if dir is viewed as names or details, if not, stipple
      vstate=`(list intersect $thread_name(2)^Names :: $:_dirview)
      vstate=($vstate `(list intersect $thread_name(2)^Details :: $:_dirview))
      [ -ne $#vstate 0 ]
    }
    select_action
    {
      # don't need to add to state, no entry means icons
      # just remove other states
      remove_dir_view_states Names Details
      display_directory -i $static_arg
    }
  }
  menu_item
  {
    ti=Names   _N_Ctrl<Key>N_Ctrl+N;
    enable_if
    {
      # see if dir is viewed as names already, if so stipple
      vstate=`(list intersect $thread_name(2)^Names :: $:_dirview)
      [ -ne $#vstate 1 ]
    }
    select_action
    {
      # if we got in here then we were either in icon or details state
      remove_dir_view_states Details
      :_dirview=( $static_arg^Names $:_dirview )
      display_directory -nf %I $static_arg
    }
  }
  menu_item
  {
    ti=Details _D__;
    enable_if
    {
      # see if dir is viewed as details already, if so stipple
      vstate=`(list intersect $thread_name(2)^Details :: $:_dirview )
      [ -ne $#vstate 1 ]
    }
    select_action
    {
      # if we got in here then we were either in icon or names state
      remove_dir_view_states Names
      :_dirview=( $static_arg^Details $:_dirview )
      display_directory -nf '%T %S %I' $static_arg
    }
  }

  dividing_line;

  menu_item: Sort    _S__
    { pull_off_menu=DirSortMenu }

  dividing_line;

  menu_item
    {
      ti=Reorganize _R_Ctrl<Key>R_Ctrl+R;
      enable_if { conts=`(query contents $thread_name(2)); [ -ne $#conts 0 ] }
      select_action { display_directory $static_arg }
    }
}
