Search completed in 0.95 seconds.
7 results for "unsigned_long":
Using Objective-C from js-ctypes
Mozilla › js-ctypes › Examples › Using Objective-C from js-ctypes
this can run with a copy-and-paste into a javascript shell. this example uses a busy loop, and thus, firefox won't respond until the speaking is done. if this code were to be used in a production add-on, then to avoid firefox locking up, run this code from a chromeworker. let { ctypes } = components.utils.i...
...while (!objc_msgsend_bool(synth, isspeaking)) {} // wait while speaking. while (objc_msgsend_bool(synth, isspeaking)) {} let release = sel_registername("release"); objc_msgsen...
.../** * the "block descriptor" is a static singleton struct. probably used in more * complex block scenarios involving actual closure variables needing storage * (in `nodobjc`, javascript closures are leveraged instead). */ // struct is seen here in docs: http://clang.llvm.org/docs/block-abi-apple.html var block_descriptor_1 = ctypes.structtype('block_descriptor_1', [ { reserved: ctypes.unsigned_long_long }, { size: ctypes.unsigned_long_long } ]); /** * we have to simulate what the llvm compiler does when it encounters a block * literal expression (see `block-abi-apple.txt` above). * the "block literal" is the struct type for each block instance. */ // struct is seen here in docs: http://clang.llvm.org/docs/block-abi-apple.html var block_literal_1 = ctypes.structtype('block_li...
Finding window handles - Archive of obsolete content
Archive › Add-ons › Code snippets › Finding Window Handles
ructtype('gdkwindow'); var gdkwindowptrstring = basewindow.nativehandle; var gdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); working with gdkwindow* gdkwindow* to xid var gdkwindow = ctypes.structtype('gdkwindow'); var gdkdrawable = ctypes.structtype('gdkdrawable'); var card32 = /^(alpha|hppa|ia64|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi) ? ...
...dules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var x11 = ctypes.open('libx11.so.6'); // types let guint32 = ctypes.uint32_t; let gdkwindow = ctypes.structtype('gdkwindow'); let gdkdrawable = ctypes.structtype('gdkdrawable'); let card32; if (/^(alpha|hppa|ia64|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi)) { card32 = ctypes.unsigned_int; } else { card32 = ctypes.unsigned_long; } let xid = card32; //https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-drawable-get-xid var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var browserwindow_madeintogdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var browserwindow_madeintogdkdrawable = ctypes.cast(browserwindow_m...
Using COM from js-ctypes
Mozilla › js-ctypes › Examples › Using COM from js-ctypes
types.voidptr_t.size == 4 /* 32-bit */) { is64bit = false; } else if (ctypes.voidptr_t.size == 8 /* 64-bit */) { is64bit = true; } let winabi = is64bit ? ctypes.default_abi : ctypes.winapi_abi; let callback_abi = is64bit ? ...
...{ is64bit = true; } let winabi = is64bit ? ctypes.default_abi : ctypes.winapi_abi; let callback_abi = is64bit ? ...
ctypes
Mozilla › js-ctypes › js-ctypes reference › ctypes
t an unsigned integer type that behaves like the unsigned int c type on the platform. long a long integer type that behaves like the corresponding c type on the platform. note this automatically converts to an int64 javascript object on all platforms, since it's unknown whether this is a 32-bit or 64-bit value. this is done for compatibility's sake. ...
... float a floating point value that behaves like the float type on the platform. double a double-precision floating point value that behaves like the double type on the platform. character types character types are 8-bit values that behave like their c counterparts. ...
Declaring and Calling Functions
Mozilla › js-ctypes › Using js-ctypes › Declaring and calling functions
e declared using the library object's declare() method. once declared, functions can be called using standard function syntax. prerequiste understanding see abi. example: no input parameters in this example, we declare the libc clock() function, which returns the elapsed time since system startup, then fetch and output that value. const clock = lib.declare("clock", ctypes.default_abi, ctypes.unsigned_long); console.log("clocks since startup: " + clock()); the clock() function requires no input parameters; it simply returns an unsigned long. example: multiple input parameters this example declares the libc asctime() function, which converts a time structure into a string. const asctime = lib.declare("asctime", ctypes.default_abi, ctypes.char.ptr, struct_tm.ptr); for a more complete version o...
Type conversion
Mozilla › js-ctypes › Using js-ctypes › Type conversion
t8_t ctypes.int16_t ctypes.uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.uint32_t ctypes.int ctypes.unsigned_int ctypes.long_long ctypes.uint64_t ctypes.uint8_t ctypes.uint16_t ctypes.unsigned_short ctypes.uint32_t ctypes.unsigned_int ctypes.unsigned_long_long ctypes.long_long ctypes.int8_t ctypes.uint8_t ctypes.int16_t ctypes.uint16_t ctypes.short ctypes.unsigned_short ctypes.int32_t ctypes.uint32_t ctypes.int ctypes.unsigned_int ctypes.int64_t ctypes.unsigned_long_long ctypes.uint8_t ctypes.uint16_t ctypes.unsigned_...
Using js-ctypes
Mozilla › js-ctypes › Using js-ctypes
ns of os x, therefore core foundation must be used. the below will do the same as standardalert from above, it will use the core foundation function of cfusernotificationdisplaynotice. ...