00001
00002
00003
00004
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
00018 #define LC_MOUSE_RELEASE 0x10
00019 #define LC_MOUSE_PRESS 0x20
00020
00021
00022
00023
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
00037
00038
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
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
00066 int cmp(int, int);
00067
00068
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);
00096 void draw_module_cost (int grp);
00097
00098
00099
00100
00101 #endif
00102