Main Page | Data Structures | Directories | File List | Data Fields | Globals

mouse.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------- *
00002  * mouse.h
00003  * This file is part of lincity.
00004  * Lincity is copyright (c) I J Peters 1995-1997, (c) Greg Sharp 1997-2001.
00005  * ---------------------------------------------------------------------- */
00006 #ifndef __mouse_h__
00007 #define __mouse_h__
00008 
00009 #include "cliglobs.h"
00010 
00011 #define NUM_BUTTONS 3
00012 
00013 #define LC_MOUSE_LEFTBUTTON     1
00014 #define LC_MOUSE_MIDDLEBUTTON   2
00015 #define LC_MOUSE_RIGHTBUTTON    3
00016 
00017 /* Mouse event flags */
00018 #define LC_MOUSE_RELEASE        0x10
00019 #define LC_MOUSE_PRESS          0x20
00020 
00021 /* Public interface variables and structures */
00022 
00023 /* Mouse registry stuff.  */
00024 
00025 struct mouse_handle_struct
00026 {
00027     Rect * r;
00028     void (* handler)(int, int, int);
00029     struct mouse_handle_struct * prev;
00030     struct mouse_handle_struct * next;
00031 };
00032 
00033 typedef struct mouse_handle_struct Mouse_Handle;
00034 
00035 /* 
00036 mappoint_[xy] are non-zero if the button was pressed inside the main window.
00037 x and y are pixel coordinates.
00038 r_* are values for when the button was released.
00039 */
00040 struct mouse_button_struct {
00041   int mappoint_x, mappoint_y;
00042   int x, y;
00043   int r_mappoint_x, r_mappoint_y;
00044   int r_x, r_y;
00045   int pressed;
00046 };
00047 
00048 /* Public functions */
00049 
00050 void mouse_setup (void);
00051 void init_mouse_registry();
00052 int mouse_handle_click(int x, int y, int button); 
00053 
00054 Mouse_Handle * mouse_register(Rect * r, void (*handler)(int, int, int));
00055 void mouse_unregister(Mouse_Handle * mhandle);
00056 
00057 void cs_mouse_handler (int enc_button, int dx, int dy);
00058 
00059 void cs_mouse_handler (int, int, int);
00060 void move_mouse (int, int); 
00061 void do_mouse_main_win (int, int, int);
00062 
00063 void drag_screen (void);
00064 
00065 /* Private functions */
00066 int cmp(int, int);
00067 
00068 /* WCK: These were in lin-city.h */
00069 
00070 void no_credit_build_msg (int selected_type);
00071 void hide_mouse (void);
00072 void redraw_mouse (void);
00073 void draw_square_mouse (int, int, int);
00074 void hide_square_mouse (void);
00075 void redraw_square_mouse (void);
00076 void draw_normal_mouse (int, int);
00077 void hide_normal_mouse (void);
00078 void redraw_normal_mouse (void);
00079 void do_mouse_select_buttons (int, int, int);
00080 void do_select_button (int, int);
00081 void highlight_select_button (int);
00082 void unhighlight_select_button (int);
00083 void do_mouse_other_buttons (int, int, int);
00084 void bulldoze_area (int, int);
00085 void fire_area (int, int);
00086 void do_market_cb_mouse (int, int);
00087 void do_port_cb_mouse (int, int);
00088 int is_real_river (int, int);
00089 void select_pause (void);
00090 void select_fast (void);
00091 void select_medium (void);
00092 void select_slow (void);
00093 void choose_residence (void);
00094 void do_multi_transport (int, int, int);
00095 int mt_draw (int, int, int); /* wcoreyk */
00096 void draw_module_cost (int grp);
00097 
00098 
00099 
00100 
00101 #endif
00102 

Generated on Sun Dec 26 11:23:25 2004 for lincity by  doxygen 1.3.9.1