Subversion Repositories Games.Chess Giants

Rev

Rev 11 | Rev 40 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. // prototypes.h
  2.  
  3. #ifndef PROTOTYPES_H
  4. #define PROTOTYPES_H
  5.  
  6.  
  7. // audio.cpp function prototypes
  8. void Audio_Think (void);
  9. void Audio_PlaySound (int sound_type);
  10.  
  11. // board.cpp function prototypes
  12. bool Board_Init (board_t *board, int white_playertype, int black_playertype, wchar_t *fen_string);
  13. void Board_Shutdown (board_t *board);
  14. bool Board_Reset (board_t *board, wchar_t *fen_string);
  15. bool Board_Think (board_t *board);
  16. void Board_SwapSides (board_t *board);
  17. void Board_SetSelectedAndHovered (board_t *board, int selected_line, int selected_column, int hovered_line, int hovered_column);
  18. char Board_ColorToMove (board_t *board);
  19. void Board_AppendMove (board_t *board, int from_line, int from_column, int to_line, int to_column, char promotion_type, wchar_t *comment);
  20.  
  21. // challenge.cpp function prototypes
  22. void Challenges_Init (void);
  23. void Challenges_Shutdown (void);
  24. challenge_t *Challenge_FindOrCreate (const wchar_t *nickname);
  25. challenge_t *Challenge_Find (const wchar_t *nickname);
  26. void Challenge_UpdateData (challenge_t *challenge, challenge_t *new_challenge);
  27.  
  28. // chessengine.cpp function prototypes
  29. bool PlayerEngine_Init (player_t *player);
  30. void PlayerEngine_Shutdown (player_t *player);
  31. bool PlayerEngine_Think (player_t *player);
  32.  
  33. // config.cpp function prototypes
  34. void Config_Load (void);
  35. void Config_Save (void);
  36.  
  37. // fenfile.cpp function prototypes
  38. bool FENFile_Load (const wchar_t *fenfile_pathname, wchar_t *fen_string, int fenstring_maxsize);
  39. bool FENFile_Save (const wchar_t *fenfile_pathname, wchar_t *fen_string);
  40.  
  41. // hyperlinks.cpp function prototypes
  42. void ConvertStaticToHyperlink (HWND hWndStatic);
  43.  
  44. // inifile.cpp function prototypes
  45. void *INIFile_NewINIFile (void);
  46. int INIFile_GetNumberOfSections (void *ini_data);
  47. wchar_t *INIFile_GetSectionName (void *ini_data, int section_index);
  48. int INIFile_GetNumberOfEntries (void  *ini_data, wchar_t *section);
  49. wchar_t *INIFile_GetEntryName (void *ini_data, wchar_t *section, int entry_index);
  50. unsigned char INIFile_ReadEntryAsBool (void *ini_data, wchar_t *section, wchar_t *entry, unsigned char default_value);
  51. long INIFile_ReadEntryAsLong (void *ini_data, wchar_t *section, wchar_t *entry, long default_value);
  52. unsigned long INIFile_ReadEntryAsUnsignedLong (void *ini_data, wchar_t *section, wchar_t *entry, unsigned long default_value);
  53. double INIFile_ReadEntryAsDouble (void *ini_data, wchar_t *section, wchar_t *entry, double default_value);
  54. wchar_t *INIFile_ReadEntryAsString (void *ini_data, wchar_t *section, wchar_t *entry, wchar_t *default_value);
  55. void INIFile_WriteEntryAsBool (void *ini_data, wchar_t *section, wchar_t *entry, unsigned char value);
  56. void INIFile_WriteEntryAsLong (void *ini_data, wchar_t *section, wchar_t *entry, long value);
  57. void INIFile_WriteEntryAsUnsignedLong (void *ini_data, wchar_t *section, wchar_t *entry, unsigned long value);
  58. void INIFile_WriteEntryAsDouble (void *ini_data, wchar_t *section, wchar_t *entry, double value);
  59. void INIFile_WriteEntryAsString (void *ini_data, wchar_t *section, wchar_t *entry, wchar_t *value);
  60. void INIFile_DeleteEntry (void *ini_data, wchar_t *section, wchar_t *entry);
  61. void INIFile_DeleteSection (void *ini_data, wchar_t *section);
  62. void *INIFile_LoadINIFile (const wchar_t *filename);
  63. unsigned char INIFile_SaveINIFile (const wchar_t *filename, void *ini_data);
  64. void INIFile_FreeINIFile (void *ini_data);
  65.  
  66. // interlocutor.cpp function prototypes
  67. void Interlocutors_Init (void);
  68. void Interlocutors_Shutdown (void);
  69. interlocutor_t *Interlocutor_FindOrCreate (const wchar_t *nickname);
  70. interlocutor_t *Interlocutor_FindByWindowHandle (HWND window_handle);
  71. void Interlocutor_Chat (interlocutor_t *interlocutor, const wchar_t *sender, bool is_localsender, const wchar_t *fmt, ...);
  72. void Interlocutor_Notify (interlocutor_t *interlocutor, const wchar_t *fmt, ...);
  73.  
  74. // localizedtexts.cpp function prototypes
  75. bool LocalizedTexts_Init (const wchar_t *fmt, ...);
  76. void LocalizedTexts_Shutdown (void);
  77. wchar_t *LocalizedTexts_GetLocalizedTextFor (wchar_t *id_string);
  78.  
  79. // move.cpp function prototypes
  80. void Move_SetSlot (boardmove_t *move, int line, int column, int color, int part_type);
  81. bool Move_IsKingThreatenedAtLocation (boardmove_t *move, int color, int at_line, int at_column, int *threat_line, int *threat_column);
  82. bool Move_IsCheck (boardmove_t *move, int color);
  83. bool Move_IsStaleMate (boardmove_t *move, int color);
  84. bool Move_IsMoveValid (boardmove_t *move, int from_line, int from_column, int to_line, int to_column);
  85. bool Move_FindRandomMove (boardmove_t *move, int color, boardmove_t *random_move);
  86. int Move_CountPartsByColorAndType (boardmove_t *move, int color, int part_type);
  87. bool Move_IsColorInCheckAfterTestMove (boardmove_t *move, int source_line, int source_column, int target_line, int target_column, int color);
  88. bool Move_IsColorInCheckAfterTestMoveEP (boardmove_t *move, int source_line, int source_column, int target_line, int target_column, int clear_line, int clear_column, int color);
  89. void Move_DescribeInFEN (boardmove_t *move);
  90. bool Move_SetupFromFEN (boardmove_t *move, wchar_t *fen_string);
  91. bool Move_SetupFromStyle12 (boardmove_t *move, wchar_t *positions, int move_color, int pawnrush_column,
  92.                             bool can_white_castle_short, bool can_white_castle_long, bool can_black_castle_short, bool can_black_castle_long, wchar_t *pretty_movestring);
  93.  
  94. // network.cpp function prototypes
  95. bool PlayerNetwork_Init (player_t *player);
  96. void PlayerNetwork_Shutdown (player_t *player);
  97. bool PlayerNetwork_Think (player_t *player);
  98.  
  99. // network-eval.cpp function prototypes
  100. void EvaluateServerReply_MOTD (player_t *player);
  101. void EvaluateServerReply_Seek (player_t *player);
  102. void EvaluateServerReply_Challenge (player_t *player);
  103. void EvaluateServerReply_Finger (player_t *player);
  104. void EvaluateServerReply_PrivateMessage (player_t *player);
  105. void EvaluateServerReply_ChallengeAccepted (player_t *player);
  106. void EvaluateServerReply_ChallengeDeclined (player_t *player);
  107. void EvaluateServerReply_Takeback (player_t *player);
  108. void EvaluateServerReply_TakebackDeclinedByOther (player_t *player);
  109. void EvaluateServerReply_TakebackDeclinedByYou (player_t *player);
  110. void EvaluateServerReply_PlayNotAllowed (player_t *player);
  111. void EvaluateServerReply_PlayUnexistent (player_t *player);
  112. void EvaluateServerReply_PlayWrongRating (player_t *player);
  113. void EvaluateServerReply_Announcement (player_t *player);
  114. void EvaluateServerReply_ChannelMessage (player_t *player);
  115. void EvaluateServerReply_ChannelsAndMembers (player_t *player);
  116. void EvaluateServerReply_SoughtList (player_t *player);
  117. void EvaluateServerReply_PlayersList (player_t *player);
  118. void EvaluateServerReply_GameStarting (player_t *player);
  119. void EvaluateServerReply_GameState (player_t *player);
  120. void EvaluateServerReply_GameResults (player_t *player);
  121.  
  122. // pgnfile.cpp function prototypes
  123. bool PGNFile_Load (const wchar_t *pgnfile_pathname);
  124. bool PGNFile_LoadGame (board_t *board, const wchar_t *pgnfile_pathname, pgngame_t *game);
  125. bool PGNFile_Save (board_t *board, const wchar_t *pgnfile_pathname);
  126.  
  127. // player.cpp function prototypes
  128. void Player_Init (player_t *player, int color, int type);
  129. void Player_Shutdown (player_t *player);
  130. void Player_ResetView (player_t *player);
  131. bool Player_RotateTable (player_t *player, float frame_time);
  132. bool Player_Think (player_t *player);
  133. bool Player_SendBuffer_Add (player_t *player, int milliseconds_max, const wchar_t *fmt, ...);
  134. player_t *Player_FindByType (int player_type);
  135. player_t *Player_GetCurrent (void);
  136. player_t *Player_GetOpposite (void);
  137.  
  138. // playercard.cpp function prototypes
  139. void PlayerCards_Init (void);
  140. void PlayerCards_Shutdown (void);
  141. playercard_t *PlayerCard_FindOrCreate (const wchar_t *nickname);
  142. void PlayerCard_AppendPersonalData (playercard_t *playercard, const wchar_t *text);
  143.  
  144. // render.cpp function prototypes
  145. bool Render_Init (void);
  146. void Render_Shutdown (void);
  147. void Render_RenderFrame (scene_t *scene);
  148. int Render_LoadMesh (const wchar_t *fmt, ...);
  149. int Render_LoadTexture (const wchar_t *fmt, ...);
  150. int Render_LoadFont (const wchar_t *font_name, int font_size, bool is_bold, bool is_italic);
  151. int Render_LoadSprite (const wchar_t *fmt, ...);
  152. int Render_MaterialIndexOf (const wchar_t *material_name);
  153. void Render_MouseToFloor (short mouse_x, short mouse_y, float *floor_x, float *floor_y);
  154. bool Render_IsMouseInBox (short mouse_x, short mouse_y, float x_percent, float y_percent, float width_percent, float height_percent);
  155.  
  156. // safelib.cpp function prototypes
  157. void *SAFE_malloc (int count, size_t element_size, bool cleanup);
  158. void *SAFE_realloc (void *allocation, int old_count, int new_count, size_t element_size, bool cleanup);
  159. void SAFE_free (void **address_of_pointer_to_allocation);
  160.  
  161. // san.cpp function prototypes
  162. bool Move_SetupFromSAN (boardmove_t *move, boardmove_t *new_move, int move_color);
  163. bool Move_DescribeInSAN (boardmove_t *move);
  164.  
  165. // scene.cpp function prototypes
  166. void Scene_Init (scene_t *scene, board_t *board);
  167. void Scene_Shutdown (scene_t *scene);
  168. void Scene_Update (scene_t *scene, board_t *board);
  169. void Scene_AddCCReply (scene_t *scene, wchar_t *nickname, wchar_t *channelname, unsigned long color_rgbx, wchar_t *fmt, ...);
  170. void Scene_AddAnnouncement (scene_t *scene, wchar_t *fmt, ...);
  171. void Scene_SetButton (guibutton_t *button, float left, float top, float width, float height, int sprite_index);
  172. void Scene_SetText (guitext_t *text, float xpos_percent, float ypos_percent, float maxwidth_percent, int horizontal_align, int vertical_align, int text_align, int font_index, unsigned long color_rgba, float duration, bool want_fade, wchar_t *fmt, ...);
  173.  
  174. // tabcontrol.cpp function prototypes
  175. void *TabControl_New (HWND hTabControlWnd, WNDPROC ParentProc);
  176. void TabControl_AddPage (void *tab_control, wchar_t *page_name, int dialog_id);
  177. void TabControl_SelectTab (void *tab_control, int page_index);
  178. HWND TabControl_GetItem (void *tab_control, int item_id);
  179. void TabControl_Destroy (void *tab_control);
  180. bool TabControl_Notify (NMHDR *notification);
  181.  
  182. // theme.cpp function prototypes
  183. bool Themes_Init (void);
  184. void Themes_Shutdown (void);
  185. void Theme_Load (theme_t *theme, bool want_all);
  186. void Background_LoadImage (backgroundsprite_t *bg, const wchar_t *fmt, ...);
  187.  
  188. // util.cpp function prototypes
  189. const wchar_t *GetDirectoryPath (const wchar_t *pathname, wchar_t *path);
  190. void CenterWindow (HWND hWnd, HWND hParentWnd);
  191. void HintWindow (HWND hWnd);
  192. float ProcessTime (void);
  193. float WrapAngle (float angle);
  194. bool SafeTerminateProcess (HANDLE hProcess, unsigned int uExitCode);
  195. wchar_t *ReachBeginningOfCurrentLine (wchar_t *string, wchar_t *current_pos);
  196. wchar_t *ReachBeginningOfNextLine (wchar_t *string, wchar_t *current_pos);
  197. wchar_t *ReadACompleteLine (wchar_t *destination_line, int max_length, wchar_t *source_buffer);
  198. wchar_t *wcsgets (wchar_t *destination_line, int max_length, wchar_t *source_buffer);
  199. wchar_t *wcsistr (const wchar_t *haystack, const wchar_t *needle);
  200. void ConvertCRLFsToSingleSpaces (wchar_t *multiline_string);
  201. void ConvertTo7BitASCII (char *dest, size_t dest_size_in_bytes, wchar_t *source);
  202. void ConvertToWideChar (wchar_t *dest, size_t dest_size_in_wchars, char *source);
  203. void MinutesToWideCharString (wchar_t *dest, size_t dest_size_in_wchars, int minutes);
  204. void SecondsToWideCharString (wchar_t *dest, size_t dest_size_in_wchars, int seconds);
  205. int MonthStringToNumber (wchar_t *month_string);
  206. bool GetImageSize (const wchar_t *imagefile_pathname, int *width, int *height);
  207. void Debug_Init (const wchar_t *logfile_name);
  208. void Debug_Log (const wchar_t *fmt, ...);
  209. const wchar_t *GetLastNetworkError (void);
  210. HICON W32LoadIcon (const wchar_t *fmt, ...);
  211. HBITMAP W32LoadImage (const wchar_t *fmt, ...);
  212. bool IsRegistrationCorrect (const wchar_t *email, const unsigned long code);
  213.  
  214. // dialog_xxx.cpp and window_xxx.cpp function prototypes
  215. void DialogBox_Registration (void);
  216. void DialogBox_About (void);                             void DialogBox_About_Validated (void);
  217. void DialogBox_Challenge (int challenge_index);          void DialogBox_Challenge_Validated (void);
  218. void DialogBox_ChangeAppearance (void);                  void DialogBox_ChangeAppearance_Validated (void);
  219. void DialogBox_Comment (void);                           void DialogBox_Comment_Validated (void);
  220. void DialogBox_EndGame (void);                           void DialogBox_EndGame_Validated (void);
  221. void DialogBox_GoToMove (void);                          void DialogBox_GoToMove_Validated (void);
  222. void DialogBox_Load (void);                              void DialogBox_Load_Validated (void);
  223. void DialogBox_Message (messagebox_t *messagebox_parms); void DialogBox_Message_Validated (void);
  224. void DialogBox_NewGame (void);                           void DialogBox_NewGame_Validated (void);
  225. void DialogBox_Options (void);                           void DialogBox_Options_Validated (void);
  226. void DialogBox_PawnPromotion (void);                     void DialogBox_PawnPromotion_Validated (void);
  227. void DialogBox_PlayerCard (int playercard_index);        void DialogBox_PlayerCard_Validated (void);
  228. void DialogBox_PlayerInfoName (void);                    void DialogBox_PlayerInfoName_Validated (void);
  229. void DialogBox_Quit (void);                              void DialogBox_Quit_Validated (void);
  230. void DialogBox_Resign (void);                            void DialogBox_Resign_Validated (void);
  231. void DialogBox_Save (void);                              void DialogBox_Save_Validated (void);
  232. void DialogBox_SavePosition (void);                      void DialogBox_SavePosition_Validated (void);
  233. void DialogBox_SendChallenge (wchar_t *challengee_name); void DialogBox_SendChallenge_Validated (void);
  234. void DialogBox_SendSeek (void);                          void DialogBox_SendSeek_Validated (void);
  235. void DialogBox_Takeback (int howmany_halfmoves);         void DialogBox_Takeback_Validated (void);
  236. void Window_Chat (int interlocutor_index);               void Window_Chat_Validated (void);
  237. void Window_ChatterChannels (void);                      void Window_ChatterChannels_Validated (void);
  238. void Window_Games (void);                                void Window_Games_Validated (void);
  239. void Window_MOTD (void);                                 void Window_MOTD_Validated (void);
  240. void Window_Opponents (void);                            void Window_Opponents_Validated (void);
  241. void Window_Sought (void);                               void Window_Sought_Validated (void);
  242. LRESULT CALLBACK WindowProc_Main (HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam);
  243.  
  244.  
  245. #endif // PROTOTYPES_H
  246.