~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/butspace.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <config.h>
40
40
#endif
41
41
 
 
42
#include "blendef.h"
42
43
#include "MEM_guardedalloc.h"
43
44
 
44
45
#include "DNA_color_types.h"
159
160
        *idpp= NULL;
160
161
}
161
162
 
 
163
/* tests for an object of type OB_MESH */
 
164
void test_meshobpoin_but(char *name, ID **idpp)
 
165
{
 
166
        ID *id;
 
167
 
 
168
        id = G.main->object.first;
 
169
        while(id) {
 
170
                Object *ob = (Object *)id;
 
171
                if(ob->type == OB_MESH && strcmp(name, id->name + 2) == 0) {
 
172
                        *idpp = id;
 
173
                        /* checks lib data, sets correct flag for saving then */
 
174
                        id_lib_extern(id);
 
175
                        return;
 
176
                }
 
177
                id = id->next;
 
178
        }
 
179
        *idpp = NULL;
 
180
}
 
181
 
162
182
void test_meshpoin_but(char *name, ID **idpp)
163
183
{
164
184
        ID *id;
679
699
/* callback */
680
700
void drawbutspace(ScrArea *sa, void *spacedata)
681
701
{
 
702
        ID *id, *idfrom;
682
703
        SpaceButs *sbuts= sa->spacedata.first;
683
704
        View2D *v2d= &sbuts->v2d;
684
705
        float col[3];
685
706
        int tab, align=0;
686
707
        
 
708
        /* context */
 
709
        buttons_active_id(&id, &idfrom);
 
710
        G.buts->lockpoin= id;
 
711
        
687
712
        myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
688
713
 
689
714
        BIF_GetThemeColor3fv(TH_BACK, col);
690
715
        glClearColor(col[0], col[1], col[2], 0.0); 
691
716
        glClear(GL_COLOR_BUFFER_BIT);
692
717
 
693
 
        uiSetButLock(G.scene->id.lib!=0, "Can't edit library data");    
 
718
        uiSetButLock(G.scene->id.lib!=0, ERROR_LIBDATA_MESSAGE);        
694
719
        uiFreeBlocksWin(&sa->uiblocks, sa->win);
695
720
 
696
721
        /* select the context to be drawn, per contex/tab the actual context is tested */