Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 761b609

Browse files
committed
hardcode some resources, removing annoying Widgets.rsrc dependency
1 parent da302da commit 761b609

2 files changed

Lines changed: 100 additions & 15 deletions

File tree

Mac/Tools/IDE/Wbase.py

Lines changed: 90 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -695,19 +695,97 @@ def HasBaseClass(obj, class_):
695695
return 0
696696

697697

698+
#
699+
# To remove the dependence of Widgets.rsrc we hardcode the cursor
700+
# data below.
701+
#_cursors = {
702+
# "watch" : Qd.GetCursor(QuickDraw.watchCursor).data,
703+
# "arrow" : Qd.qd.arrow,
704+
# "iBeam" : Qd.GetCursor(QuickDraw.iBeamCursor).data,
705+
# "cross" : Qd.GetCursor(QuickDraw.crossCursor).data,
706+
# "plus" : Qd.GetCursor(QuickDraw.plusCursor).data,
707+
# "hand" : Qd.GetCursor(468).data,
708+
# "fist" : Qd.GetCursor(469).data,
709+
# "hmover" : Qd.GetCursor(470).data,
710+
# "vmover" : Qd.GetCursor(471).data,
711+
# "zoomin" : Qd.GetCursor(472).data,
712+
# "zoomout" : Qd.GetCursor(473).data,
713+
# "zoom" : Qd.GetCursor(474).data,
714+
#}
715+
698716
_cursors = {
699-
"watch" : Qd.GetCursor(QuickDraw.watchCursor).data,
700-
"arrow" : Qd.qd.arrow,
701-
"iBeam" : Qd.GetCursor(QuickDraw.iBeamCursor).data,
702-
"cross" : Qd.GetCursor(QuickDraw.crossCursor).data,
703-
"plus" : Qd.GetCursor(QuickDraw.plusCursor).data,
704-
"hand" : Qd.GetCursor(468).data,
705-
"fist" : Qd.GetCursor(469).data,
706-
"hmover" : Qd.GetCursor(470).data,
707-
"vmover" : Qd.GetCursor(471).data,
708-
"zoomin" : Qd.GetCursor(472).data,
709-
"zoomout" : Qd.GetCursor(473).data,
710-
"zoom" : Qd.GetCursor(474).data,
717+
'arrow':
718+
'\x00\x00\x40\x00\x60\x00\x70\x00\x78\x00\x7c\x00\x7e\x00\x7f\x00'
719+
'\x7f\x80\x7c\x00\x6c\x00\x46\x00\x06\x00\x03\x00\x03\x00\x00\x00'
720+
'\xc0\x00\xe0\x00\xf0\x00\xf8\x00\xfc\x00\xfe\x00\xff\x00\xff\x80'
721+
'\xff\xc0\xff\xe0\xfe\x00\xef\x00\xcf\x00\x87\x80\x07\x80\x03\x80'
722+
'\x00\x01\x00\x01',
723+
'cross':
724+
'\x04\x00\x04\x00\x04\x00\x04\x00\x04\x00\xff\xe0\x04\x00\x04\x00'
725+
'\x04\x00\x04\x00\x04\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00'
726+
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
727+
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
728+
'\x00\x05\x00\x05',
729+
'fist':
730+
'\x00\x00\x00\x00\x0d\x80\x12\x70\x12\x4c\x12\x4a\x28\x0a\x28\x02'
731+
'\x48\x02\x40\x02\x20\x02\x20\x04\x10\x04\x08\x08\x04\x08\x04\x08'
732+
'\x00\x00\x00\x00\x0d\x80\x1f\xf0\x1f\xfc\x1f\xfe\x3f\xfe\x3f\xfe'
733+
'\x7f\xfe\x7f\xfe\x3f\xfe\x3f\xfc\x1f\xfc\x0f\xf8\x07\xf8\x07\xf8'
734+
'\x00\x09\x00\x08',
735+
'hand':
736+
'\x01\x80\x1a\x70\x26\x48\x26\x4a\x12\x4d\x12\x49\x68\x09\x98\x01'
737+
'\x88\x02\x40\x02\x20\x02\x20\x04\x10\x04\x08\x08\x04\x08\x04\x08'
738+
'\x01\x80\x1b\xf0\x3f\xf8\x3f\xfa\x1f\xff\x1f\xff\x6f\xff\xff\xff'
739+
'\xff\xfe\x7f\xfe\x3f\xfe\x3f\xfc\x1f\xfc\x0f\xf8\x07\xf8\x07\xf8'
740+
'\x00\x09\x00\x08',
741+
'hmover':
742+
'\x00\x00\x01\x80\x01\x80\x01\x80\x01\x80\x11\x88\x31\x8c\x7f\xfe'
743+
'\x31\x8c\x11\x88\x01\x80\x01\x80\x01\x80\x01\x80\x00\x00\x00\x00'
744+
'\x03\xc0\x03\xc0\x03\xc0\x03\xc0\x1b\xd8\x3b\xdc\x7f\xfe\xff\xff'
745+
'\x7f\xfe\x3b\xdc\x1b\xd8\x03\xc0\x03\xc0\x03\xc0\x03\xc0\x00\x00'
746+
'\x00\x07\x00\x07',
747+
'iBeam':
748+
'\x0c\x60\x02\x80\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00'
749+
'\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x02\x80\x0c\x60'
750+
'\x0c\x60\x02\x80\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00'
751+
'\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x02\x80\x0c\x60'
752+
'\x00\x04\x00\x07',
753+
'plus':
754+
'\x00\x00\x07\xc0\x04\x60\x04\x60\x04\x60\x7c\x7c\x43\x86\x42\x86'
755+
'\x43\x86\x7c\x7e\x3c\x7e\x04\x60\x04\x60\x07\xe0\x03\xe0\x00\x00'
756+
'\x0f\xc0\x0f\xe0\x0f\xf0\x0f\xf0\xff\xff\xff\xfe\xfc\x7f\xfc\x7f'
757+
'\xfc\x7f\xff\xff\x7f\xff\x7f\xff\x0f\xf0\x0f\xf0\x07\xf0\x03\xe0'
758+
'\x00\x08\x00\x08',
759+
'vmover':
760+
'\x00\x00\x01\x00\x03\x80\x07\xc0\x01\x00\x01\x00\x01\x00\x7f\xfc'
761+
'\x7f\xfc\x01\x00\x01\x00\x01\x00\x07\xc0\x03\x80\x01\x00\x00\x00'
762+
'\x01\x00\x03\x80\x07\xc0\x0f\xe0\x0f\xe0\x03\x80\xff\xfe\xff\xfe'
763+
'\xff\xfe\xff\xfe\x03\x80\x0f\xe0\x0f\xe0\x07\xc0\x03\x80\x01\x00'
764+
'\x00\x07\x00\x07',
765+
'watch':
766+
'\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x40\x80\x84\x40\x84\x40\x84\x60'
767+
'\x9c\x60\x80\x40\x80\x40\x40\x80\x3f\x00\x3f\x00\x3f\x00\x3f\x00'
768+
'\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x7f\x80\xff\xc0\xff\xc0\xff\xc0'
769+
'\xff\xc0\xff\xc0\xff\xc0\x7f\x80\x3f\x00\x3f\x00\x3f\x00\x3f\x00'
770+
'\x00\x08\x00\x08',
771+
'zoom':
772+
'\x0f\x00\x30\xc0\x40\x20\x40\x20\x80\x10\x80\x10\x80\x10\x80\x10'
773+
'\x40\x20\x40\x20\x30\xf0\x0f\x38\x00\x1c\x00\x0e\x00\x07\x00\x02'
774+
'\x0f\x00\x3f\xc0\x7f\xe0\x7f\xe0\xff\xf0\xff\xf0\xff\xf0\xff\xf0'
775+
'\x7f\xe0\x7f\xe0\x3f\xf0\x0f\x38\x00\x1c\x00\x0e\x00\x07\x00\x02'
776+
'\x00\x06\x00\x06',
777+
'zoomin':
778+
'\x0f\x00\x30\xc0\x40\x20\x46\x20\x86\x10\x9f\x90\x9f\x90\x86\x10'
779+
'\x46\x20\x40\x20\x30\xf0\x0f\x38\x00\x1c\x00\x0e\x00\x07\x00\x02'
780+
'\x0f\x00\x3f\xc0\x7f\xe0\x7f\xe0\xff\xf0\xff\xf0\xff\xf0\xff\xf0'
781+
'\x7f\xe0\x7f\xe0\x3f\xf0\x0f\x38\x00\x1c\x00\x0e\x00\x07\x00\x02'
782+
'\x00\x06\x00\x06',
783+
'zoomout':
784+
'\x0f\x00\x30\xc0\x40\x20\x40\x20\x80\x10\x9f\x90\x9f\x90\x80\x10'
785+
'\x40\x20\x40\x20\x30\xf0\x0f\x38\x00\x1c\x00\x0e\x00\x07\x00\x02'
786+
'\x0f\x00\x3f\xc0\x7f\xe0\x7f\xe0\xff\xf0\xff\xf0\xff\xf0\xff\xf0'
787+
'\x7f\xe0\x7f\xe0\x3f\xf0\x0f\x38\x00\x1c\x00\x0e\x00\x07\x00\x02'
788+
'\x00\x06\x00\x06',
711789
}
712790

713791
def SetCursor(what):

Mac/Tools/IDE/Wmenus.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import FrameWork
22
import Wbase, Wcontrols
3-
from Carbon import Ctl, Controls, Qd
3+
from Carbon import Ctl, Controls, Qd, Res
44
from types import *
55
import Wapplication
66

7-
_arrowright = Qd.GetPicture(472)
8-
_arrowdown = Qd.GetPicture(473)
7+
#_arrowright = Qd.GetPicture(472)
8+
#_arrowdown = Qd.GetPicture(473)
9+
10+
_arrowright = Res.Resource(
11+
'\x00I\x00\x00\x00\x00\x00\n\x00\n\x11\x01\x01\x00\n\x00\x00\x00'
12+
'\x00\x00\n\x00\n\x90\x00\x02\x00\x00\x00\x00\x00\n\x00\n\x00\x00'
13+
'\x00\x00\x00\n\x00\n\x00\x00\x00\x00\x00\n\x00\n\x00\x00\x10\x00'
14+
'\x18\x00\x1c\x00\x1e\x00\x1f\x00\x1f\x00\x1e\x00\x1c\x00\x18\x00'
15+
'\x10\x00\xff')
916

1017

1118
class PopupControl(Wcontrols.ControlWidget):

0 commit comments

Comments
 (0)