mirror of
https://github.com/danbulant/node-x11
synced 2026-06-16 13:11:11 +00:00
AppleWM events
This commit is contained in:
parent
f5303b0ad9
commit
5315432ce4
1 changed files with 60 additions and 1 deletions
|
|
@ -182,8 +182,19 @@ exports.requireExt = function(display, callback)
|
|||
X.pack_stream.flush();
|
||||
}
|
||||
|
||||
// https://developer.apple.com/library/mac/documentation/Carbon/Reference/Process_Manager/Reference/reference.html#//apple_ref/doc/c_ref/ProcessSerialNumber
|
||||
// shortcut is single-byte ASCII (optional, 0=no shortcut)
|
||||
// items example: [ 'item1', 'some item', ['C', 'item with C shortcut'] ]
|
||||
ext.SetWindowMenu = function(items)
|
||||
{
|
||||
var reqlen = 8;
|
||||
var extlength = 0;
|
||||
items.forEach(function(i) {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// https://developer.apple.com
|
||||
// /library/mac/documentation/Carbon/Reference/Process_Manager/Reference/reference.html#//apple_ref/doc/c_ref/ProcessSerialNumber
|
||||
ext.SendPSN = function(hi, lo)
|
||||
{
|
||||
X.seq_num++;
|
||||
|
|
@ -207,5 +218,53 @@ exports.requireExt = function(display, callback)
|
|||
callback(ext);
|
||||
});
|
||||
*/
|
||||
|
||||
ext.events = {
|
||||
AppleWMControllerNotify: 0,
|
||||
AppleWMActivationNotify: 1,
|
||||
AppleWMPasteboardNotify: 2,
|
||||
}
|
||||
|
||||
ext.EventKind = {
|
||||
Controller: {
|
||||
MinimizeWindow: 0,
|
||||
ZoomWindow: 1,
|
||||
CloseWindow: 2,
|
||||
BringAllToFront: 3,
|
||||
WideWindow: 4,
|
||||
HideAll: 5,
|
||||
ShowAll: 6,
|
||||
WindowMenuItem: 9,
|
||||
WindowMenuNotify: 10,
|
||||
NextWindow: 11,
|
||||
PreviousWindow: 12
|
||||
},
|
||||
Activation: {
|
||||
IsActive: 0,
|
||||
IsInactive:1,
|
||||
ReloadPreferences: 2
|
||||
},
|
||||
Pasteboard: {
|
||||
CopyToPasteboard: 0
|
||||
}
|
||||
};
|
||||
|
||||
X.eventParsers[ext.firstEvent + ext.events.AppleWMControllerNotify] =
|
||||
X.eventParsers[ext.firstEvent + ext.events.AppleWMActivationNotify] =
|
||||
X.eventParsers[ext.firstEvent + ext.events.AppleWMPasteboardNotify] = function(type, seq, extra, code, raw)
|
||||
{
|
||||
var event = {};
|
||||
switch(type) {
|
||||
case ext.firstEvent + ext.events.AppleWMControllerNotify: event.name = 'AppleWMControllerNotify'; break;
|
||||
case ext.firstEvent + ext.events.AppleWMActivationNotify: event.name = 'AppleWMActivationNotify'; break;
|
||||
case ext.firstEvent + ext.events.AppleWMPasteboardNotify: event.name = 'AppleWMPasteboardNotify'; break;
|
||||
}
|
||||
event.type = code;
|
||||
event.time = extra;
|
||||
event.arg = raw.unpack('xxL')[0];
|
||||
return event;
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue