src/osd/sdl/debugosx.c
| r1204 | r1205 | |
| 533 | 533 | static debugwin_info *debug_window_create(const char *title, void *unused) |
| 534 | 534 | { |
| 535 | 535 | CGDirectDisplayID mainID = CGMainDisplayID(); |
| 536 | | GDHandle mainDevice; |
| 537 | 536 | |
| 538 | 537 | debugwin_info *info = NULL; |
| 539 | 538 | Rect work_bounds; |
| 539 | HIRect mainBounds; |
| 540 | 540 | |
| 541 | 541 | (void)unused; |
| 542 | 542 | |
| r1204 | r1205 | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | // fill in some defaults |
| 581 | | DMGetGDeviceByDisplayID((DisplayIDType)mainID, &mainDevice, TRUE); |
| 582 | | GetAvailableWindowPositioningBounds(mainDevice, &work_bounds); |
| 581 | mainBounds = CGDisplayBounds( mainID ); |
| 583 | 582 | info->minwidth = 200; |
| 584 | 583 | info->minheight = 200; |
| 585 | | info->maxwidth = work_bounds.right - work_bounds.left; |
| 586 | | info->maxheight = work_bounds.bottom - work_bounds.top; |
| 584 | info->maxwidth = mainBounds.size.width; |
| 585 | info->maxheight = mainBounds.size.height; |
| 587 | 586 | |
| 588 | 587 | // set the default handlers |
| 589 | 588 | info->handle_command = global_handle_command; |
| r1204 | r1205 | |
| 3016 | 3015 | { |
| 3017 | 3016 | debugwin_info *info; |
| 3018 | 3017 | int bestwidth, bestheight; |
| 3019 | | Rect bounds, work_bounds; |
| 3018 | Rect bounds; |
| 3020 | 3019 | MenuRef optionsmenu, popupmenu; |
| 3021 | 3020 | UINT32 cpunum; |
| 3022 | 3021 | ControlFontStyleRec style; |
| 3023 | 3022 | Str255 fontName; |
| 3024 | 3023 | CGDirectDisplayID mainID = CGMainDisplayID(); |
| 3025 | | GDHandle mainDevice; |
| 3024 | HIRect mainBounds; |
| 3026 | 3025 | MenuItemIndex menuIndex; |
| 3027 | 3026 | ControlButtonContentInfo content; |
| 3028 | 3027 | |
| r1204 | r1205 | |
| 3143 | 3142 | } |
| 3144 | 3143 | |
| 3145 | 3144 | // get the work bounds |
| 3146 | | DMGetGDeviceByDisplayID((DisplayIDType)mainID, &mainDevice, TRUE); |
| 3147 | | GetAvailableWindowPositioningBounds(mainDevice, &work_bounds); |
| 3145 | mainBounds = CGDisplayBounds( mainID ); |
| 3148 | 3146 | |
| 3149 | 3147 | // adjust the min/max sizes for the window style |
| 3150 | 3148 | bounds.top = bounds.left = 0; |
| r1204 | r1205 | |
| 3158 | 3156 | info->maxwidth = bounds.right - bounds.left; |
| 3159 | 3157 | |
| 3160 | 3158 | // position the window at the bottom-right |
| 3161 | | bestwidth = (info->maxwidth < (work_bounds.right - work_bounds.left)) ? info->maxwidth : (work_bounds.right - work_bounds.left); |
| 3162 | | bestheight = (500 < (work_bounds.bottom - work_bounds.top)) ? 500 : (work_bounds.bottom - work_bounds.top); |
| 3159 | bestwidth = (info->maxwidth < (mainBounds.size.width)) ? info->maxwidth : (mainBounds.size.width); |
| 3160 | bestheight = (500 < (mainBounds.size.height)) ? 500 : (mainBounds.size.height); |
| 3163 | 3161 | |
| 3164 | | bounds.left = work_bounds.right - bestwidth; |
| 3165 | | bounds.top = work_bounds.bottom - bestheight; |
| 3166 | | bounds.right = bounds.left + bestwidth; |
| 3167 | | bounds.bottom = bounds.top + bestheight; |
| 3162 | bounds.left = (mainBounds.origin.x+mainBounds.size.width) - bestwidth; |
| 3163 | bounds.top = (mainBounds.origin.y+mainBounds.size.height) - bestheight; |
| 3164 | bounds.right = mainBounds.origin.x + bestwidth; |
| 3165 | bounds.bottom = mainBounds.origin.y + bestheight; |
| 3168 | 3166 | |
| 3169 | 3167 | SetWindowBounds(info->wnd, kWindowStructureRgn, &bounds ); |
| 3170 | 3168 | |