emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/macterm.c


From: Steven Tamm
Subject: [Emacs-diffs] Changes to emacs/src/macterm.c
Date: Wed, 05 Jan 2005 22:20:14 -0500

Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.89 emacs/src/macterm.c:1.90
*** emacs/src/macterm.c:1.89    Mon Jan  3 16:49:35 2005
--- emacs/src/macterm.c Thu Jan  6 02:53:39 2005
***************
*** 69,74 ****
--- 69,75 ----
  #include <errno.h>
  #include <setjmp.h>
  #include <sys/stat.h>
+ #include <sys/param.h>
  
  #include "keyboard.h"
  #include "frame.h"
***************
*** 7867,7872 ****
--- 7868,7881 ----
  
    switch (GetEventKind (event))
      {
+     case kEventWindowUpdate:
+       result = CallNextEventHandler (next_handler, event);
+       if (result != eventNotHandledErr)
+       return result;
+ 
+       do_window_update (wp);
+       break;
+ 
      case kEventWindowBoundsChanging:
        result = CallNextEventHandler (next_handler, event);
        if (result != eventNotHandledErr)
***************
*** 7924,7930 ****
  {
    OSErr err = noErr;
  #if USE_CARBON_EVENTS
!   EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowBoundsChanging}};
    static EventHandlerUPP handle_window_event_UPP = NULL;
  
    if (handle_window_event_UPP == NULL)
--- 7933,7940 ----
  {
    OSErr err = noErr;
  #if USE_CARBON_EVENTS
!   EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowUpdate},
!                          {kEventClassWindow, kEventWindowBoundsChanging}};
    static EventHandlerUPP handle_window_event_UPP = NULL;
  
    if (handle_window_event_UPP == NULL)
***************
*** 8019,8042 ****
          int i;
  
          /* AE file list is one based so just use that for indexing here.  */
!         for (i = 1; (err == noErr) && (i <= num_files_to_open); i++)
          {
-           FSSpec fs;
-           Str255 path_name, unix_path_name;
  #ifdef MAC_OSX
            FSRef fref;
! #endif
  
            err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
                              (Ptr) &fs, sizeof (fs), &actual_size);
!           if (err != noErr) break;
! 
! #ifdef MAC_OSX
!           err = FSpMakeFSRef (&fs, &fref);
!           if (err != noErr) break;
  
-           if (FSRefMakePath (&fref, unix_path_name, 255) == noErr)
- #else
            if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID,
                                        fs.name) &&
                mac_to_posix_pathname (path_name, unix_path_name, 255))
--- 8029,8056 ----
          int i;
  
          /* AE file list is one based so just use that for indexing here.  */
!         for (i = 1; i <= num_files_to_open; i++)
          {
  #ifdef MAC_OSX
            FSRef fref;
!           char unix_path_name[MAXPATHLEN];
! 
!           err = AEGetNthPtr (&the_desc, i, typeFSRef, &keyword,
!                              &actual_type, &fref, sizeof (FSRef),
!                              &actual_size);
!           if (err != noErr || actual_type != typeFSRef)
!             continue;
! 
!           if (FSRefMakePath (&fref, unix_path_name, sizeof (unix_path_name))
!               == noErr)
! #else
!           FSSpec fs;
!           Str255 path_name, unix_path_name;
  
            err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
                              (Ptr) &fs, sizeof (fs), &actual_size);
!           if (err != noErr) continue;
  
            if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID,
                                        fs.name) &&
                mac_to_posix_pathname (path_name, unix_path_name, 255))
***************
*** 8072,8089 ****
    FlavorFlags theFlags;
    OSErr result;
  
    switch (message)
      {
      case kDragTrackingEnterHandler:
        CountDragItems (theDrag, &items);
!       can_accept = 1;
        for (index = 1; index <= items; index++)
        {
          GetDragItemReferenceNumber (theDrag, index, &theItem);
          result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
!         if (result != noErr)
            {
!             can_accept = 0;
              break;
            }
        }
--- 8086,8106 ----
    FlavorFlags theFlags;
    OSErr result;
  
+   if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
+     return dragNotAcceptedErr;
+ 
    switch (message)
      {
      case kDragTrackingEnterHandler:
        CountDragItems (theDrag, &items);
!       can_accept = 0;
        for (index = 1; index <= items; index++)
        {
          GetDragItemReferenceNumber (theDrag, index, &theItem);
          result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
!         if (result == noErr)
            {
!             can_accept = 1;
              break;
            }
        }
***************
*** 8094,8100 ****
--- 8111,8119 ----
        {
          RgnHandle hilite_rgn = NewRgn ();
          Rect r;
+         struct frame *f = mac_window_to_frame (window);
  
+         mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
          GetWindowPortBounds (window, &r);
          OffsetRect (&r, -r.left, -r.top);
          RectRgn (hilite_rgn, &r);
***************
*** 8110,8115 ****
--- 8129,8137 ----
      case kDragTrackingLeaveWindow:
        if (can_accept)
        {
+         struct frame *f = mac_window_to_frame (window);
+ 
+         mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
          HideDragHilite (theDrag);
          SetThemeCursor (kThemeArrowCursor);
        }
***************
*** 8133,8141 ****
    OSErr result;
    ItemReference theItem;
    HFSFlavor data;
-   FSRef fref;
    Size size = sizeof (HFSFlavor);
  
    drag_and_drop_file_list = Qnil;
    GetDragMouse (theDrag, &mouse, 0L);
    CountDragItems (theDrag, &items);
--- 8155,8165 ----
    OSErr result;
    ItemReference theItem;
    HFSFlavor data;
    Size size = sizeof (HFSFlavor);
  
+   if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
+     return dragNotAcceptedErr;
+ 
    drag_and_drop_file_list = Qnil;
    GetDragMouse (theDrag, &mouse, 0L);
    CountDragItems (theDrag, &items);
***************
*** 8147,8157 ****
        if (result == noErr)
        {
  #ifdef MAC_OSX
!         FSRef frref;
  #else
!         Str255 path_name;
  #endif
-         Str255 unix_path_name;
          GetFlavorData (theDrag, theItem, flavorTypeHFS, &data, &size, 0L);
  #ifdef MAC_OSX
          /* Use Carbon routines, otherwise it converts the file name
--- 8171,8181 ----
        if (result == noErr)
        {
  #ifdef MAC_OSX
!         FSRef fref;
!         char unix_path_name[MAXPATHLEN];
  #else
!         Str255 path_name, unix_path_name;
  #endif
          GetFlavorData (theDrag, theItem, flavorTypeHFS, &data, &size, 0L);
  #ifdef MAC_OSX
          /* Use Carbon routines, otherwise it converts the file name
***************
*** 8169,8176 ****
                                          strlen (unix_path_name)),
                     drag_and_drop_file_list);
        }
-       else
-       continue;
      }
    /* If there are items in the list, construct an event and post it to
       the queue like an interrupt using kbd_buffer_store_event.  */
--- 8193,8198 ----
***************
*** 8730,8737 ****
          if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
              != eventNotHandledErr)
            break;
! #endif
          do_window_update ((WindowPtr) er.message);
          break;
  
        case osEvt:
--- 8752,8760 ----
          if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
              != eventNotHandledErr)
            break;
! #else
          do_window_update ((WindowPtr) er.message);
+ #endif
          break;
  
        case osEvt:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]