Diff for /np2/macosx/np2.cpp between versions 1.14 and 1.15

version 1.14, 2003/10/23 21:00:24 version 1.15, 2003/10/24 12:35:19
Line 469  static void HandleMouseDown(EventRecord  Line 469  static void HandleMouseDown(EventRecord 
         WindowPtr       hWnd;          WindowPtr       hWnd;
         Rect            rDrag;          Rect            rDrag;
   
       soundmng_stop();
         switch(FindWindow(pevent->where, &hWnd)) {          switch(FindWindow(pevent->where, &hWnd)) {
                 case inMenuBar:                  case inMenuBar:
                         HandleMenuChoice(MenuSelect(pevent->where));                          HandleMenuChoice(MenuSelect(pevent->where));
Line 501  static void HandleMouseDown(EventRecord  Line 502  static void HandleMouseDown(EventRecord 
 #endif  #endif
                         break;                          break;
   
   #ifndef NP2GCC
                 case inGoAway:                  case inGoAway:
                         if (TrackGoAway(hWnd, pevent->where)) { }                          if (TrackGoAway(hWnd, pevent->where)) { }
                         np2running = FALSE;                          np2running = FALSE;
                         break;                          break;
   #endif
         }          }
       soundmng_play();
 }  }
   
 #if 0  #if 0
Line 685  int main(int argc, char *argv[]) { Line 689  int main(int argc, char *argv[]) {
 #endif  #endif
                 else {                  else {
                         if (np2oscfg.NOWAIT) {                          if (np2oscfg.NOWAIT) {
 #if defined(NP2GCC) && 0  #if 0
                                 mouse_callback();  
 #endif  
 #if 1  
                                 mackbd_callback();                                  mackbd_callback();
 #endif  #endif
                                 pccore_exec(framecnt == 0);                                  pccore_exec(framecnt == 0);
Line 707  int main(int argc, char *argv[]) { Line 708  int main(int argc, char *argv[]) {
                         }                          }
                         else if (np2oscfg.DRAW_SKIP) {                  // frame skip                          else if (np2oscfg.DRAW_SKIP) {                  // frame skip
                                 if (framecnt < np2oscfg.DRAW_SKIP) {                                  if (framecnt < np2oscfg.DRAW_SKIP) {
 #if defined(NP2GCC) && 0  #if 0
                     mouse_callback();  
 #endif  
 #if 1  
                     mackbd_callback();                      mackbd_callback();
 #endif  #endif
                                         pccore_exec(framecnt == 0);                                          pccore_exec(framecnt == 0);
Line 723  int main(int argc, char *argv[]) { Line 721  int main(int argc, char *argv[]) {
                         else {                                                          // auto skip                          else {                                                          // auto skip
                                 if (!waitcnt) {                                  if (!waitcnt) {
                                         UINT cnt;                                          UINT cnt;
 #if defined(NP2GCC) && 0  #if 0
                     mouse_callback();  
 #endif  
 #if 1  
                     mackbd_callback();                      mackbd_callback();
 #endif  #endif
                                         pccore_exec(framecnt == 0);                                          pccore_exec(framecnt == 0);
Line 811  static pascal OSStatus np2appevent (Even Line 806  static pascal OSStatus np2appevent (Even
     GetEventParameter (event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modif);      GetEventParameter (event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modif);
   
 #if defined(NP2GCC)  #if defined(NP2GCC)
       HIPoint delta;
     EventMouseButton buttonKind;      EventMouseButton buttonKind;
     GetEventParameter (event, kEventParamMouseButton, typeMouseButton, NULL, sizeof(EventMouseButton), NULL, &buttonKind);      GetEventParameter (event, kEventParamMouseButton, typeMouseButton, NULL, sizeof(EventMouseButton), NULL, &buttonKind);
   
Line 830  static pascal OSStatus np2appevent (Even Line 826  static pascal OSStatus np2appevent (Even
                     switch (whatHappened)                      switch (whatHappened)
                         {                          {
                         case kEventMouseMoved:                          case kEventMouseMoved:
 #if 0                              GetEventParameter (event, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(HIPoint), NULL, &delta);
                             if (isFullScreen)                              mouse_callback(delta);
                             {                              result = noErr;
                                 HIPoint delta;                              break;
                                 Point pt;  
                                 GetEventParameter (event, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(HIPoint), NULL, &delta);  
                                 pt.h=(short)delta.x;  
                                 pt.v=(short)delta.y;  
                                 mouse_callback(pt);  
                             }  
                             else {  
                                 mouse_callback(eve.where);  
                             }  
 #endif  
                                 mouse_callback();  
                                 result = noErr;  
                                 break;  
                        case kEventMouseDown:                         case kEventMouseDown:
                             if (buttonKind == kEventMouseButtonSecondary | modif & controlKey) {                              if (buttonKind == kEventMouseButtonSecondary | modif & controlKey) {
                                 ret=mouse_btn(MOUSE_RIGHTDOWN);                                  ret=mouse_btn(MOUSE_RIGHTDOWN);
Line 857  static pascal OSStatus np2appevent (Even Line 840  static pascal OSStatus np2appevent (Even
                             result=noErr;                              result=noErr;
                             break;                              break;
                         case kEventMouseUp:                          case kEventMouseUp:
                                 {                              if (buttonKind == kEventMouseButtonSecondary | modif & controlKey) {
                                     if (buttonKind == kEventMouseButtonSecondary | modif & cmdKey) {                                  ret=mouse_btn(MOUSE_RIGHTUP);
                                         ret=mouse_btn(MOUSE_RIGHTUP);                              }
                                     }                              else if (buttonKind == kEventMouseButtonTertiary) {
                                     else {                                  mouse_running(MOUSE_XOR);
                                         ret=mouse_btn(MOUSE_LEFTUP);                                  menu_setmouse(np2oscfg.MOUSE_SW ^ 1);
                                     }                                  sysmng_update(SYS_UPDATECFG);
                                     result=noErr;                              }
                                     break;                                  else {
                                 }                                                      ret=mouse_btn(MOUSE_LEFTUP);
                               }
                               result=noErr;
                               break;    
                         }                          }
 #else  #else
                                                 if (whatHappened == kEventMouseDown) {                                                  if (whatHappened == kEventMouseDown) {
Line 890  static pascal OSStatus np2windowevent(Ev Line 876  static pascal OSStatus np2windowevent(Ev
     OSStatus    result = eventNotHandledErr;          OSStatus    result = eventNotHandledErr;    
     long                eventClass;      long                eventClass;
           
       
     GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL,      GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL,
                          sizeof(window), NULL, &window);                           sizeof(window), NULL, &window);
     eventClass = GetEventClass(event);      eventClass = GetEventClass(event);
Line 911  static pascal OSStatus np2windowevent(Ev Line 898  static pascal OSStatus np2windowevent(Ev
                 switch (whatHappened)                  switch (whatHappened)
                 {                  {
                     case kEventRawKeyUp:                      case kEventRawKeyUp:
                         //mackeyup((int)key);  
                         mackbd_f12up(key);                          mackbd_f12up(key);
                         result = noErr;                          result = noErr;
                         break;                          break;
                     case kEventRawKeyRepeat:                      case kEventRawKeyRepeat:
                         //mackeydown(0, (int)key);  
                         mackbd_f12down(key);                          mackbd_f12down(key);
                         result = noErr;                          result = noErr;
                         break;                          break;
                     case kEventRawKeyDown:                      case kEventRawKeyDown:
                         mackbd_f12down(key);  
                         if (modif & cmdKey) {                          if (modif & cmdKey) {
                             //if (!mackeydown(1, (int)key)) {                              char        para;
                                 char    para;                              GetEventParameter (event, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &para);
                                 GetEventParameter (event, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &para);                              HandleMenuChoice(MenuKey(para));
                                 HandleMenuChoice(MenuKey(para));  
                             //}  
                         }                          }
                         else {                          else {
                             //mackeydown(0, (int)key);                              mackbd_f12down(key);
                         }                          }
                         result = noErr;                          result = noErr;
                         break;                          break;
Line 941  static pascal OSStatus np2windowevent(Ev Line 923  static pascal OSStatus np2windowevent(Ev
                         else keystat_senddata(0x73 | 0x80);                          else keystat_senddata(0x73 | 0x80);
                         if (modif & controlKey) keystat_senddata(0x74);                          if (modif & controlKey) keystat_senddata(0x74);
                         else keystat_senddata(0x74 | 0x80);                          else keystat_senddata(0x74 | 0x80);
                         if (modif & alphaLock) keystat_senddata(0x79);                          if (modif & alphaLock) keystat_senddata(0x71);
                         else keystat_senddata(0x79 | 0x80);  
                         result = noErr;                          result = noErr;
                         break;                          break;
                     default:                       default: 

Removed from v.1.14  
changed lines
  Added in v.1.15


RetroPC.NET-CVS <cvs@retropc.net>