Re: drawGlyphsForGlyphRange layout issue

2012-09-24 Thread jonat...@mugginsoft.com

On 23 Sep 2012, at 17:33, Kyle Sluder k...@ksluder.com wrote:
 
 Attributes are specified on a character, rather than glyph, basis. So if
 you need to draw your characters with a separate color, you should
 probably override
 -showCGGlyphs:positions:count:font:matrix:attributes:inContext: to push
 and pop the foreground color you want before calling super. Should be a
 really simple override, because the context is already set up for you.
 
 
It turns out that customising NSGlyphGenerator is not necessary as the subclass 
merely calls its delegate, which is the layout manager.
So an override on NSLayoutManager of  - 
insertGlyphs:length:forStartingGlyphAtIndex:characterIndex: is appropriate.
I cache my substitute glyphs and swap them in as required (a secondary layout 
manager generates the substitute glyphs).

However there are issues.

Colourisation in - 
showCGGlyphs:positions:count:font:matrix:attributes:inContext:
will necessitate colouring by glyph value. So if a period is used to highlight 
a space then all periods in the text get highlighted regardless. 

Secondly, swapping out the tab glyph for another seems to break the tab 
functionality in the NSTextView.

Also, new line and carriage return glyph substitution doesn't seem to work. The 
substitute glyph is not drawn.
Perhaps its omitted as part of the fragment processing.

I imagine that  the second issue is related to the type setter, though that's 
just a guess.

Regards

Jonathan Mitchell
Mugginsoft LLP



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to calculate NSToolbar height in fullscreen mode

2012-09-24 Thread Nava Carmon
Hi,

I have to perform custom animation for NSWindow transition to full screen mode. 
The window have a NSToolbar in icons-only mode with custom items.
How to calculate properly the final frame of such a window in full screen? 
Seems, that the height of the toolbar in the fullscreen is not the same as in 
regular mode (not including title).

Thanks

Best Regards,

Nava Carmon,





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: drawGlyphsForGlyphRange layout issue

2012-09-24 Thread jonat...@mugginsoft.com



On 24 Sep 2012, at 12:49, jonat...@mugginsoft.com wrote:

 
 On 23 Sep 2012, at 17:33, Kyle Sluder k...@ksluder.com wrote:
 
 Attributes are specified on a character, rather than glyph, basis. So if
 you need to draw your characters with a separate color, you should
 probably override
 -showCGGlyphs:positions:count:font:matrix:attributes:inContext: to push
 and pop the foreground color you want before calling super. Should be a
 really simple override, because the context is already set up for you.
 
 
 It turns out that customising NSGlyphGenerator is not necessary as the 
 subclass merely calls its delegate, which is the layout manager.
 So an override on NSLayoutManager of  - 
 insertGlyphs:length:forStartingGlyphAtIndex:characterIndex: is appropriate.
 I cache my substitute glyphs and swap them in as required (a secondary layout 
 manager generates the substitute glyphs).
 
 However there are issues.
 
 Colourisation in - 
 showCGGlyphs:positions:count:font:matrix:attributes:inContext:
 will necessitate colouring by glyph value. So if a period is used to 
 highlight a space then all periods in the text get highlighted regardless. 
 
 Secondly, swapping out the tab glyph for another seems to break the tab 
 functionality in the NSTextView.
 
 Also, new line and carriage return glyph substitution doesn't seem to work. 
 The substitute glyph is not drawn.
 Perhaps its omitted as part of the fragment processing.
 
 I imagine that  the second issue is related to the type setter, though that's 
 just a guess.
 

I took another look at NSLayoutManager  - drawGlyphsForGlyphRange:atPoint: and 
decided to try dropping down to CoreText.
NSString -drawAtPoint:withAttributes: seemed to be the source of trouble and 
was very inefficient.

I created and cached a CTLineRef for each of my substitute characters thus:

attrString = [[NSAttributedString alloc] initWithString:newLineCharacter 
attributes:defAttributes];
textLine = 
CFMakeCollectable(CTLineCreateWithAttributedString((CFAttributedStringRef)attrString));
[lineRefs addObject:(id)textLine];

I then used CTLineDraw to draw the required line on demand.
The vertical alignment of the extra glyphs seems fine with this approach.

- (void)drawGlyphsForGlyphRange:(NSRange)glyphRange 
atPoint:(NSPoint)containerOrigin
{
if (showInvisibleCharacters ) {

NSPoint pointToDrawAt;
NSRect glyphFragment;
NSString *completeString = [[self textStorage] string];
NSInteger lengthToRedraw = NSMaxRange(glyphRange);

void *gcContext = [[NSGraphicsContext currentContext] graphicsPort];

// if our context is flipped then we need to flip our drawn text too
CGAffineTransform t = {1.0, 0.0, 0.0, -1.0, 0.0, 0.0};
if (![[NSGraphicsContext currentContext] isFlipped]) {
t = CGAffineTransformIdentity;
}
CGContextSetTextMatrix (gcContext, t);

// we may not have any glyphs generated at this stage
for (NSInteger idx = glyphRange.location; idx  lengthToRedraw; 
idx++) {
unichar characterToCheck = [completeString 
characterAtIndex:idx];
NSUInteger lineRefIndex = 0;

if (characterToCheck == '\t') {
lineRefIndex = 0;
} else if (characterToCheck == ' ') {
lineRefIndex = 1;
} else if (characterToCheck == '\n' || characterToCheck 
== '\r') {
lineRefIndex = 2;
} else {
continue;
}

pointToDrawAt = [self locationForGlyphAtIndex:idx];
glyphFragment = [self lineFragmentRectForGlyphAtIndex:idx 
effectiveRange:NULL];
pointToDrawAt.x += glyphFragment.origin.x;
pointToDrawAt.y += glyphFragment.origin.y;
   
// get our text line object
CTLineRef line = (CTLineRef)[lineRefs objectAtIndex:lineRefIndex];

CGContextSetTextPosition(gcContext, pointToDrawAt.x, 
pointToDrawAt.y);
CTLineDraw(line, gcContext);
}
}

// the following causes glyph generation to occur if required
[super drawGlyphsForGlyphRange:glyphRange atPoint:containerOrigin];
}


Regards

Jonathan Mitchell
Mugginsoft LLP








___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Toddler-proofing an app: selectively disabling function keys?

2012-09-24 Thread Clay Heaton
As I reported yesterday, I had luck with your second suggestion. There are a 
few minor problems that I would like to fix, discovered as my daughter banged 
on the keyboard this morning. These are the mappings on an extended keyboard:

- F1, F2 - the brightness keys - I would like to disable them while my app is 
running so that my daughter can't turn the screen off by mistake. I can 
shoehorn in this approach, if necessary, to keep brightness at its original 
level: 
http://stackoverflow.com/questions/3239749/programmatically-change-mac-display-brightness

- F4 - the Launchpad key - shows the Launchpad. Clicking an icon there launches 
the other app and makes it key. To me that seems like a bug with 
NSApplicationPresentationDisableProcessSwitching

- F7, F8, F8 - iTunes keys - these control iTunes in the background while my 
app is full screen and key. I would like to disable these while my app is 
running to prevent music from playing by accident.

I can intercept keystrokes on keys that aren't bound to another function, such 
as F5 and F6. My application doesn't even register keystrokes on the keys that 
are bound to other functions, however. Is there any way to capture these 
keystrokes and/or prevent the bound actions from occurring when they are 
pressed?

Thanks,
Clay


On Sep 22, 2012, at 2:59 AM, Ken Thomases k...@codeweavers.com wrote:
 
 If your app is full-screen, you might capture the display.  See the Quartz 
 Display Services 
 https://developer.apple.com/library/mac/#documentation/graphicsimaging/Conceptual/QuartzDisplayServicesConceptual/Articles/DisplayCapture.html.
   Capturing the display prevents Command-Tab app switching, Exposé/Mission 
 Control, Spotlight, etc.  I believe it will also prevent system keyboard 
 shortcuts (e.g. hiding the Dock with Command-Option-D) from reaching the 
 wider system.
 
 It might also work to set the application presentation options.  
 -[NSApplication setPresentationOptions:] with options including 
 NSApplicationPresentationDisableAppleMenu and 
 NSApplicationPresentationDisableProcessSwitching.  Or those options can be 
 included with the options passed to -[NSView 
 enterFullScreenMode:withOptions:] under the 
 NSFullScreenModeApplicationPresentationOptions key.
 
 Finally, you can use a custom subclass of NSApplication, override 
 -sendEvent:, detect events which correspond to hot keys, and don't pass them 
 through to super.  Detecting hot keys is kind of hard.  There's 
 CopySymbolicHotKeys(), but it can be hard to interpret the output data and 
 it's probably also not available in 64-bit.  For a private-use-only app, you 
 can get away with hard-coding keys that actually cause you trouble.
 
 Cheers,
 Ken
 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: iOS encrypt and stream local video file

2012-09-24 Thread Alex Zavatone
The IPA is just a renamed zip file.  

Rename the IPA from an .ipa to a zip and decompress. Right click on the 
contents and choose show package contents and you've access to all the files.

The PNG files are most likely converted to Apple's preferred CgBi format unless 
you or the developer has disabled that with a COMPRESS_PNG_FILES = NO; in the 
pList

So, if anyone can get to your IPA, they can get to the contents.  It's not 
rocket surgery.



On Sep 23, 2012, at 11:25 PM, Kyle Sluder wrote:

 On Sun, Sep 23, 2012, at 07:07 PM, Michael Hanna wrote:
 I have an ios app that contains video files. I'm concerned about users
 with
 jailbroken phones being able to rip these videos out of the app.
 
 You don't need to jailbreak your phone to get at the resources of an
 app; the .ipa itself is not encrypted.
 
 --Kyle Sluder
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
 
 This email sent to z...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Toddler-proofing an app: selectively disabling function keys?

2012-09-24 Thread Ken Thomases
On Sep 24, 2012, at 9:05 AM, Clay Heaton wrote:

 As I reported yesterday, I had luck with your second suggestion. There are a 
 few minor problems that I would like to fix, discovered as my daughter banged 
 on the keyboard this morning. These are the mappings on an extended keyboard:
 
 - F1, F2 - the brightness keys - I would like to disable them while my app is 
 running so that my daughter can't turn the screen off by mistake. I can 
 shoehorn in this approach, if necessary, to keep brightness at its original 
 level: 
 http://stackoverflow.com/questions/3239749/programmatically-change-mac-display-brightness
 
 - F4 - the Launchpad key - shows the Launchpad. Clicking an icon there 
 launches the other app and makes it key. To me that seems like a bug with 
 NSApplicationPresentationDisableProcessSwitching
 
 - F7, F8, F8 - iTunes keys - these control iTunes in the background while my 
 app is full screen and key. I would like to disable these while my app is 
 running to prevent music from playing by accident.
 
 I can intercept keystrokes on keys that aren't bound to another function, 
 such as F5 and F6. My application doesn't even register keystrokes on the 
 keys that are bound to other functions, however. Is there any way to capture 
 these keystrokes and/or prevent the bound actions from occurring when they 
 are pressed?

I agree that the Launchpad key should be disabled by 
NSApplicationPresentationDisableProcessSwitching.  I recommend filing a bug 
with Apple.

I reiterate that you might try capturing the display.  I know that prevents 
just about everything that involves another process (even the Dock, etc.) from 
presenting GUI.  And, therefore, many of those key combinations fall through to 
your app.

However, it seems like your function keys are configured to behave as hardware 
keys.  This is the default, but you can change it in the Keyboard pane of 
System Preferences.  On the Keyboard tab, see the checkbox which reads Use all 
F1, F2, etc. keys as standard function keys.  When that is checked, the 
function keys deliver key events to your app (although the function keys can 
still be used in keyboard shortcuts a.k.a. hot keys, in which case your app may 
not see them).  To access the hardware functions, like brightness, your 
daughter would have to hold down the fn key while pressing the function keys, 
which seems less likely.

If you don't change that preference, then there's no way that I know of to 
intercept those key presses.

Regards,
Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSApplicationShowExceptions - useful on main thread only?

2012-09-24 Thread Corbin Dunn

On Sep 21, 2012, at 10:38 PM, Ken Thomases k...@codeweavers.com wrote:

 On Sep 21, 2012, at 5:20 PM, Sean McBride wrote:
 
 The 10.7 release notes say:
 
 AppKit now has the ability to report uncaught exceptions. It is controlled 
 by a user default: NSApplicationShowExceptions (YES/NO)
 
 My next version will require 10.7+, so I'm finally taking a look at this 
 thing.
 
 It seems that it only works for the main thread, that is, if there's an 
 uncaught exception on the main thread I get the nice error UI.  But if an 
 uncaught exception occurs on a non-main-NSThread or dispatch queue I get no 
 nice UI.
 
 Can anyone confirm/deny?  Anyone shipping with 
 NSApplicationShowExceptions=YES?
 
 I have no inside knowledge, but I think you've misunderstood the purpose of 
 this default.  It's simply to change the behavior where AppKit would silently 
 swallow exceptions which reached the event loop.  Of course this only applies 
 to the main thread, because that's the only thread which does that.

Yeah, all the option does is implement some code in NSApp's reportException if 
the user default is turned on.

corbin

 
 The new default is described as a tool for developers during development.  I 
 wouldn't necessarily argue that it _shouldn't_ be enabled for a release 
 version of your app, but it's not really an end-user feature.
 
 If you want to change how uncaught exceptions are handled more generally, you 
 should look into Exception Programming Topics: Controlling a Program’s 
 Response to Exceptions 
 https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Exceptions/Tasks/ControllingAppResponse.html
  and NSExceptionHandler.  Of course, you should first strive to make sure 
 your app doesn't raise exceptions, but no amount of programming care or 
 testing can guarantee that it can never happen in the field.
 
 Regards,
 Ken
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/corbind%40apple.com
 
 This email sent to corb...@apple.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: drawGlyphsForGlyphRange layout issue

2012-09-24 Thread Aki Inoue
To be compatible with NSLayoutManager, you should use 
-drawWithRect:options:attributes: here instead of using CT.

Your source of trouble is using -drawAtPoint: which uses 
NSStringDrawingUsesLineFragmentOrigin option (layout glyphs from the top 
instead of the glyph origin).

Aki

On 2012/09/24, at 7:02, jonat...@mugginsoft.com wrote:

 
 
 
 On 24 Sep 2012, at 12:49, jonat...@mugginsoft.com wrote:
 
 
 On 23 Sep 2012, at 17:33, Kyle Sluder k...@ksluder.com wrote:
 
 Attributes are specified on a character, rather than glyph, basis. So if
 you need to draw your characters with a separate color, you should
 probably override
 -showCGGlyphs:positions:count:font:matrix:attributes:inContext: to push
 and pop the foreground color you want before calling super. Should be a
 really simple override, because the context is already set up for you.
 
 
 It turns out that customising NSGlyphGenerator is not necessary as the 
 subclass merely calls its delegate, which is the layout manager.
 So an override on NSLayoutManager of  - 
 insertGlyphs:length:forStartingGlyphAtIndex:characterIndex: is appropriate.
 I cache my substitute glyphs and swap them in as required (a secondary 
 layout manager generates the substitute glyphs).
 
 However there are issues.
 
 Colourisation in - 
 showCGGlyphs:positions:count:font:matrix:attributes:inContext:
 will necessitate colouring by glyph value. So if a period is used to 
 highlight a space then all periods in the text get highlighted regardless. 
 
 Secondly, swapping out the tab glyph for another seems to break the tab 
 functionality in the NSTextView.
 
 Also, new line and carriage return glyph substitution doesn't seem to work. 
 The substitute glyph is not drawn.
 Perhaps its omitted as part of the fragment processing.
 
 I imagine that  the second issue is related to the type setter, though 
 that's just a guess.
 
 
 I took another look at NSLayoutManager  - drawGlyphsForGlyphRange:atPoint: 
 and decided to try dropping down to CoreText.
 NSString -drawAtPoint:withAttributes: seemed to be the source of trouble and 
 was very inefficient.
 
 I created and cached a CTLineRef for each of my substitute characters thus:
 
attrString = [[NSAttributedString alloc] initWithString:newLineCharacter 
 attributes:defAttributes];
textLine = 
 CFMakeCollectable(CTLineCreateWithAttributedString((CFAttributedStringRef)attrString));
[lineRefs addObject:(id)textLine];
 
 I then used CTLineDraw to draw the required line on demand.
 The vertical alignment of the extra glyphs seems fine with this approach.
 
 - (void)drawGlyphsForGlyphRange:(NSRange)glyphRange 
 atPoint:(NSPoint)containerOrigin
 {
if (showInvisibleCharacters ) {
 
   NSPoint pointToDrawAt;
   NSRect glyphFragment;
   NSString *completeString = [[self textStorage] string];
   NSInteger lengthToRedraw = NSMaxRange(glyphRange);
 
void *gcContext = [[NSGraphicsContext currentContext] graphicsPort];
 
// if our context is flipped then we need to flip our drawn text too
CGAffineTransform t = {1.0, 0.0, 0.0, -1.0, 0.0, 0.0};
if (![[NSGraphicsContext currentContext] isFlipped]) {
t = CGAffineTransformIdentity;
}
CGContextSetTextMatrix (gcContext, t);
 
// we may not have any glyphs generated at this stage
   for (NSInteger idx = glyphRange.location; idx  lengthToRedraw; 
 idx++) {
   unichar characterToCheck = [completeString 
 characterAtIndex:idx];
NSUInteger lineRefIndex = 0;
 
   if (characterToCheck == '\t') {
lineRefIndex = 0;
} else if (characterToCheck == ' ') {
lineRefIndex = 1;
   } else if (characterToCheck == '\n' || characterToCheck 
 == '\r') {
lineRefIndex = 2;
   } else {
continue;
}
 
pointToDrawAt = [self locationForGlyphAtIndex:idx];
glyphFragment = [self lineFragmentRectForGlyphAtIndex:idx 
 effectiveRange:NULL];
pointToDrawAt.x += glyphFragment.origin.x;
pointToDrawAt.y += glyphFragment.origin.y;
 
// get our text line object
CTLineRef line = (CTLineRef)[lineRefs objectAtIndex:lineRefIndex];
 
CGContextSetTextPosition(gcContext, pointToDrawAt.x, 
 pointToDrawAt.y);
CTLineDraw(line, gcContext);
   }
}
 
// the following causes glyph generation to occur if required
[super drawGlyphsForGlyphRange:glyphRange atPoint:containerOrigin];
 }
 
 
 Regards
 
 Jonathan Mitchell
 Mugginsoft LLP
 
 
 
 
 
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your 

Re: iOS encrypt and stream local video file

2012-09-24 Thread Gene Crucean
I agree that it's probably not worth the hassle and wouldn't put too many
resources into trying to find protection.

But why not stream the videos? What about using a php/nodejs script that
returns a unique video url for each request. That way the would be hacker
wouldn't have direct access by sniffing packets to any URL's coming in to
display the video.



On Sun, Sep 23, 2012 at 7:07 PM, Michael Hanna taomaili...@gmail.comwrote:

 I have an ios app that contains video files. I'm concerned about users with
 jailbroken phones being able to rip these videos out of the app.

 One of the solutions I thought might work would be to encrypt the videos,
 then from a http server running from within the app, segment and serve the
 files, and then decrypt them  to MPMovieController via the http live
 streaming protocol. Is this something that can be done(and also be approved
 by the app store)? Perhaps there is a component out there that does this
 already even?

 Perhaps I'm too worried about jailbreakers sneaking into my content?
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:

 https://lists.apple.com/mailman/options/cocoa-dev/emailgeneonthelist%40gmail.com

 This email sent to emailgeneonthel...@gmail.com




-- 
Gene Crucean - Emmy winning - Oscar nominated VFX Supervisor / iOS-OSX
Developer / Filmmaker / Photographer
** *Freelance for hire* **
www.genecrucean.com

~~ Please use my website's contact form on www.genecrucean.com for any
personal emails. Thanks. I may not get them at this address. ~~
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: drawGlyphsForGlyphRange layout issue

2012-09-24 Thread jonat...@mugginsoft.com
On 24 Sep 2012, at 19:19, Aki Inoue a...@apple.com wrote:

 To be compatible with NSLayoutManager, you should use 
 -drawWithRect:options:attributes: here instead of using CT.
Using -drawWithRect:options:attributes: works.
2 questions:

1. Why is -drawWithRect:options:attributes: more compatible with 
NSLayoutManager?
2. I thought the core text route would be more efficient. I have cached my 
CTLineRefs. Doesn't -drawWithRect:options:attributes: require instantiating an 
NSLayoutManager on each call?

 
 Your source of trouble is using -drawAtPoint: which uses 
 NSStringDrawingUsesLineFragmentOrigin option (layout glyphs from the top 
 instead of the glyph origin).
 
Why does the vertical offset only appear for some fonts, not others?

Regards

Jonathan Mitchell
Mugginsoft LLP


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to calculate NSToolbar height in fullscreen mode

2012-09-24 Thread Lee Ann Rucker

On Sep 24, 2012, at 5:50 AM, Nava Carmon wrote:

 Hi,
 
 I have to perform custom animation for NSWindow transition to full screen 
 mode. The window have a NSToolbar in icons-only mode with custom items.
 How to calculate properly the final frame of such a window in full screen? 
 Seems, that the height of the toolbar in the fullscreen is not the same as in 
 regular mode (not including title).
 
 Thanks
 
 Best Regards,
 
 Nava Carmon,
 


rdar://12144703

http://openradar.appspot.com/12144703

In window:startCustomAnimationToExitFullScreenWithDuration:, I know the target 
contentRect but I can't use -frameRectForContentRect: to find the target 
frameRect because the window style is still fullscreen, and can't use 
+frameRectForContentRect:styleMask: because it doesn't know about the toolbar.

Because all the windows using the same toolbar get updated when the toolbar 
style changes, I can't just save the window and/or toolbar size before going 
into fullscreen because it may not be valid when I exit.

Though if you always keep the same toolbar style and size you should be able to 
cache the toolbar height from before you enter FS and restore it coming out; 
even if it is different in FS (something I've never seen) it's the standard 
window you care about. The FS window always covers the entire screen; the 
toolbar slides down over it and you don't need to worry about it. It's not even 
a child of your window at that point, it's got a special window it lives in.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iOS encrypt and stream local video file

2012-09-24 Thread Roland King
Almost. The executable is encrypted, but that's it, and there are too many blog 
posts about decrypting it to mention. All assets are just zipped  

On 24 Sep, 2012, at 22:55, Alex Zavatone z...@mac.com wrote:

 The IPA is just a renamed zip file.  
 
 Rename the IPA from an .ipa to a zip and decompress. Right click on the 
 contents and choose show package contents and you've access to all the files.
 
 The PNG files are most likely converted to Apple's preferred CgBi format 
 unless you or the developer has disabled that with a COMPRESS_PNG_FILES = NO; 
 in the pList
 
 So, if anyone can get to your IPA, they can get to the contents.  It's not 
 rocket surgery.
 
 
 
 On Sep 23, 2012, at 11:25 PM, Kyle Sluder wrote:
 
 On Sun, Sep 23, 2012, at 07:07 PM, Michael Hanna wrote:
 I have an ios app that contains video files. I'm concerned about users
 with
 jailbroken phones being able to rip these videos out of the app.
 
 You don't need to jailbreak your phone to get at the resources of an
 app; the .ipa itself is not encrypted.
 
 --Kyle Sluder
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
 
 This email sent to z...@mac.com
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: toolbar buttons are missing in iOS 6

2012-09-24 Thread Gavin Stokes
Are obviously rogues, using crazy technologies like toolbars and maps.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com