diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-28 08:14:32 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-28 08:14:32 +0300 |
commit | f9ee03f1b195a55ea8298783215d50d0ad4f3795 (patch) | |
tree | 6206a12f0d0486c9aaac09c1e8e8163a4c9e12b4 /source/blender/editors/space_image | |
parent | dbf295b904fb0bcb59656a57e32474b1f5adf77a (diff) |
Got rid of some dead code
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_header.c | 337 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 24 |
2 files changed, 0 insertions, 361 deletions
diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index e0fd652bf92..dbe2acd603f 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -75,343 +75,6 @@ #include "image_intern.h" -/* ************************ header area region *********************** */ - -#define B_NOP -1 -#define B_REDR 1 -#define B_SIMAGEPAINTTOOL 4 -#define B_SIMA_USE_ALPHA 5 -#define B_SIMA_SHOW_ALPHA 6 -#define B_SIMA_SHOW_ZBUF 7 -#define B_SIMA_RECORD 8 -#define B_SIMA_PLAY 9 - -#if 0 -static void do_image_imagemenu(void *arg, int event) -{ - /* events >=20 are registered bpython scripts */ -#ifndef DISABLE_PYTHON - if (event >= 20) BPY_menu_do_python(PYMENU_IMAGE, event - 20); -#endif -} - -#ifndef DISABLE_PYTHON - { - BPyMenu *pym; - int i = 0; - - /* note that we acount for the N previous entries with i+20: */ - for (pym = BPyMenuTable[PYMENU_IMAGE]; pym; pym = pym->next, i++) { - - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i+20, - pym->tooltip?pym->tooltip:pym->filename); - } - } -#endif -#endif - -#if 0 -#ifndef DISABLE_PYTHON -static void do_image_uvs_scriptsmenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_UV, event); - - allqueue(REDRAWIMAGE, 0); -} - -static void image_uvs_scriptsmenu (void *args_unused) -{ - uiBlock *block; - BPyMenu *pym; - int i= 0; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_scriptsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_image_uvs_scriptsmenu, NULL); - - /* note that we acount for the N previous entries with i+20: */ - for (pym = BPyMenuTable[PYMENU_UV]; pym; pym = pym->next, i++) { - - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i, - pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -#endif /* DISABLE_PYTHON */ -#endif - -#if 0 -static void do_image_buttons(bContext *C, void *arg, int event) -{ - switch(event) { - case B_REDR: - ED_area_tag_redraw(CTX_wm_area(C)); - break; - } - - ToolSettings *settings= G.scene->toolsettings; - ID *id, *idtest; - int nr; - - if(curarea->win==0) return; - - if(event<=100) { - if(event<=50) do_global_buttons2(event); - else do_global_buttons(event); - return; - } - - switch(event) { - case B_SIMABROWSE: - if(sima->imanr== -2) { - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel((ID *)sima->image, ID_IM, 0, B_SIMABROWSE, - &sima->imanr, do_image_buttons); - } else { - activate_databrowse((ID *)sima->image, ID_IM, 0, B_SIMABROWSE, - &sima->imanr, do_image_buttons); - } - return; - } - if(sima->imanr < 0) break; - - nr= 1; - id= (ID *)sima->image; - - idtest= BLI_findlink(&G.main->image, sima->imanr-1); - if(idtest==NULL) { /* no new */ - return; - } - - if(idtest!=id) { - sima->image= (Image *)idtest; - if(idtest->us==0) idtest->us= 1; - BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE); - allqueue(REDRAWIMAGE, 0); - } - /* also when image is the same: assign! 0==no tileflag: */ - image_changed(sima, (Image *)idtest); - BIF_undo_push("Assign image UV"); - - break; - case B_SIMAGETILE: - image_set_tile(sima, 1); /* 1: only tileflag */ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - break; - case B_SIMA3DVIEWDRAW: - allqueue(REDRAWVIEW3D, 0); - break; - case B_SIMA_REDR_IMA_3D: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMAPACKIMA: - pack_image_sima(); - break; - - case B_SIMA_REPACK: - BKE_image_memorypack(sima->image); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMA_USE_ALPHA: - sima->flag &= ~(SI_SHOW_ALPHA|SI_SHOW_ZBUF); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_SIMA_SHOW_ALPHA: - sima->flag &= ~(SI_USE_ALPHA|SI_SHOW_ZBUF); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_SIMA_SHOW_ZBUF: - sima->flag &= ~(SI_SHOW_ALPHA|SI_USE_ALPHA); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_SIMARELOAD: - reload_image_sima(); - break; - case B_SIMAGELOAD: - open_image_sima(0); - break; - case B_SIMANAME: - if(sima->image) { - Image *ima; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - /* name in ima has been changed by button! */ - BLI_strncpy(str, sima->image->name, sizeof(str)); - ima= BKE_add_image_file(str); - if(ima) { - BKE_image_signal(ima, &sima->iuser, IMA_SIGNAL_RELOAD); - image_changed(sima, ima); - } - BIF_undo_push("Load image"); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_SIMAMULTI: - if(sima && sima->image) { - BKE_image_multilayer_index(sima->image->rr, &sima->iuser); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_TRANS_IMAGE: - image_editvertex_buts(NULL); - break; - case B_CURSOR_IMAGE: - image_editcursor_buts(NULL); - break; - - case B_TWINANIM: - { - Image *ima; - int nr; - - ima = sima->image; - if (ima) { - if(ima->flag & IMA_TWINANIM) { - nr= ima->xrep*ima->yrep; - if(ima->twsta>=nr) ima->twsta= 1; - if(ima->twend>=nr) ima->twend= nr-1; - if(ima->twsta>ima->twend) ima->twsta= 1; - } - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - } - break; - } - case B_SIMACLONEBROWSE: - if(settings->imapaint.brush) { - Brush *brush= settings->imapaint.brush; - - if(sima->menunr== -2) { - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel((ID *)brush->clone.image, ID_IM, 0, B_SIMACLONEBROWSE, - &sima->menunr, do_image_buttons); - } else { - activate_databrowse((ID *)brush->clone.image, ID_IM, 0, B_SIMACLONEBROWSE, - &sima->menunr, do_image_buttons); - } - break; - } - if(sima->menunr < 0) break; - - if(brush_clone_image_set_nr(brush, sima->menunr)) - allqueue(REDRAWIMAGE, 0); - } - break; - - case B_SIMACLONEDELETE: - if (settings->imapaint.brush) - if (brush_clone_image_delete(settings->imapaint.brush)) - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMABRUSHCHANGE: - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_SIMACURVES: - curvemapping_do_ibuf(sima->cumap, imagewindow_get_ibuf(sima)); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMARANGE: - curvemapping_set_black_white(sima->cumap, NULL, NULL); - curvemapping_do_ibuf(sima->cumap, imagewindow_get_ibuf(sima)); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMABRUSHBROWSE: - if(sima->menunr==-2) { - activate_databrowse((ID*)settings->imapaint.brush, ID_BR, 0, B_SIMABRUSHBROWSE, &sima->menunr, do_global_buttons); - break; - } - else if(sima->menunr < 0) break; - - if(brush_set_nr(&settings->imapaint.brush, sima->menunr)) { - BIF_undo_push("Browse Brush"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_SIMABRUSHDELETE: - if(brush_delete(&settings->imapaint.brush)) { - BIF_undo_push("Unlink Brush"); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - case B_KEEPDATA: - brush_toggled_fake_user(settings->imapaint.brush); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_SIMABRUSHLOCAL: - if(settings->imapaint.brush && settings->imapaint.brush->id.lib) { - if(okee("Make local")) { - make_local_brush(settings->imapaint.brush); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - } - break; - case B_SIMABTEXBROWSE: - if(settings->imapaint.brush) { - Brush *brush= settings->imapaint.brush; - - if(sima->menunr==-2) { - MTex *mtex= brush->mtex[brush->texact]; - ID *id= (ID*)((mtex)? mtex->tex: NULL); - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel(id, ID_TE, 0, B_SIMABTEXBROWSE, &sima->menunr, do_image_buttons); - } else { - activate_databrowse(id, ID_TE, 0, B_SIMABTEXBROWSE, &sima->menunr, do_image_buttons); - } - break; - } - else if(sima->menunr < 0) break; - - if(brush_texture_set_nr(brush, sima->menunr)) { - BIF_undo_push("Browse Brush Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_SIMABTEXDELETE: - if(settings->imapaint.brush) { - if (brush_texture_delete(settings->imapaint.brush)) { - BIF_undo_push("Unlink Brush Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_SIMA_PLAY: - play_anim(0); - break; - case B_SIMA_RECORD: - imagespace_composite_flipbook(curarea); - break; - } -} -#endif - /********************** toolbox operator *********************/ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index d82364fed2f..a077357d03e 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -489,36 +489,12 @@ static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn) /* add handlers, stuff you only do once or on area/region changes */ static void image_header_area_init(wmWindowManager *wm, ARegion *ar) { -#if 0 - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); -#else ED_region_header_init(ar); -#endif } static void image_header_area_draw(const bContext *C, ARegion *ar) { ED_region_header(C, ar); -#if 0 - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - image_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); -#endif } /**************************** spacetype *****************************/ |