/*! unregisters a QTMovieWindowH from Movie association */ void unregister_QTMovieWindowH_for_Movie( Movie movie ) { if( movie && m2qtmwh_initialised && m2qtmwh.count(movie) ){ m2qtmwh.erase(movie); m2qtmwh.resize(0); } }
/*! remove a NativeWindow -> QTMovieWindowH association */ void unregister_QTMovieWindowH_from_NativeWindow( NativeWindow hwnd ) { if( nw2q_initialised && hwnd && hwnd2qtwmh.count(hwnd) ){ hwnd2qtwmh.erase(hwnd); hwnd2qtwmh.resize(0); } }
/*! unregisters a QTMovieWindowH object */ void unregister_QTMovieWindowH( QTMovieWindowH qtwmH ) { NativeWindow hwnd; if( qtwmH && q2nw_initialised && qtwmh2hwnd.count(qtwmH) ){ hwnd = qtwmh2hwnd[qtwmH]; if( (*qtwmH)->theView == hwnd ){ if( nw2q_initialised && hwnd2qtwmh.count(hwnd) ){ hwnd2qtwmh.erase(hwnd); hwnd2qtwmh.resize(0); } } qtwmh2hwnd.erase(qtwmH); qtwmh2hwnd.resize(0); if( lastQTWMH == qtwmH ){ lastQTWMH = NULL; } } }
/*! given a movie, find the associated QTMovieWindowH object */ QTMovieWindowH QTMovieWindowH_from_Movie( Movie movie ) { QTMovieWindowH wi; if( movie && m2qtmwh_initialised && m2qtmwh.count(movie) ){ wi = m2qtmwh[movie]; if( Handle_Check(wi) && (*wi)->self == *wi && (*wi)->theMovie == movie ){ return wi; } } return NULL; }
/*! look up the QTMovieWindowH that uses the given window for displaying. Used in event processing. */ QTMovieWindowH QTMovieWindowH_from_NativeWindow( NativeWindow hwnd ) { QTMovieWindowH wi; if( hwnd2qtwmh.count(hwnd) ){ wi = hwnd2qtwmh[hwnd]; if( QTMovieWindowH_Check(wi) && (*wi)->theView == hwnd ){ return wi; } } return NULL; }
// fetch the row associated with the given index // and assign it if it doesn't exist lindex fetch_index(mwIndex gi) { if (imap.count(gi) != 0) { return imap[gi]; } lindex li = nextind; nextind ++; imap[gi] = li; grow_vector_to_index(gmap, li, (mwIndex)(-1)); gmap[li] = gi; return li; }
const char *GetMacOSStatusErrStrings(ErrCode err, const char **comment) { #if defined(WIN32) || defined(_WINDOWS) || defined(_MSC_VER) MacErrorTables *et; if( met_initialised && metMap.count(err) ){ if( (et = metMap[err]) ){ if( comment ){ *comment = et->errComment; } return et->errString; } } return NULL; #else if( comment ){ *comment = GetMacOSStatusCommentString(err); } return GetMacOSStatusErrorString(err); #endif }
/*! find the native window in which a QTMovieWindowH object is displayed. This exists mostly for double-check reasons, as the window is also accessible as (*qtwmH)->theView */ NativeWindow NativeWindow_from_QTMovieWindowH( QTMovieWindowH qtwmH ) { NativeWindow hwnd; if( qtwmH && q2nw_initialised ){ // some caching to speed things up ... if( qtwmH == lastQTWMH && (*lastQTWMH)->theView ){ return (*lastQTWMH)->theView; } else if( qtwmh2hwnd.count(qtwmH) ){ hwnd = qtwmh2hwnd[qtwmH]; if( (*qtwmH)->theView == hwnd ){ lastQTWMH = qtwmH; return hwnd; } else if( !(*qtwmH)->theView ){ // 20110228: a window that has been closed through the GUI but not yet // completely flushed from our management. We will need to suppose that // it was once a valid window, and thus cannot return NULL. return hwnd; } } } return NULL; }