home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import os
- import wx
- import objc
- from AppKit import *
- from Foundation import *
- from Quartz import *
- from machelpers import *
- NSApplicationLoad()
-
- class IconEditor(object):
-
- def __init__(self, parent, icon = ''):
- self.image_changed = False
- nspool().__enter__()
-
- try:
- self.picTaker = IKPictureTaker.alloc().init()
-
- try:
- if not icon == '':
- data = NSData.dataWithBytes_length_(icon, len(icon))
- image = NSImage.alloc().initWithData_(data)
- if image:
- self.picTaker.setInputImage_(image)
-
- except:
- nspool().__exit__
- nspool()
- raise
-
- finally:
- pass
-
-
-
- def RaiseExisting(cls):
- return False
-
- RaiseExisting = classmethod(RaiseExisting)
-
- def Prompt(self, callback):
- result = self.picTaker.runModal()
- if result == NSOKButton:
- self.image_changed = True
- self.output = self.picTaker.outputImage()
- callback()
-
-
-
- def Bytes(self):
- rep = None
- for arep in self.output.representations():
- if isinstance(arep, NSBitmapImageRep):
- rep = arep
- continue
-
- return str(rep.representationUsingType_properties_(NSPNGFileType, None).bytes())
-
- Bytes = property(Bytes)
-
- def ImageChanged(self):
- return self.image_changed
-
- ImageChanged = property(ImageChanged)
-
-