comparison libvo/vo_quartz.c @ 13855:493a0dd78307

set aqua default theme
author nplourde
date Tue, 02 Nov 2004 18:16:41 +0000
parents 394deaee5d21
children 335778f9e6ae
comparison
equal deleted inserted replaced
13854:b6b3d96a5c16 13855:493a0dd78307
115 115
116 static MenuRef windMenu; 116 static MenuRef windMenu;
117 static MenuRef movMenu; 117 static MenuRef movMenu;
118 static MenuRef aspectMenu; 118 static MenuRef aspectMenu;
119 119
120 static int border = 20; 120 static int border = 15;
121 enum 121 enum
122 { 122 {
123 kQuitCmd = 1, 123 kQuitCmd = 1,
124 kHalfScreenCmd = 2, 124 kHalfScreenCmd = 2,
125 kNormalScreenCmd = 3, 125 kNormalScreenCmd = 3,
603 image_data = malloc(image_size); 603 image_data = malloc(image_size);
604 604
605 //Create player window////////////////////////////////////////////////// 605 //Create player window//////////////////////////////////////////////////
606 windowAttrs = kWindowStandardDocumentAttributes 606 windowAttrs = kWindowStandardDocumentAttributes
607 | kWindowStandardHandlerAttribute 607 | kWindowStandardHandlerAttribute
608 | kWindowMetalAttribute
609 | kWindowCompositingAttribute 608 | kWindowCompositingAttribute
610 | kWindowLiveResizeAttribute; 609 | kWindowLiveResizeAttribute;
611 610
612 if (theWindow == NULL) 611 if (theWindow == NULL)
613 { 612 {
627 SetRect(&oldWinRect, 0, 0, d_width, d_height); 626 SetRect(&oldWinRect, 0, 0, d_width, d_height);
628 SizeWindow (theWindow, d_width, d_height, 1); 627 SizeWindow (theWindow, d_width, d_height, 1);
629 } 628 }
630 629
631 //Show window 630 //Show window
631 SetThemeWindowBackground( theWindow, kThemeBrushModelessDialogBackgroundActive, TRUE);
632 RepositionWindow(theWindow, NULL, kWindowCenterOnMainScreen); 632 RepositionWindow(theWindow, NULL, kWindowCenterOnMainScreen);
633 ShowWindow (theWindow); 633 ShowWindow (theWindow);
634 634
635 switch (image_format) 635 switch (image_format)
636 { 636 {
1144 void window_resized() 1144 void window_resized()
1145 { 1145 {
1146 float aspectX; 1146 float aspectX;
1147 float aspectY; 1147 float aspectY;
1148 1148
1149 int padding; 1149 int padding = 0;
1150 1150
1151 uint32_t d_width; 1151 uint32_t d_width;
1152 uint32_t d_height; 1152 uint32_t d_height;
1153 1153
1154 Rect tmpRect;
1155 CGRect tmpBounds; 1154 CGRect tmpBounds;
1156 1155
1157 GetPortBounds( GetWindowPort(theWindow), &winRect ); 1156 GetPortBounds( GetWindowPort(theWindow), &winRect );
1158 1157
1159 if(vo_keepaspect) 1158 if(vo_keepaspect)
1179 { 1178 {
1180 SetRect(&dstRect, 0, 0, winRect.right, winRect.bottom-border); 1179 SetRect(&dstRect, 0, 0, winRect.right, winRect.bottom-border);
1181 } 1180 }
1182 1181
1183 //Clear Background 1182 //Clear Background
1183 SetThemeWindowBackground( theWindow, kThemeBrushUtilityWindowBackgroundInactive, TRUE);
1184 tmpBounds = CGRectMake( 0, border, winRect.right, winRect.bottom); 1184 tmpBounds = CGRectMake( 0, border, winRect.right, winRect.bottom);
1185 CreateCGContextForPort(GetWindowPort(theWindow),&context); 1185 CreateCGContextForPort(GetWindowPort(theWindow),&context);
1186 CGContextClearRect(context, tmpBounds); 1186 CGContextClearRect(context, tmpBounds);
1187 1187
1188 switch (image_format) 1188 switch (image_format)
1287 } 1287 }
1288 1288
1289 //go fullscreen 1289 //go fullscreen
1290 border = 0; 1290 border = 0;
1291 panscan_calc(); 1291 panscan_calc();
1292 ChangeWindowAttributes(theWindow, 0, kWindowResizableAttribute); 1292 ChangeWindowAttributes(theWindow, 0, kWindowResizableAttribute|kWindowNoShadowAttribute);
1293 MoveWindow(theWindow, deviceRect.left-(vo_panscan_x >> 1), deviceRect.top-(vo_panscan_y >> 1), 1); 1293 MoveWindow(theWindow, deviceRect.left-(vo_panscan_x >> 1), deviceRect.top-(vo_panscan_y >> 1), 1);
1294 SizeWindow(theWindow, device_width+vo_panscan_x, device_height+vo_panscan_y,1); 1294 SizeWindow(theWindow, device_width+vo_panscan_x, device_height+vo_panscan_y,1);
1295 1295
1296 vo_quartz_fs = 1; 1296 vo_quartz_fs = 1;
1297 } 1297 }
1312 1312
1313 //show mouse cursor 1313 //show mouse cursor
1314 ShowCursor(); 1314 ShowCursor();
1315 1315
1316 //revert window to previous setting 1316 //revert window to previous setting
1317 border = 20; 1317 border = 15;
1318 ChangeWindowAttributes(theWindow, kWindowResizableAttribute, 0); 1318 ChangeWindowAttributes(theWindow, kWindowResizableAttribute, kWindowNoShadowAttribute);
1319 SizeWindow(theWindow, oldWinRect.right, oldWinRect.bottom,1); 1319 SizeWindow(theWindow, oldWinRect.right, oldWinRect.bottom,1);
1320 MoveWindow(theWindow, oldWinBounds.left, oldWinBounds.top, 1); 1320 MoveWindow(theWindow, oldWinBounds.left, oldWinBounds.top, 1);
1321 1321
1322 vo_quartz_fs = 0; 1322 vo_quartz_fs = 0;
1323 } 1323 }