void MyLUpdateVisRgn(DialogRef theDialog, ListHandle listHdl) { #if TARGET_API_MAC_CARBON RgnHandle visRgn = NewRgn(); if(visRgn) GetPortVisibleRegion(GetDialogPort(theDialog), visRgn); LUpdate(visRgn,listHdl); if(visRgn) DisposeRgn(visRgn); #else LUpdate(theDialog->visRgn,listHdl); #endif }
// -------------------------------------------------------------------------------------- void HandleDrawContent(WindowRef prefsWindow) { RgnHandle visibleRegion; ListHandle iconList; GetWindowProperty(prefsWindow, kAppSignature, kIconListTag, sizeof(ListHandle), NULL, &iconList); visibleRegion = NewRgn(); GetPortVisibleRegion(GetWindowPort(prefsWindow), visibleRegion); if (visibleRegion != NULL) { Boolean active = IsWindowHilited(prefsWindow); SInt16 pixelDepth; Boolean isColorDevice; if (active) SetThemeWindowBackground(prefsWindow, kThemeBrushModelessDialogBackgroundActive, false); else SetThemeWindowBackground(prefsWindow, kThemeBrushModelessDialogBackgroundInactive, false); EraseRgn(visibleRegion); UpdateControls(prefsWindow, visibleRegion); GetWindowDeviceDepthAndColor(prefsWindow, &pixelDepth, &isColorDevice); SetThemeBackground(kThemeBrushWhite, pixelDepth, isColorDevice); LUpdate(visibleRegion, iconList); drawFrameAndFocus(iconList, active, prefsWindow); DisposeRgn(visibleRegion); } }
void UpdateAdditionsWin(void) { Rect r; Cell c; int i; GrafPtr oldPort; GetPort(&oldPort); SetPort(gWPtr); MoveTo( gControls->aw->compListBox.left, gControls->aw->compListBox.top - kInterWidgetPad + 1); HLock(gControls->cfg->selAddMsg); DrawString( CToPascal(*gControls->cfg->selAddMsg)); HUnlock(gControls->cfg->selAddMsg); #if 0 RGBColor backColorOld; Rect adjustedRect, *clRect = &gControls->aw->compListBox; SetRect(&adjustedRect, clRect->left, clRect->top+1, clRect->right, clRect->bottom-1); GetBackColor(&backColorOld); BackColor(whiteColor); EraseRect(&adjustedRect); RGBBackColor(&backColorOld); #endif LUpdate( (*gControls->aw->compList)->port->visRgn, gControls->aw->compList); SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top, gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom); FrameRect(&r); SetPt(&c, 0, 0); if (LGetSelect(true, &c, gControls->aw->compList)) { HLock((Handle)gControls->aw->compDescTxt); SetRect(&r, (*gControls->aw->compDescTxt)->viewRect.left, (*gControls->aw->compDescTxt)->viewRect.top, (*gControls->aw->compDescTxt)->viewRect.right, (*gControls->aw->compDescTxt)->viewRect.bottom); HUnlock((Handle)gControls->aw->compDescTxt); TEUpdate(&r, gControls->aw->compDescTxt); } DrawDiskSpaceMsgs( gControls->opt->vRefNum ); for (i = 0; i < numRows; i++) { if (gControls->cfg->comp[rowToComp[i]].highlighted) { AddInitRowHighlight(i); break; } } SetPort(oldPort); }
/* -----------------------------------------------------------------------------*/ void FillLists (void) { TDriverInfos drvInfo; TSlotInfos slotInfo; SlotRefNum sref; Cell srcCell, dstCell; Boolean visible; short ref, i, j, p, n = MidiCountDrivers(); srcCell.h = srcCell.v = dstCell.h = dstCell.v = 0; LDelRow(0, 0, theList[SrcL]); LDelRow(0, 0, theList[DstL]); ResetPortMap (); for (i = 1; i <= n; i++) { ref = MidiGetIndDriver (i); if (MidiGetDriverInfos (ref, &drvInfo)) { for (j = 1; j <= drvInfo.slots; j++) { sref = MidiGetIndSlot (ref, j); if (MidiGetSlotInfos (sref, &slotInfo)) { visible = false; if (slotInfo.direction & MidiInputSlot) { LAddRow(1, srcCell.v, theList[SrcL]); LSetCell(&slotInfo.name[1], slotInfo.name[0], srcCell, theList[SrcL]); srcCell.v++; visible = true; } if (slotInfo.direction & MidiOutputSlot) { LAddRow(1, dstCell.v, theList[DstL]); LSetCell(&slotInfo.name[1], slotInfo.name[0], dstCell, theList[DstL]); dstCell.v++; visible = true; } if (visible) { for (p = 0; p < 32; p++) PortsMap[p] |= slotInfo.cnx[p]; } } } if (i <= 64) { InListMap[i-1] = srcCell.v; OutListMap[i-1] = dstCell.v; } } } InvalPortArea(); LUpdate(myWindow->visRgn, theList[SrcL]); LUpdate(myWindow->visRgn, theList[DstL]); }
static void mac_updateeventlog(WindowPtr window) { Session *s = mac_windowsession(window); #if TARGET_API_MAC_CARBON RgnHandle visrgn; #endif SetPort((GrafPtr)GetWindowPort(window)); BeginUpdate(window); #if TARGET_API_MAC_CARBON visrgn = NewRgn(); GetPortVisibleRegion(GetWindowPort(window), visrgn); LUpdate(visrgn, s->eventlog); DisposeRgn(visrgn); #else LUpdate(window->visRgn, s->eventlog); #endif mac_draweventloggrowicon(s); EndUpdate(window); }
extern pascal void LUpdateWhite(RgnHandle theRgn, ListHandle lHandle) { OSStatus err; MoreThemeDrawingState state; err = MoreGetThemeDrawingState(&state); if (err == noErr) { err = MoreNormalizeThemeDrawingState(); assert(err == noErr); LUpdate(theRgn, lHandle); err = MoreSetThemeDrawingState(state, true); } assert(err == noErr); }
static void update_ListWin() { SetPortWindowPort(win.ref); LUpdate( win.ref->visRgn, gPlaylist); DrawGrowIcon(win.ref); }