GithubHelp home page GithubHelp logo

osxtypes's People

Contributors

philikon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

osxtypes's Issues

Excellent - availble to help/tutor?

Hi there man this is excellent work. I was wondering if you were available to help a noob at mac os js-ctypes. I'm trying to do the following things:

  • Change icon of Firefox windows in a profile (affect change icon in taskbar and alt+tab menu too) (I accomplished this in Windows it looks like this: here)
  • Get process id that is locking a file
  • Get most recent window in process id
  • Set window to foreground

Aside:
do you know how to create a applescript file and set its icon? Im trying to programatically do this http://weblogs.mozillazine.org/asa/archives/2008/08/shortcut_to_lau.html

I'm in process of trying to get a Mac OS VM setup :)

MacMemory Functions

Hi there philikon,

I'm trying to do this here:


Creating ICNS files can also be done using the old IconFamily API, but it's a bit hairy. Also, it doesn't support high-resolution icons.

First, you create a handle (pointer-to-pointer-to-resizable-buffer) for the icon family:

IconFamilyHandle iconFamily = (IconFamilyHandle)NewHandle(0);

Then, for each image size (16, 32, 128, 256, and 512), you create a handle for a raw bitmap of the image data. The bitmap should be 32 bits per pixel, 8 bits per component, ARGB non-premultiplied data with no padding.

int size = /* 16, 32, 128, 256, or 512 */;
Handle handle = NewHandle(size * size * 4);
// fill handle with image data; buffer pointer is *handle

Then, you add that handle to the icon family with a call like:

SetIconFamilyData(iconFamily, kIconServices16PixelDataARGB, handle);

For the other sizes, replace the "16" in kIconServices16PixelDataARGB with the appropriate value.

Then, you write the icon family handle's data out to file. A pointer to the data is obtained by simply dereferencing the handle (i.e. *iconFamily). Its size is obtained by calling GetHandleSize((Handle)iconFamily).

Dispose of any handles you created along the way by calling DisposeHandle().

Reference: http://stackoverflow.com/a/27809425/1828637

This requires MacMemory functions from here: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/Mac__Memory.3pm.html

I was wondering how come NewHandle and GetHandleSize and DisposeHandle are not in ostypes repo, I was wondering how would I define these to use thse functions?

Thanks

Bug in const defintion of kFSEventStreamEventIdSinceNow

Found bug here: https://github.com/philikon/osxtypes/blob/master/modules/CarbonCore.jsm#L31

kFSEventStreamEventIdSinceNow is defined as -1. I guess C compiler takes this. but typedef of this is FSEventStreamEventId which is typedef of UInt64 which is typedef of ULL (ctypes.unsigned_long_long) and in js-ctypes it denies dangerous cast, like signed to unsigned so we have to defined this as ctypes.unsigned_long_long('0xFFFFFFFFFFFFFFFF')

you can see this in action here: https://github.com/Noitidart/jscFileWatcher/blob/removePath-flesh-out/modules/workers/FSWPollWorker.js#L583

i verified this is true by testing in action. the sinceNow arg works properly and events are given from proper sinceNow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.