예제 #1
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
/*!
	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);
	}
}
예제 #2
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
/*!
	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);
	}
}
예제 #3
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
/*!
	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;
		}
	}
}
예제 #4
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
/*!
	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;
}
예제 #5
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
/*!
	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;
}
예제 #6
0
 // 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;
 }
예제 #7
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
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
}
예제 #8
0
파일: Lists.cpp 프로젝트: RJVB/QTilities
/*!
	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;
}