本文整理匯總了C++中BLI_remlink函數的典型用法代碼示例。如果您正苦於以下問題:C++ BLI_remlink函數的具體用法?C++ BLI_remlink怎麽用?C++ BLI_remlink使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BLI_remlink函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: BLI_end_threads
void VideoFFmpeg::stopCache()
{
if (m_cacheStarted)
{
m_stopThread = true;
BLI_end_threads(&m_thread);
// now delete the cache
CacheFrame *frame;
CachePacket *packet;
while ((frame = (CacheFrame *)m_frameCacheBase.first) != NULL)
{
BLI_remlink(&m_frameCacheBase, frame);
MEM_freeN(frame->frame->data[0]);
av_free(frame->frame);
delete frame;
}
while ((frame = (CacheFrame *)m_frameCacheFree.first) != NULL)
{
BLI_remlink(&m_frameCacheFree, frame);
MEM_freeN(frame->frame->data[0]);
av_free(frame->frame);
delete frame;
}
while ((packet = (CachePacket *)m_packetCacheBase.first) != NULL)
{
BLI_remlink(&m_packetCacheBase, packet);
av_free_packet(&packet->packet);
delete packet;
}
while ((packet = (CachePacket *)m_packetCacheFree.first) != NULL)
{
BLI_remlink(&m_packetCacheFree, packet);
delete packet;
}
m_cacheStarted = false;
}
}
示例2: wm_window_close
/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
wmWindow *tmpwin;
bScreen *screen = win->screen;
/* first check if we have any non-temp remaining windows */
if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved) {
if (wm->windows.first) {
for (tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next) {
if (tmpwin == win)
continue;
if (tmpwin->screen->temp == 0)
break;
}
if (tmpwin == NULL) {
if (!GHOST_confirmQuit(win->ghostwin))
return;
}
}
}
BLI_remlink(&wm->windows, win);
wm_draw_window_clear(win);
CTX_wm_window_set(C, win); /* needed by handlers */
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
wm_window_free(C, wm, win);
/* if temp screen, delete it after window free (it stops jobs that can access it) */
if (screen->temp) {
Main *bmain = CTX_data_main(C);
BKE_libblock_free(&bmain->screen, screen);
}
/* check remaining windows */
if (wm->windows.first) {
for (win = wm->windows.first; win; win = win->next)
if (win->screen->temp == 0)
break;
/* in this case we close all */
if (win == NULL)
WM_exit(C);
}
else
WM_exit(C);
}
示例3: pthread_mutex_lock
void VideoFFmpeg::releaseFrame(AVFrame *frame)
{
if (frame == m_frameRGB)
{
// this is not a frame from the cache, ignore
return;
}
// this frame MUST be the first one of the queue
pthread_mutex_lock(&m_cacheMutex);
CacheFrame *cacheFrame = (CacheFrame *)m_frameCacheBase.first;
assert (cacheFrame != NULL && cacheFrame->frame == frame);
BLI_remlink(&m_frameCacheBase, cacheFrame);
BLI_addtail(&m_frameCacheFree, cacheFrame);
pthread_mutex_unlock(&m_cacheMutex);
}
示例4: sensor_remove_exec
static int sensor_remove_exec(bContext *C, wmOperator *op)
{
Object *ob = NULL;
bSensor *sens = edit_sensor_property_get(C, op, &ob);
if (!sens)
return OPERATOR_CANCELLED;
BLI_remlink(&(ob->sensors), sens);
free_sensor(sens);
WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
}
示例5: wm_window_close
/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
wmWindow *tmpwin;
bool do_exit = false;
/* first check if we have to quit (there are non-temp remaining windows) */
for (tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next) {
if (tmpwin == win)
continue;
if (tmpwin->screen->temp == 0)
break;
}
if (tmpwin == NULL)
do_exit = 1;
if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved) {
if (do_exit) {
if (!GHOST_confirmQuit(win->ghostwin))
return;
}
}
/* let WM_exit do all freeing, for correct quit.blend save */
if (do_exit) {
WM_exit(C);
}
else {
bScreen *screen = win->screen;
BLI_remlink(&wm->windows, win);
wm_draw_window_clear(win);
CTX_wm_window_set(C, win); /* needed by handlers */
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
wm_window_free(C, wm, win);
/* if temp screen, delete it after window free (it stops jobs that can access it) */
if (screen->temp) {
Main *bmain = CTX_data_main(C);
BKE_libblock_free(bmain, screen);
}
}
}
示例6: controller_remove_exec
static int controller_remove_exec(bContext *C, wmOperator *op)
{
Object *ob = NULL;
bController *cont = edit_controller_property_get(C, op, &ob);
if (!cont)
return OPERATOR_CANCELLED;
BLI_remlink(&(ob->controllers), cont);
unlink_controller(cont);
free_controller(cont);
WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
}
示例7: actuator_remove_exec
static int actuator_remove_exec(bContext *C, wmOperator *op)
{
Object *ob = NULL;
bActuator *act = edit_actuator_property_get(C, op, &ob);
if (!act)
return OPERATOR_CANCELLED;
BLI_remlink(&(ob->actuators), act);
unlink_actuator(act);
free_actuator(act);
WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
}
示例8: BLI_callback_global_finalize
/* call on application exit */
void BLI_callback_global_finalize(void)
{
eCbEvent evt;
for (evt = 0; evt < BLI_CB_EVT_TOT; evt++) {
ListBase *lb = &callback_slots[evt];
bCallbackFuncStore *funcstore;
bCallbackFuncStore *funcstore_next;
for (funcstore = (bCallbackFuncStore *)lb->first; funcstore; funcstore = funcstore_next) {
funcstore_next = (bCallbackFuncStore *)funcstore->next;
BLI_remlink(lb, funcstore);
if (funcstore->alloc) {
MEM_freeN(funcstore);
}
}
}
}
示例9: freeMetaElemlist
/* free all MetaElems from ListBase */
static void freeMetaElemlist(ListBase *lb)
{
MetaElem *ml, *next;
if (lb == NULL) return;
ml = lb->first;
while (ml) {
next = ml->next;
BLI_remlink(lb, ml);
MEM_freeN(ml);
ml = next;
}
lb->first = lb->last = NULL;
}
示例10: unpackImage
int unpackImage(ReportList *reports, Image *ima, int how)
{
int ret_value = RET_ERROR;
if (ima != NULL) {
while (ima->packedfiles.last) {
char localname[FILE_MAX], absname[FILE_MAX];
char *newname;
ImagePackedFile *imapf = ima->packedfiles.last;
unpack_generate_paths(imapf->filepath, (ID *)ima, absname, localname, sizeof(absname), sizeof(localname));
newname = unpackFile(reports, absname, localname, imapf->packedfile, how);
if (newname != NULL) {
ImageView *iv;
ret_value = ret_value == RET_ERROR ? RET_ERROR : RET_OK;
freePackedFile(imapf->packedfile);
imapf->packedfile = NULL;
/* update the new corresponding view filepath */
iv = BLI_findstring(&ima->views, imapf->filepath, offsetof(ImageView, filepath));
if (iv) {
BLI_strncpy(iv->filepath, newname, sizeof(imapf->filepath));
}
/* keep the new name in the image for non-pack specific reasons */
if (how != PF_REMOVE) {
BLI_strncpy(ima->name, newname, sizeof(imapf->filepath));
}
MEM_freeN(newname);
}
else {
ret_value = RET_ERROR;
}
BLI_remlink(&ima->packedfiles, imapf);
MEM_freeN(imapf);
}
}
if (ret_value == RET_OK) {
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
}
return(ret_value);
}
示例11: RE_engines_exit
void RE_engines_exit(void)
{
RenderEngineType *type, *next;
for (type = R_engines.first; type; type = next) {
next = type->next;
BLI_remlink(&R_engines, type);
if (!(type->flag & RE_INTERNAL)) {
if (type->ext.free)
type->ext.free(type->ext.data);
MEM_freeN(type);
}
}
}
示例12: wm_window_match_init
/* To be able to read files without windows closing, opening, moving
* we try to prepare for worst case:
* - active window gets active screen from file
* - restoring the screens from non-active windows
* Best case is all screens match, in that case they get assigned to proper window
*/
static void wm_window_match_init(bContext *C, ListBase *wmlist)
{
wmWindowManager *wm;
wmWindow *win, *active_win;
*wmlist = G.main->wm;
BLI_listbase_clear(&G.main->wm);
active_win = CTX_wm_window(C);
/* first wrap up running stuff */
/* code copied from wm_init_exit.c */
for (wm = wmlist->first; wm; wm = wm->id.next) {
WM_jobs_kill_all(wm);
for (win = wm->windows.first; win; win = win->next) {
CTX_wm_window_set(C, win); /* needed by operator close callbacks */
WM_event_remove_handlers(C, &win->handlers);
WM_event_remove_handlers(C, &win->modalhandlers);
ED_screen_exit(C, win, win->screen);
}
}
/* reset active window */
CTX_wm_window_set(C, active_win);
ED_editors_exit(C);
/* just had return; here from r12991, this code could just get removed?*/
#if 0
if (wm == NULL) return;
if (G.fileflags & G_FILE_NO_UI) return;
/* we take apart the used screens from non-active window */
for (win = wm->windows.first; win; win = win->next) {
BLI_strncpy(win->screenname, win->screen->id.name, MAX_ID_NAME);
if (win != wm->winactive) {
BLI_remlink(&G.main->screen, win->screen);
//BLI_addtail(screenbase, win->screen);
}
}
#endif
}
示例13: blf_font_free
void blf_font_free(FontBLF *font)
{
GlyphCacheBLF *gc;
font->glyph_cache = NULL;
while (font->cache.first) {
gc = font->cache.first;
BLI_remlink(&font->cache, gc);
blf_glyph_cache_free(gc);
}
FT_Done_Face(font->face);
if (font->filename)
MEM_freeN(font->filename);
if (font->name)
MEM_freeN(font->name);
MEM_freeN(font);
}
示例14: blf_glyph_cache_clear
void blf_glyph_cache_clear(FontBLF *font)
{
GlyphCacheBLF *gc;
GlyphBLF *g;
int i;
for (gc = font->cache.first; gc; gc = gc->next) {
for (i = 0; i < 257; i++) {
while (gc->bucket[i].first) {
g = gc->bucket[i].first;
BLI_remlink(&(gc->bucket[i]), g);
blf_glyph_free(g);
}
}
memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table));
}
}
示例15: blf_glyph_cache_free
void blf_glyph_cache_free(GlyphCacheBLF *gc)
{
GlyphBLF *g;
int i;
for (i = 0; i < 257; i++) {
while (gc->bucket[i].first) {
g = gc->bucket[i].first;
BLI_remlink(&(gc->bucket[i]), g);
blf_glyph_free(g);
}
}
if (gc->cur_tex+1 > 0)
glDeleteTextures(gc->cur_tex+1, gc->textures);
free((void *)gc->textures);
MEM_freeN(gc);
}