~ubuntu-branches/ubuntu/feisty/basilisk2/feisty

« back to all changes in this revision

Viewing changes to src/MacOSX/clip_macosx.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2006-06-01 01:11:16 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060601011116-xjhegbgyfsxag5fl
Tags: 0.9.20060529-1
* New upstream CVS snapshot.
* Update local cdbs snippet copyright-check.mk:
  + Broaden scan to also look for "(c)" by default.
  + Make egrep options configurable.
  + Ignore auto-tools files.
* Bump up standards-version to 3.7.2 (no changes needed).
* Let dh_strip do the stripping (not the make install target).

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
        Size byteCount;
70
70
        if (GetScrapFlavorSize(theScrap, type, &byteCount) == noErr) {
71
71
 
72
 
          // Get the native clipboard data
73
 
          uint8 *data = new uint8[byteCount];
74
 
          if (GetScrapFlavorData(theScrap, type, &byteCount, data) == noErr) {
75
 
                  M68kRegisters r;
76
 
 
77
 
                  // Add new data to clipboard
78
 
                  static uint16 proc[] = {
79
 
                          0x598f,                               // subq.l               #4,sp
80
 
                          0xa9fc,                               // ZeroScrap()
81
 
                          0x2f3c, 0, 0,                 // move.l               #length,-(sp)
82
 
                          0x2f3c, 0, 0,                 // move.l               #type,-(sp)
83
 
                          0x2f3c, 0, 0,                 // move.l               #outbuf,-(sp)
84
 
                          0xa9fe,                               // PutScrap()
85
 
                          0x588f,                               // addq.l               #4,sp
86
 
                          M68K_RTS
87
 
                  };
88
 
                  uint32 proc_area = (uint32)proc;
89
 
                  WriteMacInt32(proc_area +  6, byteCount);
90
 
                  WriteMacInt32(proc_area + 12, type);
91
 
                  WriteMacInt32(proc_area + 18, (uint32)data);
92
 
                  we_put_this_data = true;
93
 
                  Execute68k(proc_area, &r);
94
 
          }
95
 
 
96
 
          delete[] data;
 
72
                // Allocate space for new scrap in MacOS side
 
73
                M68kRegisters r;
 
74
                r.d[0] = byteCount;
 
75
                Execute68kTrap(0xa71e, &r);                             // NewPtrSysClear()
 
76
                uint32 scrap_area = r.a[0];
 
77
 
 
78
                // Get the native clipboard data
 
79
                if (scrap_area) {
 
80
                        uint8 * const data = Mac2HostAddr(scrap_area);
 
81
                        if (GetScrapFlavorData(theScrap, type, &byteCount, data) == noErr) {
 
82
 
 
83
                                // Add new data to clipboard
 
84
                                static uint8 proc[] = {
 
85
                                        0x59, 0x8f,                                     // subq.l       #4,sp
 
86
                                        0xa9, 0xfc,                                     // ZeroScrap()
 
87
                                        0x2f, 0x3c, 0, 0, 0, 0,         // move.l       #length,-(sp)
 
88
                                        0x2f, 0x3c, 0, 0, 0, 0,         // move.l       #type,-(sp)
 
89
                                        0x2f, 0x3c, 0, 0, 0, 0,         // move.l       #outbuf,-(sp)
 
90
                                        0xa9, 0xfe,                                     // PutScrap()
 
91
                                        0x58, 0x8f,                                     // addq.l       #4,sp
 
92
                                        M68K_RTS >> 8, M68K_RTS
 
93
                                };
 
94
                                r.d[0] = sizeof(proc);
 
95
                                Execute68kTrap(0xa71e, &r);             // NewPtrSysClear()
 
96
                                uint32 proc_area = r.a[0];
 
97
 
 
98
                                if (proc_area) {
 
99
                                        Host2Mac_memcpy(proc_area, proc, sizeof(proc));
 
100
                                        WriteMacInt32(proc_area +  6, byteCount);
 
101
                                        WriteMacInt32(proc_area + 12, type);
 
102
                                        WriteMacInt32(proc_area + 18, scrap_area);
 
103
                                        we_put_this_data = true;
 
104
                                        Execute68k(proc_area, &r);
 
105
 
 
106
                                        r.a[0] = proc_area;
 
107
                                        Execute68kTrap(0xa01f, &r);     // DisposePtr
 
108
                                }
 
109
                        }
 
110
 
 
111
                        r.a[0] = scrap_area;
 
112
                        Execute68kTrap(0xa01f, &r);                     // DisposePtr
 
113
                }
97
114
        }
98
115
}
99
116