/[emacs]/emacs/src/macterm.c
ViewVC logotype

Diff of /emacs/src/macterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.114 by mituharu, Fri May 6 08:03:24 2005 UTC revision 1.115 by mituharu, Fri May 13 08:42:38 2005 UTC
# Line 3271  x_clear_frame () Line 3271  x_clear_frame ()
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;
# Line 4135  XTmouse_position (fp, insist, bar_window Line 4133  XTmouse_position (fp, insist, bar_window
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,
# Line 4267  construct_scroll_bar_click (bar, part, t Line 4265  construct_scroll_bar_click (bar, part, t
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;
# Line 4340  x_scroll_bar_handle_drag (win, bar, mous Line 4338  x_scroll_bar_handle_drag (win, bar, mous
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);
# Line 4669  XTset_vertical_scroll_bar (w, portion, w Line 4667  XTset_vertical_scroll_bar (w, portion, w
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
# Line 4724  XTset_vertical_scroll_bar (w, portion, w Line 4720  XTset_vertical_scroll_bar (w, portion, w
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);
# Line 4876  XTjudge_scroll_bars (f) Line 4872  XTjudge_scroll_bars (f)
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  {  {
# Line 5034  x_scroll_bar_report_motion (fp, bar_wind Line 5030  x_scroll_bar_report_motion (fp, bar_wind
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
# Line 7498  OSErr install_window_handler (WindowPtr) Line 7509  OSErr install_window_handler (WindowPtr)
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();
# Line 8650  profiler_exit_proc () Line 8660  profiler_exit_proc ()
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
# Line 8929  XTread_socket (sd, expected, hold_quit) Line 8934  XTread_socket (sd, expected, hold_quit)
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
# Line 8973  XTread_socket (sd, expected, hold_quit) Line 8978  XTread_socket (sd, expected, hold_quit)
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
# Line 9548  XTread_socket (sd, expected, hold_quit) Line 9553  XTread_socket (sd, expected, hold_quit)
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  }  }

Legend:
Removed from v.1.114  
changed lines
  Added in v.1.115

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26