6 /* ---------------------------- included header files ---------------------- */
8 /* ---------------------------- global definitions ------------------------- */
10 /* ---------------------------- global macros ------------------------------ */
12 /* ---------------------------- type definitions --------------------------- */
35 MULTI_DIR_FIRST
= (1 << DIR_N
),
36 MULTI_DIR_N
= (1 << DIR_N
),
37 MULTI_DIR_E
= (1 << DIR_E
),
38 MULTI_DIR_S
= (1 << DIR_S
),
39 MULTI_DIR_W
= (1 << DIR_W
),
40 MULTI_DIR_NE
= (1 << DIR_NE
),
41 MULTI_DIR_SE
= (1 << DIR_SE
),
42 MULTI_DIR_SW
= (1 << DIR_SW
),
43 MULTI_DIR_NW
= (1 << DIR_NW
),
44 MULTI_DIR_ALL
= ((1 << (DIR_MASK
+ 1)) - 1),
45 MULTI_DIR_C
= (1 << DIR_C
),
46 MULTI_DIR_LAST
= (1 << DIR_ALL_MASK
)
58 /* ---------------------------- exported variables (globals) --------------- */
60 /* ---------------------------- interface functions ------------------------ */
62 void gravity_get_offsets(int grav
, int *xp
,int *yp
);
63 void gravity_move(int gravity
, rectangle
*rect
, int xdiff
, int ydiff
);
64 void gravity_resize(int gravity
, rectangle
*rect
, int wdiff
, int hdiff
);
65 void gravity_move_resize_parent_child(
66 int child_gravity
, rectangle
*parent_diff_r
, rectangle
*child_r
);
67 direction_t
gravity_grav_to_dir(
69 int gravity_dir_to_grav(
71 int gravity_combine_xy_grav(
72 int grav_x
, int grav_y
);
73 void gravity_split_xy_grav(
74 int *ret_grav_x
, int *ret_grav_y
, int in_grav
);
75 int gravity_combine_xy_dir(
76 int dir_x
, int dir_y
);
77 void gravity_split_xy_dir(
78 int *ret_dir_x
, int *ret_dir_y
, int in_dir
);
79 int gravity_dir_to_sign_one_axis(
81 direction_t
gravity_parse_dir_argument(
82 char *action
, char **ret_action
, direction_t default_ret
);
83 char *gravity_dir_to_string(direction_t dir
, char *default_str
);
84 multi_direction_t
gravity_parse_multi_dir_argument(
85 char *action
, char **ret_action
);
86 void gravity_get_next_multi_dir(int dir_set
, multi_direction_t
*dir
);
87 direction_t
gravity_multi_dir_to_dir(multi_direction_t mdir
);
88 void gravity_rotate_xy(rotation_t rot
, int x
, int y
, int *ret_x
, int *ret_y
);
89 rotation_t
gravity_add_rotations(rotation_t rot1
, rotation_t rot2
);
91 #endif /* GRAVITY_H */