Previous 15994 Revisions Next

r1205 Wednesday 31st October, 2007 at 13:16:56 UTC by R. Belmont
[SDLMESS] OS X debugger fixes for Leopard [Ernesto Corvi]
[src/osd/sdl]debugosx.c

src/osd/sdl/debugosx.c
r1204r1205
533533static debugwin_info *debug_window_create(const char *title, void *unused)
534534{
535535   CGDirectDisplayID   mainID = CGMainDisplayID();
536   GDHandle         mainDevice;
537536
538537   debugwin_info *info = NULL;
539538   Rect work_bounds;
539   HIRect            mainBounds;
540540   
541541   (void)unused;
542542   
r1204r1205
578578   }
579579   
580580   // fill in some defaults
581   DMGetGDeviceByDisplayID((DisplayIDType)mainID, &mainDevice, TRUE);
582   GetAvailableWindowPositioningBounds(mainDevice, &work_bounds);
581   mainBounds = CGDisplayBounds( mainID );
583582   info->minwidth = 200;
584583   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;
587586
588587   // set the default handlers
589588   info->handle_command = global_handle_command;
r1204r1205
30163015{
30173016   debugwin_info *info;
30183017   int bestwidth, bestheight;
3019   Rect bounds, work_bounds;
3018   Rect bounds;
30203019   MenuRef optionsmenu, popupmenu;
30213020   UINT32 cpunum;
30223021   ControlFontStyleRec      style;
30233022   Str255      fontName;
30243023   CGDirectDisplayID   mainID = CGMainDisplayID();
3025   GDHandle         mainDevice;
3024   HIRect            mainBounds;
30263025   MenuItemIndex   menuIndex;
30273026   ControlButtonContentInfo   content;
30283027
r1204r1205
31433142      }
31443143
31453144   // get the work bounds
3146   DMGetGDeviceByDisplayID((DisplayIDType)mainID, &mainDevice, TRUE);
3147   GetAvailableWindowPositioningBounds(mainDevice, &work_bounds);
3145   mainBounds = CGDisplayBounds( mainID );
31483146
31493147   // adjust the min/max sizes for the window style
31503148   bounds.top = bounds.left = 0;
r1204r1205
31583156   info->maxwidth = bounds.right - bounds.left;
31593157
31603158   // 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);
31633161
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;
31683166
31693167   SetWindowBounds(info->wnd, kWindowStructureRgn, &bounds );
31703168

Previous 15994 Revisions Next


© 1998-2018 The MESS Team