Iphoto = {}
top = Image.load(MACXT_Path.."/Programs/Iphoto/Images/top.png")
bottom = Image.load(MACXT_Path.."/Programs/Iphoto/Images/bottom.png")
Finder_Module_Directory = "ms0:/"
dofile(MACXT_Path.."/Programs/Iphoto/Iphoto_MACXT.lua")
MACXT_Programmes:NewAppli_MACXT() -- application de macxt ^^
function Iphoto:kaboum()
   screen:blit(0,0,Sprite_Blanc_MACXT)
   if Image_Loaded ~= nil then
      screen:blit(480/2-Image_Loaded:width()/2,272/2-Image_Loaded:height()/2,Image_Loaded)
   end
   screen:blit(0,22,top) -- x, y, nom 
   screen:blit(0,272 - 39,bottom)
end
function Iphoto:Afficher_Photo()
end
while true do -- boucle
   Iphoto:kaboum() -- appel la fonction
   MACXT_Objets_Barre[1] = {Caption = "Iphoto",Fonction = "optionIphoto"}
   MACXT_Objets_Barre[2] = {Caption = "Fichiers",Fonction = "file"}
   MACXT_Objets_Barre[3] = {Caption = "Presentation",Fonction = "Presentation_Iphoto"}
   if Fonction_Barre == "file" then
      MACXT_Objets_Barre_Fonction[1] = {Caption = "Ouvrir image",Action = "ouvrir_image"}
      MACXT_Objets_Barre_Fonction[2] = {Caption = "Fermer image",Action = "Fermer_Image"}
      MACXT_Repertoire:Actualise_Fonction()
   end
   if Fonction_Barre == "optionIphoto" then
      MACXT_Objets_Barre_Fonction[1] = {Caption = "A propos de Iphoto",Action = "Propos_Iphoto"}
      MACXT_Objets_Barre_Fonction[2] = {Caption = "Fermer Iphoto",Action = "Fermer_Iphoto"}
      MACXT_Repertoire:Actualise_Fonction()
   end
   if Fonction_Barre == "Presentation_Iphoto" then
      MACXT_Objets_Barre_Fonction[1] = {Caption = "Plein ecran",Action = "FullScreen"}
      MACXT_Repertoire:Actualise_Fonction()
   end
   if x >= 5 and x <= 20 and y >= MACXT_Barre1:height() + 2 and y <= MACXT_Barre1:height() + 20 then
      MACXTAide = "Fermer Iphoto"
      if MACXTKeyPad:cross() then
         Image_Loaded = nil
         break
      end
   end
   MACXT_Repertoire:Actualise_Systeme_Barre()
   if Action_Barre == "FullScreen" then
      if Image_Loaded ~= nil then
         XPosPhoto = 480/2-Image_Loaded:width()/2
         YPosPhoto = 272/2-Image_Loaded:height()/2
         Window_Hauteur = 45
         Window_Longueur = 190
         MACXT_Graphic:Init_New_Personnal_Window()
         MACXT_Title = "Informations"
         MACXT_Texte_Window[1] = {Caption = "Triangle pour revenir"}
         MACXT_Repertoire:Actualise_Texte_Window()
         Affichage_Button = "Horizontal_Drawing"
         MACXT_Draw_Button[1] = {Caption = "Accepter",Action = "AcceptFullScreen"}
         MACXT_Draw_Button[2] = {Caption = "Annuler",Action = "AnnulerFullScreen"}
         MACXT_Repertoire:Actualise_Draw_Button()
         if Action_Button == "AcceptFullScreen" then
            MACXTMouse:DesactivePad()
            MACXTMouse:DesactivePadAnalog()
            Afficher_Personnal_Window = 0
            Iphoto:FullScreen()
            MACXT_Repertoire:Anti_Bug()
         end
         if Action_Button == "AnnulerFullScreen" then
            Afficher_Personnal_Window = 0
            MACXT_Repertoire:Anti_Bug()
         end
       else
         Window_Hauteur = 45
         Window_Longueur = 150
         MACXT_Graphic:Init_New_Personnal_Window()
         Afficher_Fenetre_Fde = 1
         MACXT_Repertoire:Anti_Bug()
      end
   end
   if Action_Barre == "Propos_Iphoto" then
      Window_Hauteur = 60
      Window_Longueur = 250
      MACXT_Graphic:Init_New_Personnal_Window()
      Afficher_Propos_Iphoto = 1
      MACXT_Repertoire:Anti_Bug()
   end
   if Action_Barre == "Fermer_Iphoto" then
      Image_Loaded = nil
      break
   end
   if Action_Barre == "Fermer_Image" then
      Image_Loaded = nil
      MACXT_Repertoire:Anti_Bug()
   end
   if Action_Barre=="ouvrir_image" then
      Extension = ".png"
      Module_Finder:Init_Finder_Module()
      MACXT_Repertoire:Anti_Bug()
   end
   if Afficher_Propos_Iphoto == 1 then
      Iphoto:Propos_Iphoto()
   end
   if Afficher_Fenetre_Fde == 1 then
      Window_Hauteur = 45
      Window_Longueur = 150
      MACXT_Title = "Avertissement"
      MACXT_Texte_Window[1] = {Caption = "Chargez d'abord"}
      MACXT_Texte_Window[2] = {Caption = "une image."}
      MACXT_Repertoire:Actualise_Texte_Window()
      if Afficher_Personnal_Window == 0 then
         Afficher_Fenetre_Fde = 0
      end
   end
   Iphoto:Set_As_Wallpaper()
   MACXT_Kernel:Load_Kernel_Application() -- charge le kernel de macxt par <3
screen.waitVblankStart() -- par <3
screen:flip() -- rafraichir
end -- fin