home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / THREEDOM.ZIP / WINLIB / WINLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-27  |  3.5 KB  |  101 lines

  1. /* @(#)winlib.h 1.1   8/27/96 */
  2.  
  3. /******************************************************************************
  4. * WinLib: a simple Windows 95 GUI library                                     *
  5. * (C) Copyright 1996 by Philip Stephens                                       *
  6. * (C) Copyright 1996 by the IBM Corporation                                   *
  7. * All Rights Reserved                                                         *
  8. *                                                                             *
  9. * Permission to use, copy, modify, and distribute this software and its       *
  10. * documentation without fee for any non-commerical purpose is hereby granted, *
  11. * provided that the above copyright notice appears on all copies and that     *
  12. * both that copyright notice and this permission notice appear in all         *
  13. * supporting documentation.                                                   *
  14. *                                                                             *
  15. * NO REPRESENTATIONS ARE MADE ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY  *
  16. * PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.       *
  17. * NEITHER PHILIP STEPHENS OR IBM SHALL BE LIABLE FOR ANY DAMAGES SUFFERED BY  *
  18. * THE USE OF THIS SOFTWARE.                                                   *
  19. ******************************************************************************/
  20.  
  21. /*
  22.  * Definition of structure used by HandleEvent() function.
  23.  */
  24. typedef struct {
  25.     void (*create_fn)(HWND window_handle);
  26.     void (*destroy_fn)(HWND window_handle);
  27.     void (*paint_fn)(HWND window_handle);
  28.     void (*char_fn)(HWND window_handle, UINT ch, int repeat);
  29.     void (*key_fn)(HWND window_handle, UINT keycode, BOOL keydown,
  30.                int repeat, UINT flags);
  31.     void (*button_fn)(HWND window_handle, UINT message, int x, int y,
  32.               UINT flags);
  33.     void (*mouse_fn)(HWND window_handle, int x, int y, UINT flags);
  34.     BOOL (*focus_fn)(HWND window_handle);
  35.     void (*command_fn)(HWND window_handle, int menu_id, HWND control_handle,
  36.                UINT code_notify);
  37. } event_callbacks;
  38.  
  39. /*
  40.  * Definition of a fast bitmap structure.
  41.  */
  42. typedef struct {
  43.     HWND window_handle;
  44.     BITMAPINFO *bitmap_info;
  45.     LOGPALETTE *palette_info;
  46.     HBITMAP bitmap_handle;
  47.     HPALETTE palette_handle;
  48.     BYTE *bits;
  49. } fast_bitmap;
  50.  
  51. /*
  52.  * Externally available functions.
  53.  */
  54. extern void
  55. WinLibInit(HINSTANCE instance);
  56.  
  57. extern void
  58. WinLibCleanUp(void);
  59.  
  60. extern HWND
  61. CreateMainWindow(LPCSTR window_title, UINT window_width, UINT window_height,
  62.          UINT window_state, LPCSTR menu_name,
  63.          event_callbacks *callback_list);
  64.  
  65. extern HWND
  66. CreateChildWindow(HWND parent_window_handle, UINT x, UINT y,
  67.           UINT window_width, UINT window_height, UINT window_style,
  68.           event_callbacks *callback_list);
  69.  
  70. extern HWND
  71. CreateStaticControl(HWND parent_window_handle, UINT x, UINT y,
  72.             UINT window_width, UINT window_height, UINT window_style,
  73.             event_callbacks *callback_list);
  74.  
  75. extern HWND
  76. CreateEditControl(HWND parent_window_handle, UINT x, UINT y,
  77.           UINT window_width, UINT window_height, UINT window_style,
  78.           event_callbacks *callback_list);
  79.  
  80. extern fast_bitmap *
  81. CreateFastBitmap(HWND window_handle, UINT width, UINT height, RGBQUAD *palette,
  82.          UINT colours, UINT offset);
  83.  
  84. extern void
  85. DestroyFastBitmap(fast_bitmap *bitmap_ptr);
  86.  
  87. extern void
  88. DisplayFastBitmap(fast_bitmap *bitmap_ptr);
  89.  
  90. extern BOOL
  91. InstallFastBitmapPalette(fast_bitmap *bitmap_ptr);
  92.  
  93. extern void
  94. DisplayMessage(HWND edit_handle, char *format, ...);
  95.  
  96. extern void
  97. EnterEventLoop(void (*work_proc_ptr)(void));
  98.  
  99. extern char *
  100. OpenFileDialog(char *title, char *filter);
  101.