~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/editors/interface/resources.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
                                        cp = ts->grid; break;
258
258
                                case TH_WIRE:
259
259
                                        cp = ts->wire; break;
 
260
                                case TH_WIRE_EDIT:
 
261
                                        cp = ts->wire_edit; break;
260
262
                                case TH_LAMP:
261
263
                                        cp = ts->lamp; break;
262
264
                                case TH_SPEAKER:
279
281
                                        cp = ts->vertex; break;
280
282
                                case TH_VERTEX_SELECT:
281
283
                                        cp = ts->vertex_select; break;
 
284
                                case TH_VERTEX_UNREFERENCED:
 
285
                                        cp = ts->vertex_unreferenced; break;
282
286
                                case TH_VERTEX_SIZE:
283
287
                                        cp = &ts->vertex_size; break;
284
288
                                case TH_OUTLINE_WIDTH:
307
311
                                        cp = &ts->facedot_size; break;
308
312
                                case TH_DRAWEXTRA_EDGELEN:
309
313
                                        cp = ts->extra_edge_len; break;
 
314
                                case TH_DRAWEXTRA_EDGEANG:
 
315
                                        cp = ts->extra_edge_angle; break;
310
316
                                case TH_DRAWEXTRA_FACEAREA:
311
317
                                        cp = ts->extra_face_area; break;
312
318
                                case TH_DRAWEXTRA_FACEANG:
359
365
                                        cp = ts->handle_sel_vect; break;
360
366
                                case TH_HANDLE_SEL_ALIGN:
361
367
                                        cp = ts->handle_sel_align; break;
 
368
                                case TH_FREESTYLE_EDGE_MARK:
 
369
                                        cp = ts->freestyle_edge_mark; break;
 
370
                                case TH_FREESTYLE_FACE_MARK:
 
371
                                        cp = ts->freestyle_face_mark; break;
362
372
 
363
373
                                case TH_SYNTAX_B:
364
374
                                        cp = ts->syntaxb; break;
387
397
                                        cp = ts->syntaxv; break;
388
398
                                case TH_NODE_GROUP:
389
399
                                        cp = ts->syntaxc; break;
 
400
                                case TH_NODE_INTERFACE:
 
401
                                        cp = ts->console_output; break;
390
402
                                case TH_NODE_FRAME:
391
403
                                        cp = ts->movie; break;
392
404
                                case TH_NODE_MATTE:
439
451
                                case TH_HANDLE_VERTEX_SIZE:
440
452
                                        cp = &ts->handle_vertex_size;
441
453
                                        break;
442
 
 
443
454
                                case TH_DOPESHEET_CHANNELOB:
444
455
                                        cp = ts->ds_channel;
445
456
                                        break;
727
738
 
728
739
        rgba_char_args_set_fl(btheme->tv3d.grid,     0.251, 0.251, 0.251, 1.0);
729
740
        rgba_char_args_set(btheme->tv3d.wire,       0x0, 0x0, 0x0, 255);
 
741
        rgba_char_args_set(btheme->tv3d.wire_edit,  0x0, 0x0, 0x0, 255);
730
742
        rgba_char_args_set(btheme->tv3d.lamp,       0, 0, 0, 40);
731
743
        rgba_char_args_set(btheme->tv3d.speaker,    0, 0, 0, 255);
732
744
        rgba_char_args_set(btheme->tv3d.camera,    0, 0, 0, 255);
738
750
        rgba_char_args_set(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
739
751
        rgba_char_args_set(btheme->tv3d.vertex, 0, 0, 0, 255);
740
752
        rgba_char_args_set(btheme->tv3d.vertex_select, 255, 133, 0, 255);
 
753
        rgba_char_args_set(btheme->tv3d.vertex_unreferenced, 0, 0, 0, 255);
741
754
        btheme->tv3d.vertex_size = 3;
742
755
        btheme->tv3d.outline_width = 1;
743
756
        rgba_char_args_set(btheme->tv3d.edge,       0x0, 0x0, 0x0, 255);
758
771
        rgba_char_args_set(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
759
772
        rgba_char_args_set(btheme->tv3d.button_title, 0, 0, 0, 255);
760
773
        rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255);
 
774
        rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
 
775
        rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
761
776
 
762
777
        btheme->tv3d.facedot_size = 4;
763
778
 
764
779
        rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
 
780
        rgba_char_args_set(btheme->tv3d.extra_edge_angle, 32, 32, 0, 255);
765
781
        rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 32, 0, 255);
766
782
        rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 0, 128, 255);
767
783
 
882
898
        rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
883
899
        rgba_char_args_set(btheme->tseq.meta,   109, 145, 131, 255);
884
900
        rgba_char_args_set(btheme->tseq.preview_back,   0, 0, 0, 255);
 
901
        rgba_char_args_set(btheme->tseq.grid,   64, 64, 64, 255);
885
902
 
886
903
        /* space image */
887
904
        btheme->tima = btheme->tv3d;
949
966
        rgba_char_args_set_fl(btheme->ttime.grid,   0.36, 0.36, 0.36, 1.0);
950
967
        rgba_char_args_set(btheme->ttime.shade1,  173, 173, 173, 255);      /* sliders */
951
968
        
952
 
        /* space node, re-uses syntax color storage */
 
969
        /* space node, re-uses syntax and console color storage */
953
970
        btheme->tnode = btheme->tv3d;
954
971
        rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255);      /* wire selected */
955
972
        rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160);  /* TH_NODE, backdrop */
958
975
        rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255);  /* generator */
959
976
        rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255);  /* group */
960
977
        rgba_char_args_set(btheme->tnode.movie, 155, 155, 155, 160);  /* frame */
 
978
        rgba_char_args_set(btheme->tnode.syntaxs, 151, 116, 116, 255);  /* matte nodes */
 
979
        rgba_char_args_set(btheme->tnode.syntaxd, 116, 151, 151, 255);  /* distort nodes */
 
980
        rgba_char_args_set(btheme->tnode.console_output, 223, 202, 53, 255);  /* interface nodes */
961
981
        btheme->tnode.noodle_curving = 5;
962
982
 
963
983
        /* space logic */
985
1005
        btheme->tclip.handle_vertex_size = 4;
986
1006
}
987
1007
 
 
1008
void ui_style_init_default(void)
 
1009
{
 
1010
        BLI_freelistN(&U.uistyles);
 
1011
        /* gets automatically re-allocated */
 
1012
        uiStyleInit();
 
1013
}
 
1014
 
988
1015
 
989
1016
void UI_SetTheme(int spacetype, int regionid)
990
1017
{
991
 
        if (spacetype == 0) {  /* called for safety, when delete themes */
 
1018
        if (spacetype) {
 
1019
                /* later on, a local theme can be found too */
 
1020
                theme_active = U.themes.first;
 
1021
                theme_spacetype = spacetype;
 
1022
                theme_regionid = regionid;
 
1023
        }
 
1024
        else if (regionid) {
 
1025
                /* popups */
 
1026
                theme_active = U.themes.first;
 
1027
                theme_spacetype = SPACE_BUTS;
 
1028
                theme_regionid = regionid;
 
1029
        }
 
1030
        else {
 
1031
                /* for safety, when theme was deleted */
992
1032
                theme_active = U.themes.first;
993
1033
                theme_spacetype = SPACE_VIEW3D;
994
1034
                theme_regionid = RGN_TYPE_WINDOW;
995
1035
        }
996
 
        else {
997
 
                /* later on, a local theme can be found too */
998
 
                theme_active = U.themes.first;
999
 
                theme_spacetype = spacetype;
1000
 
                theme_regionid = regionid;
1001
 
        }
1002
1036
}
1003
1037
 
1004
1038
bTheme *UI_GetTheme(void)
1039
1073
        CLAMP(g, 0, 255);
1040
1074
        b = offset + (int) cp[2];
1041
1075
        CLAMP(b, 0, 255);
1042
 
        //glColor3ub(r, g, b);
1043
1076
        glColor4ub(r, g, b, cp[3]);
1044
1077
}
1045
1078
void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
1368
1401
        
1369
1402
        /* signal for derivedmesh to use colorband */
1370
1403
        /* run in case this was on and is now off in the user prefs [#28096] */
1371
 
        vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL);
 
1404
        vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL, UI_GetTheme()->tv3d.vertex_unreferenced);
1372
1405
 
1373
1406
        if (bmain->versionfile <= 191) {
1374
1407
                strcpy(U.sounddir, "/");
1533
1566
                        rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
1534
1567
                }
1535
1568
                if (U.coba_weight.tot == 0)
1536
 
                        init_colorband(&U.coba_weight, 1);
 
1569
                        init_colorband(&U.coba_weight, true);
1537
1570
        }
1538
1571
        if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 11)) {
1539
1572
                bTheme *btheme;
2015
2048
                }
2016
2049
        }
2017
2050
 
2018
 
        /* GL Texture Garbage Collection (variable abused above!) */
2019
 
        if (U.textimeout == 0) {
2020
 
                U.texcollectrate = 60;
2021
 
                U.textimeout = 120;
2022
 
        }
2023
 
        if (U.memcachelimit <= 0) {
2024
 
                U.memcachelimit = 32;
2025
 
        }
2026
 
        if (U.frameserverport == 0) {
2027
 
                U.frameserverport = 8080;
2028
 
        }
2029
 
        if (U.dbl_click_time == 0) {
2030
 
                U.dbl_click_time = 350;
2031
 
        }
2032
 
        if (U.scrcastfps == 0) {
2033
 
                U.scrcastfps = 10;
2034
 
                U.scrcastwait = 50;
2035
 
        }
2036
 
        if (U.v2d_min_gridsize == 0) {
2037
 
                U.v2d_min_gridsize = 35;
2038
 
        }
2039
 
        if (U.dragthreshold == 0)
2040
 
                U.dragthreshold = 5;
2041
 
        if (U.widget_unit == 0)
2042
 
                U.widget_unit = 20;
2043
 
        if (U.anisotropic_filter <= 0)
2044
 
                U.anisotropic_filter = 1;
2045
 
 
2046
 
        if (U.ndof_sensitivity == 0.0f) {
2047
 
                U.ndof_sensitivity = 1.0f;
2048
 
                U.ndof_flag = NDOF_LOCK_HORIZON |
2049
 
                              NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
2050
 
        }
2051
 
        
2052
 
        if (U.ndof_orbit_sensitivity == 0.0f) {
2053
 
                U.ndof_orbit_sensitivity = U.ndof_sensitivity;
2054
 
 
2055
 
                if (!(U.flag & USER_TRACKBALL))
2056
 
                        U.ndof_flag |= NDOF_TURNTABLE;
2057
 
        }
2058
 
        if (U.tweak_threshold == 0)
2059
 
                U.tweak_threshold = 10;
 
2051
        if (U.versionfile < 267) {
 
2052
                /* Freestyle color settings */
 
2053
                bTheme *btheme;
 
2054
 
 
2055
                for (btheme = U.themes.first; btheme; btheme = btheme->next) {
 
2056
                        /* check for alpha == 0 is safe, then color was never set */
 
2057
                        if (btheme->tv3d.freestyle_edge_mark[3] == 0) {
 
2058
                                rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
 
2059
                                rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
 
2060
                        }
 
2061
 
 
2062
                        if (btheme->tv3d.wire_edit[3] == 0) {
 
2063
                                rgba_char_args_set(btheme->tv3d.wire_edit,  0x0, 0x0, 0x0, 255);
 
2064
                        }
 
2065
                }
 
2066
 
 
2067
                /* GL Texture Garbage Collection */
 
2068
                if (U.textimeout == 0) {
 
2069
                        U.texcollectrate = 60;
 
2070
                        U.textimeout = 120;
 
2071
                }
 
2072
                if (U.memcachelimit <= 0) {
 
2073
                        U.memcachelimit = 32;
 
2074
                }
 
2075
                if (U.frameserverport == 0) {
 
2076
                        U.frameserverport = 8080;
 
2077
                }
 
2078
                if (U.dbl_click_time == 0) {
 
2079
                        U.dbl_click_time = 350;
 
2080
                }
 
2081
                if (U.scrcastfps == 0) {
 
2082
                        U.scrcastfps = 10;
 
2083
                        U.scrcastwait = 50;
 
2084
                }
 
2085
                if (U.v2d_min_gridsize == 0) {
 
2086
                        U.v2d_min_gridsize = 35;
 
2087
                }
 
2088
                if (U.dragthreshold == 0)
 
2089
                        U.dragthreshold = 5;
 
2090
                if (U.widget_unit == 0)
 
2091
                        U.widget_unit = 20;
 
2092
                if (U.anisotropic_filter <= 0)
 
2093
                        U.anisotropic_filter = 1;
 
2094
 
 
2095
                if (U.ndof_sensitivity == 0.0f) {
 
2096
                        U.ndof_sensitivity = 1.0f;
 
2097
                        U.ndof_flag = (NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE);
 
2098
                }
 
2099
                
 
2100
                if (U.ndof_orbit_sensitivity == 0.0f) {
 
2101
                        U.ndof_orbit_sensitivity = U.ndof_sensitivity;
 
2102
 
 
2103
                        if (!(U.flag & USER_TRACKBALL))
 
2104
                                U.ndof_flag |= NDOF_TURNTABLE;
 
2105
                }
 
2106
                if (U.tweak_threshold == 0)
 
2107
                        U.tweak_threshold = 10;
 
2108
        }
2060
2109
 
2061
2110
        if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 1)) {
2062
2111
                bTheme *btheme;
2147
2196
                }
2148
2197
        }
2149
2198
 
 
2199
        if (U.versionfile < 266 || (U.versionfile == 266 && U.subversionfile < 2)) {
 
2200
                bTheme *btheme;
 
2201
                for (btheme = U.themes.first; btheme; btheme = btheme->next) {
 
2202
                        rgba_char_args_test_set(btheme->tnode.console_output, 223, 202, 53, 255);  /* interface nodes */
 
2203
                }
 
2204
        }
 
2205
 
2150
2206
        /* NOTE!! from now on use U.versionfile and U.subversionfile */
2151
2207
        
2152
2208
        
2153
2209
        if (U.pixelsize == 0.0f)
2154
2210
                U.pixelsize = 1.0f;
2155
2211
        
 
2212
        if (U.image_draw_method == 0)
 
2213
                U.image_draw_method = IMAGE_DRAW_METHOD_2DTEXTURE;
 
2214
        
2156
2215
        /* funny name, but it is GE stuff, moves userdef stuff to engine */
2157
2216
// XXX  space_set_commmandline_options();
2158
2217
        /* this timer uses U */