module FoxTails

def self.get_icon name
  FTApp.instance.get_icon(name)
end

# These icons are the PNG icons from the fox examples plus some
# of the internal Fox icons, converted to PNG files.

def self.get_standard_icons
  unless @have_standard_icons
    get_file_icons
    get_edit_icons
    get_browse_icons
    get_view_icons
    get_tree_icons
    get_misc_icons
    @have_standard_icons = true
  end
end

def self.get_file_icons 
  unless @have_file_icons
    const_set :FILE_NEW_ICON,       get_icon("filenew.png")
    const_set :FILE_OPEN_ICON,      get_icon("fileopen.png")
    const_set :FILE_SAVE_ICON,      get_icon("filesave.png")
    const_set :FILE_SAVE_AS_ICON,   get_icon("filesaveas.png")
    const_set :FILE_REFRESH_ICON,   get_icon("redo.png")
    const_set :FILE_CLOSE_ICON,     get_icon("kill.png")
    const_set :PRINT_ICON,          get_icon("printicon.png")
    @have_file_icons = true
  end
end

def self.get_edit_icons
  unless @have_edit_icons
    const_set :CUT_ICON,            get_icon("cut.png")
    const_set :COPY_ICON,           get_icon("copy.png")
    const_set :PASTE_ICON,          get_icon("paste.png")
    const_set :CLEAR_ICON,          get_icon("kill.png")
    @have_edit_icons = true
  end
end

def self.get_browse_icons
  unless @have_browse_icons
    const_set :HOME_ICON,           get_icon("home.png")
    const_set :UPLEVEL_ICON,        get_icon("uplevel.png")
    const_set :NEW_DIR_ICON,        get_icon("newdir.png")
    const_set :NEW_FOLDER_ICON,     get_icon("newfolder.png")
    const_set :LINK_ICON,           get_icon("link.png")
    const_set :MOVE_ICON,           get_icon("movefile.png")
    const_set :DELETE_ICON,         get_icon("deletefile.png")
    const_set :MARK_ICON,           get_icon("mark.png")
    const_set :CLEAR_MARKS_ICON,    get_icon("clear.png")
    @have_browse_icons = true
  end
end

def self.get_view_icons
  unless @have_view_icons
    const_set :PERSPECTIVE_ICON,    get_icon("perspective.png")
    const_set :PARALLEL_ICON,       get_icon("parallel.png")
    const_set :LIGHT_ICON,          get_icon("light.png")
    const_set :NO_LIGHT_ICON,       get_icon("nolight.png")
    const_set :SMOOTHLIGHT_ICON,    get_icon("smoothlight.png")
    const_set :FRONTVIEW_ICON,      get_icon("frontview.png")
    const_set :BACKVIEW_ICON,       get_icon("backview.png")
    const_set :LEFTVIEW_ICON,       get_icon("leftview.png")
    const_set :RIGHTVIEW_ICON,      get_icon("rightview.png")
    const_set :TOPVIEW_ICON,        get_icon("topview.png")
    const_set :BOTTOMVIEW_ICON,     get_icon("bottomview.png")
    const_set :ZOOM_ICON,           get_icon("zoom.png")
    const_set :CAMERA_ICON,         get_icon("camera.png")
    @have_view_icons = true
  end
end

def self.get_tree_icons
  unless @have_tree_icons
    const_set :FOLDER_OPEN_ICON,    get_icon("minifolderopen.png")
    const_set :FOLDER_CLOSED_ICON,  get_icon("minifolder.png")
    const_set :DOC_ICON,            get_icon("minidoc.png")
    @have_tree_icons = true
  end
end

def self.get_misc_icons
  unless @have_misc_icons
    const_set :PALETTE_ICON,        get_icon("colorpal.png")
    const_set :MDI_ICON,            get_icon("winapp.png")
    const_set :PENGUIN_ICON,        get_icon("penguin.png")
    const_set :FOX_ICON,            get_icon("foxicon.png")
    @have_misc_icons
  end
end

end