PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 3ms app.codeStats 0ms

/Frameworks/AppKit/browser.platform/CPDOMDisplayServer.j

http://github.com/polymar/polish
Unknown | 91 lines | 91 code | 0 blank | 0 comment | 0 complexity | d3001885b1c99825e574be5ecfbe87cf MD5 | raw file
 1I;22;Foundation/CPRunLoop.jc;3207;
 2var _1=nil;
 3CPDOMDisplayServerInstructions=[];
 4CPDOMDisplayServerInstructionCount=0;
 5CPDOMDisplayServerViews=[];
 6CPDOMDisplayServerViewsCount=0;
 7CPDOMDisplayServerViewsContext={};
 8var _2=objj_allocateClassPair(CPObject,"CPDOMDisplayServer"),_3=_2.isa;
 9objj_registerClassPair(_2);
10objj_addClassForBundle(_2,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
11class_addMethods(_3,[new objj_method(sel_getUid("start"),function(_4,_5){
12with(_4){
13_1=objj_msgSend(CPRunLoop,"currentRunLoop");
14objj_msgSend(_1,"performSelector:target:argument:order:modes:",sel_getUid("run"),CPDOMDisplayServer,nil,0,[CPDefaultRunLoopMode]);
15}
16}),new objj_method(sel_getUid("run"),function(_6,_7){
17with(_6){
18while(CPDOMDisplayServerInstructionCount||CPDOMDisplayServerViewsCount){
19var _8=0;
20while(_8<CPDOMDisplayServerInstructionCount){
21var _9=CPDOMDisplayServerInstructions[_8++];
22try{
23switch(_9){
24case 0:
25case 1:
26case 2:
27case 3:
28var _a=CPDOMDisplayServerInstructions[_8],_b=_a.style,x=(_9==0||_9==2)?"left":"right",y=(_9==0||_9==1)?"top":"bottom";
29CPDOMDisplayServerInstructions[_8++]=nil;
30var _e=CPDOMDisplayServerInstructions[_8++];
31if(_e){
32var _f={x:CPDOMDisplayServerInstructions[_8++],y:CPDOMDisplayServerInstructions[_8++]},_10={x:_f.x*_e.a+_f.y*_e.c+_e.tx,y:_f.x*_e.b+_f.y*_e.d+_e.ty};
33_b[x]=ROUND(_10.x)+"px";
34_b[y]=ROUND(_10.y)+"px";
35}else{
36_b[x]=ROUND(CPDOMDisplayServerInstructions[_8++])+"px";
37_b[y]=ROUND(CPDOMDisplayServerInstructions[_8++])+"px";
38}
39_a.CPDOMDisplayContext[0]=-1;
40break;
41case 4:
42var _a=CPDOMDisplayServerInstructions[_8],_b=_a.style;
43CPDOMDisplayServerInstructions[_8++]=nil;
44_a.CPDOMDisplayContext[4]=-1;
45_b.width=MAX(0,ROUND(CPDOMDisplayServerInstructions[_8++]))+"px";
46_b.height=MAX(0,ROUND(CPDOMDisplayServerInstructions[_8++]))+"px";
47break;
48case 5:
49var _a=CPDOMDisplayServerInstructions[_8];
50CPDOMDisplayServerInstructions[_8++]=nil;
51_a.CPDOMDisplayContext[5]=-1;
52_a.width=MAX(0,ROUND(CPDOMDisplayServerInstructions[_8++]));
53_a.height=MAX(0,ROUND(CPDOMDisplayServerInstructions[_8++]));
54break;
55case 6:
56CPDOMDisplayServerInstructions[_8].appendChild(CPDOMDisplayServerInstructions[_8+1]);
57CPDOMDisplayServerInstructions[_8++]=nil;
58CPDOMDisplayServerInstructions[_8++]=nil;
59break;
60case 7:
61CPDOMDisplayServerInstructions[_8].insertBefore(CPDOMDisplayServerInstructions[_8+1],CPDOMDisplayServerInstructions[_8+2]);
62CPDOMDisplayServerInstructions[_8++]=nil;
63CPDOMDisplayServerInstructions[_8++]=nil;
64CPDOMDisplayServerInstructions[_8++]=nil;
65break;
66case 8:
67CPDOMDisplayServerInstructions[_8].removeChild(CPDOMDisplayServerInstructions[_8+1]);
68CPDOMDisplayServerInstructions[_8++]=nil;
69CPDOMDisplayServerInstructions[_8++]=nil;
70break;
71}
72}
73catch(e){
74CPLog("here?"+_9);
75}
76}
77CPDOMDisplayServerInstructionCount=0;
78var _11=CPDOMDisplayServerViews,_8=0,_12=CPDOMDisplayServerViewsCount;
79CPDOMDisplayServerViews=[];
80CPDOMDisplayServerViewsCount=0;
81for(;_8<_12;++_8){
82var _13=_11[_8];
83delete CPDOMDisplayServerViewsContext[objj_msgSend(_13,"hash")];
84objj_msgSend(_13,"layoutIfNeeded");
85objj_msgSend(_13,"displayIfNeeded");
86}
87}
88objj_msgSend(_1,"performSelector:target:argument:order:modes:",sel_getUid("run"),CPDOMDisplayServer,nil,0,[CPDefaultRunLoopMode]);
89}
90})]);
91objj_msgSend(CPDOMDisplayServer,"start");