home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Finder Marquee
- by Jordan Zimmerman
- (c)1995 by Altura Software, Inc.
-
- Unlimited use is hereby granted without restriction. However,
- the author would appreciate credit if possible. Please send
- comments, questions, bugs, etc. to jordanz@altura.com
-
- This code implements a "rubber band" marquee select rect
- with very smooth drawing in a manner similar to the Mac Finder.
-
- */
-
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
-
- struct finder_marquee_rec; // forward declaration
-
- // return true if the selection will change, false if not
- typedef int (*finder_marquee_check_selections_proc_t)(struct finder_marquee_rec* marquee_ptr);
-
- // change the selections based on the new marquee_r
- typedef void (*finder_marquee_change_selection_proc_t)(struct finder_marquee_rec* marquee_ptr, const Rect* old_marquee_r_ptr);
-
- typedef struct finder_marquee_rec
- {
-
- // the following are two optional callbacks - set NULL if you're not using them
- finder_marquee_check_selections_proc_t selections_proc; // return true if the selection will change, false if not
- finder_marquee_change_selection_proc_t change_selection_proc; // change the selections based on the new marquee_r
-
- void* user_ptr; // put whatever you want here
-
- // the following fields are filled by the library
- Rect marquee_r; // current marquee_r
- Point pin_pt; // mouse down point
- Point current_pt; // current mouse location
-
- } finder_marquee_rec;
-
- // call to begin the marquee select - port must be set
- // marquee_ptr is a pointer to a finder_marquee_rec structure for the library to use
- // mouse_down_pt is where the mouse went down in local coordinates
- void FinderMarqueeBegin(finder_marquee_rec* marquee_ptr, Point mouse_down_pt);
-
- // call to continue with marquee selection - port must be set
- // marquee_ptr should be a pointer to the same finder_marquee_rec passed to FinderMarqueeBegin
- // new_mouse_pt is the current mouse position in local coordinates
- void FinderMarqueeContinue(finder_marquee_rec* marquee_ptr, Point new_mouse_pt);
-
- // call when finished with marquee selection - port must be set
- // marquee_ptr should be a pointer to the same finder_marquee_rec passed to FinderMarqueeBegin
- // you can use marquee_r to get the final selection rectangle
- void FinderMarqueeEnd(finder_marquee_rec* marquee_ptr);
-
- #ifdef __cplusplus
- }
- #endif // __cplusplus
-