hedgewars/uMobile.pas
changeset 3928 2560731c860d
child 3935 5ca27a0e9a63
equal deleted inserted replaced
3926:668b71f31e51 3928:2560731c860d
       
     1 (*
       
     2  * Hedgewars, a free turn based strategy game
       
     3  * Copyright (c) 2004-2008 Andrey Korotaev <unC0Rr@gmail.com>
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation; version 2 of the License
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
       
    17  *)
       
    18 
       
    19 {$INCLUDE "options.inc"}
       
    20 
       
    21 unit uMobile;
       
    22 interface
       
    23 
       
    24 {$IFDEF IPHONEOS}
       
    25 (*  iOS calls written in C/Objc  *)
       
    26 procedure clearView; cdecl; external;
       
    27 procedure startSpinning; cdecl; external;
       
    28 procedure stopSpinning; cdecl; external;
       
    29 procedure replayBegan; cdecl; external;
       
    30 procedure replayFinished; cdecl; external;
       
    31 procedure updateVisualsNewTurn; cdecl; external;
       
    32 function  isApplePhone: Boolean; cdecl; external;
       
    33 {$ENDIF}
       
    34 function  isPhone: Boolean;
       
    35 procedure doRumble;
       
    36 procedure doSomethingWhen_AddProgress;
       
    37 procedure doSomethingWhen_FinishProgress;
       
    38 procedure doSomethingWhen_NewTurnBeginning;
       
    39 procedure doSomethingWhen_SaveBeganSynching;
       
    40 procedure doSomethingWhen_SaveFinishedSynching;
       
    41 
       
    42 implementation
       
    43 
       
    44 function isPhone: Boolean;
       
    45 begin
       
    46 {$IFDEF IPHONEOS}
       
    47     exit(isApplePhone());
       
    48 {$ENDIF}
       
    49     exit(false);
       
    50 end;
       
    51 
       
    52 procedure doRumble;
       
    53 begin
       
    54     // fill me!
       
    55 end;
       
    56 
       
    57 procedure doSomethingWhen_AddProgress;
       
    58 begin
       
    59 {$IFDEF IPHONEOS}
       
    60     startSpinning();
       
    61 {$ENDIF}
       
    62 end;
       
    63 
       
    64 procedure doSomethingWhen_FinishProgress;
       
    65 begin
       
    66 {$IFDEF IPHONEOS}
       
    67     stopSpinning();
       
    68 {$ENDIF}
       
    69 end;
       
    70 
       
    71 procedure doSomethingWhen_NewTurnBeginning;
       
    72 begin
       
    73 {$IFDEF IPHONEOS}
       
    74     clearView();
       
    75     updateVisualsNewTurn();
       
    76 {$ENDIF}
       
    77 end;
       
    78 
       
    79 procedure doSomethingWhen_SaveBeganSynching;
       
    80 begin
       
    81 {$IFDEF IPHONEOS}
       
    82     replayBegan();
       
    83 {$ENDIF}
       
    84 end;
       
    85 
       
    86 procedure doSomethingWhen_SaveFinishedSynching;
       
    87 begin
       
    88 {$IFDEF IPHONEOS}
       
    89     replayFinished();
       
    90 {$ENDIF}
       
    91 end;
       
    92 
       
    93 
       
    94 end.