3271 |
BLOCK_INPUT; |
BLOCK_INPUT; |
3272 |
XClearWindow (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f)); |
XClearWindow (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f)); |
3273 |
|
|
|
#if 0 /* Clearing frame on Mac OS clears scroll bars. */ |
|
3274 |
/* We have to clear the scroll bars, too. If we have changed |
/* We have to clear the scroll bars, too. If we have changed |
3275 |
colors or something like that, then they should be notified. */ |
colors or something like that, then they should be notified. */ |
3276 |
x_scroll_bar_clear (f); |
x_scroll_bar_clear (f); |
|
#endif |
|
3277 |
|
|
3278 |
XFlush (FRAME_MAC_DISPLAY (f)); |
XFlush (FRAME_MAC_DISPLAY (f)); |
3279 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
4133 |
static pascal void scroll_bar_timer_callback P_ ((EventLoopTimerRef, void *)); |
static pascal void scroll_bar_timer_callback P_ ((EventLoopTimerRef, void *)); |
4134 |
static OSStatus install_scroll_bar_timer P_ ((void)); |
static OSStatus install_scroll_bar_timer P_ ((void)); |
4135 |
static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); |
static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); |
4136 |
static int control_part_code_to_scroll_bar_part P_((ControlPartCode)); |
static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); |
4137 |
static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, |
static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, |
4138 |
unsigned long, |
unsigned long, |
4139 |
struct input_event *)); |
struct input_event *)); |
4140 |
static OSErr get_control_part_bound P_((ControlHandle, ControlPartCode, |
static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, |
4141 |
Rect *)); |
Rect *)); |
4142 |
static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, |
static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, |
4143 |
ControlPartCode, |
ControlPartCode, |
4144 |
unsigned long, |
unsigned long, |
4265 |
} |
} |
4266 |
|
|
4267 |
static OSErr |
static OSErr |
4268 |
get_control_part_bound (ch, part_code, rect) |
get_control_part_bounds (ch, part_code, rect) |
4269 |
ControlHandle ch; |
ControlHandle ch; |
4270 |
ControlPartCode part_code; |
ControlPartCode part_code; |
4271 |
Rect *rect; |
Rect *rect; |
4338 |
int top, top_range; |
int top, top_range; |
4339 |
Rect r; |
Rect r; |
4340 |
|
|
4341 |
get_control_part_bound (SCROLL_BAR_CONTROL_HANDLE (bar), |
get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar), |
4342 |
kControlIndicatorPart, &r); |
kControlIndicatorPart, &r); |
4343 |
|
|
4344 |
if (GC_NILP (bar->dragging)) |
if (GC_NILP (bar->dragging)) |
4345 |
XSETINT (bar->dragging, mouse_pos.v - r.top); |
XSETINT (bar->dragging, mouse_pos.v - r.top); |
4667 |
BLOCK_INPUT; |
BLOCK_INPUT; |
4668 |
|
|
4669 |
/* If already correctly positioned, do nothing. */ |
/* If already correctly positioned, do nothing. */ |
4670 |
if (XINT (bar->left) == sb_left |
if (!(XINT (bar->left) == sb_left |
4671 |
&& XINT (bar->top) == top |
&& XINT (bar->top) == top |
4672 |
&& XINT (bar->width) == sb_width |
&& XINT (bar->width) == sb_width |
4673 |
&& XINT (bar->height) == height) |
&& XINT (bar->height) == height)) |
4674 |
Draw1Control (ch); |
{ |
|
else |
|
|
{ |
|
4675 |
/* Clear areas not covered by the scroll bar because it's not as |
/* Clear areas not covered by the scroll bar because it's not as |
4676 |
wide as the area reserved for it . This makes sure a |
wide as the area reserved for it . This makes sure a |
4677 |
previous mode line display is cleared after C-x 2 C-x 1, for |
previous mode line display is cleared after C-x 2 C-x 1, for |
4720 |
|
|
4721 |
/* Move the scroll bar thumb to the top. */ |
/* Move the scroll bar thumb to the top. */ |
4722 |
SetControl32BitValue (ch, 0); |
SetControl32BitValue (ch, 0); |
4723 |
get_control_part_bound (ch, kControlIndicatorPart, &r0); |
get_control_part_bounds (ch, kControlIndicatorPart, &r0); |
4724 |
|
|
4725 |
/* Move the scroll bar thumb to the bottom. */ |
/* Move the scroll bar thumb to the bottom. */ |
4726 |
SetControl32BitValue (ch, 1); |
SetControl32BitValue (ch, 1); |
4727 |
get_control_part_bound (ch, kControlIndicatorPart, &r1); |
get_control_part_bounds (ch, kControlIndicatorPart, &r1); |
4728 |
|
|
4729 |
UnionRect (&r0, &r1, &r0); |
UnionRect (&r0, &r1, &r0); |
4730 |
XSETINT (bar->track_top, r0.top); |
XSETINT (bar->track_top, r0.top); |
4872 |
static void |
static void |
4873 |
x_scroll_bar_handle_click (bar, part_code, er, bufp) |
x_scroll_bar_handle_click (bar, part_code, er, bufp) |
4874 |
struct scroll_bar *bar; |
struct scroll_bar *bar; |
4875 |
int part_code; |
ControlPartCode part_code; |
4876 |
EventRecord *er; |
EventRecord *er; |
4877 |
struct input_event *bufp; |
struct input_event *bufp; |
4878 |
{ |
{ |
5030 |
|
|
5031 |
*time = last_mouse_movement_time; |
*time = last_mouse_movement_time; |
5032 |
} |
} |
5033 |
|
|
5034 |
|
|
5035 |
|
/* The screen has been cleared so we may have changed foreground or |
5036 |
|
background colors, and the scroll bars may need to be redrawn. |
5037 |
|
Clear out the scroll bars, and ask for expose events, so we can |
5038 |
|
redraw them. */ |
5039 |
|
|
5040 |
|
void |
5041 |
|
x_scroll_bar_clear (f) |
5042 |
|
FRAME_PTR f; |
5043 |
|
{ |
5044 |
|
XTcondemn_scroll_bars (f); |
5045 |
|
XTjudge_scroll_bars (f); |
5046 |
|
} |
5047 |
|
|
5048 |
|
|
5049 |
/*********************************************************************** |
/*********************************************************************** |
5050 |
Text Cursor |
Text Cursor |
7509 |
|
|
7510 |
extern void init_emacs_passwd_dir (); |
extern void init_emacs_passwd_dir (); |
7511 |
extern int emacs_main (int, char **, char **); |
extern int emacs_main (int, char **, char **); |
|
extern void check_alarm (); |
|
7512 |
|
|
7513 |
extern void initialize_applescript(); |
extern void initialize_applescript(); |
7514 |
extern void terminate_applescript(); |
extern void terminate_applescript(); |
8660 |
#endif |
#endif |
8661 |
|
|
8662 |
/* These few functions implement Emacs as a normal Mac application |
/* These few functions implement Emacs as a normal Mac application |
8663 |
(almost): set up the heap and the Toolbox, handle necessary |
(almost): set up the heap and the Toolbox, handle necessary system |
8664 |
system events plus a few simple menu events. They also set up |
events plus a few simple menu events. They also set up Emacs's |
8665 |
Emacs's access to functions defined in the rest of this file. |
access to functions defined in the rest of this file. Emacs uses |
8666 |
Emacs uses function hooks to perform all its terminal I/O. A |
function hooks to perform all its terminal I/O. A complete list of |
8667 |
complete list of these functions appear in termhooks.h. For what |
these functions appear in termhooks.h. For what they do, read the |
8668 |
they do, read the comments there and see also w32term.c and |
comments there and see also w32term.c and xterm.c. What's |
8669 |
xterm.c. What's noticeably missing here is the event loop, which |
noticeably missing here is the event loop, which is normally |
8670 |
is normally present in most Mac application. After performing the |
present in most Mac application. After performing the necessary |
8671 |
necessary Mac initializations, main passes off control to |
Mac initializations, main passes off control to emacs_main |
8672 |
emacs_main (corresponding to main in emacs.c). Emacs_main calls |
(corresponding to main in emacs.c). Emacs_main calls XTread_socket |
8673 |
mac_read_socket (defined further below) to read input. This is |
(defined further below) to read input. This is where |
8674 |
where WaitNextEvent is called to process Mac events. This is also |
WaitNextEvent/ReceiveNextEvent is called to process Mac events. */ |
|
where check_alarm in sysdep.c is called to simulate alarm signals. |
|
|
This makes the cursor jump back to its correct position after |
|
|
briefly jumping to that of the matching parenthesis, print useful |
|
|
hints and prompts in the minibuffer after the user stops typing for |
|
|
a wait, etc. */ |
|
8675 |
|
|
8676 |
#ifdef MAC_OS8 |
#ifdef MAC_OS8 |
8677 |
#undef main |
#undef main |
8934 |
case mouseUp: |
case mouseUp: |
8935 |
{ |
{ |
8936 |
WindowPtr window_ptr; |
WindowPtr window_ptr; |
8937 |
SInt16 part_code; |
ControlPartCode part_code; |
8938 |
int tool_bar_p = 0; |
int tool_bar_p = 0; |
8939 |
|
|
8940 |
#if USE_CARBON_EVENTS |
#if USE_CARBON_EVENTS |
8978 |
SelectWindow (window_ptr); |
SelectWindow (window_ptr); |
8979 |
else |
else |
8980 |
{ |
{ |
8981 |
SInt16 control_part_code; |
ControlPartCode control_part_code; |
8982 |
ControlHandle ch; |
ControlHandle ch; |
8983 |
Point mouse_loc = er.where; |
Point mouse_loc = er.where; |
8984 |
#ifdef MAC_OSX |
#ifdef MAC_OSX |
9553 |
pending_autoraise_frame = 0; |
pending_autoraise_frame = 0; |
9554 |
} |
} |
9555 |
|
|
|
#if !TARGET_API_MAC_CARBON |
|
|
check_alarm (); /* simulate the handling of a SIGALRM */ |
|
|
#endif |
|
|
|
|
9556 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
9557 |
return count; |
return count; |
9558 |
} |
} |