diff options
author | Ton Roosendaal <ton@blender.org> | 2003-10-05 00:35:50 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-10-05 00:35:50 +0400 |
commit | 842bb449c57fc95d7590574cc5d15753459bffe4 (patch) | |
tree | 8ea0722c505073b031c30705f7e19fd84ffbe072 /source/blender | |
parent | c355aa06a8d4a921c29188081735b29722009416 (diff) |
huge commit, sorry!
this is part 1 of the UI makeover. It has:
- menu system from Matt integrated
- buttons drawing from Matt
- generic button panel system implemented
- converted displaybuttons (not the rest yet)
- cleaned up a lot in drawing spaces itself, to make it aligned and pixel exact.
- cleaned loads of little compiler warnings, protos...
still a lot of work needed, will all be in next week i hope!
(warn: 2 new c files! butspace.c and buttons_scene.c)
Diffstat (limited to 'source/blender')
34 files changed, 8170 insertions, 1986 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 63a15702c21..2443e679a09 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { struct ListBase; -#define BLENDER_VERSION 228 +#define BLENDER_VERSION 229 int BKE_read_file(char *dir, void *type_r); int BKE_read_file_from_memory(char* filebuf, int filelength, void *type_r); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f33dc498227..6f34e3137a9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2526,6 +2526,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc) SpaceLink *sl; link_list(fd, &(sa->spacedata)); + link_list(fd, &(sa->panels)); for (sl= sa->spacedata.first; sl; sl= sl->next) { if (sl->spacetype==SPACE_VIEW3D) { @@ -3733,7 +3734,73 @@ static void do_versions(Main *main) } } } + } + if(main->versionfile <= 228) { + Scene *sce; + bScreen *sc; + + for (sce= main->scene.first; sce; sce= sce->id.next) { + sce->r.mode |= R_ENVMAP; + } + // convert old mainb values for new button panels + for (sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + + for (sa= sc->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if (sl->spacetype==SPACE_BUTS) { + SpaceButs *sbuts= (SpaceButs *) sl; + + if(sbuts->mainb==BUTS_LAMP) { + sbuts->mainb= CONTEXT_SHADING; + sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP; + } + else if(sbuts->mainb==BUTS_MAT) { + sbuts->mainb= CONTEXT_SHADING; + sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT; + } + else if(sbuts->mainb==BUTS_TEX) { + sbuts->mainb= CONTEXT_SHADING; + sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX; + } + else if(sbuts->mainb==BUTS_ANIM) { + sbuts->mainb= CONTEXT_OBJECT; + } + else if(sbuts->mainb==BUTS_WORLD) { + sbuts->mainb= CONTEXT_SCENE; + sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_WORLD; + } + else if(sbuts->mainb==BUTS_RENDER) { + sbuts->mainb= CONTEXT_SCENE; + sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_RENDER; + } + else if(sbuts->mainb==BUTS_GAME) { + sbuts->mainb= CONTEXT_LOGIC; + } + else if(sbuts->mainb==BUTS_FPAINT) { + sbuts->mainb= CONTEXT_EDITING; + } + else if(sbuts->mainb==BUTS_RADIO) { + sbuts->mainb= CONTEXT_SHADING; + sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_RAD; + } + else if(sbuts->mainb==BUTS_CONSTRAINT) { + sbuts->mainb= CONTEXT_OBJECT; + } + else if(sbuts->mainb==BUTS_SCRIPT) { + sbuts->mainb= CONTEXT_OBJECT; + } + else if(sbuts->mainb==BUTS_EDIT) { + sbuts->mainb= CONTEXT_EDITING; + } + else sbuts->mainb= CONTEXT_SCENE; + } + } + } + } } /* don't forget to set version number in blender.c! */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index bdbef708b90..03316bf00e3 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1201,9 +1201,16 @@ static void write_screens(WriteData *wd, ListBase *scrbase) sa= sc->areabase.first; while(sa) { SpaceLink *sl; + Panel *pa; writestruct(wd, DATA, "ScrArea", 1, sa); + pa= sa->panels.first; + while(pa) { + writestruct(wd, DATA, "Panel", 1, pa); + pa= pa->next; + } + sl= sa->spacedata.first; while(sl) { if(sl->spacetype==SPACE_VIEW3D) { diff --git a/source/blender/include/BIF_butspace.h b/source/blender/include/BIF_butspace.h new file mode 100644 index 00000000000..3cca3dd9008 --- /dev/null +++ b/source/blender/include/BIF_butspace.h @@ -0,0 +1,413 @@ +/** + * $Id$ + * + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ +#ifndef BIF_BUTSPACE_H +#define BIF_BUTSPACE_H + +/* all internal calls and event codes for buttons space */ + +extern void render_panels(void); + + +/* -------------- event defines ------------ */ + + +#define B_DIFF 1 + +/* *********************** */ +#define B_VIEWBUTS 1100 + +#define B_LOADBGPIC 1001 +#define B_BLENDBGPIC 1002 +#define B_BGPICBROWSE 1003 +#define B_BGPICTEX 1004 +#define B_BGPICCLEAR 1005 +#define B_BGPICTEXCLEAR 1006 + +/* *********************** */ +#define B_LAMPBUTS 1200 + +#define B_LAMPREDRAW 1101 +#define B_COLLAMP 1102 +#define B_TEXCLEARLAMP 1103 +#define B_SBUFF 1104 + +/* *********************** */ +#define B_MATBUTS 1300 + +#define B_MATCOL 1201 +#define B_SPECCOL 1202 +#define B_MIRCOL 1203 +#define B_ACTCOL 1204 +#define B_MATFROM 1205 +#define B_MATPRV 1206 +#define B_MTEXCOL 1207 +#define B_TEXCLEAR 1208 +#define B_MATPRV_DRAW 1209 +#define B_MTEXPASTE 1210 +#define B_MTEXCOPY 1211 +#define B_MATLAY 1212 + +/* *********************** */ +#define B_TEXBUTS 1400 + +#define B_TEXTYPE 1301 +#define B_DEFTEXVAR 1302 +#define B_LOADTEXIMA 1303 +#define B_NAMEIMA 1304 +#define B_TEXCHANNEL 1305 +#define B_TEXREDR_PRV 1306 +#define B_TEXIMABROWSE 1307 +#define B_IMAPTEST 1308 +#define B_RELOADIMA 1309 +#define B_LOADPLUGIN 1310 +#define B_NAMEPLUGIN 1311 +#define B_COLORBAND 1312 +#define B_ADDCOLORBAND 1313 +#define B_DELCOLORBAND 1314 +#define B_CALCCBAND 1315 +#define B_CALCCBAND2 1316 +#define B_DOCOLORBAND 1317 +#define B_REDRAWCBAND 1318 +#define B_BANDCOL 1319 +#define B_LOADTEXIMA1 1320 +#define B_PLUGBUT 1321 + +/* plugbut reserves 24 buttons at least! */ + +#define B_ENV_MAKE 1350 +#define B_ENV_FREE 1351 +#define B_ENV_DELETE 1352 +#define B_ENV_SAVE 1353 +#define B_ENV_OB 1354 + +#define B_PACKIMA 1355 +#define B_TEXSETFRAMES 1356 + +#define B_ENV_FREE_ALL 1357 + +/* *********************** */ +#define B_ANIMBUTS 1500 + +#define B_RECALCPATH 1401 +#define B_MUL_IPO 1402 +#define B_AUTOTIMEOFS 1403 +#define B_FRAMEMAP 1404 +#define B_NEWEFFECT 1405 +#define B_PREVEFFECT 1406 +#define B_NEXTEFFECT 1407 +#define B_CHANGEEFFECT 1408 +#define B_CALCEFFECT 1409 +#define B_DELEFFECT 1410 +#define B_RECALCAL 1411 +#define B_SETSPEED 1412 +#define B_PRINTSPEED 1413 +#define B_PRINTLEN 1414 +#define B_RELKEY 1415 + + /* this has MAX_EFFECT settings! Next free define is 1450... */ +#define B_SELEFFECT 1430 + + +/* *********************** */ +#define B_WORLDBUTS 1600 + +#define B_TEXCLEARWORLD 1501 + +/* *********************** */ +#define B_RENDERBUTS 1700 + +#define B_FS_PIC 1601 +#define B_FS_BACKBUF 1602 + +#define B_FS_FTYPE 1604 +#define B_DORENDER 1605 +#define B_DOANIM 1606 +#define B_PLAYANIM 1607 +#define B_PR_PAL 1608 +#define B_PR_FULL 1609 +#define B_PR_PRV 1610 +#define B_PR_CDI 1611 +#define B_PR_PAL169 1612 +#define B_PR_D2MAC 1613 +#define B_PR_MPEG 1614 +#define B_REDRAWDISP 1615 +#define B_SETBROWSE 1616 +#define B_CLEARSET 1617 +#define B_PR_PRESET 1618 +#define B_PR_PANO 1619 +#define B_PR_NTSC 1620 + +#define B_IS_FTYPE 1622 +#define B_IS_BACKBUF 1623 +#define B_PR_PC 1624 + +#define B_PR_PANO360 1627 +#define B_PR_HALFFIELDS 1628 +#define B_NEWRENDERPIPE 1629 +#define B_R_SCALE 1630 +#define B_G_SCALE 1631 +#define B_B_SCALE 1632 +#define B_USE_R_SCALE 1633 +#define B_USE_G_SCALE 1634 +#define B_USE_B_SCALE 1635 +#define B_EDGECOLSLI 1636 +#define B_GAMMASLI 1637 + +#define B_FILETYPEMENU 1638 +#define B_SELECTCODEC 1639 +#define B_RTCHANGED 1640 + +#ifdef __NLA +/* *********************** */ +enum { + B_ARMATUREBUTS = 1800, + B_POSE = 1701 +}; +#endif + +/* *********************** */ +#define B_COMMONEDITBUTS 2049 + +#define B_MATWICH 2003 +#define B_MATNEW 2004 +#define B_MATDEL 2005 +#define B_MATASS 2006 +#define B_MATSEL 2007 +#define B_MATDESEL 2008 +#define B_HIDE 2009 +#define B_REVEAL 2010 +#define B_SELSWAP 2011 +#define B_SETSMOOTH 2012 +#define B_SETSOLID 2013 +#define B_AUTOTEX 2014 +#define B_DOCENTRE 2015 +#define B_DOCENTRENEW 2016 +#define B_DOCENTRECURSOR 2017 + + /* 32 values! */ +#define B_OBLAY 2018 + +#define B_MESHBUTS 2100 + +#define B_FLIPNORM 2050 +#define B_SPIN 2051 +#define B_SPINDUP 2052 +#define B_EXTR 2053 +#define B_SCREW 2054 +#define B_EXTREP 2055 +#define B_SPLIT 2056 +#define B_REMDOUB 2057 +#define B_SUBDIV 2058 +#define B_FRACSUBDIV 2059 +#define B_XSORT 2060 +#define B_HASH 2061 +#define B_DELSTICKY 2062 +#define B_DELVERTCOL 2063 +#define B_MAKE_TFACES 2064 +#define B_TOSPHERE 2065 +#define B_DEL_TFACES 2066 +#define B_NEWVGROUP 2067 +#define B_DELVGROUP 2068 +#define B_ASSIGNVGROUP 2069 +#define B_REMOVEVGROUP 2070 +#define B_SELVGROUP 2071 +#define B_DESELVGROUP 2072 +#define B_DECIM_FACES 2073 +#define B_DECIM_CANCEL 2074 +#define B_DECIM_APPLY 2075 +#define B_AUTOVGROUP 2076 +#define B_SLOWERDRAW 2077 +#define B_FASTERDRAW 2078 +#define B_VERTEXNOISE 2079 +#define B_VERTEXSMOOTH 2080 +#define B_MAKESTICKY 2082 +#define B_MAKEVERTCOL 2083 + +/* *********************** */ +#define B_CURVEBUTS 2200 + +#define B_CONVERTPOLY 2101 +#define B_CONVERTBEZ 2102 +#define B_CONVERTBSPL 2103 +#define B_CONVERTCARD 2104 +#define B_CONVERTNURB 2105 +#define B_UNIFU 2106 +#define B_ENDPU 2107 +#define B_BEZU 2108 +#define B_UNIFV 2109 +#define B_ENDPV 2110 +#define B_BEZV 2111 +#define B_SETWEIGHT 2112 +#define B_SETW1 2113 +#define B_SETW2 2114 +#define B_SETW3 2115 +#define B_SETORDER 2116 +#define B_MAKEDISP 2117 +#define B_SUBDIVCURVE 2118 +#define B_SPINNURB 2119 +#define B_CU3D 2120 +#define B_SETRESOLU 2121 +#define B_SETW4 2122 + + +/* *********************** */ +#define B_FONTBUTS 2300 + +#define B_MAKEFONT 2201 +#define B_TOUPPER 2202 +#define B_SETFONT 2203 +#define B_LOADFONT 2204 +#define B_TEXTONCURVE 2205 +#define B_PACKFONT 2206 + +/* *********************** */ +#define B_IKABUTS 2400 + +#define B_IKASETREF 2301 +#define B_IKARECALC 2302 + +/* *********************** */ +#define B_CAMBUTS 2500 + +/* *********************** */ +#define B_MBALLBUTS 2600 + +#define B_RECALCMBALL 2501 + +/* *********************** */ +#define B_LATTBUTS 2700 + +#define B_RESIZELAT 2601 +#define B_DRAWLAT 2602 +#define B_LATTCHANGED 2603 + +/* *********************** */ +#define B_GAMEBUTS 2800 + +/* in editsca.c */ + +/* *********************** */ +#define B_FPAINTBUTS 2900 + +#define B_VPCOLSLI 2801 +#define B_VPGAMMA 2802 + +#define B_COPY_TF_MODE 2804 +#define B_COPY_TF_UV 2805 +#define B_COPY_TF_COL 2806 +#define B_REDR_3D_IMA 2807 +#define B_SET_VCOL 2808 + +#define B_COPY_TF_TEX 2814 +#define B_TFACE_HALO 2815 +#define B_TFACE_BILLB 2816 + +#define B_SHOWTEX 2832 +#define B_ASSIGNMESH 2833 + + +/* *********************** */ +#define B_RADIOBUTS 3000 + +#define B_RAD_GO 2901 +#define B_RAD_INIT 2902 +#define B_RAD_LIMITS 2903 +#define B_RAD_FAC 2904 +#define B_RAD_NODELIM 2905 +#define B_RAD_NODEFILT 2906 +#define B_RAD_FACEFILT 2907 +#define B_RAD_ADD 2908 +#define B_RAD_DELETE 2909 +#define B_RAD_COLLECT 2910 +#define B_RAD_SHOOTP 2911 +#define B_RAD_SHOOTE 2912 +#define B_RAD_REPLACE 2913 +#define B_RAD_DRAW 2914 +#define B_RAD_FREE 2915 +#define B_RAD_ADDMESH 2916 + +/* *********************** */ +#define B_SCRIPTBUTS 3100 + +#define B_SCRIPT_ADD 3001 +#define B_SCRIPT_DEL 3002 +#define B_SCRIPT_TYPE 3003 + +/* Scene script buttons */ +#define B_SSCRIPT_ADD 3004 +#define B_SSCRIPT_DEL 3005 +#define B_SSCRIPT_TYPE 3006 + +/* *********************** */ +#define B_SOUNDBUTS 3200 +enum B_SOUND_BUTTONS { + B_SOUND_CHANGED = 3101, + B_SOUND_REDRAW, + B_SOUND_VOLUME, + B_SOUND_PANNING, + B_SOUND_PITCH, + B_SOUND_LOAD_SAMPLE, + B_SOUND_MENU_SAMPLE, + B_SOUND_NAME_SAMPLE, + B_SOUND_UNLINK_SAMPLE, + B_SOUND_RELOAD_SAMPLE, + B_SOUND_UNPACK_SAMPLE, + B_SOUND_PLAY_SAMPLE, + B_SOUND_COPY_SOUND, + B_SOUND_LOOPSTART, + B_SOUND_LOOPEND, + B_SOUND_BIDIRECTIONAL, + B_SOUND_RECALC, + B_SOUND_RATECHANGED, + B_SOUND_MIXDOWN +}; + +/* *********************** */ +#define B_CONSTRAINTBUTS 3300 +enum { + B_CONSTRAINT_REDRAW = 3201, + B_CONSTRAINT_ADD, + B_CONSTRAINT_DEL, + B_CONSTRAINT_TEST, + B_CONSTRAINT_CHANGETYPE, + B_CONSTRAINT_CHANGENAME, + B_CONSTRAINT_CHANGETARGET +}; + +/* *********************** */ +/* BUTTON BUT: > 4000 */ +/* BUTTON 4001-4032: layers */ + + + +#endif + diff --git a/source/blender/include/BIF_interface.h b/source/blender/include/BIF_interface.h index 8754a7a08d9..55fd6003a92 100644 --- a/source/blender/include/BIF_interface.h +++ b/source/blender/include/BIF_interface.h @@ -41,6 +41,11 @@ typedef struct uiBut uiBut; typedef struct uiBlock uiBlock; void uiEmboss(float x1, float y1, float x2, float y2, int sel); +void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad); +void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad); +void uiSetRoundBox(int type); +void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad); + void uiDrawMenuBox(float minx, float miny, float maxx, float maxy); void uiTextBoundsBlock(uiBlock *block, int addval); void uiBoundsBlock(struct uiBlock *block, int addval); @@ -99,6 +104,7 @@ typedef uiBlock* (*uiBlockFuncFP) (void *arg1); void uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, char *str, short x1, short y1, short x2, short y2, char *tip); void uiDefIconBlockBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, int icon, short x1, short y1, short x2, short y2, char *tip); +void uiDefIconTextBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip); void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip); @@ -133,5 +139,12 @@ void uiButSetFunc (uiBut *but, void (*func)(void *arg1, void *arg2), void *arg short pupmenu(char *instr); short pupmenu_col(char *instr, int maxrow); +extern void uiFreePanels(struct ListBase *lb); +extern void uiNewPanel(struct ScrArea *sa, struct uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey); +extern void uiScalePanelBlock(struct uiBlock *block); +extern int uiIsPanelClosed(struct uiBlock *block); +extern void uiAnimatePanels(struct ScrArea *sa); +extern void uiSetPanel_view2d(struct ScrArea *sa); + #endif /* BIF_INTERFACE_H */ diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index 305df25388c..0a2167fc071 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -262,6 +262,8 @@ typedef enum { #define BIFCOLORSHADE_FIRST (COLORSHADE_DARK) COLORSHADE_DARK, COLORSHADE_GREY, + COLORSHADE_LGREY, + COLORSHADE_LMEDIUM, COLORSHADE_MEDIUM, COLORSHADE_HILITE, COLORSHADE_LIGHT, @@ -287,6 +289,15 @@ typedef enum { BUTDPINK, BUTMACTIVE, + ACTIONBUTCOL, + NUMBUTCOL, + TEXBUTCOL, + TOGBUTCOL, + SLIDERCOL, + TABCOL, + MENUCOL, + MENUACTIVECOL, + BUTIPO, BUTAUDIO, BUTCAMERA, @@ -303,6 +314,10 @@ typedef enum { BUTYUCK, BUTSEASICK, BUTCHOKE, + + HEADERCOL, + HEADERCOLSEL, + BUTIMPERIAL, #define BIFCOLORID_LAST (BUTIMPERIAL) #define BIFNCOLORIDS (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1) diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h index 416df442e7c..b5f8cc9d89f 100644 --- a/source/blender/include/BIF_screen.h +++ b/source/blender/include/BIF_screen.h @@ -75,7 +75,7 @@ void getmouseco_headwin(short *mval); unsigned short qtest(void); int anyqtest(void); void areawinset(short win); -void headerbox(int selcol, int width); +void headerbox(struct ScrArea *sa); void defheaddraw(void); void defheadchange(void); unsigned short winqtest(struct ScrArea *sa); @@ -103,13 +103,13 @@ int mywinopen(int mode, short posx, short posy, short sizex, short sizey); void setscreen(struct bScreen *sc); void area_fullscreen(void); int select_area(int spacetype); -void drawedge(short x1, short y1, short x2, short y2); void drawscreen(void); struct bScreen *default_twosplit(void); void initscreen(void); void unlink_screen(struct bScreen *sc); void reset_autosave(void); int area_is_active_area(struct ScrArea *area); +void draw_area_emboss(struct ScrArea *sa); /***/ diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index fc1d6ab2312..7ef1e7085f0 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -43,6 +43,10 @@ struct BWinEvent; #define OOPS_TEST 2 #define REMAKEALLIPO 3 /* Reevan's ipo fixing test */ +#define BUT_HORIZONTAL 1 +#define BUT_VERTICAL 2 + + void scrarea_do_windraw (struct ScrArea *sa); void scrarea_do_winchange (struct ScrArea *sa); void scrarea_do_winhandle (struct ScrArea *sa, struct BWinEvent *evt); @@ -84,6 +88,8 @@ extern void winqreadnlaspace(struct ScrArea *sa, void *spacedata, struct B extern void winqreadseqspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); extern void test_butspace(void); extern void start_game(void); +extern void group_menu(void); + #ifdef _WIN32 // FULLSCREEN extern void mainwindow_toggle_fullscreen(int fullscreen); diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index 6fa1e89674e..09c97990cbf 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -40,8 +40,7 @@ /* **************** MAX ********************* */ - -#define MAXLAMP 32766 +#define MAXLAMP 32765 /* max length material array, 16 because of bits in matfrom */ #define MAXPICKBUF 2000 #define MAXSEQ 32 @@ -244,6 +243,7 @@ #define B_POSEMODE 153 #define B_TEXTUREPAINT 154 #define B_WPAINT 155 +#define B_MODESELECT 156 /* IPO: 200 */ #define B_IPOHOME 201 @@ -284,15 +284,21 @@ #define B_SETTRANSBUTS 315 #define B_DOLANGUIFONT 316 +#define B_UITHEMECHANGED 317 +#define B_UITHEMECOLORMOD 318 +#define B_UITHEMERESET 319 +#define B_UITHEMEIMPORT 320 +#define B_UITHEMEEXPORT 321 + /* Definitions for the fileselect buttons in user prefs */ -#define B_FONTDIRFILESEL 320 -#define B_TEXTUDIRFILESEL 321 -#define B_PLUGTEXDIRFILESEL 322 -#define B_PLUGSEQDIRFILESEL 323 -#define B_RENDERDIRFILESEL 324 -#define B_PYTHONDIRFILESEL 325 -#define B_SOUNDDIRFILESEL 326 -#define B_TEMPDIRFILESEL 327 +#define B_FONTDIRFILESEL 330 +#define B_TEXTUDIRFILESEL 331 +#define B_PLUGTEXDIRFILESEL 332 +#define B_PLUGSEQDIRFILESEL 333 +#define B_RENDERDIRFILESEL 334 +#define B_PYTHONDIRFILESEL 335 +#define B_SOUNDDIRFILESEL 336 +#define B_TEMPDIRFILESEL 337 /* END Definitions for the fileselect buttons in user prefs */ /* IMAGE: 350 */ @@ -366,6 +372,8 @@ #define B_KEEPORIG 2 #define B_BEAUTY 4 #define B_SMOOTH 8 +#define B_KNIFE 0x80 +#define B_PERCENTSUBD 0x40 /* ***************** DISPLIST ***************** */ diff --git a/source/blender/include/interface.h b/source/blender/include/interface.h index 8a9f5330221..7f10f376bf0 100644 --- a/source/blender/include/interface.h +++ b/source/blender/include/interface.h @@ -91,6 +91,7 @@ #define UI_RETURN_OK 4 #define UI_RETURN_OUT 8 #define UI_RETURN 14 +#define UI_EXIT_LOOP 16 /* uiBut->flag */ #define UI_SELECT 1 @@ -120,6 +121,10 @@ #define UI_EMBOSSM 4 /* Colored Border */ #define UI_EMBOSSP 5 /* Borderless coloured button */ #define UI_EMBOSSA 6 /* same as EMBOSSX but with arrows to simulate */ +#define UI_EMBOSSTABL 7 +#define UI_EMBOSSTABM 8 +#define UI_EMBOSSTABR 9 +#define UI_EMBOSST 10 /* uiBlock->direction */ #define UI_TOP 0 diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index f5ab3fb49fe..96bf31d9530 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -78,6 +78,19 @@ typedef struct ScrEdge { typedef unsigned short dna_ushort_fix; #endif + +/* panel->flag */ +#define PNL_SELECT 1 +#define PNL_CLOSED 2 + +typedef struct Panel { /* the part from uiBlock that needs saved in file */ + struct Panel *next, *prev; + char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */ + short ofsx, ofsy, sizex, sizey; + short flag, pad; + int pad2; +} Panel; + typedef struct ScrArea { struct ScrArea *next, *prev; ScrVert *v1, *v2, *v3, *v4; @@ -97,16 +110,17 @@ typedef struct ScrArea { ListBase spacedata; ListBase uiblocks; + ListBase panels; } ScrArea; #define MAXWIN 128 /* If you change EDGEWIDTH, also do the global arrat edcol[] */ -#define EDGEWIDTH 5 -#define EDGEWIDTH2 (2) +#define EDGEWIDTH 1 +#define EDGEWIDTH2 0 #define AREAGRID 4 #define AREAMINX 32 -#define HEADERY 21 +#define HEADERY 24 #define AREAMINY (HEADERY+EDGEWIDTH) #define HEADERDOWN 1 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index a3b2e857417..3cc07cb1bda 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -93,7 +93,7 @@ typedef struct SpaceButs { struct ScrArea *area; short cursens, curact; - int pad2; + short align, pad2; /* align for panels */ View2D v2d; short mainb, menunr; /* texnr and menunr have to remain shorts */ @@ -110,12 +110,8 @@ typedef struct SpaceButs { short scriptblock; short scaflag; - char texact, pad3[7]; - - /* a hackish link the anim buts keep - * to a SpaceIpo. - */ - struct SpaceIpo *anim_linked_sipo; + char texact, tab[7]; /* storing tabs for each context */ + } SpaceButs; typedef struct SpaceSeq { @@ -337,7 +333,7 @@ typedef struct SpaceImaSel { #define V3D_LOCAL 2 */ -/* buts->mainb */ +/* buts->mainb old */ #define BUTS_VIEW 0 #define BUTS_LAMP 1 #define BUTS_MAT 2 @@ -353,6 +349,27 @@ typedef struct SpaceImaSel { #define BUTS_SOUND 12 #define BUTS_CONSTRAINT 13 +/* warning: the values of these defines are used in sbuts->tabs[7] */ +/* buts->mainb new */ +#define CONTEXT_SCENE 0 +#define CONTEXT_OBJECT 1 +#define CONTEXT_TYPES 2 +#define CONTEXT_SHADING 3 +#define CONTEXT_EDITING 4 +#define CONTEXT_SCRIPT 5 +#define CONTEXT_LOGIC 6 + +/* buts->tab new */ +#define TAB_SCENE_RENDER 0 +#define TAB_SCENE_WORLD 1 +#define TAB_SCENE_SETTINGS 2 + +#define TAB_SHADING_MAT 0 +#define TAB_SHADING_TEX 1 +#define TAB_SHADING_RAD 2 +#define TAB_SHADING_WORLD 3 +#define TAB_SHADING_LAMP 4 + /* buts->scaflag */ #define BUTS_SENS_SEL 1 #define BUTS_SENS_ACT 2 diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index da5c8736a08..8f1956a36b8 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -97,6 +97,7 @@ typedef struct View3D { short mxo, myo; short gridlines, viewbut; + short modeselect, pad4, pad5, pad6; int pad2, pad3; } View3D; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 4ff94472df2..a38b89dfbcf 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -1041,7 +1041,7 @@ int make_structDNA(FILE *file) void make_bad_file(char *file) { FILE *fp= fopen(file, "w"); - fprintf(fp, "NO NO NO! YOUR STUPID STUPID STUPID!\n"); + fprintf(fp, "ERROR! Cannot make correct DNA.c file\n"); fclose(fp); } diff --git a/source/blender/src/blenderbuttons.c b/source/blender/src/blenderbuttons.c index 8b256fc5b7a..d6589d62bc7 100644 --- a/source/blender/src/blenderbuttons.c +++ b/source/blender/src/blenderbuttons.c @@ -31,714 +31,709 @@ */ /* DataToC output of file <blenderbuttons_png> */ -int datatoc_blenderbuttons_size= 42002; +int datatoc_blenderbuttons_size= 41885; char datatoc_blenderbuttons[]= { -137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, - 1,190, 0, 0, 0,242, 8, 2, 0, 0, 0,189, 2, 55, 29, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, - 0,154,156, 24, 0, 0, 10, 57,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,108, -101, 0, 0,120,218,157,150,119, 84, 84,215, 22,135,207,189,119,122,161,205, 48, 2, 82,134,222,187,192, 0,210,123,147, 94, 69, - 97,152, 25, 96, 40, 3, 14, 51, 52,177, 33,162, 2, 17, 69, 68,154, 34, 72, 80,196,128,209, 80, 36, 86, 68,177, 16, 20, 84,176, - 7, 36, 8, 40, 49, 24, 69, 84, 44,111, 70,214,139,174,172,188,247,242,242,251,227,172,111,237,179,247,185,251,236,189,207, 90, - 23, 0,146,167, 47,151,151, 6, 75, 1,144,202, 19,240,131, 60,156,233, 17,145, 81,116,236, 0,128, 1, 30, 96,128, 41, 0, 76, - 86, 70,186, 95,176,123, 8, 16,201,203,205,133,158, 33,114, 2, 95, 4, 1,240,122, 88,188, 2,112,211,208, 51,128, 78, 7,255, -159,164, 89,233,124,129,232,152, 0, 17,155,179, 57, 25, 44, 17, 23,136, 56, 37, 75,144, 46,182,207,138,152, 26,151, 44,102, 24, - 37,102,190, 40, 65, 17,203,137, 57, 97,145, 13, 62,251, 44,178,163,152,217,169, 60,182,136,197, 57,167,179, 83,217, 98,238, 21, -241,182, 76, 33, 71,196,136,175,136, 11, 51,185,156, 44, 17,223, 18,177, 70,138, 48,149, 43,226, 55,226,216, 84, 14, 51, 3, 0, - 20, 73,108, 23,112, 88,137, 34, 54, 17, 49,137, 31, 18,228, 34,226,229, 0,224, 72, 9, 95,113,220, 87, 44,224,100, 11,196,151, -114, 73, 75,207,225,115, 19, 18, 5,116, 29,150, 46,221,212,218,154, 65,247,228,100,165,112, 4, 2,195, 0, 38, 43,153,201,103, -211, 93,210, 82,211,153,188, 28, 0, 22,239,252, 89, 50,226,218,210, 69, 69,182, 52,181,182,180, 52, 52, 51, 50,253,170, 80,255, -117,243,111, 74,220,219, 69,122, 25,248,185,103, 16,173,255,139,237,175,252,210, 26, 0, 96,204,137,106,179,243,139, 45,174, 10, -128,206, 45, 0,200,221,251, 98,211, 56, 0,128,164,168,111, 29,215,191,186, 15, 77, 60, 47,137, 2, 65,186,141,177,113, 86, 86, -150, 17,151,195, 50, 18, 23,244, 15,253, 79,135,191,161,175,190,103, 36, 62,238,143,242,208, 93, 57,241, 76, 97,138,128, 46,174, - 27, 43, 45, 37, 77,200,167,103,164, 51, 89, 28,186,225,159,135,248, 31, 7,254,117, 30, 6, 65,156,120, 14,159,195, 19, 69,132, -137,166,140,203, 75, 16,181,155,199,230, 10,184,105, 60, 58,151,247,159,154,248, 15,195,254,164,197,185, 22,137,210,248, 17, 80, - 99,140,128,212,117, 42, 64,126,237, 7, 40, 10, 17, 32,209,251,197, 93,255,163,111,190,248, 48, 32,126,121,225, 42,147,139,115, -255,239, 55,253,103,193,165,226, 37,131,155,240, 57,206, 37, 40,132,206, 18,242, 51, 23,247,196,207, 18,160, 1, 1, 72, 2, 42, -144, 7,202, 64, 29,232, 0, 67, 96, 6,172,128, 45,112, 4,110,192, 27,248,131, 16, 16, 9, 86, 3, 22, 72, 4,169,128, 15,178, - 64, 30,216, 4, 10, 65, 49,216, 9,246,128,106, 80, 7, 26, 65, 51,104, 5,199, 65, 39, 56, 5,206,131, 75,224, 26,184, 1,110, -131,251, 96, 20, 76,128,103, 96, 22,188, 6, 11, 16, 4, 97, 33, 50, 68,129,228, 33, 21, 72, 19,210,135,204, 32, 6,100, 15,185, - 65,190, 80, 16, 20, 9,197, 66, 9, 16, 15, 18, 66,121,208,102,168, 24, 42,131,170,161,122,168, 25,250, 30, 58, 9,157,135,174, - 64,131,208, 93,104, 12,154,134,126,135,222,193, 8, 76,130,169,176, 18,172, 5, 27,195, 12,216, 9,246,129, 67,224, 85,112, 2, -188, 6,206,133, 11,224, 29,112, 37,220, 0, 31,133, 59,224,243,240, 53,248, 54, 60, 10, 63,131,231, 16,128, 16, 17, 26,162,138, - 24, 34, 12,196, 5,241, 71,162,144,120,132,143,172, 71,138,144, 10,164, 1,105, 69,186,145, 62,228, 38, 50,138,204, 32,111, 81, - 24, 20, 5, 69, 71, 25,162,108, 81,158,168, 80, 20, 11,181, 6,181, 30, 85,130,170, 70, 29, 70,117,160,122, 81, 55, 81, 99,168, - 89,212, 71, 52, 25,173,136,214, 71,219,160,189,208, 17,232, 4,116, 22,186, 16, 93,129,110, 66,183,163, 47,162,111,163, 39,208, -175, 49, 24, 12, 13,163,141,177,194,120, 98, 34, 49, 73,152,181,152, 18,204, 62, 76, 27,230, 28,102, 16, 51,142,153,195, 98,177, -242, 88,125,172, 29,214, 31,203,196, 10,176,133,216, 42,236, 81,236, 89,236, 16,118, 2,251, 6, 71,196,169,224,204,112,238,184, - 40, 28, 15,151,143,171,192, 29,193,157,193, 13,225, 38,113, 11,120, 41,188, 38,222, 6,239,143,103,227,115,240,165,248, 70,124, - 55,254, 58,126, 2,191, 64,144, 38,104, 19,236, 8, 33,132, 36,194, 38, 66, 37,161,149,112,145,240,128,240,146, 72, 36,170, 17, -173,137,129, 68, 46,113, 35,177,146,120,140,120,153, 56, 70,124, 75,146, 33,233,145, 92, 72,209, 36, 33,105, 7,233, 16,233, 28, -233, 46,233, 37,153, 76,214, 34, 59,146,163,200, 2,242, 14,114, 51,249, 2,249, 17,249,141, 4, 69,194, 72,194, 75,130, 45,177, - 65,162, 70,162, 67, 98, 72,226,185, 36, 94, 82, 83,210, 73,114,181,100,174,100,133,228, 9,201,235,146, 51, 82,120, 41, 45, 41, - 23, 41,166,212,122,169, 26,169,147, 82, 35, 82,115,210, 20,105, 83,105,127,233, 84,233, 18,233, 35,210, 87,164,167,100,176, 50, - 90, 50,110, 50,108,153, 2,153,131, 50, 23,100,198, 41, 8, 69,157,226, 66, 97, 81, 54, 83, 26, 41, 23, 41, 19, 84, 12, 85,155, -234, 69, 77,162, 22, 83,191,163, 14, 80,103,101,101,100,151,201,134,201,102,203,214,200,158,150, 29,165, 33, 52, 45,154, 23, 45, -133, 86, 74, 59, 78, 27,166,189, 91,162,180,196,105, 9,103,201,246, 37,173, 75,134,150,204,203, 45,149,115,148,227,200, 21,201, -181,201,221,150,123, 39, 79,151,119,147, 79,150,223, 37,223, 41,255, 80, 1,165,160,167, 16,168,144,165,176, 95,225,162,194,204, - 82,234, 82,219,165,172,165, 69, 75,143, 47,189,167, 8, 43,234, 41, 6, 41,174, 85, 60,168,216,175, 56,167,164,172,228,161,148, -174, 84,165,116, 65,105, 70,153,166,236,168,156,164, 92,174,124, 70,121, 90,133,162, 98,175,194, 85, 41, 87, 57,171,242,148, 46, - 75,119,162,167,208, 43,233,189,244, 89, 85, 69, 85, 79, 85,161,106,189,234,128,234,130,154,182, 90,168, 90,190, 90,155,218, 67, -117,130, 58, 67, 61, 94,189, 92,189, 71,125, 86, 67, 69,195, 79, 35, 79,163, 69,227,158, 38, 94,147,161,153,168,185, 87,179, 79, -115, 94, 75, 91, 43, 92,107,171, 86,167,214,148,182,156,182,151,118,174,118,139,246, 3, 29,178,142,131,206, 26,157, 6,157, 91, -186, 24, 93,134,110,178,238, 62,221, 27,122,176,158,133, 94,162, 94,141,222,117,125, 88,223, 82,159,171,191, 79,127,208, 0,109, - 96,109,192, 51,104, 48, 24, 49, 36, 25, 58, 25,102, 26,182, 24,142, 25,209,140,124,141,242,141, 58,141,158, 27,107, 24, 71, 25, -239, 50,238, 51,254,104, 98, 97,146, 98,210,104,114,223, 84,198,212,219, 52,223,180,219,244,119, 51, 61, 51,150, 89,141,217, 45, -115,178,185,187,249, 6,243, 46,243, 23,203,244,151,113,150,237, 95,118,199,130, 98,225,103,177,213,162,199,226,131,165,149, 37, -223,178,213,114,218, 74,195, 42,214,170,214,106,132, 65,101, 4, 48, 74, 24,151,173,209,214,206,214, 27,172, 79, 89,191,181,177, -180, 17,216, 28,183,249,205,214,208, 54,217,246,136,237,212,114,237,229,156,229,141,203,199,237,212,236,152,118,245,118,163,246, -116,251, 88,251, 3,246,163, 14,170, 14, 76,135, 6,135,199,142,234,142,108,199, 38,199, 73, 39, 93,167, 36,167,163, 78,207,157, - 77,156,249,206,237,206,243, 46, 54, 46,235, 92,206,185, 34,174, 30,174, 69,174, 3,110, 50,110,161,110,213,110,143,220,213,220, - 19,220, 91,220,103, 61, 44, 60,214,122,156,243, 68,123,250,120,238,242, 28,241, 82,242, 98,121, 53,123,205,122, 91,121,175,243, -238,245, 33,249, 4,251, 84,251, 60,246,213,243,229,251,118,251,193,126,222,126,187,253, 30,172,208, 92,193, 91,209,233, 15,252, -189,252,119,251, 63, 12,208, 14, 88, 19,240, 99, 32, 38, 48, 32,176, 38,240, 73,144,105, 80, 94, 80, 95, 48, 37, 56, 38,248, 72, -240,235, 16,231,144,210,144,251,161, 58,161,194,208,158, 48,201,176,232,176,230,176,249,112,215,240,178,240,209, 8,227,136,117, - 17,215, 34, 21, 34,185,145, 93, 81,216,168,176,168,166,168,185,149,110, 43,247,172,156,136,182,136, 46,140, 30, 94,165,189, 42, -123,213,149,213, 10,171, 83, 86,159,142,145,140, 97,198,156,136, 69,199,134,199, 30,137,125,207,244,103, 54, 48,231,226,188,226, -106,227,102, 89, 46,172,189,172,103,108, 71,118, 57,123,154, 99,199, 41,227, 76,198,219,197,151,197, 79, 37,216, 37,236, 78,152, - 78,116, 72,172, 72,156,225,186,112,171,185, 47,146, 60,147,234,146,230,147,253,147, 15, 37,127, 74, 9, 79,105, 75,197,165,198, -166,158,228,201,240,146,121,189,105,202,105,217,105,131,233,250,233,133,233,163,107,108,214,236, 89, 51,203,247,225, 55,101, 64, - 25,171, 50,186, 4, 84,209,207, 84,191, 80, 71,184, 69, 56,150,105,159, 89,147,249, 38, 43, 44,235, 68,182,116, 54, 47,187, 63, - 71, 47,103,123,206,100,174,123,238,183,107, 81,107, 89,107,123,242, 84,243, 54,229,141,173,115, 90, 87,191, 30, 90, 31,183,190, -103,131,250,134,130, 13, 19, 27, 61, 54, 30,222, 68,216,148,188,233,167,124,147,252,178,252, 87,155,195, 55,119, 23, 40, 21,108, - 44, 24,223,226,177,165,165, 80,162,144, 95, 56,178,213,118,107,221, 54,212, 54,238,182,129,237,230,219,171,182,127, 44, 98, 23, - 93, 45, 54, 41,174, 40,126, 95,194, 42,185,250,141,233, 55,149,223,124,218, 17,191, 99,160,212,178,116,255, 78,204, 78,222,206, -225, 93, 14,187, 14,151, 73,151,229,150,141,239,246,219,221, 81, 78, 47, 47, 42,127,181, 39,102,207,149,138,101, 21,117,123, 9, -123,133,123, 71, 43,125, 43,187,170, 52,170,118, 86,189,175, 78,172,190, 93,227, 92,211, 86,171, 88,187,189,118,126, 31,123,223, -208,126,199,253,173,117, 74,117,197,117,239, 14,112, 15,220,169,247,168,239,104,208,106,168, 56,136, 57,152,121,240, 73, 99, 88, - 99,223,183,140,111,155,155, 20,154,138,155, 62, 28,226, 29, 26, 61, 28,116,184,183,217,170,185,249,136,226,145,210, 22,184, 69, -216, 50,125, 52,250,232,141,239, 92,191,235,106, 53,108,173,111,163,181, 21, 31, 3,199,132,199,158,126, 31,251,253,240,113,159, -227, 61, 39, 24, 39, 90,127,208,252,161,182,157,210, 94,212, 1,117,228,116,204,118, 38,118,142,118, 69,118, 13,158,244, 62,217, -211,109,219,221,254,163,209,143,135, 78,169,158,170, 57, 45,123,186,244, 12,225, 76,193,153, 79,103,115,207,206,157, 75, 63, 55, -115, 62,225,252,120, 79, 76,207,253, 11, 17, 23,110,245, 6,246, 14, 92,244,185,120,249,146,251,165, 11,125, 78,125,103, 47,219, - 93, 62,117,197,230,202,201,171,140,171,157,215, 44,175,117,244, 91,244,183,255,100,241, 83,251,128,229, 64,199,117,171,235, 93, - 55,172,111,116, 15, 46, 31, 60, 51,228, 48,116,254,166,235,205, 75,183,188,110, 93,187,189,226,246,224,112,232,240,157,145,232, -145,209, 59,236, 59, 83,119, 83,238,190,184,151,121,111,225,254,198, 7,232, 7, 69, 15,165, 30, 86, 60, 82,124,212,240,179,238, -207,109,163,150,163,167,199, 92,199,250, 31, 7, 63,190, 63,206, 26,127,246, 75,198, 47,239, 39, 10,158,144,159, 84, 76,170, 76, - 54, 79,153, 77,157,154,118,159,190,241,116,229,211,137,103,233,207, 22,102, 10,127,149,254,181,246,185,206,243, 31,126,115,252, -173,127, 54, 98,118,226, 5,255,197,167,223, 75, 94,202,191, 60,244,106,217,171,158,185,128,185, 71,175, 83, 95, 47,204, 23,189, -145,127,115,248, 45,227,109,223,187,240,119,147, 11, 89,239,177,239, 43, 63,232,126,232,254,232,243,241,193,167,212, 79,159,254, - 5, 3,152,243,252,145,192, 90,219, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,177,142,124,251, 81,147, 0, 0, 0, 32, 99, 72, 82, - 77, 0, 0,122, 37, 0, 0,128,131, 0, 0,249,255, 0, 0,128,233, 0, 0,117, 48, 0, 0,234, 96, 0, 0, 58,152, 0, 0, 23, -111,146, 95,197, 70, 0, 0,153, 67, 73, 68, 65, 84,120,218, 98,244,137,169,101, 24, 5,163, 96, 20,140,130, 81, 64, 10, 0, 8, - 32,166,209, 32, 24, 5,163, 96, 20,140, 2, 82, 1, 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8,160,209,162,115, - 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52, 90,116,142,130, 81, 48, 10, 70, 1,201, 0, 32,128, 70,139,206, 81, 48, 10, 70,193, - 40, 32, 25, 0, 4,208,104,209, 57, 10, 70,193, 40, 24, 5, 36, 3,128, 0, 26, 45, 58, 71,193, 40, 24, 5,163,128,100, 0, 16, - 64,163, 69,231, 40, 24, 5,163, 96, 20,144, 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0,141, 22,157,163, - 96, 20,140,130, 81, 64, 50, 0, 8,160,209,162,115, 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52, 90,116,142,130, 81, 48, 10, 70, - 1,201, 0, 32,128, 88,112, 73,108, 89,210, 12,103,147,119, 68, 8,196, 4, 82,245, 82, 98, 47,178, 94,178,157, 77,146,203,209, -108, 36,195, 94,242,252,139,213, 94,178, 77, 24,168, 56, 26, 77, 87,163,233,106,240,164, 43, 82, 1, 64, 0, 49, 17, 19,130,184, - 2, 20,151, 94, 8, 34, 35, 97, 81,104, 47,145,233,128,188,212, 67, 11,128,233, 95,250,216, 78,197,112,166,167,222,209,116, 53, -154,174,168,174,151,108, 0, 16, 64, 44,120,228, 32,133, 55, 61,163, 28,173,198,128, 68, 57,241,181, 52,154, 94,186,165,111, 10, -107, 57,184,118,226,109,199,180,145,120,189,112,149,105,229, 29, 64,114, 86,103, 5, 68,144,248,112,134,104, 36, 85, 47, 28, 32, -219, 59,154,174, 70,211,213, 16, 77, 87, 0, 1,196, 68, 48,185,144, 90,128, 2,213, 67, 16, 25, 49, 61,176,135,135,162,197, 31, -125,172, 67,246, 50,217, 33, 64, 70, 31, 22,238, 77, 74,252, 75,146, 94,180,224,133, 48, 70,211,213,104,186, 26,216,116, 69, 54, - 0, 8, 32, 22,134, 97, 1,208, 98,151,140, 40,167, 36,125,211,127,156,133, 66,207,142,130,209,116, 53,154,174, 40, 4, 0, 1, - 52, 72,103,216,225,163, 51,100,140, 22, 15,108,148,147, 61, 24, 71,183,129, 17, 72,200,192,251, 53, 16,198, 8,201, 33,163,233, -106, 52, 93, 81, 11, 0, 4, 16,203,224, 76,223,148,215,180, 36, 13,148, 80,216,165, 66, 27, 84, 34,195,106, 50,220, 76,121,211, -128,140, 81, 33,160, 69, 64, 27,233, 60, 76, 57,154,174, 70,211,213, 32, 4, 0, 1,196, 52,204,210, 55,242,176, 14,145,245, 45, - 37,233, 27,109, 20,137,236,145, 56,184, 57,244,156,148, 3,122,153, 12, 95, 83,232,223,209,116, 69,159,116, 5,137, 92,120, 20, -143,166, 43,170, 3,128, 0, 98, 25, 78,233, 27,173, 18,163,176,170, 36,163,174, 30,144,224, 34,175, 65,129, 60,172, 14,244, 59, - 73,158, 29,114,189,176,209,116, 53,154,174,168, 14, 0, 2,136,105,120,164,111,122,142,233, 12, 6,123, 71,193,104,186, 26, 5, - 3, 11, 0, 2,136, 9, 87,217, 15,143, 57, 58,143,142, 83,197, 34,146,146, 29,114,151, 25,185,163, 68, 94, 78,163,131, 22,170, - 0,180,225,124,242,178, 52, 73,105, 99, 96,167, 17, 70, 90,186, 26,168,113,195,145,147,174, 0, 2,136,101,176,229,106, 76, 75, -137, 9, 5, 72, 79,138, 90, 27,230, 40,116, 51,241, 81, 14, 31,254, 39,195,205,100, 87,105,112,123,145, 19, 55,217,155,252, 40, -201, 93,163,233,138,166,233,138,188,248, 29, 77, 87, 68, 2,128, 0, 98, 28, 93,183, 53, 10, 70,193, 40, 24, 5,164, 2,128, 0, - 26, 61, 57,105, 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52, 90,116,142,130, 81, 48, 10, 70, 1,201, 0, 32,128, 70,139,206, 81, - 48, 10, 70,193, 40, 32, 25, 0, 4,208,104,209, 57, 10, 70,193, 40, 24, 5, 36, 3,128, 0, 26, 45, 58, 71,193, 40, 24, 5,163, -128,100, 0, 16, 64,163, 69,231, 40, 24, 5,163, 96, 20,144, 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0, -141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8, 32,196,110, 34, 95, 91, 25,226,181,109, 62,252, 4,153,139,166,247,254,213, -227, 12, 76, 63, 36,101,164, 63,127,255,250,254,237, 87, 53, 77, 27,226,245, 30, 57,119,151,225, 31,251,203,167, 79,185, 57,185, - 5,133,184,205, 77, 20,137,215, 75,137,155,159, 62, 91,205,198,241,135,157,131,133,153,133,249, 47, 3, 35, 31, 91, 32,241,122, - 5,132,140, 5, 5, 5, 57, 57, 57, 25, 24, 25,175, 93,222,132,223, 94, 78,233, 27,196,187,249,251, 83, 13,100,174, 20,215, 75, -226,245, 62,251, 38,142,162,247, 39, 9,246, 62, 99, 71,177, 87,250,215, 77,226,245, 62,101, 83, 31, 12,122,181,177,133,115,103, -231,234,242,242, 80, 76,241,171,168,225,204, 41,243,139,132, 56,122,194,134,146, 54,164, 73,136,163,205, 79, 81,226,232,199, 79, -110,226,245,114,176,127, 69, 49,202,111, 10,241,122,125, 55,229, 32,115,139, 95,204, 32, 94,111,175, 68, 6,141,242, 32,221,244, - 82, 5, 0, 4, 16,129,147,147, 82,175,215,207,214,108, 36,198,160,123, 87,118, 49, 50,252,227, 97,231,156, 63,115,217,194,133, - 19,173, 93,172,255,124,253,166,165, 97,247,239, 31, 67,118,217, 95, 45, 45,245, 59,119, 30,254,248,254,135, 87,210, 26, 83,239, -209,243,175,254, 51, 48,126,249,249, 61,189,168,165,113,146,251,179,171,103,129, 9, 99,219,197, 39, 76, 76, 12, 19, 27,106,110, -221,186,169,160, 32,207,206,201, 34, 44,200,142,169,247,250,230,237,236,236,236, 92, 92, 92,188,188,188, 2, 2, 2,194, 66,194, - 66, 66,130,252,252, 2, 60,220,220,204, 44, 44,255,254,253,253,254,253,251,231, 79,159, 47,124,251,136,203,229,119,110,173,100, -231,248,206,195,203,193,193,197,206,194,198,204,200,196,200,196,194,252,159,121,215,239, 63,140,108,127, 92,241,251,250,254, 35, - 38, 17, 17, 17, 14,238, 31, 63,127,254, 96, 98,102, 98,100,100,144,146,181,253,240,225,253,183,207, 87,104, 87,221,205,154, 53, - 43, 45, 45,109,180,218, 39, 8,112, 21,148,164,170, 1, 2, 9, 78,174,167, 79,159,178,114,176,255,227,226,162,167, 23,190,189, -187,112,108,239, 10,100, 17,151,208,142,193, 25,218,139, 23, 45, 98,103, 99,251,247,239, 31, 55, 15,143,175,159,223,176, 79, 93, - 0, 1,132,175,232,188,189,160,154,193,156, 37,245,227,242,217,252,145,248, 77, 9,245, 83,249,233, 36,244,251,203, 7,150,191, - 76,102,122, 50,241,241,249,208,225, 0, 38,134, 19,199, 23,136,200, 73,255,251,242,201,222, 92,247,217,179,247,123,206,255, 65, -211,155,158,222,198,192,198,207,200,197,247,159,249,255,197,107,137,243, 86,236,132,136, 3,203, 92, 15, 75, 75,134, 47, 47, 24, - 24,120,239, 94,190,206, 42, 34, 96,109,161,195, 35, 32,134,105, 59, 35,176,177,199, 8, 42,241,152,153,128,165, 37, 51, 11, 43, - 8, 0, 73, 22, 22,150, 63,127, 24,153,152,152,129,178,184, 92,126,241,252, 44,126,126, 22, 94, 30, 30, 81, 49, 97, 30, 94,174, -191,255,255,254,248,249,253,247,223,191, 92, 60, 92,162, 98,146,127,255, 61,120,124, 67, 1,171,198, 29,187,111,241,242,242, 8, - 8, 8,126,251,198,249,237, 27, 23, 7, 7, 59, 35,120,240, 3, 88, 82,127,251,246,237,205,123,190, 55,111,222,188,125,243,210, -218, 82, 22,171,246,213,157,171,241, 7,169, 75,130,139,160,184, 32,214,114,147,138,165,103, 85,119, 55,144,108, 43, 45, 37, 67, -111,101, 87, 23,144,108, 47, 43, 35, 94,203,149,167, 79,111,221,186, 5,100, 4, 57, 58, 18,169,101,230,170, 85,160, 40,134,197, -224,255,255,255,129,108, 8, 9,225, 66,100,211, 66,177, 20,127,192, 50, 17,127,201, 72, 76,185,169, 40, 40,244,253,215, 79, 32, -131,141,147,227,215,247, 31,255,190,126,123,243,226,185,164,174, 46, 30, 45,146,202,106, 4,253,197, 47,175,121, 99,223, 70,130, -202,128,229,166,141, 75, 4,135,160, 1, 81,129, 21,250,142,160,146,176,176,176, 85,161,123,176, 74, 57,238,121, 13,103,107, 9, -128, 74,134, 87, 63,254,125,255, 3, 10,225,175, 96,114,166,185,128, 26, 47, 43, 86,189, 61, 61, 61, 85, 5, 37,254, 65,129, 63, -126,124,159,216,223, 55,101,202,148,156,156,156,225, 93,116, 2, 4, 16,190,162, 83, 53,161,181,108, 65,117,151,249,141, 84, 6, - 2,165,231,207, 47,239, 36, 84,156, 91, 74,131, 22,204, 60, 0, 17, 57,120,108,198,215,111, 63,189, 92,242,173,172, 19, 34,194, -156, 56, 57,217,127,253,253,243,249,219, 47, 53,139, 40, 12,221, 15, 25,126, 49, 4, 69, 79, 79, 45,130,118, 4, 60,172, 28,128, - 37,209,134,125, 59,183, 29, 61,190,104,254,180, 31,223,127,178, 49,179,240,112,177,241,177,253,189,243,232, 5,154,102, 96,222, -249, 15,206, 65, 96, 18,204,248, 7,162,254,253,255,247, 23, 12,254,128, 1, 86,103,159, 60, 62, 75, 76,148,153,151,151, 91, 86, - 86, 78, 93, 83,149,135,135,235,221,135,183,207, 94, 60,127,253,246,205,191, 63,255,185,185,184,213,213,180,248, 5, 30, 93, 57, -193,131,166,113,211,134, 83, 12, 44,236,223, 89,152,216,216,217,190,125,227, 0,150,158,160,162,147, 17,152,188, 24,191,129,192, -151,111,223,190,126,253,242,233,237,235,103, 75, 22,156,227, 87, 54,198,106,123,247,162,110, 92,225, 89, 26,135,189, 44,123,255, -254, 61, 50, 91, 72, 72, 8, 82,142, 8, 10, 10,222,189,123,119,245,234,213, 36,149,167,108,226,208,222, 34,208, 80, 65,178,155, -192,171, 87,103,103,103,255,126,245,138,152,114, 83, 76, 76, 44,200,205,237, 55, 59,123,111,111,111,176,147, 19,164,224,195, 15, -128, 30,236,105,104,128,246, 43,235,235,123, 27, 27,177,178,113,105, 71, 46, 61,129, 12, 99, 99,227, 61,123,238,185,184, 40, 17, - 89,110,106, 72, 72, 10,240,241, 65,202,104,110, 14,206,231,175, 95,125,122,255,129, 71, 64,240,225,233, 51,242,166, 38,120, 52, -250,165,149,196, 4,251,170, 42, 64,235,221,250,222,201,112,169,198,226, 92, 32,249,104,251, 94, 51, 53, 89,162, 58,230, 68,150, -155,208, 58, 89,136,144, 10, 23,130,102,112,179, 48, 94,108, 76,102,228, 19,249,123,239,226,207,123, 87,111,189,251,106,178, 29, - 95,252,206,152, 57,179, 40, 61, 59, 46, 37,105,245,210, 21, 10, 10, 10, 45,157, 93,188, 13, 45, 27, 54,108, 8, 8, 8, 24, 18, -133, 32,121,231,239, 0, 4, 16,129, 14, 59,241,165, 39, 48, 39,106,105,170, 51, 49, 29,184,245,225, 45,176, 27,253,241,233,109, - 96,239,102,227,214, 73,223,222,252,141, 78, 44, 4, 54, 33,253,124, 45,255,178,240,224,210,124,235,214,117,160, 26, 47,125, 96, - 83, 66,138,129, 65,254,199,207, 95, 33, 30,110, 28, 2, 76,139,150,237, 0, 54, 93,215,172, 88,192,252,231,179,166, 60,251,157, - 71, 12, 24, 69,231,255,127, 96, 0, 42, 37,255,254,249,245,251,215,207,159, 63,191,255,248, 14,106,135, 50, 49,253,249,243, 27, - 84,148,125,255,206,128,109, 62,140,159,239, 63,176,125, 42, 36, 36,172,162,172,170,166,162, 1,108,158,254,249,251,239,213,235, -119, 63,127,252,254,251,239,235,235,151,111,100,164,191,107,168,106,156, 59,191, 1,216, 99, 67,214,200,206, 4,180,245,251,239, -111,127,190, 50, 51,112,176,179, 1,203, 77, 96, 27,247,223,191, 63, 64, 75,191,126,251,246,234,229,179,171,151,206,188,125,245, - 12,232, 40, 38, 70, 98, 39,226,230, 77,159, 7, 97, 36,101, 38,225,204, 23,171, 87, 35,179,139,138,138, 30, 61,122, 4,180,116, -230,204,153,100,164,152,169, 83,167,190,124,249,114,205,154, 53,222,118,118,130, 98, 98,164,106, 7,182, 55,223,131,195, 31,216, -196, 0,245, 30,194,194,240,171, 7,182, 55,129,229, 38, 40,161,176,177,169,169,169,173,221,183,143,152,230, 39, 49,197, 43,126, - 0, 44, 31,129,197,229,217,179,103,129,108, 56, 25, 26, 26, 74,176,220, 84, 19, 19, 7,150,155,204, 76, 76, 89, 49,209,223,127, -252,236,157, 59,151,139,147,243, 7, 16,124,255,206,196,194,252,248,252,121, 89, 67, 67, 92,122, 33,229,227,237, 7, 15,144,185, -100, 0,115,167,136, 61,171, 43, 92,253,146,255,179,171, 18,169,133, 49, 12, 90,191,254, 95, 37,136, 75, 4, 23, 0, 54, 54, 31, -126,249,123,208, 85,148, 53,127,230,167,104, 69, 22, 65, 49,130,229,230,222,189,123, 21, 36,165, 82,178, 50, 42, 10,203,166,204, -159, 97,102,100, 52, 99,242,140,130,178,146,165,150,230,151, 47, 95,214,197,219, 60, 31,108,229, 38, 3, 41, 7, 81, 3, 4, 16, - 11,218,200, 38,182,216, 99,121,250,229,175,244, 51,130,165,231, 63,102,102,102, 48, 3, 88, 75,203,240, 75,171, 63,188,185,102, -250,204,249, 76, 63,185,220, 28,173,119,236, 61,250,237, 27, 3,151, 16, 63,166, 54, 78, 46,245,239,223,110, 2, 11, 62,152, 0, -176, 93,249,140,137,217, 33, 46, 62,249, 31,251,215, 45, 91,231,249,249, 38,113,113, 51,124,123,251, 30,173,252,130,218, 10,106, - 93,254, 3,182, 43,127,255,254,253,243,199, 79, 96, 49, 9, 44, 13,129,125,248, 95,191,126, 1,139, 45,160, 56,168, 17,248,229, - 11, 3, 63,250, 16,213,193,253, 51, 37,196, 65,229, 43, 11, 51,235,223,127,255,223,189,253,248,235,207,175,151, 47,222,126,120, -255,249,219,215, 95, 12,223,255,252,251,247,130,153,229,138,148,140, 60, 55, 39, 39,182, 81, 2, 6,134, 63,191,190,191,127,253, -234,251,151,127,191,127, 48, 3,139,221, 63,191, 95,189,124,122,237,210,217,151,207, 30, 3, 51, 60, 19, 19, 48,211, 49, 49,224, - 30, 43, 32, 3, 64, 26,149,192,222,122, 72, 72,136,129,129, 1, 59, 59,123, 95, 95, 31,121, 70, 65,154,156, 22, 58, 58,226,226, -226,192,178,207,199,222, 94,138,244,210, 83, 16, 92, 98,178,138,137, 1, 77, 0,146, 4,219,158,192,246, 38,235,207,159,107,215, -174, 69,110,126, 18,223,121, 39, 27, 64, 74, 76,120, 5,147,158,158, 14,172,120, 8, 22,157,192, 90, 80, 84, 72, 40, 49, 36,228, -195,199, 79,175,223,189, 5,143, 0,129, 0, 48,129,177,115,114,125,122,251,230,243,227, 39,188,178, 56, 39, 43,128,229,230,146, -181,155,145,139, 78, 72,219,211,220, 72,207,203,209,158, 8, 87,127,102, 96,224,229, 21, 54,112,241,227,222,189,105, 46,125, 70, - 57, 47, 45,156,240,115,199,124,177,217,231,128,101, 40, 51,159,208,159,247,175,128,229, 38,176, 17, 10,236,176, 51,227,104, 3, -220,191,115,103,219,166,173, 11,103, 47,156, 52,119,218,140,190, 9, 66,194, 66, 45,109, 45,139,150, 45,181,181,176,158, 55,119, - 94, 80,104,144,173,181,237, 32, 47, 55,201,187,255, 29, 32,128, 80,194,163,236,228, 31, 8, 2,150,149,160,164,243,251,255, 87, - 57,211,215,218,254,108,230, 65, 95,129, 13, 70, 96,233,249,113, 57, 86, 83, 54,237,123,199,192,240,201, 63, 62, 31,216,114,100, - 96, 0,178,121,129,217, 68, 94,221,136,131,157,229,239,159,159,255,127,129,250,203,188,188,188,111,223,189,199,212, 59,161,191, - 8, 72, 94, 59, 49,151, 9,234, 22,144, 17,255,190, 95,253,241,243, 55, 51, 43, 7, 35, 27,104,108,229,243,167, 79,194,194,194, -216, 11,108,112,139, 19, 88,108,253,252,249, 11,216,216, 4,150,146, 31, 63,126,250,240,254,195,187,183,239,222, 2,193,187,183, -239, 63,188,255,248, 9,203, 28, 17, 59,251, 47, 96,153,251,235,215,159,247, 31, 62,221,185,115,255,204,217, 11,167, 78,157,191, -113,227,238,179,167,175,191,124,249,249,229,243,143,215,175,222, 95,187,118,251,228,201,179, 79,159, 98,153, 51,133,183,133,126, -125,255,246,244,254,237, 75,167,142,173, 95, 57,119,199,166, 21, 79, 30,221,251,251,239, 47,168,196,100,132,149,176,120, 1,174, -190, 57,206,186,142, 5, 90,219, 1, 59,233,192, 32, 45, 47, 47, 39, 47,209, 0,155,156,192,242, 23, 52,150, 39, 42,202, 72, 89, -249, 14, 41, 49, 33,109, 79, 60,189,117, 32, 9, 44, 40,111, 63,127, 14, 44, 52,109, 12, 64,157,208, 75,151, 46, 1,201,117,251, -247,227, 55, 31,216, 31, 47,105,104,128,244,202, 33, 12, 8, 27,194,192,211, 91,135, 0, 96,147, 19,185,220,132,179, 33,226,184, -128, 0, 11,203,143, 95, 63,129,173,129, 27,247,238,222,123,242,248,228,133,139,191,126,253, 6,214,132,192,240, 7, 6, 23,176, -186,254,254,245,219,238, 85, 43,241,152, 0, 47, 55,129, 61,119,148, 97,162,115,151,224,173, 81,188,128, 23,150, 82, 85, 33,133, - 38,176,249,201,250,231, 54,109,203,146,119,207,217,228,212, 94,101, 91, 1,203, 80, 22, 17, 73,136, 24,144, 43,194,193,196,199, -130, 61,145,168,171,170,115,113,113, 79,154, 51,213,209,222,222,220,210,226,254,157,251, 55,238,220, 2,182,104, 56,216,217,173, -141,173,183,110,218,186,126,253,250,161, 50,124, 73,210,149, 74, 0, 1,196,130,214, 61, 71,110,123, 50,102,175,229,214,180, 62, -124,252, 42,144,237,153, 50,227,203,132, 64,238,135, 39, 82,255, 47,159, 45,128,165,237,169,194, 39,115,229,210, 58, 88,113,252, - 21,152,161, 64,232,247, 79,150,127,192,234, 10, 84, 26,174,223,176, 11, 72, 90,123, 98,233,214,237,184,252,223,195, 80, 7,169, - 61, 7,116, 21, 43, 3, 43,199, 31,198,191,255,192,133, 79,120,116, 30,104, 76,244,216, 44,172, 69,231,159,191,127,153,126,255, - 97, 98,250, 9,106,229, 49, 48, 2, 59,238, 63,127,254, 0, 54, 14,128, 5, 2,176, 49, 11,108,126, 2, 91,163,236,178,146,104, - 26, 65,229,230,239,127, 12,223,127,189,121,243,254,219, 55, 96, 38, 97, 1,230,141,159, 64,252,247, 55,176, 37,251, 31,168,153, -233,247,231, 47,191, 94,191,254,252,245, 59,176,232, 87,195, 81,114, 66, 25, 63,127,124,255,248,225, 29,120, 74, 10, 60,109, 69, - 74,132,221,124,120, 83, 93, 94, 29, 79, 63, 29,121,224,143, 19,214, 4, 6,230,225,123,247,238,117,118,118,130,251,164,229,252, -252,252, 31, 63,126,252,240,225, 3, 49, 61, 92, 72,147, 83, 66, 2,218,138,207,201,201,153, 60,121, 50,121, 13, 79,184, 9,120, -138, 78,248, 40, 39, 35, 47, 47,208,193,101,101,101,192,134,219,239,247,239,129,110,174,200,201, 33,216,246, 68, 30,211,196, 53, -238,137,117, 10,136, 96, 83, 20,210, 26,197, 58,194,245,254,221, 59, 30, 94,222, 55,239,223,239, 63,121,146,133,137,249,231,239, -223,223,190,127, 7, 38, 54,200,224,242,159,223,192, 84,245, 19,127, 80, 99,118,210,129, 34,144,134,167,170,130,194,163,123,119, - 72, 10, 97, 96,233,249,245,245,201,237,235,231,146,209,246, 36,216, 79,135,131, 11,171,102, 27,196, 23,178, 43,234,129,250, 84, -111,158, 3,123,235,160,162,219,210,231,209,223, 63, 92, 83, 78, 98,213,242,233,211, 39,118, 78, 14, 21, 69,197,251, 79, 30,191, -125,253, 54, 60, 38,122,219,222,221, 19, 59,122,215,111,219,164,170,168, 26, 23, 28,123,252,220,209,245,107,215, 6, 6, 7, 15, -179,105, 34,128, 0, 66, 31,235, 68,244,217,181,157,185, 52,172, 20, 2,107,159,189, 1, 53,217,138, 34,157,218,131,235, 25,250, - 60, 25,158,223, 96, 16,192, 98,208,157, 79,159,212, 4,248,254,252,100,184,115, 96,137,138,131, 59, 3, 3,168,243,254,251,215, -111, 86, 6,166, 47, 63, 64, 19,148, 30, 14, 70,156,194,210, 88, 29,225,161,203,184,237,226,127, 86, 14, 6, 54, 57,247, 95,143, - 14, 67, 26,158,172,108,236,191, 25,126,240,112,114,128, 90,181,219,150,127,127,251,216, 66, 89, 0, 91,209,249, 31, 52,202,201, - 8, 44, 58, 25, 33, 37, 41,176,172,252,254,253, 59,164,117, 6, 42, 88,255,252, 1,138,136, 98,104,252,241,227, 15,184,151,253, -239,231,207,191,159, 63,127, 7,230, 2, 32,251,247,239,191,192,146, 31,216,135,103, 96, 98,252, 15,202, 36,140,127,254,125,253, -254,227, 47,190,116, 9, 47, 63,161, 69, 38,188,189, 9,225, 51, 82,177,201, 9, 4, 92,176,197, 49,200,229,166,146,146,210,231, -207,159,129, 62,133,100,108, 34,155,156, 10, 34, 34, 16, 46,144,193, 72,213,129, 5, 92,163,156,255, 63,127,174,173,173,253,249, -246,237,111, 72,117, 11, 46,187,129, 93,120, 95, 95,223,167,175, 94, 73, 83,117,221, 15,188, 63, 14, 31,232, 68, 3,198,198,198, -144,249, 34, 6,208,186, 78,116,217, 63, 63,127,125,248,245,238,199,143, 31, 2,252,252, 28,192,164,248,247, 15, 48, 96, 33, 53, -241,239,223,191,129,213, 53,254,112, 6,182, 43,225,115, 68,200, 61,119,228,185, 35, 82, 1,183,168, 57,176, 5, 66,134, 70,226, -199, 58,237,119,191,126,165,176, 6,216,240,100, 84,212,147,159,127,254,205,143,127,192,222,250,175, 35, 27,110,222,187,143, 43, -129,124,255,243,235,236,241, 83, 19,122,250,173, 28,108,106,154, 26,118,110,223,185,116,209, 98, 75, 59, 27, 89, 5, 57, 22, 46, -214,189,135,247, 46, 91,184,120,221,134,181, 91,183,110,245,246,246, 30, 78, 69, 39, 64, 0, 49, 97,150,155,192, 14, 59,136, 35, - 99,208, 50,127, 7,164,220, 4,130,190,229,251, 24,101,241,207,244,125,184,245,225, 17, 11, 59,131,135, 95,225,178, 73,192,138, -241, 23,195,183,159,127,191, 51,108,216,127, 97,207,233,107, 32,243,228, 20, 65, 69, 18, 14,224,165,207,248,251, 7,195,166,173, - 59, 76,220,114, 65, 77, 78, 6, 86,102, 78,134, 48,159, 80, 47, 59,127,160,236,147,135,119,255,255,254,139, 99, 26,225, 31,184, -225, 9, 76,234,191,126, 0,219,126,223, 65,115,219,192,114, 4,216, 4,251,244, 17, 88, 35,126, 6,118,225,191,125,251,134,101, - 36,235,235,191,239,223,255, 0,209,215,175,191, 62,127,254,241,233,243,247,207, 95,126, 0,187,234,159, 62,254,248,252,249,231, -231, 79, 32,244,241,227,207,143, 31,190,191,127,255, 29,231,252, 5, 24, 67,166,247,193, 69, 38, 35,188,125, 72, 76,111, 29, 8, - 52, 45, 53,143,110, 59,186,115,223, 78, 72, 73, 10,108,129,226, 81, 12,236, 63,178,192,194,176, 11,188, 54,168,162,162, 2, 88, -110, 50,192,150,239, 16,223,228, 20, 23, 71, 89,140,157,157,157,189,245,208,161,103, 68, 76,148, 99, 5,192, 38, 39,254,194, 23, -216,180,132, 48, 86,174, 92,121,231, 5,104,153,196,150, 3, 7,224,130, 55,111,222, 20, 21, 21,165, 81, 18,135,148,143,233,233, -233,112, 17, 8, 27, 94,110, 98,175,162,248,120,129,189,242, 79,239,222,131, 22,153,125,120,255,245,219, 55, 32, 2, 38,166,175, - 31, 63,125,254,240,225,199,247,111,191,126,252, 0, 38, 59, 92,218,145,203, 71,120,185, 9, 97, 35,207,182,227, 7, 95, 94,159, - 4,118,210,225,220,111,239, 46,208,186, 56,120, 30,174, 0, 44, 49,129,229,230,207,131,107, 30, 38, 26, 2,203,205,195,174,162, -127, 62,190, 54,217,241, 10, 71,127,157, 1, 88, 7,167,230,103,222,185,121,243,248,129,195,252,188,252,145,225,145, 2,194, 66, -231, 78,157,225, 97,227,224,230,230,150, 84,144, 90,190, 98,121, 69,117,213,151, 15, 31, 6, 97,241, 7,191,215, 8,142,136,215, - 11, 16, 64, 44,152,229,102,172,147, 17,195,215, 75, 12,111,239,213, 38,149, 52, 78,152,205,196, 15, 26, 8,183, 17,122,247,255, - 49,254,152,227, 1,198, 53,144,186,120,105,179,190,129,111, 93,205,162,141,235,250,118,237,191,238,104,169,205,194,194,190,251, -240,185,255,192, 30,241,223,191,248, 93,227, 97,168,177,227,236, 13,134,222,142, 16, 95, 47, 31, 31,223,157,251,214,255,249,253, -195,219, 61,146,233,239,111, 86,102,102, 28, 99,157,255, 33,173, 84,232,138,164,127,255,152, 65,157,119, 38, 80, 35, 20,216, 4, -251, 7,157,129,199, 54, 9,192,198,200,248,157,149, 21,180, 6, 30, 92, 0, 51,252, 5, 53, 81,129,232, 63, 35,243, 31,144, 94, - 6, 96,147,147,225,215,159,127,192, 86, 39,151, 32,206, 22, 39, 50,139,145, 17, 82,132, 49,162, 78, 39,225,108,114, 2,203, 77, -104,203,104,193, 30, 32, 2, 50,128,197, 40,131, 23,190, 32, 2,251,151, 97,205,154, 53,144, 84,171,168,168, 8,105, 92, 3,155, - 66,192, 86, 39,193,162, 19, 88,110, 66,154,156,138,212, 43,170, 88,193,221,124,111,123,156, 83, 31, 86,186,186,192, 46, 57,176, -105, 9, 44, 34,129, 45,208, 0, 23,208,250, 24,117,117,117,184,224,195,135, 15, 69,216,217, 37, 96,173, 96,204,177, 78,120,107, -186,164,161, 1,238, 71,130,163,156,112, 16, 26, 26,186,122,245,106, 96,137, 57,115,230, 76, 72,185, 9,108,114,226,215,242,254, -205, 71, 70,134, 63,160,193,158,151,223,216, 56, 56,128,157, 24, 72,171,243, 59,176,118,253,250,245,231,207,159,192,178,192, 35, - 58, 26,151,118, 72,249, 8,233,179,155, 27,233,157, 60,119, 9, 46,133, 54,244,137,115,146,232,245,201,147, 7,214, 59,123, 69, - 64,139,209,143,183,111, 94, 58, 74, 70, 99,147,248,222, 58,168,127,240,238,235,163, 20,211,255,247, 47,137,205, 62,247,245,207, -255, 79,209,138,252,203,238,127, 74, 20, 6,150,155, 76,184,171,198,236,156,156,218,142, 22, 49, 97,145,223,255,254,222,126,124, - 47, 58, 50,106,209,146, 37, 27, 55,108,138,138,142,250,249,227,231,225, 51,199,190,127,255,146,150,144,176,247,248,113,172, 51, -189, 3, 94,122, 34,223,153, 74,252,253, 72, 0, 1,196,130, 54, 77,164,154,208,122,130,129, 65,247,250, 37,134, 51,235,255,235, -122,255,190,184,182,177,177,145,145, 95,186,190, 48,245,255,148, 32,160,154,215,223,255, 97, 53,232,224,129,141,246, 14,206,160, - 34,233,223,239, 59, 31, 30, 49, 48,252, 85,225, 83,116,116,212, 19, 23,145,120,251,241, 19,168, 81,250,235,207,243, 15, 95, 53, -177,233,149,145,179,124,242,232, 56, 56,182, 89, 60, 64,235,147, 88,118, 92,254,189,115,203,154,151,111,158, 9, 11,128, 38,229, - 5,216, 88, 37, 5,120,112,148, 94,255,193, 5,227, 63,200,170, 78,208,156, 17,211, 95, 96,105,200, 8, 46,195,254, 67, 87,123, - 98,113,115,100, 84,254,226, 69,141,192, 76, 1,236,182, 67,138,164,127,127,255, 3,251, 97,160,222, 24,176,120, 98,100,252, 7, - 26, 54,253,255,243,247,191,252,204, 70,180,141, 92, 72, 35,157,255,225, 28,120,161,137,160,240, 54, 60,225,229, 38, 26, 27, 84, -122,226, 0,192,172, 11,204,180,192,130, 15, 82,116,174, 1, 3, 32, 87, 89, 89, 25,104,251,196,137, 19,129,141,208,119,239,240, -173,139, 46, 1,131, 29, 59,118,124,125,137, 50,247, 5, 44, 73,239,223,191,207,128,119,121, 60,230, 26,120, 96,161, 9, 44,136, -129,225,235, 99,111, 47,141,123,156, 20, 88, 38, 90,233,233,189,125,240, 0, 88, 62,222,130,205,179,171, 74, 74, 22, 21, 21, 29, - 61,122, 84, 77, 77, 77, 71, 90, 26,207,240, 46,242,248, 38,241, 99,157,200,131,158,192,206, 59, 16,221,187, 7,109,111,194,151, -121,226,153,100,231,145, 22,251,254,252, 5,176, 93,249, 21,216,127,121,243,154,145, 17,180, 30, 13,216,127,135, 36,179,251,215, -174,255,254,245, 19,207,244, 58, 74,143,202,209, 30,136,224, 83, 67,196,116,216,191,188, 57, 5, 44, 55, 65,206,224,230,222,136, -212,240, 52,177, 13,164,105, 57, 98,178,253,213, 25, 79, 6, 3, 99,151, 87,217, 86, 18,211,142, 1, 75, 82, 65, 54,198,183,239, -222,179, 48, 50,178,224,237, 67,197,197,197,193,217,155, 55,111,246,242,246,220,178,105,203,170, 85,171, 26,170,107,119, 29,216, -203,204,194, 44, 45, 35, 13, 12, 72, 6,182, 65, 87,116, 50,144,123, 79, 31, 64, 0,177, 32,149,155,191, 85, 19,218,160,227, 68, -167,254,116,154,177, 48,204, 79, 97,208,118,174,183, 48, 96,248,246,224,127,147, 9,195,251,167, 95,127,255,223, 96,132,189, 84, -190,121,235,215,145, 19, 32,237,255,152, 57, 32,157,203, 59,159,158,215,229, 36,125,251,246,243,211,119,208, 88,231, 47, 38,118, - 39,143, 16,172,122,107,171, 19,118,108, 5, 47, 48,254, 11,217, 59,252,199, 67,151, 49, 34,171,143,139,139,157, 15, 60,214,201, -250,239,135,180, 40,142,156, 9,218, 89, 2, 42,248, 32, 13,147,127,140, 32, 8,217, 95, 4, 42,183,254,227,235,197,126,251,198, -249,253,251,103, 96,195, 19,216,238, 4,150,150, 64, 67,192,173,206,127,223, 64, 91, 40, 24,129, 34,191,129,205, 56, 38, 70,108, -118,130,203,196,255,240,210,243, 63,114, 11, 20,214,220, 4, 41,137, 73, 12,196,181,127,246,250,241,235, 36,143,247,255,255,255, -253,251,119, 93, 93, 93, 96, 39,253,193,131, 7,171,192, 59,109, 32,197, 40, 4,116,116,116, 16, 44, 61,129, 32, 35, 35, 3, 83, - 48, 56, 62,158,129,136,229,241,144,237, 61,200,192,215,193,129,224,252,146, 4,108,129, 4,114, 11, 20,216,216, 52, 81, 87,103, -251,250, 21,191,151, 41,201, 21,200,229, 35,242,170, 88, 6, 34,246, 26,113, 74, 74,124,187,125,231,239,159, 63,159,222,127, 0, -183,232, 65, 21,240,251,151,175, 62,189,127, 15,116, 21,158, 38, 39,218,160, 39,176,147,142,188, 32, 9,121, 24, 20, 71,186,188, -120, 98, 63,100,198,149, 97,227,106,208,178, 36, 35,251, 8, 33, 49, 3, 90,150, 30,255, 81, 74, 79,134,217, 6, 25,117, 47,254, -253,211, 95,112,234,148,135,184,246,150,151,192,114,147,151,149,216, 21,202,192,200,221,119, 96,159,147,171,243,166,181, 27,154, - 59, 59,202, 63,126, 4,182,104, 86,174, 92, 43, 34, 34,242,232,211,240, 25,235, 4, 8, 32, 68,209, 9, 47, 55, 65,227,247,241, -160,149,240,160, 1, 53,134,189, 12, 87,247,194,219,164, 32,101,122, 56,205, 18, 21, 50,244, 74,136,251,251, 31,222, 60,252,255, -229,235, 39,102, 22,126, 6, 38,174,178, 30, 2,107,182, 61,188,117, 54, 76,173, 96, 96,250,198, 0,107, 32,242,240,240,255,253, -253,158,225,255,215,135,199,102,153,232,201,225,157,165, 1,109,227, 1, 22, 96,160, 62, 54, 35,120,204,145, 17, 54,220,136,145, - 50,144, 65,122, 70,217,148,201,109,159, 63,127,100, 97, 97,130,205, 56,129, 90,157, 95,190,252, 2,246,211,129,165, 49, 51, 11, - 83, 87,251, 4, 76,141,158,254, 22, 64,114,231,230, 19,127,193,163, 93,255, 33, 78,128,206, 10, 65,109,143, 79, 9,193,227,223, -148,230,148, 7,119, 31,144, 17, 97,192, 86,231,123,240,220, 52,176,203,105,102,102,246,250,245,235,187,119,239,130,150,203,252, -251,183,118,237, 90,130,165,103, 78,124, 60,167,152,152, 15,182,206,117, 14,184,232,228,196, 93, 8,150,130, 27,164,104,122,165, - 81,199, 76, 9, 2, 96, 11,212, 26,220, 2, 21,227,228,212,177,178,162,105,226, 70, 43, 25,129, 33,134, 54, 95, 68,176,244, 20, - 86, 85,249,252,254, 61, 11, 59,219,207,159, 63,254,254, 6,166,137,127,188,130,130, 31,223,189, 3,150,155,248,155,156,240, 37, -241,144,129, 78, 96,135, 29, 88,116,194, 71, 57,113,173,144, 87,147,124,255,230,237,155, 85,171, 17, 75, 0,195,162,147,223,253, - 82, 37,173, 20,196,232,161, 99,136, 48, 18,108,123, 50,108,135,110,163, 84,217, 8,221,191,247,241,247, 95,226,221,224,228,224, -116, 81,240,162,155,183, 71,106,108,178,158,190,238,166,141,155,143, 95, 56,155,150,150,246,136, 6,199,112, 80, 2,208,110, 78, - 38,233, 34,101,128, 0,194,185,155, 8,178, 80, 9, 82,128, 34,139,224, 7, 58, 58,214,147, 38, 45,202,203,143,148,150, 7,198, -247, 79, 86,118,142, 39,207, 63,217,251,198, 17,227, 20, 67, 67,165,132,132,176, 5,243,214, 49,252,123, 8,236,179,255,249,241, - 93, 90,146, 95,142,239, 15,193,134, 24,176,172,250, 15,130, 12,144,182, 31, 35,168, 25, 8,110,131, 18, 97,105, 78,110, 21,144, -172,170,204, 99,102,102,250, 15,234, 17, 3, 27,158,127,191,124, 1, 21,156, 76, 76,140,211,167,227, 59, 81,198,221, 23, 84,128, -110,219,112,244, 63,162,224, 4, 37,202,228,244, 72,130,246,126,252,242, 17,235, 22,117,130, 0,152,123,129, 13, 79, 96,207,253, -211,167, 79,204,204,204, 64,134,132,132,196,239,223,191,145,215, 45, 2, 75, 79, 92, 59, 50, 33,205, 67, 65,178, 22, 33, 9, 65, - 42, 35, 18,203, 74, 76, 32,142, 99,137, 46, 46, 64,246, 88, 39, 90,153,136,117,158,157,224,194,120, 5, 51, 83, 32,121,227,224, -193, 31,223,190,255,251,251, 87,211,216, 88,215,202, 14,216,157,199,155, 40, 25, 31,222,191, 11, 26, 89,102, 96, 72, 10,130, 14, - 93, 3, 69,144,217, 88, 23,176,221,122, 14, 76, 18,130,225,209, 41, 15, 31,191, 56,113,104, 11, 80,100,213,210,185,230,118, 62, -188,226, 54,196, 4, 84, 24,104, 67, 23,225,125,150,127, 25,217,177,138, 63, 10,148,216,254,236, 7,181, 74, 37,125, 48, 56,115, -230,204,222, 19, 7,133, 69,132, 7,243,129, 53,228,221,255, 14, 16, 64,132, 55, 98,146,106,162,178,134,233,214,157,119, 2,188, -185,196,164,101,223,125,254, 99,239, 29, 75,188, 94, 75, 83, 13, 75,211,170,244,244, 58, 6,134,151,130,188, 44,114, 66,255, 8, -107,137, 14,167, 60,236,218,218, 39, 1,201,188,188,220,223,191,126, 1,251,233, 92, 92, 92,253,253,253, 68,234,245, 10, 0,157, - 5,181,117,253, 17, 70, 70,166,180,172, 24, 58,196, 52,176,236, 0,182, 61,127,253,250, 5, 41, 80, 32, 69,201,112, 61, 75,137, -224,254, 78,226, 1, 49, 39, 36,225, 2, 26,246,246,196, 43,126,126,239,166,185,170, 12,217,118,189,253,165,194, 35,174,226, 18, -106, 67,170, 70, 92,231,122, 32, 1,166, 63,140,236,223,153,176,207, 16,222,253,252, 71,141, 23, 79,129, 64,206,242, 53, 19, 19, -147,193,156,186, 48,231,133,136, 31,247, 4, 8, 32, 70,242,134, 72, 71,193,192, 2,206,159, 55,190,163, 30,169, 57, 10, 70,193, - 40,160, 39, 0, 8,160,209, 83,226,135, 36, 24, 45, 55, 71,193, 40, 24, 88, 0, 16, 64,163, 69,231, 40, 24, 5,163, 96, 20,144, - 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8, 32,154, - 92,235, 54,170,119, 84,239,224,212, 11,217,139, 57, 26, 86, 35, 92, 47, 85, 0, 64, 0,177,160, 37, 44, 98,244, 96, 77,124,148, -232, 29, 5, 36, 1, 92,249,127, 20,144, 17, 80,184,212,176,255,253,255,147, 25,177, 28,231,209,163, 71, 79,159, 62,101,103,103, - 23, 17, 17,145,147,147,163,155, 23,224,231, 99, 13,230, 28,244,234,213,171,167, 79,159,226, 87, 35, 45, 45, 45,134,109, 53, 49, - 37,122, 7, 22, 0, 4, 16,250, 50, 46,130,251,222,240, 28,144,131,166, 23,243, 0, 52, 60,122, 23, 46,154,139,223,222,248,184, -228,193,150, 45,241, 43, 40, 40, 40,208,212,212, 36, 91,123,104,104,168,139,139, 11, 46,141,212, 42, 61,221,221,221,129,228,206, -157, 59,233,160,247,235,215,175,107,215,174,133, 92,235, 22, 28, 28,108,136,251,118, 10, 76,255, 18,188,214,109,198,140, 25, 88, -235,105,252, 1,133, 71, 22, 94,110, 2,243,246,207,159, 63,129, 86,112,112,112,252,248,241, 3, 88,134,158, 62,125, 90, 95, 95, - 95, 69, 69, 5,151,177,214,214,214, 4,253,245,252,249,115, 96,177, 72, 80, 25,176,220,132, 28, 42, 72, 76, 88, 17,179,182, 55, - 44, 44, 12,107,186, 66, 75,147,242,242,242, 64,242,243,231,207, 64,191, 67,226, 14, 79,154, 4,150,125, 69, 69, 69,120, 44,125, -255,254,189,185,185, 57,214,160, 6,234,213,210,210,194,163,247,229,203,151,181,181,181,131,176,194, 0, 8, 32,150, 65,229,154, -163, 71, 78, 90,219,152, 99,138, 51, 17,177, 28,151,254,109,177,141, 51, 60,112, 73, 5,100,238,160,164, 1,142,171, 96,221,179, -103, 15, 50, 27,158,142,239,223,191, 15,185,214,141,164, 16,184,124,249, 50,164,248, 67, 54,138, 84,144,145,145,145,157,157, 77, -204, 21, 52,144,123, 53,226,226,226,128, 25,169,183,183, 87, 65, 65, 65, 80,144,240,126, 42, 96,153,181,125,251,118, 8,219,195, -195, 99,199,142, 29, 88,217,120, 2, 25,158, 48,128, 12, 99, 99, 99,248,101,162,196, 36,152,143, 31, 63, 66,218, 59,192, 50,154, -147,147, 19, 88,140,126,248,240,129,159,159,255,212,169, 83, 64, 65, 60,165,167,142,142, 14,176,160,129, 23,121,200, 45, 71,200, -193,254, 39, 78,156,136,138,138, 34, 38,132,137, 44, 55, 33, 96,194,132, 9,148, 39,108,110,110,238,107,215,174,177,178,178,254, -250,245, 11, 24,200,183,111,223,174,172,172, 36,168,235, 37,210,129, 50,182,182,182,135, 15, 31,134,115,223,188,121, 67,164, 70, - 76,240,128,168, 19,245, 41, 2,228, 93,235, 6, 16,128,185, 51,182, 65, 24, 6,162, 40,178, 43, 6,112,197, 26,244, 30,196,141, - 87,112,239,146,173, 44,111,192, 62,238, 16, 79, 28,178,172, 0,201, 97,138,240,171, 40,210, 69, 39,235,244,242, 83,228,254,127, -161,115,164,167, 49,166, 47,139,187, 29, 84, 59, 32,246,253,146, 61,157, 47,207, 23,233, 53, 79,148, 75, 74,240,186,119, 88,196, -186,193,187, 82, 10,112, 89, 44,182, 80,170,199,186, 73,210,198,183,194,111,214, 90,123,172,219,230,201,227, 55,101,191,142,196, -186, 65, 79,141,253,252, 61,214,141,198, 56,219, 49,214,141, 57,129,107,155, 13,131,120,224,206, 28,198, 24,241,155, 24,219,227, - 35,214,173,181,102,173,229, 81,206, 57, 48,250,182, 86,248,216,125,229,116, 14, 10,133,116,171, 55,158, 40,165, 36, 23,253,143, -184,215, 59,159,132,217, 4,115, 57,103,232,201, 96,120,239,149,220, 28, 5, 55, 67, 8, 35, 61,197,186,174, 12,210,142,192,153, -142,117,187, 11,192,221, 25,219, 48, 12, 2, 81,212, 18,202, 4,176, 81, 66,197, 2,236,194, 62,236,193, 64, 80, 82,231,197,167, - 32, 37,114, 8,182, 19, 23,190, 2, 33, 75, 92, 3, 60,255,163,184,255, 75,116,182,203,223,249, 50, 78,207,197, 38,155,253, 96, -195,206,253, 14,216,212, 19,176,179,214, 78,175,109,147, 86, 5,146,115,122,180,251,189,137,173, 27,227, 6,243,194,235, 28,164, - 34,195,136,253,161,192,104,155,252,220, 19,139,182,110, 95,133,118,173, 85,107,237,189, 71,123,230,156, 47, 79, 95, 55, 38, 48, -180,148, 66,229,222, 73, 2, 55,219, 47, 77,208, 41,218,115,238, 78, 63,170,241, 33, 38,107,101,225, 1, 7, 27,137,151, 82,114, -206,193, 80, 99, 12,115,184, 9, 70, 41,216,149, 82,131,220, 12, 33,200,101,124,211,158,159, 34,198,216, 17,158, 84,244,108,193, -191,185, 41,174, 68,171,108,221,238, 2, 48,119, 45, 55, 20,130, 64,240,213, 68,232,129,192,245,181,241,218,160, 3,219, 48,156, -189,209, 6, 9,157, 0,137, 19, 55,217,131, 31, 4,244,240,246, 96,208,248, 65,148,113,102, 77,118,222,132,206,163,204,108,252, -119,212,174,220,235, 97,140,233,229,158,183, 61,188, 61,213,247,183,204,147,122, 50,104, 79,166, 4,207,171, 1,202, 73,100, 19, -120, 7,222,138,119,119,216,247,149, 14, 4,122, 94,221, 8,101, 57, 63,155,173, 27,104, 38,215,118, 36, 91, 55,218, 88,225,158, -208,227,156, 55,215, 90, 51, 15,173,232,244,227,247,123,103,235,134, 97,103,229,126, 26, 49, 70,240, 77,224, 5, 26,184, 98, 8, -129,138, 6,144,173, 91, 41, 5,192,234,156,171,128, 32,227, 38, 24,238, 14,199,187, 52, 56,118,166, 14,247,210,207,129, 72, 41, - 9, 33,188,247, 82, 74, 60, 53, 74,137, 96, 85, 41,149,115,110,193, 77, 44,173,181, 87,202,253, 63,131,221,220,208,104, 47, 20, -191, 10, 32,106, 22,157,148, 76, 19, 81,171,244, 4, 54, 97, 72,106,123, 66, 18,229,210,165, 75,209,196,183,109,219, 6, 20, 36, -210,144, 19,247,181, 44, 20,175,145,215, 79,135, 52, 79,128,249,129,140,243, 59,208,174, 39, 34,102,218, 1,185,201,137,118,173, - 27,121, 13, 79,184, 9,120,174,117,131, 55, 51,129,185, 17,232, 96, 85, 85, 85,208,125,188,236,236,192,222,110, 75, 75, 11,193, -182, 39,242,152, 38,174,113, 79, 50, 42, 69, 96, 17, 6, 87,131,217,202, 0, 54, 42,121,121,121,129,228,177, 99,199,128, 5, 40, -228,194, 43,248,181,110,160,155,171, 9, 93,235,134,217, 73,135,215,115,192,200,122, 69,226, 93, 38,192,164, 8,137,110, 50, 42, - 90,226,207,178, 1, 70, 68,105,105, 41,164, 26, 3, 90, 7,236,173, 51,128,142, 52, 51, 4,214, 28,196,204,113, 83, 82, 74, 66, -138, 93, 42, 26, 72,107, 0, 16,128,185, 51, 72, 1, 16, 4,162,104, 72, 43,207,226,162, 35,120, 1,143,228, 93, 60,140,135,114, -217,163, 9, 17,164, 80,179,168, 69, 72, 24,132,225,155,255, 71,107,214,223, 62,217, 0, 55,135,233, 73,127,113, 25,217,182, 52, -114, 19,201, 57, 87,167, 15,115,115,233, 89, 79, 16,201,105,204, 89,133,148,198, 67,225,217,152,229,196,250,121,239,225,166, 92, -223,142,146,194, 16,211, 57, 23, 99,228, 60, 61,185, 33,170,243,170,172, 91, 14, 87,245,190, 63, 88, 9, 55, 83, 74,240, 29,202, - 75,241,146, 92,214,141,198, 61, 55, 37, 28,214,206,189, 92, 59,234, 61,134,111,108,207,117, 18,201,112,235,204, 32,173,181,181, -150, 17,224,149, 17,219, 66, 8, 74,189,251,249, 12,148,204,102, 95, 38,224, 7,220,148, 63, 39,161, 52, 75,195,222,152,235,220, - 5, 16,211, 48, 43, 55, 33,128,248, 6, 35, 60,155,193,123, 25,196,151,155, 16, 96,100,104,176,119,223,254,101,251,184, 32, 37, - 41,176, 5, 74,146, 83,129, 25,120, 15, 24, 64, 74, 82, 34, 90,142,208, 28,139,118,173, 27,169,163,156,152,215,186,173, 89,179, - 6, 34, 69, 6, 32,120,173, 27, 48,251, 65, 24, 43, 87,174,188,112, 1,116,201,213,138, 21, 43,224,130, 52,189,214, 13, 62,159, -142, 86, 99,225,111,230, 3,155,156,192,242, 17,232,194, 55,111,222, 0,201,111, 96,240,229,203,151, 79,159, 62,125,252,248, 17, -216, 2, 5,182, 58,255,226,190,107, 11, 57, 82,208, 38,247,136, 31, 96, 1, 38, 6,100,103, 19,223,171, 32, 27, 44, 92,184, 16, - 88, 98, 2,203,205,107,215,174, 1,251,233,192,114,179,174,174, 14, 88,171, 85, 86, 86, 18, 83,116,218, 98, 3, 36,149,158,192, -108, 72,183,114, 19,101, 84,135,196, 59,221,128, 0, 32, 0,115,103,144, 2, 33, 8, 70, 97,193, 35,120, 26, 23, 51, 48,115, 5, - 23,110,242,132, 49, 19,120, 45,113,233,126,158, 25, 34, 90,241,143, 81,244, 22,237, 10,250,131,199,251, 76,124,119,252, 77,244, -120, 74, 98, 41,238,170, 48,253, 14,168, 73,228,142,248, 73,247, 77, 24, 37,124,115, 97,210,239,244,153, 59, 17, 96,163,236,253, - 2,101, 82, 34,103, 46, 23, 27,103, 49,210, 62,161,232, 80, 85,173,219, 95,190,153, 34,231,106,192,236, 11,158,201,112,193,236, -155,131, 82,170,172,117, 27,134,120,170,105, 85,235,102,140, 57,105,173,147,117,213,186, 9, 33,188,247,200,152,206, 57,164,206, - 92,235, 22, 66,128,135,194, 55, 97,160,213, 34,102,169, 12, 4,172, 57,157,126,231,174,150, 42, 50,245,183,123,227,137, 97,147, - 78,235, 16, 8, 29,159, 3, 47, 40,165,196, 21, 67,211, 90, 91,107, 57,231, 20,235, 60,158, 28,211, 19,174,231,244, 50,117, 18, -245, 19,128,185, 51, 74, 1, 16, 4,130,232, 5, 60,130,224, 25, 60,130,208,141,188,174, 95,158,164,169,129,101, 83,147,205, 32, -242, 75,164,126,210,158, 99, 59, 52,191, 43, 19,189,212,155,107,220,212,244,124,164, 55,135,253,131,158, 54,189, 57,236,107,243, -230,176,221,197,186, 49, 90, 99, 14, 83,137,117,107,198, 65, 76,198,186, 77,156, 34,189, 7,158, 32, 6, 83,192, 77, 57,254,247, - 45,198, 24, 66, 96,130, 27,208,201, 58,187, 30,212,161, 96,237, 70,113,245,117,218,191,117,234, 69,136, 57,197,134,132, 7,203, - 5, 41, 70,133,201, 92,123,239, 75, 41,252, 27, 63, 78,232,100,183,196,186,177,106,100,212,251,219,217, 68, 51, 90,238, 18, 80, -226, 98,253, 18, 45,155,156,140,141, 62,164,156, 51, 36,103, 74, 9, 36,117,206,213, 90,141,232, 20,246, 81,130,172, 17,240, 75, -110,178,194,222,148,137,140, 21,246, 93, 0,177, 96,166, 84,178,221,129, 22,175,200,117, 38,114, 85, 76,187,114, 19, 24, 97, 20, - 46,224, 32, 73,251,227, 39, 47,112, 73,113,114,114, 17,212,142,117, 0,142,200,172,136,255, 90, 55,130, 77, 81,172,215,186, 65, -214, 30, 19,108,246, 98, 86,135,185,185,185,120,202, 77, 8, 16, 18, 18,130, 12,101, 2, 91,112,200,141,205,154,154, 26,252, 73, -142,194,117,157,200,229, 35,218,234, 87,130, 53,165,189,189,253,182,109,219,254,252,249,243,225,195, 7,248, 69,205,192, 70, 40, -144, 11,100, 19, 57,106, 9, 25,232, 68, 94,144,132, 60, 12,138,191,220,132,135, 54, 61,215,219, 65, 74, 79, 96, 42, 58,120,240, - 32, 48,154,218,219,219,129,117, 45,176,209,205,193,193, 65,204,128, 12, 25, 45, 71,100,189, 67, 8, 0, 4, 16, 11,254,226, 15, - 87, 79,100,112, 2,122,166,176,150,150, 22,252,123, 36, 8, 86, 51,100, 15, 93, 1,203, 26,101, 48,112,118,118, 6, 26,130,245, - 90, 55, 92,165, 39,228,106, 54, 96,182, 71, 30,235,132, 52,169,202,202,202,240,151, 83, 88,245,146,218,193, 39,178,177, 73,173, -110, 16,114,146,192,188,214, 13,127,233, 9, 12, 22,111,111,111, 96,235,137,141,141, 13,216, 67, 7,150,158,192, 64, 22, 16, 16, - 0,102,117, 92, 91, 18,209,242, 17,124,130, 8,104, 47, 80, 61, 60,239,224,202,101,144, 36,129,182,245,136,212,177,108,204, 30, - 58, 73,125,118, 72,233, 9, 95, 6,159,149,149, 5, 97, 0, 91,223,120,180, 60,123,246, 12,121,221,251,138, 21, 43, 8,238, 76, -199,165,151,254, 0,109,154,136, 72, 0, 16, 64, 44, 84, 44, 25, 49,245, 18,111, 26,229, 91,212,233,188, 18, 94, 20, 12,200,214, -174, 4, 6,148, 59, 3,110, 14,114, 99, 16, 88,122,226, 10, 13,178, 55, 92, 82,168, 23,107, 11,148, 72, 64,246, 88, 39, 90, 32, - 96,109,230, 19, 76, 54,192,174, 12,176,114,218,191,127, 63,228, 54, 61, 3, 3,131,176,176, 48,130,113,119,226,196, 9,120,211, - 21, 46,130,204,198, 21,155,240,106, 21, 82,230, 2,115, 16,193, 98, 26, 14,194, 40,187,199,137,236, 28, 36, 45, 45, 29, 24, 72, -224,130,248,230,230,102,170,235,165, 28,192,239, 38, 66, 46, 52,137,156, 97, 7, 8, 32, 22,106,149, 62,163,103,249,140,156, 22, -247, 16,245, 23,217, 70, 65,218,248,196,171, 7,182,169,137,220,159,142,167, 58, 36,163,162,162, 86,221, 70, 42, 16, 19, 19, 35, - 59,108, 41,209, 75,221,210,147,164,114, 19, 8, 0, 2,104,244, 90,183,161, 10, 70,111,118, 27, 5,163, 96, 0, 1, 64, 0,141, -158, 18, 63, 84,193,104,185, 57, 10, 70,193, 0, 2,128, 0, 26, 45, 58, 71,193, 40, 24, 5,163,128,100, 0, 16, 64,163, 69,231, - 40, 24, 5,163, 96, 20,144, 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0,209,240, 90, 55,146,174,208, 98, -254,255,159,245, 47,195, 15, 22,236,171,163,185,126,255,251,193,194,244,143,113,244, 42, 43,170,233,253,251,247,239,143, 31, 63, -152,193, 0,200,133, 31,201, 65, 11,123,255, 18, 93, 65,111, 59, 56, 40,194,106,179,223, 20,226,245,250,110,202,161,150,222,141, -190, 36,232,245,223,140,162,215,199, 70,154, 1,188, 22,245,247,239,223,247,239,223,255,245,235, 23, 11, 11,203,147, 39, 79, 34, -249, 21,118,158, 57,243, 93, 79,214,194,194, 2, 24,215,144,165, 93, 91,142, 60,165, 86, 88, 65,236,133, 3,200, 6,135,171, 87, -175, 74, 73, 73,189,123,247, 14, 72,114,114,114, 50,192,182, 54,160,217,139, 85,239,227, 43, 75,210,109, 31, 45, 59,163,198, 34, -230,198,195,203,135, 75,239,128, 95,235, 6, 16, 64, 36,108,196,196,191,177,129,242, 43,180,254,194,220, 34,113,226,218,157, 87, -207, 57,217, 56,212,185,248,239,216,129,182,169,124, 99,165, 71,235,120, 72, 92,161, 69, 45, 0,204, 69,220,220,220,148,155,115, -243,230,205,254,254,254,222, 42, 16,123,195, 97,208, 14, 60, 52, 5,200,229,230,227, 71,143,159, 62,121,114,243,198,141,247,239, -223,203,203,203,243,240,242,186,186,187,225, 55,127,247,238,221, 4,221,176,102,205, 26,226, 99, 10,178,147, 10,235, 93, 70,248, - 64,232, 59, 48,245, 31,116,134,192,106, 33, 18, 52, 26,247, 51, 40,197,131,147,215, 2,134,179, 69, 36,135,111,200, 27,132,189, -107, 68,240, 40, 4,150, 59, 95,191,126,221,181,107, 23, 48, 25,135,178, 10, 75,200,138,254,248,250,157,243,219, 31,235,146, 84, - 59,223,240, 45,115,103,108,222,187,215,205,205,141, 14, 73, 11, 88, 43, 3,221,160,175,175,175,166,166,118,238,220, 57, 96, 13, -173,170,170, 74,228,169, 20,127,254,252,185,120,230,188, 76,178, 97,153,153,246,137, 93, 61,107, 47, 59,168,234, 56, 81,114,162, - 5,237, 0, 64, 0, 17, 85,116, 18,179, 21,157, 42, 87,104,169,158,187, 43,248,246, 11, 35,195,255, 95,127,153,127,191,251,242, -228,205,199, 7, 83,206,242, 56,154,139,104,227,155, 77, 62,187, 63, 93, 3,186,234,142,121,253,174,127,135, 79,255, 79,139, 96, - 0,138, 20,181,146, 86, 8,146,116,133, 22,174, 50,151,214,135,209,130,114,113, 40,104,177,180,144, 16,150,173,238,239,222,185, -128,131, 90,144, 62, 75,252, 96,229,230,127,112,185,105,119,228,200, 17,204,162, 19, 14, 12,117,119,189,124,178,118,209,124, 40, -247,214,141,155, 64, 50, 37,113,221,199, 47, 57, 31, 62,225,219,199,185,114,229, 74,130,213, 0, 73,213, 63, 74, 73,154,158, 62, -131,184, 98, 23,249, 34, 57, 18,128, 82, 60,226, 24, 14, 50,138, 78,152,239,240,156,210, 4, 1,119,239,222, 61,176,106, 85,147, - 75,152, 65,116, 22,155,184, 32, 3, 11, 19,232, 78,175,127,255, 25,254,177,254,251,249,223, 43, 62,237,209,164,142, 99,199,142, - 89, 89, 89,209,186, 24, 98, 98, 98, 50, 48, 48, 56,112,224, 0,176,244, 52, 51, 51,123,241,226,197,197,139, 23,245,244,244,136, -217,228, 13,244,172,179,147,107,123,223,166,242,132,203, 22, 30,153, 22,230,123, 74, 38, 63, 81, 51,141,195,170, 23,126,229, 31, - 30, 31,225,186,242,143,114, 0, 16, 64, 44,196, 38, 53,151, 85, 51, 67,223, 19, 95,122,146,113,133,150,204,221,151, 70,156,130, -108,146,252,127, 25,254,115,126,224,122,241,250,245,139,207, 31, 21,217,121,110,236, 60, 2, 12, 24, 81,220,165, 39,176,148,188, -113,151,233,255,127,142,191,140,236, 1,174,191, 3,221,190,131,110, 51,130,214,213, 36,166,115, 18, 75, 61,248,241, 54,103,206, -156, 1,114, 77, 42,238,117,158, 5,150,193, 97, 4, 11, 80,178,111,196, 68,180,102,140,141,177, 89, 65,236,118,224,219,123,249, -122, 86, 69, 66,216,197,161,203, 85,157, 63,146,122,124, 1,176,220,236,235,235, 3,230,147,226, 54,232, 97,224,120, 76, 0,150, -155, 22,230,107, 45,204, 25, 26, 27, 17,130, 81, 81, 12,224,115,253,167, 44, 95,133,175,244, 4,102, 39,200,137, 39,192,226, 35, - 60, 60, 28,178,103,159, 96, 81,130,181,189, 9,217,177, 10,119,103, 70, 6,177,229, 38,153,192,184,143, 1,118,213, 26,168,232, - 52,234,101, 56, 87, 76, 35,171,246,237,219, 55, 61, 48, 77,209,201,149,129,249, 39, 35, 43, 19, 35, 11, 19, 35, 51,235,255,255, -140,255,190,254,249,255,247, 47,176, 49,146, 26,159,149, 85,151,127, 87, 92,156,164,229,253,100, 0, 96, 94,144,148,148, 4,134, -243,193,131, 7,111,220,184,225,234,234,106,105,105,121,242,228, 73,109,109,109,130,122,143,236, 93, 30,100,240,237,236,103,230, -168,250, 47, 54,134, 19,115, 10,194,123,202, 63,148,247, 44, 85, 50,140,194, 83, 44,194,139, 23, 96, 20,163,137,224,207,104,104, - 23, 19, 33, 70, 18,136, 88,237, 14, 16, 64, 44, 68,150,155, 32,238,106, 65, 98, 74, 79,242,174,208, 82,184,241, 76,157,141,155, -237,255, 31,206,158,210, 63,223,126,113, 20,183,242,179,113,252, 96,253,254,245,199,119, 78, 6,198,231, 7, 79,176,201, 72,226, -186, 66,235,198, 93,134, 89, 43,128,101,229, 55, 48, 98,176, 53,101, 10,116, 99,132,149,158, 12,192, 22,232,172, 21, 68, 69, 57, -169, 87,104, 65,202, 77, 72,161, 9, 41, 55,225,193,213, 73, 68,233,121,183,227, 46, 46, 41,229, 10,124,137, 27,216,222, 68, 62, -166, 23, 85, 42, 29, 44,133,239, 88,179, 55,151, 37,107,166,248,255,103,248,111, 41, 84, 99,237,162,125,100,247,213,222,213, 81, - 12,171,255,215, 23, 77,147, 82, 39,182,249,246,229, 97,186, 52, 7,195,183,183, 87,129, 21, 62,175,152, 30,164,220,156, 62,125, - 58, 86,197, 2,124, 87,128,229, 38,132,125,242, 36,131, 57,236,140, 23,248,254,186,200,176, 41, 51,230, 84,255,103,144,197,211, - 37,167, 48, 63, 3, 99, 22, 82,110, 34,149,164,233, 51,102, 96, 79,150, 76, 97,239,225, 21, 47, 35, 24,255, 11, 69,149,101,132, -244,161, 65,148, 55,106, 59,155, 41,252, 61,164,123, 13, 4,255,254, 37, 20, 20, 20, 64,196,129, 12, 96, 25,202,164,154, 12, 53, - 24,172, 6, 77, 47, 75, 56,186,189,200,183, 90,128,100,113,219, 11,236, 23, 75,200, 43, 48,252,251,197,196,206,192,200,194,252, -231,243,199, 31,247,238,191,126,242, 84,198,202,129,145, 77,128,241,247, 47, 6,102,166,206,204, 18,215, 89, 13,248, 47,254, 37, - 24,140,120,138, 21, 72, 3,240,251,247,239, 66, 66, 66,192,154, 21, 24,218,247,239,223, 95,176, 96,129,166,166,230,135, 15, 31, - 8, 54,234,129,122,229,153, 78, 74,202,121,124, 56,120,249,227,123,246,197, 91,254,108, 59,177, 36, 47,148,147,229, 27, 48,214, -176, 20,157, 3,219,139, 7, 8, 32, 22,252,133, 38,232,194,107, 87,216,121, 51,123,194, 24, 66, 9, 87,209,144, 18,243,219,183, -165,192,208,248,241, 99, 30, 48,159, 19,115,133,150,216,243,119, 98,226, 28, 28,245, 89,127,223,188,251,243,236, 13, 11, 27, 43, - 23, 35, 51, 55, 16, 49,179, 8,177,114,188,255,252,225,249,190, 99,252,129,158, 88,245,162,149,140,135, 79,255, 3, 23,157, 12, -125,213,140,255, 25, 25, 24,255, 19,219,252, 36,245, 10, 45,228,114, 19, 29,128, 75, 79,146,134, 74, 5,211,160, 97,254,126,214, - 76, 98,156, 74, 94,195, 25, 24,161,213, 83,252, 32,133,166,149, 54,232,110, 34, 32,121,236, 42,168, 0,109,236,203,158, 57,147, -216,174, 13, 48,243,166, 23, 94,129,164,120, 27, 27, 27, 96,209,137,171,220, 4, 2, 59,155,211,112,182,169, 41,195,236,217, 12, -251,247, 51,168,170, 2,157,138,104,165, 26,232, 94, 63,127, 89, 22,215,216, 25,241,157,119, 60,173,123,180,134, 42,174,114, 19, - 36, 53,115, 38,164,244,195, 90, 63,253,131,229, 88, 96, 51, 1, 24, 14,155, 15,161, 76, 65, 76,159, 49, 19,226, 43, 5, 5, 5, - 96,104, 79,156, 56, 17, 34, 14,100, 0,139,206,157, 59,119, 66, 14,247,131,148,142,104,122, 33, 77, 96,160,174,212,212, 84, 44, -227,128, 48,247,207,154, 61, 27,104,239,150,195, 79,209, 98,150,133,151,151,129,149,249,239,183, 15,215,183,237, 93,186,106,205, -180,103, 32,139, 78, 53,242,169,218,121,253,124,244,248,234,197,179,151,239,223,250,248,226,197,149, 43,192,136,147, 32,163,176, -128,156, 81,141,191,236,123,246,236, 89,109,109,109, 79, 79,207,175, 95,191,128,221, 5, 94, 94,222,175, 95,191,158, 58,117, 10, -127,178,132,232,253,240,228,104,227,252, 71,115, 11,164,222,125,101, 99, 99, 97,146, 17,228,120,241,230, 87,122,215, 31,125, 19, - 99, 57,220, 61, 9, 72, 1, 10,143,104, 76, 6, 30,128, 89, 13,224,106,135, 98, 2,128, 0, 98,194,149,218, 32,231, 18, 34, 68, -247, 16,117,178, 0,228,108,227,111,223,150, 65,202, 77,248,232, 27,254, 51,143, 89, 14,156,229,127,247,249, 31, 27,203,175,179, - 87,127, 94,191,247, 99,215, 97,134,239, 63,217,254,255,231, 98, 96,102, 97, 96,252,249,239,207,187,159, 63,166,237,222,130, 75, -123, 95, 53,168,105, 9, 7, 96, 54, 36,229,255,191,121,231,127, 81, 43, 9, 85, 19,228, 10, 45, 6, 34, 14,108, 7,202, 34, 31, -178,137,104,114, 34,149,158,116, 56,214,155,228, 97,217, 11, 95,129, 33, 3, 47, 55,129, 32,168,158, 21,216,115,183,113, 5,118, -166,254,223, 61,255,133, 24, 67,150, 45, 91, 86,220,198,200, 35,170, 11, 12, 89,143,192,204, 35, 71,142,224,203, 21, 12,143,165, -165, 80, 78,187,208,215, 7,149,155,113,113, 40,189,123, 89,217,167,120, 58,236, 64, 0,236,170, 51,163, 2,184, 8,126,215,194, - 83, 50, 73, 35, 18,140, 72,185, 26, 2, 48,185,140,216, 42,101,184, 70, 55, 55, 55,180,246, 29,176,225, 9,185,199, 20,230, 50, -116,189, 27,102,206, 4,150,107, 16,195,225,222, 68, 14, 4, 8, 23,171,189,192,252,194,196,197,254,251,197,195,153, 53, 53, 11, -190,126,120,111,111, 1, 17,159,187,100, 65, 67, 73,138, 90, 81,100,211,229,125,171,222,223,119,245,243, 35,178, 83, 5, 44, 40, -129,185,224,252,249,243, 72,149,205, 12,172, 97, 8, 9,144,203,151, 47, 3,123,232,145,145,145, 83,166, 76,249,242,229, 11,228, -152, 62, 96, 91,152,135,135, 39, 44, 44,204,218,218, 26, 87,161, 9,210,123,124,237,173,157, 69, 69,149,189,155,235,165,174, 63, -101,249,248,133,249, 31, 35,195,219, 47,191,254, 11, 43, 23, 86,181,250, 4,196,224,172,228,128, 21, 32, 56,195,206, 4, 3,172, - 12,226, 1,164,220, 36,114,111, 58, 64, 0,177, 96, 45, 52,201,104,198,163,137, 64,202, 77,228,166, 40,158, 43,180, 88,222,126, -120,247,159,149,237,237, 59,142, 13,251, 24, 89,152, 24,126,252,250,255,249, 43,227,159, 63,172,192,150,194,255,127, 63,254,254, -249,252,231, 23,195, 63,156, 99, 91,144,233,160,190,106, 44,241, 2,158, 62, 34,217, 59,196, 92,161,133,214,228, 60,211,161,132, - 89,140, 18,115, 9, 23,176,111,142,167,231, 78,117,208, 53,163,216, 66,176, 6, 94,110, 66, 0, 68,196, 82,232, 42, 80,150,160, -131,151, 46, 93,122,232,208,161,183,111,157,133,133,247,242,136,232, 0, 83, 11, 19, 19, 19,158,145,248, 71,143, 24,144,107, 16, - 96,226, 50, 51, 3, 15,182,222,102,152, 58, 21, 42,248,238, 29, 3, 11, 11,206,177, 32,130,195,154,196, 79, 19, 97, 77,180,248, -189,156,159,159, 15,111, 57, 34, 23,130,248, 13,135, 28,250, 7, 25,229,132, 3, 72,195, 19, 40,133,104,120,162,130,100,105,181, - 91, 87,175, 61, 5, 95,254,158,151,151, 55,105,210, 36,226,237,181,253, 41,240,255,223,151,148,182,106,221,144,144,153,109,109, -240,147,137,103,222,190, 2,237,141, 29, 62,188,123,247,110,160,213,224, 12,254,141, 96,185, 9,233, 70, 0, 3, 7,216,178, 51, - 48, 48, 0,150,161, 64,141,153,153,153,143, 63, 99,169,156,158, 60,121,226,239,239, 15,244,218,182,109,219, 32, 23,144, 48,128, -167,203, 25,192, 39,100,227,153,201, 1,138,223,187,121,161,161, 44, 73, 88,117,245,249,213,241,151, 30, 51, 62,122,201,194,240, -159,233,231,175,223,239,254, 11,103, 39,103,145, 55,189, 78,198,185,195, 36,149,155, 64, 0, 16, 64,212, 89,244, 51, 19, 6, 96, - 13,177,255,152,115, 26,112, 53,152,218,175, 61,121,116,250,205,179,171,247,239,189,188,255,224,211,131, 39,159, 31, 63,253,243, -237,251,239,223,127, 62,255,253,245,237,239,159,159,255,129, 89,231,255,127, 66, 97, 1,159, 79,191,113, 23,196, 6, 54, 54,193, -237, 77,166,222,106,114, 78,194, 39,166,102, 6, 22,145,240, 82, 18,194, 70, 22, 65, 46, 76, 9, 52,213,223,207,130,244,211, 33, -136,214,165, 39,184,129, 9, 14,168, 87,160,243,222,215, 53,254, 46, 43,168, 7, 50,128, 77, 81, 98,218,155,129,118,135,128, 61, - 9,193, 19,123,251,171, 65,233,222,206,206, 14, 79, 87, 29,212,156,148,147, 85, 86,102,128,163, 27, 55, 24, 32,135, 10,169,170, -254, 7, 22, 44, 66, 66, 32,164,162,194,224,234, 78,160,100,132,183, 52,145,155, 96, 16, 46,133,137, 22,143, 26, 96, 89,131, 86, -252, 65, 59, 58,125,125,248, 87, 77,185,184,184,192, 47, 83, 67, 6, 64, 65,148,134, 39, 42, 56,116,237, 81, 82,114,246,217,101, -203, 42, 43, 43, 49,203,107,136,189,123,247,238,197, 90, 46,216,105,201,205,155, 59,213, 56, 42,170,189,189, 29,171,213,192, 98, -215,217,217,153,200, 98, 8, 24,167, 64, 91,128,129, 3, 84, 15,169, 23, 33, 77, 78,200, 77,124,152,224,247,239,223, 91,182,108, -185,118,237,218,237,219,183,129, 61,116, 32,151, 1,124, 53, 94, 64, 64, 0,193,214,216,207,159, 63,207,174,141,250,113,107,242, -206,131,119,239, 63,103,254,244,149,233,239,127,134,167, 95, 57,179,139,170, 9,234, 5,214,127,144,213,102, 64, 18, 82, 23, 66, -110, 93, 6,234,130, 48,104,151,143, 0, 2,136, 9, 51, 49, 33,119, 79,144,187,159,196, 24, 7, 25, 27,226,226,138, 70,158,211, - 96, 32,116,133, 22, 43, 27, 51, 48,176,158,124,253,240,232,227,187,215,159,222,127,252,241,227,253,175,239,175,127,126,127,254, -227,219,211, 31, 95,222,253,254,249,254,223,239, 95, 72, 3,252,232,245,173, 41,246,161,207,148,112,158,255,192,126, 12, 3, 27, -145,115, 62,228, 93,161,133,165,171, 78,116,185,137,127, 58,136, 70,224,232,158,171, 16,134,134,152, 59,176,183, 14, 71,189,171, -162, 24, 25, 24,241, 39, 83,127,155,131,241, 69,160,114, 19,152, 66, 54, 30,117, 96, 0, 31,103, 73,208, 70, 53, 13,117,164,194, -151, 97,202, 20,134, 59,119, 64,109,207,198,198,255,112,128,235, 38, 97,120,171,243, 47, 24, 64,198, 58,255,194, 0,169, 67,159, -164, 2, 72,243, 16,173,173, 7,108,135, 2,189,143,171,229, 8,111,245, 96, 45,115,177, 10, 34,134,233,217, 63, 48, 50,241,204, -169,106,229,217,178, 7,152,101,224, 39,215,165,171,234,228, 27, 91,113,113,113, 1, 43,170,218,218,218, 61,123,246, 96,158,172, - 62,247,233,173,231,218, 90,210,210,210,255,254,253,195, 90,236, 98, 21,196, 21,209,240,201,107, 96, 51,147, 1,182, 24, 22,235, -229, 2, 16,207,202,202,202, 62,122,244, 8,216,176, 85, 81, 81, 97, 97, 97,129,212,118, 22, 22, 22,196, 52, 15,149, 53, 12,103, -237, 18,184,180,173,222,214, 82,147,155,131,137,155,235, 47, 39,251, 79, 79,127,162, 70, 8,129,229, 21,188,100,167,164,195, 78, -106,147, 19, 8, 0, 2,136, 9, 87,109, 12, 47, 64,255,239, 14, 37,166, 95, 3, 7,144, 91,171, 32, 37, 38,132, 36,120,133,150, -166,149,213, 31, 30,174,247,255,255, 94,251,250,254,202,199,183, 87, 63,189,185,250,233,221,181,175,239,238,124,123,255,246,231, -143, 47,127,254, 60,251,246, 21,207,101, 88,129,110,140,125,213,204, 64,244,159,129,249, 63, 35, 83, 90, 4, 99,106, 4, 91,114, -184,168,178,178,248, 63, 6, 86, 6, 6, 70, 98,202, 77, 82,175,208,130, 43,134,148,146,152,101,229,234,213,171,137,185, 73, 6, -114, 35,102,197,217, 10, 72, 73, 10,105,129,210, 14,148,132, 45, 63,254,174,245,216, 85,232,132, 53,176,201, 9,236,173, 67,216, -173,217, 91,102,204,152,133, 39, 59,245,215, 48, 36, 20, 57, 11,156,216,227,216,101,207,228,205,112,224,192, 1, 34,147,132,188, -188, 60,156,237,228,196, 32, 32, 0,108,212, 51,120,162,206,249,153,152,154, 18, 28,235, 68,110,111, 66, 68,136,105,117,162, 13, - 86, 34,205, 48, 16,213, 36, 1,182, 46,209, 78, 89, 7, 22,127,196, 44,212,135,215, 10,200,220,127,184, 91, 0,160,102, 26, 35, -227,191,111, 63, 89, 37,228,211, 91, 90, 18,184, 5, 4, 14, 28,135,118,228, 99, 18, 26,122,230,220,238, 91, 94,167,235, 20, 38, -168,184,123,211, 38,204,170, 61, 32, 35, 93, 91, 71, 7, 50,133, 5,175, 90,224,117, 15, 50, 23,107,247, 28, 88, 44, 66,102,129, - 32,131,155,240, 82, 18,216,204,132, 76,197, 0,203, 80, 92, 77, 78,160, 44, 43, 43, 43,176,129, 9,236,170, 3,203,116, 78, 78, - 78, 81, 81, 81, 1, 1, 1,252,119,114,192,245,178,179,179, 7,103, 76, 90,112,218,228,193,227, 79,226,252,204,150,234,140,122, -138,255,185,249,248, 24, 6, 55, 0, 8, 32, 22, 60,197, 57,202,144, 1,113,173, 78,228, 43,180,132,132, 86, 51, 16,119,133,214, - 23,125,149,111,183,110,125,251,243,243,211,215,111,119,127,255,102,253, 7,234,240,127,252,253,227, 31, 56,221,109,123,121,255, -235,159,223,192, 30, 52, 51,206, 84,199, 88,212,138, 72, 22,224, 65,207,127,127, 25,126, 94,191,243,121,222,202, 79, 68,150,155, - 12, 36, 94,161, 5,234,209,119,134, 97, 13, 22, 72, 49, 74,112,160, 19, 88, 80, 98,189, 17,147,129,150,139,217, 85,157, 62, 49, -172,250, 15,105,120, 66, 70, 60,129,189,245, 99, 87,181,123, 86, 69, 85, 77,245,158, 57, 3,159,131,129,237, 77,216, 58,252, 3, -224, 1, 74,151,255,255, 87,131, 83,200,255,213,171,241, 45,135, 10, 12, 9,222,189,115, 23, 3,120, 33,167,163, 35, 52, 77, 1, -227,118,203, 22, 6, 31, 31, 16,219,220,210, 66, 91, 87,135,152,177, 78, 82,151,115,194,163, 0, 24,179, 76, 76, 76,200, 37, 23, -176,153, 66,204,122,120,200,224, 32,124,196, 19,210, 2,197,223,228,100, 64,154, 23, 69,158, 43, 39,120, 65, 44, 48,104,254,124, -254,204, 42, 34,196,204,197,163, 29, 28,210,228,230, 90, 5, 89, 96,100,104,244,247,251, 15, 86, 97,113, 93, 11, 7, 5, 25,197, - 73,215,143,235,232,232, 60, 63,141,114,191, 75, 6, 40,233,130, 66, 54, 11, 88,234,129,215, 48,253, 65, 10, 43, 96, 67, 16, 40, - 2, 95,246,228,141,218,188, 2,150,137,144,142, 57,164,237,134,214, 49, 7,178,241,148,155, 16,103, 3, 11, 74, 96, 27,243,198, -141, 27,231,206,157, 3,198, 17, 55, 55,247,183,111,223,136, 28,148, 20, 23, 23,247,247,247, 63,113,228,212,132,213,187,249, 24, -217,212,197,127,222,121,195,109,163,254, 27, 94,182,226, 26,184, 4,138,195, 51, 44,158,169,118, 90, 52, 57,129, 0, 32,128, 88, -136, 73,121, 32, 71, 16,177, 50,137,146, 43,180,132, 67,188,222, 46, 89,251,145,233,223,139, 31, 95, 24,126,255,254, 11, 12, 47, - 6,134,235, 95, 62, 60,253,246, 9,126,133, 22,238, 65,143,255,192,150,230,172, 21,255,225, 99,157, 26,202,127,152, 25,190,146, - 84,110, 50,144,126,133, 22,120, 37, 19,176, 91,113, 6, 94, 98, 2, 59,239,144,114,211,196,196,132, 96,147,147,236, 27, 49,193, -139, 22,222,187,186,206,194, 28,147,133, 72,165,167,227,187,154,173, 45,123, 75,245, 84,223,227,171,254, 91, 10, 93,133,172,235, - 60,241,190, 5,216, 85,111,205,222,204,192,248, 12,143,189,192,114, 19,152, 88, 3, 3, 3,103,207,254, 4, 73,204,140,176,185, - 94,200, 6, 39, 8,216,124,216, 18, 83,111,118, 94,238,212, 73,147,129, 77, 78,100,247,122,121, 49,212,213, 49,236,220,109,225, -132,119,237, 26,164,247, 23, 18, 18, 2,236,158, 99, 93, 30, 79,100, 25, 10, 89, 18,143, 60,118, 54, 3, 36,152, 62, 99, 6,129, - 24, 7,198, 8,176,165, 9, 41, 58,129, 45, 80, 98,154,156,228,205, 87, 0,155,105, 47, 30, 62, 80, 84, 86,253,247,231, 39,227, -159,191, 44,188,124,188, 70, 38, 60,134,166,255,190,254,249,251,237,231,255, 63,127, 25,254,254, 43,159,222, 19, 30, 21,142,217, -160,251,179, 66, 16,143,201,104,178,254,155,209, 21, 0, 11, 71, 96,185, 9,201, 2,240,251,136,144, 75, 79,252, 30, 84, 87, 87, -159, 60,121,242,235,215,175, 93, 93, 93,207,156, 57, 3, 44, 55,129, 90, 8,222, 64, 3,209,107, 97,110,158,145,156,113,255,201, -253,216,228,140,147,187, 23, 62,255,252,206,196,222, 85, 92, 70, 13,173,113,138,181,197, 10, 47,160, 48, 87,194, 19,179, 36,158, - 18, 0, 16, 64, 44, 68, 38, 59, 34,219,155,200,101, 1, 73, 87,104, 1,171, 66,181,216,224,167, 51, 23, 48,112,114,188,255,255, -231,215,159, 63,255,254,255, 19,230,231,127,242,245, 35,124, 95,205, 63, 70, 92, 19, 68,255,177,141,117,254, 37,169,220,100, 32, -125, 15, 37,100, 29, 40,164,148,132,140, 39, 32,151,155, 4,141, 34,251, 70, 76,100,237, 24,129, 76,168,201,202,200, 32,162,243, -106,230,244,121, 55,247,113,244,174,142, 60,190, 10, 40,192, 8,236,197,171, 59,252,251,199,244,140, 96, 26, 0, 23,145,159,192, -169,150, 1,173, 76, 88,208,187, 23, 72,114,203, 1, 83, 48,150,163, 22,128,141,202,105,179,103,138,136, 1,219,158,235,224,217, -230,243,103, 53, 67, 99, 29,113, 25, 87,252,229, 11,174, 86, 39,124,160,147,200, 25,118, 96,238, 2,150,158,104,151,226, 18, 44, - 55,145, 71, 60, 33, 25,152, 96,147,147,108,224,228,228,148,189,106, 86,211,231, 15, 6,246, 54, 76,226,130, 32,235,126,255, 7, -109,166,100, 96,101,100,102, 97,100, 99,158, 61,163,143,207,217, 68, 89, 89,153,234,171,193, 33, 29,243,233,211,167, 3, 73,125, -125,125,146,244,222,189,123,119,239,222,189,192, 88,176,181,181, 5, 6, 47,218, 16, 39, 48,202,128,241,139,235, 46, 98, 96, 43, -117,209,130,133,108,204,236, 33,145, 33, 64, 53, 54, 94, 41, 40, 37,254,159, 63, 16,189,148,220,212, 75, 35, 0, 16, 64, 84,187, -135,157, 42, 87,104, 57,166, 39,220,187,123,239,220,246,157, 95,127,254, 2,118, 55,148,205,140, 60,228, 34, 9,150, 65,100, 31, -210, 1, 41,251,200,187, 66, 11,110, 2,100, 37, 19,176,184,132,151,191,196,184,135,146, 27, 49,211,211, 5,113,249, 26,216,222, - 36, 60,186,196, 4,234, 10,169,185,252,154,233, 2, 55,225,211, 63,226,172, 6,151,143,140,241, 69,208, 19, 25, 32,233, 25, 40, - 8, 44, 49,185,229, 66, 9,106,127,246,210,109,250, 28, 55, 70,134,199,252,124, 31,129, 92,200,230, 75,130,153,130,188,181, 71, -120, 74, 79, 50, 52,194, 71, 60, 73,106,114,226,105, 49, 97, 31,195, 81, 86,150,200,203,155,176,107,215,189,230, 13,161,172,194, - 2,224, 35, 60,190,127,251,147, 95, 82,201,204, 37,180,109,225,204,139, 34,140,110,164,108, 66,255,251,247, 15, 49, 99,253, 68, -118,204,113,249,238,214,173, 91, 64, 82, 67, 67,227,237,219,183, 44, 44, 44,192,242, 78, 88, 88,152, 1,118, 34, 9, 27, 27,104, -158, 22,107,209, 9,212,117,234,212,169,127,127, 24,173,172,245,159, 60,121, 2, 84,249,235,215, 47, 25, 25, 25,136,212,199,143, - 31,129,141,107,160, 33,236,236,236,120, 90,108,144, 82, 21,153, 65, 82,135,157,188,222, 58, 16, 0, 4, 16, 11,141,138,100,242, -139, 51,101, 37,165,156, 76, 52,193,223, 63,127, 48,177,176, 82, 49, 11, 33,151,125,228, 93,161,133, 89,128,146, 97, 47,121,214, -225,113, 45,173, 79,253, 0, 55, 42, 25,208,122,201,248, 11, 77,108, 35,212,178,159, 63,128, 54, 14, 17, 19,157,174, 96, 64,153, -171,255, 35, 23, 31,228, 29, 6, 1,108,105, 18, 28,169,196, 63,232, 73,100, 49,196,197,197, 21, 24, 24, 8, 57, 56,238, 17,236, -224,184,163,123,119, 67, 14,142,115,182,112,198,165,119,246,251,246, 84,193, 74, 20, 33,188, 39, 45,225, 42, 61,201,240,163,169, -169, 41,100, 9,231,191,127,255,128,101, 31, 3,248,182,122, 32,201,195,195,195, 0, 94,162,196,128,113,170, 33,220,191, 62, 62, - 62, 16, 5, 64,189, 63,126,252, 96, 0, 45, 4,126, 4, 36, 33, 43, 46, 32, 34,192, 34, 21,107,171,115, 96, 15, 54, 3, 8,160, -209,107,221, 70,193, 40, 24, 5,163,128,100, 0, 16, 64,163,167,196,143,130, 81, 48, 10, 70, 1,201, 0, 32,128, 70,139,206, 81, - 48, 10, 70,193, 40, 32, 25, 0, 4,208,104,209, 57, 10, 70,193, 40, 24, 5, 36, 3,128, 0, 98, 25, 13,130,161, 2, 12,137, 62, - 14, 11, 14,206,143, 14,100,143,130, 81, 64, 27, 0, 16, 64, 52,188,214,141, 14,122,141,100,110,114, 48, 94,103, 97,122,198,196, -240, 13,124, 50, 39,243, 63,240,142,117,240,194,153,255,144, 93,152,204, 12,191, 74, 91, 65, 27,126,209, 38,196,134,162,127,101, - 72,153, 82,124,130,186, 56, 99,244, 10,188, 81,189,163,122,169, 8, 0, 2,104,104,183, 58,155, 58, 86,165, 70,176,105, 42,255, -190,113,247, 63,100, 37,124, 95, 53, 83, 81, 43, 98, 57, 76,111, 13, 19,176, 24, 69,222,107,132, 5,252,255,255,235,197,131,143, -191,254,129,246,125, 50, 50, 9,136, 75, 17,179,247, 22, 25,240,242,242,126,254,252,249,199,155, 91, 28, 34,106,163,181, 49, 65, -112,253,230,185, 95, 63,190,233,235,219,144,164, 11,235, 50, 61, 34,151,167, 80,162, 23, 2, 20, 21, 21, 33,107,164, 32,231,182, -145,228,114,228,179,111,200, 91,225, 52, 10, 6, 33, 0, 8, 32,244,162,115,225,162,185,248, 53,196,199, 37,227,146,162, 68, 47, -217, 96,246,138, 95,125,213,200, 7,197, 35,202, 77, 96,137,201, 8, 90, 60,252, 95, 67, 25,180,177,125,223, 67, 28, 70,252,249, -229,113, 97,218,169, 55,127,159,126,255,247,234, 23,227, 67, 54, 1, 86,101, 99, 45, 43,103, 14,240, 37,168, 4,193,150, 3, 55, - 54, 77, 99, 97,248,249, 11,104, 16, 3,251,181, 99,199,190,159,185,202,203,193, 79, 90, 25,250,227,213, 45, 14,177,225, 95,236, - 94,186,184, 71, 65,230,167,174,242,255,127,255,254,126,124,189,226,233, 75,166, 47, 63, 37, 77,140,109,137,212,254,241,245, 28, -102,102,232,230,218, 59, 19, 42, 12,154,126, 17,111, 53,114,121,183,118,237,218,146,146, 18,146, 92, 14, 44, 55, 11, 10, 10, 24, - 25, 25,251,251,251,201, 40,254,200,188, 18,110,100, 0,252,199,170, 65, 26, 55,179,102,207,198, 85, 35,194,151,124, 66,118,187, -195,247,188,195,207,183,166,209,181,110, 0, 1, 68,191, 86, 39, 19, 3,245,183, 82,245, 86,179, 51, 50,252, 4,151,146, 12,240, - 75, 49,109, 77,225,151, 98,254, 71,190, 20,211, 7,199, 81,211,204, 12,255, 20, 69,120, 62,127,123,205,252,231, 47,227,159,255, -127, 63,127,127,113, 98,243,206,139, 39,108,227, 11,133,192,155, 34,240,128, 37,251,159, 49, 42,248, 49, 48,108, 99, 96, 98, 98, - 96, 5,157,106,111,229,192,163,171,245, 98,254,134,135, 28, 92,242,132, 75,204,247,183, 76,212, 63, 91,153,115, 50,252,252,195, -192,112,205,106,130,169,200,155,179, 62,118, 26,116,139, 20, 60,103, 43,224, 1, 23,206,239, 97,103,121,199,194,244,235,199,143, +137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 1,190, 0, 0, 0,242, 8, 2, 0, 0, 0,189, 2, + 55, 29, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 10, 57,105, 67, 67, 80, 80, +104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,108,101, 0, 0,120,218,157,150,119, 84, 84,215, 22,135, +207,189,119,122,161,205, 48, 2, 82,134,222,187,192, 0,210,123,147, 94, 69, 97,152, 25, 96, 40, 3, 14, 51, 52,177, 33,162, 2, + 17, 69, 68,154, 34, 72, 80,196,128,209, 80, 36, 86, 68,177, 16, 20, 84,176, 7, 36, 8, 40, 49, 24, 69, 84, 44,111, 70,214,139, +174,172,188,247,242,242,251,227,172,111,237,179,247,185,251,236,189,207, 90, 23, 0,146,167, 47,151,151, 6, 75, 1,144,202, 19, +240,131, 60,156,233, 17,145, 81,116,236, 0,128, 1, 30, 96,128, 41, 0, 76, 86, 70,186, 95,176,123, 8, 16,201,203,205,133,158, + 33,114, 2, 95, 4, 1,240,122, 88,188, 2,112,211,208, 51,128, 78, 7,255,159,164, 89,233,124,129,232,152, 0, 17,155,179, 57, + 25, 44, 17, 23,136, 56, 37, 75,144, 46,182,207,138,152, 26,151, 44,102, 24, 37,102,190, 40, 65, 17,203,137, 57, 97,145, 13, 62, +251, 44,178,163,152,217,169, 60,182,136,197, 57,167,179, 83,217, 98,238, 21,241,182, 76, 33, 71,196,136,175,136, 11, 51,185,156, + 44, 17,223, 18,177, 70,138, 48,149, 43,226, 55,226,216, 84, 14, 51, 3, 0, 20, 73,108, 23,112, 88,137, 34, 54, 17, 49,137, 31, + 18,228, 34,226,229, 0,224, 72, 9, 95,113,220, 87, 44,224,100, 11,196,151,114, 73, 75,207,225,115, 19, 18, 5,116, 29,150, 46, +221,212,218,154, 65,247,228,100,165,112, 4, 2,195, 0, 38, 43,153,201,103,211, 93,210, 82,211,153,188, 28, 0, 22,239,252, 89, + 50,226,218,210, 69, 69,182, 52,181,182,180, 52, 52, 51, 50,253,170, 80,255,117,243,111, 74,220,219, 69,122, 25,248,185,103, 16, +173,255,139,237,175,252,210, 26, 0, 96,204,137,106,179,243,139, 45,174, 10,128,206, 45, 0,200,221,251, 98,211, 56, 0,128,164, +168,111, 29,215,191,186, 15, 77, 60, 47,137, 2, 65,186,141,177,113, 86, 86,150, 17,151,195, 50, 18, 23,244, 15,253, 79,135,191, +161,175,190,103, 36, 62,238,143,242,208, 93, 57,241, 76, 97,138,128, 46,174, 27, 43, 45, 37, 77,200,167,103,164, 51, 89, 28,186, +225,159,135,248, 31, 7,254,117, 30, 6, 65,156,120, 14,159,195, 19, 69,132,137,166,140,203, 75, 16,181,155,199,230, 10,184,105, + 60, 58,151,247,159,154,248, 15,195,254,164,197,185, 22,137,210,248, 17, 80, 99,140,128,212,117, 42, 64,126,237, 7, 40, 10, 17, + 32,209,251,197, 93,255,163,111,190,248, 48, 32,126,121,225, 42,147,139,115,255,239, 55,253,103,193,165,226, 37,131,155,240, 57, +206, 37, 40,132,206, 18,242, 51, 23,247,196,207, 18,160, 1, 1, 72, 2, 42,144, 7,202, 64, 29,232, 0, 67, 96, 6,172,128, 45, +112, 4,110,192, 27,248,131, 16, 16, 9, 86, 3, 22, 72, 4,169,128, 15,178, 64, 30,216, 4, 10, 65, 49,216, 9,246,128,106, 80, + 7, 26, 65, 51,104, 5,199, 65, 39, 56, 5,206,131, 75,224, 26,184, 1,110,131,251, 96, 20, 76,128,103, 96, 22,188, 6, 11, 16, + 4, 97, 33, 50, 68,129,228, 33, 21, 72, 19,210,135,204, 32, 6,100, 15,185, 65,190, 80, 16, 20, 9,197, 66, 9, 16, 15, 18, 66, +121,208,102,168, 24, 42,131,170,161,122,168, 25,250, 30, 58, 9,157,135,174, 64,131,208, 93,104, 12,154,134,126,135,222,193, 8, + 76,130,169,176, 18,172, 5, 27,195, 12,216, 9,246,129, 67,224, 85,112, 2,188, 6,206,133, 11,224, 29,112, 37,220, 0, 31,133, + 59,224,243,240, 53,248, 54, 60, 10, 63,131,231, 16,128, 16, 17, 26,162,138, 24, 34, 12,196, 5,241, 71,162,144,120,132,143,172, + 71,138,144, 10,164, 1,105, 69,186,145, 62,228, 38, 50,138,204, 32,111, 81, 24, 20, 5, 69, 71, 25,162,108, 81,158,168, 80, 20, + 11,181, 6,181, 30, 85,130,170, 70, 29, 70,117,160,122, 81, 55, 81, 99,168, 89,212, 71, 52, 25,173,136,214, 71,219,160,189,208, + 17,232, 4,116, 22,186, 16, 93,129,110, 66,183,163, 47,162,111,163, 39,208,175, 49, 24, 12, 13,163,141,177,194,120, 98, 34, 49, + 73,152,181,152, 18,204, 62, 76, 27,230, 28,102, 16, 51,142,153,195, 98,177,242, 88,125,172, 29,214, 31,203,196, 10,176,133,216, + 42,236, 81,236, 89,236, 16,118, 2,251, 6, 71,196,169,224,204,112,238,184, 40, 28, 15,151,143,171,192, 29,193,157,193, 13,225, + 38,113, 11,120, 41,188, 38,222, 6,239,143,103,227,115,240,165,248, 70,124, 55,254, 58,126, 2,191, 64,144, 38,104, 19,236, 8, + 33,132, 36,194, 38, 66, 37,161,149,112,145,240,128,240,146, 72, 36,170, 17,173,137,129, 68, 46,113, 35,177,146,120,140,120,153, + 56, 70,124, 75,146, 33,233,145, 92, 72,209, 36, 33,105, 7,233, 16,233, 28,233, 46,233, 37,153, 76,214, 34, 59,146,163,200, 2, +242, 14,114, 51,249, 2,249, 17,249,141, 4, 69,194, 72,194, 75,130, 45,177, 65,162, 70,162, 67, 98, 72,226,185, 36, 94, 82, 83, +210, 73,114,181,100,174,100,133,228, 9,201,235,146, 51, 82,120, 41, 45, 41, 23, 41,166,212,122,169, 26,169,147, 82, 35, 82,115, +210, 20,105, 83,105,127,233, 84,233, 18,233, 35,210, 87,164,167,100,176, 50, 90, 50,110, 50,108,153, 2,153,131, 50, 23,100,198, + 41, 8, 69,157,226, 66, 97, 81, 54, 83, 26, 41, 23, 41, 19, 84, 12, 85,155,234, 69, 77,162, 22, 83,191,163, 14, 80,103,101,101, +100,151,201,134,201,102,203,214,200,158,150, 29,165, 33, 52, 45,154, 23, 45,133, 86, 74, 59, 78, 27,166,189, 91,162,180,196,105, + 9,103,201,246, 37,173, 75,134,150,204,203, 45,149,115,148,227,200, 21,201,181,201,221,150,123, 39, 79,151,119,147, 79,150,223, + 37,223, 41,255, 80, 1,165,160,167, 16,168,144,165,176, 95,225,162,194,204, 82,234, 82,219,165,172,165, 69, 75,143, 47,189,167, + 8, 43,234, 41, 6, 41,174, 85, 60,168,216,175, 56,167,164,172,228,161,148,174, 84,165,116, 65,105, 70,153,166,236,168,156,164, + 92,174,124, 70,121, 90,133,162, 98,175,194, 85, 41, 87, 57,171,242,148, 46, 75,119,162,167,208, 43,233,189,244, 89, 85, 69, 85, + 79, 85,161,106,189,234,128,234,130,154,182, 90,168, 90,190, 90,155,218, 67,117,130, 58, 67, 61, 94,189, 92,189, 71,125, 86, 67, + 69,195, 79, 35, 79,163, 69,227,158, 38, 94,147,161,153,168,185, 87,179, 79,115, 94, 75, 91, 43, 92,107,171, 86,167,214,148,182, +156,182,151,118,174,118,139,246, 3, 29,178,142,131,206, 26,157, 6,157, 91,186, 24, 93,134,110,178,238, 62,221, 27,122,176,158, +133, 94,162, 94,141,222,117,125, 88,223, 82,159,171,191, 79,127,208, 0,109, 96,109,192, 51,104, 48, 24, 49, 36, 25, 58, 25,102, + 26,182, 24,142, 25,209,140,124,141,242,141, 58,141,158, 27,107, 24, 71, 25,239, 50,238, 51,254,104, 98, 97,146, 98,210,104,114, +223, 84,198,212,219, 52,223,180,219,244,119, 51, 61, 51,150, 89,141,217, 45,115,178,185,187,249, 6,243, 46,243, 23,203,244,151, +113,150,237, 95,118,199,130, 98,225,103,177,213,162,199,226,131,165,149, 37,223,178,213,114,218, 74,195, 42,214,170,214,106,132, + 65,101, 4, 48, 74, 24,151,173,209,214,206,214, 27,172, 79, 89,191,181,177,180, 17,216, 28,183,249,205,214,208, 54,217,246,136, +237,212,114,237,229,156,229,141,203,199,237,212,236,152,118,245,118,163,246,116,251, 88,251, 3,246,163, 14,170, 14, 76,135, 6, +135,199,142,234,142,108,199, 38,199, 73, 39, 93,167, 36,167,163, 78,207,157, 77,156,249,206,237,206,243, 46, 54, 46,235, 92,206, +185, 34,174, 30,174, 69,174, 3,110, 50,110,161,110,213,110,143,220,213,220, 19,220, 91,220,103, 61, 44, 60,214,122,156,243, 68, +123,250,120,238,242, 28,241, 82,242, 98,121, 53,123,205,122, 91,121,175,243,238,245, 33,249, 4,251, 84,251, 60,246,213,243,229, +251,118,251,193,126,222,126,187,253, 30,172,208, 92,193, 91,209,233, 15,252,189,252,119,251, 63, 12,208, 14, 88, 19,240, 99, 32, + 38, 48, 32,176, 38,240, 73,144,105, 80, 94, 80, 95, 48, 37, 56, 38,248, 72,240,235, 16,231,144,210,144,251,161, 58,161,194,208, +158, 48,201,176,232,176,230,176,249,112,215,240,178,240,209, 8,227,136,117, 17,215, 34, 21, 34,185,145, 93, 81,216,168,176,168, +166,168,185,149,110, 43,247,172,156,136,182,136, 46,140, 30, 94,165,189, 42,123,213,149,213, 10,171, 83, 86,159,142,145,140, 97, +198,156,136, 69,199,134,199, 30,137,125,207,244,103, 54, 48,231,226,188,226,106,227,102, 89, 46,172,189,172,103,108, 71,118, 57, +123,154, 99,199, 41,227, 76,198,219,197,151,197, 79, 37,216, 37,236, 78,152, 78,116, 72,172, 72,156,225,186,112,171,185, 47,146, + 60,147,234,146,230,147,253,147, 15, 37,127, 74, 9, 79,105, 75,197,165,198,166,158,228,201,240,146,121,189,105,202,105,217,105, +131,233,250,233,133,233,163,107,108,214,236, 89, 51,203,247,225, 55,101, 64, 25,171, 50,186, 4, 84,209,207, 84,191, 80, 71,184, + 69, 56,150,105,159, 89,147,249, 38, 43, 44,235, 68,182,116, 54, 47,187, 63, 71, 47,103,123,206,100,174,123,238,183,107, 81,107, + 89,107,123,242, 84,243, 54,229,141,173,115, 90, 87,191, 30, 90, 31,183,190,103,131,250,134,130, 13, 19, 27, 61, 54, 30,222, 68, +216,148,188,233,167,124,147,252,178,252, 87,155,195, 55,119, 23, 40, 21,108, 44, 24,223,226,177,165,165, 80,162,144, 95, 56,178, +213,118,107,221, 54,212, 54,238,182,129,237,230,219,171,182,127, 44, 98, 23, 93, 45, 54, 41,174, 40,126, 95,194, 42,185,250,141, +233, 55,149,223,124,218, 17,191, 99,160,212,178,116,255, 78,204, 78,222,206,225, 93, 14,187, 14,151, 73,151,229,150,141,239,246, +219,221, 81, 78, 47, 47, 42,127,181, 39,102,207,149,138,101, 21,117,123, 9,123,133,123, 71, 43,125, 43,187,170, 52,170,118, 86, +189,175, 78,172,190, 93,227, 92,211, 86,171, 88,187,189,118,126, 31,123,223,208,126,199,253,173,117, 74,117,197,117,239, 14,112, + 15,220,169,247,168,239,104,208,106,168, 56,136, 57,152,121,240, 73, 99, 88, 99,223,183,140,111,155,155, 20,154,138,155, 62, 28, +226, 29, 26, 61, 28,116,184,183,217,170,185,249,136,226,145,210, 22,184, 69,216, 50,125, 52,250,232,141,239, 92,191,235,106, 53, +108,173,111,163,181, 21, 31, 3,199,132,199,158,126, 31,251,253,240,113,159,227, 61, 39, 24, 39, 90,127,208,252,161,182,157,210, + 94,212, 1,117,228,116,204,118, 38,118,142,118, 69,118, 13,158,244, 62,217,211,109,219,221,254,163,209,143,135, 78,169,158,170, + 57, 45,123,186,244, 12,225, 76,193,153, 79,103,115,207,206,157, 75, 63, 55,115, 62,225,252,120, 79, 76,207,253, 11, 17, 23,110, +245, 6,246, 14, 92,244,185,120,249,146,251,165, 11,125, 78,125,103, 47,219, 93, 62,117,197,230,202,201,171,140,171,157,215, 44, +175,117,244, 91,244,183,255,100,241, 83,251,128,229, 64,199,117,171,235, 93, 55,172,111,116, 15, 46, 31, 60, 51,228, 48,116,254, +166,235,205, 75,183,188,110, 93,187,189,226,246,224,112,232,240,157,145,232,145,209, 59,236, 59, 83,119, 83,238,190,184,151,121, +111,225,254,198, 7,232, 7, 69, 15,165, 30, 86, 60, 82,124,212,240,179,238,207,109,163,150,163,167,199, 92,199,250, 31, 7, 63, +190, 63,206, 26,127,246, 75,198, 47,239, 39, 10,158,144,159, 84, 76,170, 76, 54, 79,153, 77,157,154,118,159,190,241,116,229,211, +137,103,233,207, 22,102, 10,127,149,254,181,246,185,206,243, 31,126,115,252,173,127, 54, 98,118,226, 5,255,197,167,223, 75, 94, +202,191, 60,244,106,217,171,158,185,128,185, 71,175, 83, 95, 47,204, 23,189,145,127,115,248, 45,227,109,223,187,240,119,147, 11, + 89,239,177,239, 43, 63,232,126,232,254,232,243,241,193,167,212, 79,159,254, 5, 3,152,243,252,145,192, 90,219, 0, 0, 0, 4, +103, 65, 77, 65, 0, 0,177,142,124,251, 81,147, 0, 0, 0, 32, 99, 72, 82, 77, 0, 0,122, 37, 0, 0,128,131, 0, 0,249,255, + 0, 0,128,233, 0, 0,117, 48, 0, 0,234, 96, 0, 0, 58,152, 0, 0, 23,111,146, 95,197, 70, 0, 0,152,176, 73, 68, 65, 84, +120,218, 98,244,137,169,101, 24, 5,163, 96, 20,140,130, 81, 64, 10, 0, 8, 32,166,209, 32, 24, 5,163, 96, 20,140, 2, 82, 1, + 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8,160,209,162,115, 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52, 90,116, +142,130, 81, 48, 10, 70, 1,201, 0, 32,128, 70,139,206, 81, 48, 10, 70,193, 40, 32, 25, 0, 4,208,104,209, 57, 10, 70,193, 40, + 24, 5, 36, 3,128, 0, 26, 45, 58, 71,193, 40, 24, 5,163,128,100, 0, 16, 64,163, 69,231, 40, 24, 5,163, 96, 20,144, 12, 0, + 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8,160,209,162,115, + 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52, 90,116,142,130, 81, 48, 10, 70, 1,201, 0, 32,128, 88,112, 73,108, 89,210, 12,103, +147,119, 68, 8,196, 4, 82,245, 82, 98, 47,178, 94,178,157, 77,146,203,209,108, 36,195, 94,242,252,139,213, 94,178, 77, 24,168, + 56, 26, 77, 87,163,233,106,240,164, 43, 82, 1, 64, 0, 49, 17, 19,130,184, 2, 20,151, 94, 8, 34, 35, 97, 81,104, 47,145,233, +128,188,212, 67, 11,128,233, 95,250,216, 78,197,112,166,167,222,209,116, 53,154,174,168,174,151,108, 0, 16, 64, 44,120,228, 32, +133, 55, 61,163, 28,173,198,128, 68, 57,241,181, 52,154, 94,186,165,111, 10,107, 57,184,118,226,109,199,180,145,120,189,112,149, +105,229, 29, 64,114, 86,103, 5, 68,144,248,112,134,104, 36, 85, 47, 28, 32,219, 59,154,174, 70,211,213, 16, 77, 87, 0, 1,196, + 68, 48,185,144, 90,128, 2,213, 67, 16, 25, 49, 61,176,135,135,162,197, 31,125,172, 67,246, 50,217, 33, 64, 70, 31, 22,238, 77, + 74,252, 75,146, 94,180,224,133, 48, 70,211,213,104,186, 26,216,116, 69, 54, 0, 8, 32, 22,134, 97, 1,208, 98,151,140, 40,167, + 36,125,211,127,156,133, 66,207,142,130,209,116, 53,154,174, 40, 4, 0, 1, 52, 72,103,216,225,163, 51,100,140, 22, 15,108,148, +147, 61, 24, 71,183,129, 17, 72,200,192,251, 53, 16,198, 8,201, 33,163,233,106, 52, 93, 81, 11, 0, 4, 16,203,224, 76,223,148, +215,180, 36, 13,148, 80,216,165, 66, 27, 84, 34,195,106, 50,220, 76,121,211,128,140, 81, 33,160, 69, 64, 27,233, 60, 76, 57,154, +174, 70,211,213, 32, 4, 0, 1,196, 52,204,210, 55,242,176, 14,145,245, 45, 37,233, 27,109, 20,137,236,145, 56,184, 57,244,156, +148, 3,122,153, 12, 95, 83,232,223,209,116, 69,159,116, 5,137, 92,120, 20,143,166, 43,170, 3,128, 0, 98, 25, 78,233, 27,173, + 18,163,176,170, 36,163,174, 30,144,224, 34,175, 65,129, 60,172, 14,244, 59, 73,158, 29,114,189,176,209,116, 53,154,174,168, 14, + 0, 2,136,105,120,164,111,122,142,233, 12, 6,123, 71,193,104,186, 26, 5, 3, 11, 0, 2,136, 9, 87,217, 15,143, 57, 58,143, +142, 83,197, 34,146,146, 29,114,151, 25,185,163, 68, 94, 78,163,131, 22,170, 0,180,225,124,242,178, 52, 73,105, 99, 96,167, 17, + 70, 90,186, 26,168,113,195,145,147,174, 0, 2,136,101,176,229,106, 76, 75,137, 9, 5, 72, 79,138, 90, 27,230, 40,116, 51,241, + 81, 14, 31,254, 39,195,205,100, 87,105,112,123,145, 19, 55,217,155,252, 40,201, 93,163,233,138,166,233,138,188,248, 29, 77, 87, + 68, 2,128, 0, 98, 28, 93,183, 53, 10, 70,193, 40, 24, 5,164, 2,128, 0, 26, 61, 57,105, 20,140,130, 81, 48, 10, 72, 6, 0, + 1, 52, 90,116,142,130, 81, 48, 10, 70, 1,201, 0, 32,128, 70,139,206, 81, 48, 10, 70,193, 40, 32, 25, 0, 4,208,104,209, 57, + 10, 70,193, 40, 24, 5, 36, 3,128, 0, 26, 45, 58, 71,193, 40, 24, 5,163,128,100, 0, 16, 64,163, 69,231, 40, 24, 5,163, 96, + 20,144, 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8, + 32,196,110, 34, 95, 91, 25,226,181,109, 62,252, 4,153,139,166,247,254,213,227, 12, 76, 63, 36,101,164, 63,127,255,250,254,237, + 87, 53, 77, 27,226,245, 30, 57,119,151,225, 31,251,203,167, 79,185, 57,185, 5,133,184,205, 77, 20,137,215, 75,137,155,159, 62, + 91,205,198,241,135,157,131,133,153,133,249, 47, 3, 35, 31, 91, 32,241,122, 5,132,140, 5, 5, 5, 57, 57, 57, 25, 24, 25,175, + 93,222,132,223, 94, 78,233, 27,196,187,249,251, 83, 13,100,174, 20,215, 75,226,245, 62,251, 38,142,162,247, 39, 9,246, 62, 99, + 71,177, 87,250,215, 77,226,245, 62,101, 83, 31, 12,122,181,177,133,115,103,231,234,242,242, 80, 76,241,171,168,225,204, 41,243, +139,132, 56,122,194,134,146, 54,164, 73,136,163,205, 79, 81,226,232,199, 79,110,226,245,114,176,127, 69, 49,202,111, 10,241,122, +125, 55,229, 32,115,139, 95,204, 32, 94,111,175, 68, 6,141,242, 32,221,244, 82, 5, 0, 4, 16,129,147,147, 82,175,215,207,214, +108, 36,198,160,123, 87,118, 49, 50,252,227, 97,231,156, 63,115,217,194,133, 19,173, 93,172,255,124,253,166,165, 97,247,239, 31, + 67,118,217, 95, 45, 45,245, 59,119, 30,254,248,254,135, 87,210, 26, 83,239,209,243,175,254, 51, 48,126,249,249, 61,189,168,165, +113,146,251,179,171,103,129, 9, 99,219,197, 39, 76, 76, 12, 19, 27,106,110,221,186,169,160, 32,207,206,201, 34, 44,200,142,169, +247,250,230,237,236,236,236, 92, 92, 92,188,188,188, 2, 2, 2,194, 66,194, 66, 66,130,252,252, 2, 60,220,220,204, 44, 44,255, +254,253,253,254,253,251,231, 79,159, 47,124,251,136,203,229,119,110,173,100,231,248,206,195,203,193,193,197,206,194,198,204,200, +196,200,196,194,252,159,121,215,239, 63,140,108,127, 92,241,251,250,254, 35, 38, 17, 17, 17, 14,238, 31, 63,127,254, 96, 98,102, + 98,100,100,144,146,181,253,240,225,253,183,207, 87,104, 87,221,205,154, 53, 43, 45, 45,109,180,218, 39, 8,112, 21,148,164,170, + 1, 2, 9, 78,174,167, 79,159,178,114,176,255,227,226,162,167, 23,190,189,187,112,108,239, 10,100, 17,151,208,142,193, 25,218, +139, 23, 45, 98,103, 99,251,247,239, 31, 55, 15,143,175,159,223,176, 79, 93, 0, 1,132,175,232,188,189,160,154,193,156, 37,245, +227,242,217,252,145,248, 77, 9,245, 83,249,233, 36,244,251,203, 7,150,191, 76,102,122, 50,241,241,249,208,225, 0, 38,134, 19, +199, 23,136,200, 73,255,251,242,201,222, 92,247,217,179,247,123,206,255, 65,211,155,158,222,198,192,198,207,200,197,247,159,249, +255,197,107,137,243, 86,236,132,136, 3,203, 92, 15, 75, 75,134, 47, 47, 24, 24,120,239, 94,190,206, 42, 34, 96,109,161,195, 35, + 32,134,105, 59, 35,176,177,199, 8, 42,241,152,153,128,165, 37, 51, 11, 43, 8, 0, 73, 22, 22,150, 63,127, 24,153,152,152,129, +178,184, 92,126,241,252, 44,126,126, 22, 94, 30, 30, 81, 49, 97, 30, 94,174,191,255,255,254,248,249,253,247,223,191, 92, 60, 92, +162, 98,146,127,255, 61,120,124, 67, 1,171,198, 29,187,111,241,242,242, 8, 8, 8,126,251,198,249,237, 27, 23, 7, 7, 59, 35, +120,240, 3, 88, 82,127,251,246,237,205,123,190, 55,111,222,188,125,243,210,218, 82, 22,171,246,213,157,171,241, 7,169, 75,130, +139,160,184, 32,214,114,147,138,165,103, 85,119, 55,144,108, 43, 45, 37, 67,111,101, 87, 23,144,108, 47, 43, 35, 94,203,149,167, + 79,111,221,186, 5,100, 4, 57, 58, 18,169,101,230,170, 85,160, 40,134,197,224,255,255,255,129,108, 8, 9,225, 66,100,211, 66, +177, 20,127,192, 50, 17,127,201, 72, 76,185,169, 40, 40,244,253,215, 79, 32,131,141,147,227,215,247, 31,255,190,126,123,243,226, +185,164,174, 46, 30, 45,146,202,106, 4,253,197, 47,175,121, 99,223, 70,130,202,128,229,166,141, 75, 4,135,160, 1, 81,129, 21, +250,142,160,146,176,176,176, 85,161,123,176, 74, 57,238,121, 13,103,107, 9,128, 74,134, 87, 63,254,125,255, 3, 10,225,175, 96, +114,166,185,128, 26, 47, 43, 86,189, 61, 61, 61, 85, 5, 37,254, 65,129, 63,126,124,159,216,223, 55,101,202,148,156,156,156,225, + 93,116, 2, 4, 16,190,162, 83, 53,161,181,108, 65,117,151,249,141, 84, 6, 2,165,231,207, 47,239, 36, 84,156, 91, 74,131, 22, +204, 60, 0, 17, 57,120,108,198,215,111, 63,189, 92,242,173,172, 19, 34,194,156, 56, 57,217,127,253,253,243,249,219, 47, 53,139, + 40, 12,221, 15, 25,126, 49, 4, 69, 79, 79, 45,130,118, 4, 60,172, 28,128, 37,209,134,125, 59,183, 29, 61,190,104,254,180, 31, +223,127,178, 49,179,240,112,177,241,177,253,189,243,232, 5,154,102, 96,222,249, 15,206, 65, 96, 18,204,248, 7,162,254,253,255, +247, 23, 12,254,128, 1, 86,103,159, 60, 62, 75, 76,148,153,151,151, 91, 86, 86, 78, 93, 83,149,135,135,235,221,135,183,207, 94, + 60,127,253,246,205,191, 63,255,185,185,184,213,213,180,248, 5, 30, 93, 57,193,131,166,113,211,134, 83, 12, 44,236,223, 89,152, +216,216,217,190,125,227, 0,150,158,160,162,147, 17,152,188, 24,191,129,192,151,111,223,190,126,253,242,233,237,235,103, 75, 22, +156,227, 87, 54,198,106,123,247,162,110, 92,225, 89, 26,135,189, 44,123,255,254, 61, 50, 91, 72, 72, 8, 82,142, 8, 10, 10,222, +189,123,119,245,234,213, 36,149,167,108,226,208,222, 34,208, 80, 65,178,155,192,171, 87,103,103,103,255,126,245,138,152,114, 83, + 76, 76, 44,200,205,237, 55, 59,123,111,111,111,176,147, 19,164,224,195, 15,128, 30,236,105,104,128,246, 43,235,235,123, 27, 27, +177,178,113,105, 71, 46, 61,129, 12, 99, 99,227, 61,123,238,185,184, 40, 17, 89,110,106, 72, 72, 10,240,241, 65,202,104,110, 14, +206,231,175, 95,125,122,255,129, 71, 64,240,225,233, 51,242,166, 38,120, 52,250,165,149,196, 4,251,170, 42, 64,235,221,250,222, +201,112,169,198,226, 92, 32,249,104,251, 94, 51, 53, 89,162, 58,230, 68,150,155,208, 58, 89,136,144, 10, 23,130,102,112,179, 48, + 94,108, 76,102,228, 19,249,123,239,226,207,123, 87,111,189,251,106,178, 29, 95,252,206,152, 57,179, 40, 61, 59, 46, 37,105,245, +210, 21, 10, 10, 10, 45,157, 93,188, 13, 45, 27, 54,108, 8, 8, 8, 24, 18,133, 32,121,231,239, 0, 4, 16,129, 14, 59,241,165, + 39, 48, 39,106,105,170, 51, 49, 29,184,245,225, 45,176, 27,253,241,233,109, 96,239,102,227,214, 73,223,222,252,141, 78, 44, 4, + 54, 33,253,124, 45,255,178,240,224,210,124,235,214,117,160, 26, 47,125, 96, 83, 66,138,129, 65,254,199,207, 95, 33, 30,110, 28, + 2, 76,139,150,237, 0, 54, 93,215,172, 88,192,252,231,179,166, 60,251,157, 71, 12, 24, 69,231,255,127, 96, 0, 42, 37,255,254, +249,245,251,215,207,159, 63,191,255,248, 14,106,135, 50, 49,253,249,243, 27, 84,148,125,255,206,128,109, 62,140,159,239, 63,176, +125, 42, 36, 36,172,162,172,170,166,162, 1,108,158,254,249,251,239,213,235,119, 63,127,252,254,251,239,235,235,151,111,100,164, +191,107,168,106,156, 59,191, 1,216, 99, 67,214,200,206, 4,180,245,251,239,111,127,190, 50, 51,112,176,179, 1,203, 77, 96, 27, +247,223,191, 63, 64, 75,191,126,251,246,234,229,179,171,151,206,188,125,245, 12,232, 40, 38, 70, 98, 39,226,230, 77,159, 7, 97, + 36,101, 38,225,204, 23,171, 87, 35,179,139,138,138, 30, 61,122, 4,180,116,230,204,153,100,164,152,169, 83,167,190,124,249,114, +205,154, 53,222,118,118,130, 98, 98,164,106, 7,182, 55,223,131,195, 31,216,196, 0,245, 30,194,194,240,171, 7,182, 55,129,229, + 38, 40,161,176,177,169,169,169,173,221,183,143,152,230, 39, 49,197, 43,126, 0, 44, 31,129,197,229,217,179,103,129,108, 56, 25, + 26, 26, 74,176,220, 84, 19, 19, 7,150,155,204, 76, 76, 89, 49,209,223,127,252,236,157, 59,151,139,147,243, 7, 16,124,255,206, +196,194,252,248,252,121, 89, 67, 67, 92,122, 33,229,227,237, 7, 15,144,185,100, 0,115,167,136, 61,171, 43, 92,253,146,255,179, +171, 18,169,133, 49, 12, 90,191,254, 95, 37,136, 75, 4, 23, 0, 54, 54, 31,126,249,123,208, 85,148, 53,127,230,167,104, 69, 22, + 65, 49,130,229,230,222,189,123, 21, 36,165, 82,178, 50, 42, 10,203,166,204,159, 97,102,100, 52, 99,242,140,130,178,146,165,150, +230,151, 47, 95,214,197,219, 60, 31,108,229, 38, 3, 41, 7, 81, 3, 4, 16, 11,218,200, 38,182,216, 99,121,250,229,175,244, 51, +130,165,231, 63,102,102,102, 48, 3, 88, 75,203,240, 75,171, 63,188,185,102,250,204,249, 76, 63,185,220, 28,173,119,236, 61,250, +237, 27, 3,151, 16, 63,166, 54, 78, 46,245,239,223,110, 2, 11, 62,152, 0,176, 93,249,140,137,217, 33, 46, 62,249, 31,251,215, + 45, 91,231,249,249, 38,113,113, 51,124,123,251, 30,173,252,130,218, 10,106, 93,254, 3,182, 43,127,255,254,253,243,199, 79, 96, + 49, 9, 44, 13,129,125,248, 95,191,126, 1,139, 45,160, 56,168, 17,248,229, 11, 3, 63,250, 16,213,193,253, 51, 37,196, 65,229, + 43, 11, 51,235,223,127,255,223,189,253,248,235,207,175,151, 47,222,126,120,255,249,219,215, 95, 12,223,255,252,251,247,130,153, +229,138,148,140, 60, 55, 39, 39,182, 81, 2, 6,134, 63,191,190,191,127,253,234,251,151,127,191,127, 48, 3,139,221, 63,191, 95, +189,124,122,237,210,217,151,207, 30, 3, 51, 60, 19, 19, 48,211, 49, 49,224, 30, 43, 32, 3, 64, 26,149,192,222,122, 72, 72,136, +129,129, 1, 59, 59,123, 95, 95, 31,121, 70, 65,154,156, 22, 58, 58,226,226,226,192,178,207,199,222, 94,138,244,210, 83, 16, 92, + 98,178,138,137, 1, 77, 0,146, 4,219,158,192,246, 38,235,207,159,107,215,174, 69,110,126, 18,223,121, 39, 27, 64, 74, 76,120, + 5,147,158,158, 14,172,120, 8, 22,157,192, 90, 80, 84, 72, 40, 49, 36,228,195,199, 79,175,223,189, 5,143, 0,129, 0, 48,129, +177,115,114,125,122,251,230,243,227, 39,188,178, 56, 39, 43,128,229,230,146,181,155,145,139, 78, 72,219,211,220, 72,207,203,209, +158, 8, 87,127,102, 96,224,229, 21, 54,112,241,227,222,189,105, 46,125, 70, 57, 47, 45,156,240,115,199,124,177,217,231,128,101, + 40, 51,159,208,159,247,175,128,229, 38,176, 17, 10,236,176, 51,227,104, 3,220,191,115,103,219,166,173, 11,103, 47,156, 52,119, +218,140,190, 9, 66,194, 66, 45,109, 45,139,150, 45,181,181,176,158, 55,119, 94, 80,104,144,173,181,237, 32, 47, 55,201,187,255, + 29, 32,128, 80,194,163,236,228, 31, 8, 2,150,149,160,164,243,251,255, 87, 57,211,215,218,254,108,230, 65, 95,129, 13, 70, 96, +233,249,113, 57, 86, 83, 54,237,123,199,192,240,201, 63, 62, 31,216,114,100, 96, 0,178,121,129,217, 68, 94,221,136,131,157,229, +239,159,159,255,127,129,250,203,188,188,188,111,223,189,199,212, 59,161,191, 8, 72, 94, 59, 49,151, 9,234, 22,144, 17,255,190, + 95,253,241,243, 55, 51, 43, 7, 35, 27,104,108,229,243,167, 79,194,194,194,216, 11,108,112,139, 19, 88,108,253,252,249, 11,216, +216, 4,150,146, 31, 63,126,250,240,254,195,187,183,239,222, 2,193,187,183,239, 63,188,255,248, 9,203, 28, 17, 59,251, 47, 96, +153,251,235,215,159,247, 31, 62,221,185,115,255,204,217, 11,167, 78,157,191,113,227,238,179,167,175,191,124,249,249,229,243,143, +215,175,222, 95,187,118,251,228,201,179, 79,159, 98,153, 51,133,183,133,126,125,255,246,244,254,237, 75,167,142,173, 95, 57,119, +199,166, 21, 79, 30,221,251,251,239, 47,168,196,100,132,149,176,120, 1,174,190, 57,206,186,142, 5, 90,219, 1, 59,233,192, 32, + 45, 47, 47, 39, 47,209, 0,155,156,192,242, 23, 52,150, 39, 42,202, 72, 89,249, 14, 41, 49, 33,109, 79, 60,189,117, 32, 9, 44, + 40,111, 63,127, 14, 44, 52,109, 12, 64,157,208, 75,151, 46, 1,201,117,251,247,227, 55, 31,216, 31, 47,105,104,128,244,202, 33, + 12, 8, 27,194,192,211, 91,135, 0, 96,147, 19,185,220,132,179, 33,226,184,128, 0, 11,203,143, 95, 63,129,173,129, 27,247,238, +222,123,242,248,228,133,139,191,126,253, 6,214,132,192,240, 7, 6, 23,176,186,254,254,245,219,238, 85, 43,241,152, 0, 47, 55, +129, 61,119,148, 97,162,115,151,224,173, 81,188,128, 23,150, 82, 85, 33,133, 38,176,249,201,250,231, 54,109,203,146,119,207,217, +228,212, 94,101, 91, 1,203, 80, 22, 17, 73,136, 24,144, 43,194,193,196,199,130, 61,145,168,171,170,115,113,113, 79,154, 51,213, +209,222,222,220,210,226,254,157,251, 55,238,220, 2,182,104, 56,216,217,173,141,173,183,110,218,186,126,253,250,161, 50,124, 73, +210,149, 74, 0, 1,196,130,214, 61, 71,110,123, 50,102,175,229,214,180, 62,124,252, 42,144,237,153, 50,227,203,132, 64,238,135, + 39, 82,255, 47,159, 45,128,165,237,169,194, 39,115,229,210, 58, 88,113,252, 21,152,161, 64,232,247, 79,150,127,192,234, 10, 84, + 26,174,223,176, 11, 72, 90,123, 98,233,214,237,184,252,223,195, 80, 7,169, 61, 7,116, 21, 43, 3, 43,199, 31,198,191,255,192, +133, 79,120,116, 30,104, 76,244,216, 44,172, 69,231,159,191,127,153,126,255, 97, 98,250, 9,106,229, 49, 48, 2, 59,238, 63,127, +254, 0, 54, 14,128, 5, 2,176, 49, 11,108,126, 2, 91,163,236,178,146,104, 26, 65,229,230,239,127, 12,223,127,189,121,243,254, +219, 55, 96, 38, 97, 1,230,141,159, 64,252,247, 55,176, 37,251, 31,168,153,233,247,231, 47,191, 94,191,254,252,245, 59,176,232, + 87,195, 81,114, 66, 25, 63,127,124,255,248,225, 29,120, 74, 10, 60,109, 69, 74,132,221,124,120, 83, 93, 94, 29, 79, 63, 29,121, +224,143, 19,214, 4, 6,230,225,123,247,238,117,118,118,130,251,164,229,252,252,252, 31, 63,126,252,240,225, 3, 49, 61, 92, 72, +147, 83, 66, 2,218,138,207,201,201,153, 60,121, 50,121, 13, 79,184, 9,120,138, 78,248, 40, 39, 35, 47, 47,208,193,101,101,101, +192,134,219,239,247,239,129,110,174,200,201, 33,216,246, 68, 30,211,196, 53,238,137,117, 10,136, 96, 83, 20,210, 26,197, 58,194, +245,254,221, 59, 30, 94,222, 55,239,223,239, 63,121,146,133,137,249,231,239,223,223,190,127, 7, 38, 54,200,224,242,159,223,192, + 84,245, 19,127, 80, 99,118,210,129, 34,144,134,167,170,130,194,163,123,119, 72, 10, 97, 96,233,249,245,245,201,237,235,231,146, +209,246, 36,216, 79,135,131, 11,171,102, 27,196, 23,178, 43,234,129,250, 84,111,158, 3,123,235,160,162,219,210,231,209,223, 63, + 92, 83, 78, 98,213,242,233,211, 39,118, 78, 14, 21, 69,197,251, 79, 30,191,125,253, 54, 60, 38,122,219,222,221, 19, 59,122,215, +111,219,164,170,168, 26, 23, 28,123,252,220,209,245,107,215, 6, 6, 7, 15,179,105, 34,128, 0, 66, 31,235, 68,244,217,181,157, +185, 52,172, 20, 2,107,159,189, 1, 53,217,138, 34,157,218,131,235, 25,250, 60, 25,158,223, 96, 16,192, 98,208,157, 79,159,212, + 4,248,254,252,100,184,115, 96,137,138,131, 59, 3, 3,168,243,254,251,215,111, 86, 6,166, 47, 63, 64, 19,148, 30, 14, 70,156, +194,210, 88, 29,225,161,203,184,237,226,127, 86, 14, 6, 54, 57,247, 95,143, 14, 67, 26,158,172,108,236,191, 25,126,240,112,114, +128, 90,181,219,150,127,127,251,216, 66, 89, 0, 91,209,249, 31, 52,202,201, 8, 44, 58, 25, 33, 37, 41,176,172,252,254,253, 59, +164,117, 6, 42, 88,255,252, 1,138,136, 98,104,252,241,227, 15,184,151,253,239,231,207,191,159, 63,127, 7,230, 2, 32,251,247, +239,191,192,146, 31,216,135,103, 96, 98,252, 15,202, 36,140,127,254,125,253,254,227, 47,190,116, 9, 47, 63,161, 69, 38,188,189, + 9,225, 51, 82,177,201, 9, 4, 92,176,197, 49,200,229,166,146,146,210,231,207,159,129, 62,133,100,108, 34,155,156, 10, 34, 34, + 16, 46,144,193, 72,213,129, 5, 92,163,156,255, 63,127,174,173,173,253,249,246,237,111, 72,117, 11, 46,187,129, 93,120, 95, 95, +223,167,175, 94, 73, 83,117,221, 15,188, 63, 14, 31,232, 68, 3,198,198,198,144,249, 34, 6,208,186, 78,116,217, 63, 63,127,125, +248,245,238,199,143, 31, 2,252,252, 28,192,164,248,247, 15, 48, 96, 33, 53,241,239,223,191,129,213, 53,254,112, 6,182, 43,225, +115, 68,200, 61,119,228,185, 35, 82, 1,183,168, 57,176, 5, 66,134, 70,226,199, 58,237,119,191,126,165,176, 6,216,240,100, 84, +212,147,159,127,254,205,143,127,192,222,250,175, 35, 27,110,222,187,143, 43,129,124,255,243,235,236,241, 83, 19,122,250,173, 28, +108,106,154, 26,118,110,223,185,116,209, 98, 75, 59, 27, 89, 5, 57, 22, 46,214,189,135,247, 46, 91,184,120,221,134,181, 91,183, +110,245,246,246, 30, 78, 69, 39, 64, 0, 49, 97,150,155,192, 14, 59,136, 35, 99,208, 50,127, 7,164,220, 4,130,190,229,251, 24, +101,241,207,244,125,184,245,225, 17, 11, 59,131,135, 95,225,178, 73,192,138,241, 23,195,183,159,127,191, 51,108,216,127, 97,207, +233,107, 32,243,228, 20, 65, 69, 18, 14,224,165,207,248,251, 7,195,166,173, 59, 76,220,114, 65, 77, 78, 6, 86,102, 78,134, 48, +159, 80, 47, 59,127,160,236,147,135,119,255,255,254,139, 99, 26,225, 31,184,225, 9, 76,234,191,126, 0,219,126,223, 65,115,219, +192,114, 4,216, 4,251,244, 17, 88, 35,126, 6,118,225,191,125,251,134,101, 36,235,235,191,239,223,255, 0,209,215,175,191, 62, +127,254,241,233,243,247,207, 95,126, 0,187,234,159, 62,254,248,252,249,231,231, 79, 32,244,241,227,207,143, 31,190,191,127,255, + 29,231,252, 5, 24, 67,166,247,193, 69, 38, 35,188,125, 72, 76,111, 29, 8, 52, 45, 53,143,110, 59,186,115,223, 78, 72, 73, 10, +108,129,226, 81, 12,236, 63,178,192,194,176, 11,188, 54,168,162,162, 2, 88,110, 50,192,150,239, 16,223,228, 20, 23, 71, 89,140, +157,157,157,189,245,208,161,103, 68, 76,148, 99, 5,192, 38, 39,254,194, 23,216,180,132, 48, 86,174, 92,121,231, 5,104,153,196, +150, 3, 7,224,130, 55,111,222, 20, 21, 21,165, 81, 18,135,148,143,233,233,233,112, 17, 8, 27, 94,110, 98,175,162,248,120,129, +189,242, 79,239,222,131, 22,153,125,120,255,245,219, 55, 32, 2, 38,166,175, 31, 63,125,254,240,225,199,247,111,191,126,252, 0, + 38, 59, 92,218,145,203, 71,120,185, 9, 97, 35,207,182,227, 7, 95, 94,159, 4,118,210,225,220,111,239, 46,208,186, 56,120, 30, +174, 0, 44, 49,129,229,230,207,131,107, 30, 38, 26, 2,203,205,195,174,162,127, 62,190, 54,217,241, 10, 71,127,157, 1, 88, 7, +167,230,103,222,185,121,243,248,129,195,252,188,252,145,225,145, 2,194, 66,231, 78,157,225, 97,227,224,230,230,150, 84,144, 90, +190, 98,121, 69,117,213,151, 15, 31, 6, 97,241, 7,191,215, 8,142,136,215, 11, 16, 64, 44,152,229,102,172,147, 17,195,215, 75, + 12,111,239,213, 38,149, 52, 78,152,205,196, 15, 26, 8,183, 17,122,247,255, 49,254,152,227, 1,198, 53,144,186,120,105,179,190, +129,111, 93,205,162,141,235,250,118,237,191,238,104,169,205,194,194,190,251,240,185,255,192, 30,241,223,191,248, 93,227, 97,168, +177,227,236, 13,134,222,142, 16, 95, 47, 31, 31,223,157,251,214,255,249,253,195,219, 61,146,233,239,111, 86,102,102, 28, 99,157, +255, 33,173, 84,232,138,164,127,255,152, 65,157,119, 38, 80, 35, 20,216, 4,251, 7,157,129,199, 54, 9,192,198,200,248,157,149, + 21,180, 6, 30, 92, 0, 51,252, 5, 53, 81,129,232, 63, 35,243, 31,144, 94, 6, 96,147,147,225,215,159,127,192, 86, 39,151, 32, +206, 22, 39, 50,139,145, 17, 82,132, 49,162, 78, 39,225,108,114, 2,203, 77,104,203,104,193, 30, 32, 2, 50,128,197, 40,131, 23, +190, 32, 2,251,151, 97,205,154, 53,144, 84,171,168,168, 8,105, 92, 3,155, 66,192, 86, 39,193,162, 19, 88,110, 66,154,156,138, +212, 43,170, 88,193,221,124,111,123,156, 83, 31, 86,186,186,192, 46, 57,176,105, 9, 44, 34,129, 45,208, 0, 23,208,250, 24,117, +117,117,184,224,195,135, 15, 69,216,217, 37, 96,173, 96,204,177, 78,120,107,186,164,161, 1,238, 71,130,163,156,112, 16, 26, 26, +186,122,245,106, 96,137, 57,115,230, 76, 72,185, 9,108,114,226,215,242,254,205, 71, 70,134, 63,160,193,158,151,223,216, 56, 56, +128,157, 24, 72,171,243, 59,176,118,253,250,245,231,207,159,192,178,192, 35, 58, 26,151,118, 72,249, 8,233,179,155, 27,233,157, + 60,119, 9, 46,133, 54,244,137,115,146,232,245,201,147, 7,214, 59,123, 69, 64,139,209,143,183,111, 94, 58, 74, 70, 99,147,248, +222, 58,168,127,240,238,235,163, 20,211,255,247, 47,137,205, 62,247,245,207,255, 79,209,138,252,203,238,127, 74, 20, 6,150,155, + 76,184,171,198,236,156,156,218,142, 22, 49, 97,145,223,255,254,222,126,124, 47, 58, 50,106,209,146, 37, 27, 55,108,138,138,142, +250,249,227,231,225, 51,199,190,127,255,146,150,144,176,247,248,113,172, 51,189, 3, 94,122, 34,223,153, 74,252,253, 72, 0, 1, +196,130, 54, 77,164,154,208,122,130,129, 65,247,250, 37,134, 51,235,255,235,122,255,190,184,182,177,177,145,145, 95,186,190, 48, +245,255,148, 32,160,154,215,223,255, 97, 53,232,224,129,141,246, 14,206,160, 34,233,223,239, 59, 31, 30, 49, 48,252, 85,225, 83, +116,116,212, 19, 23,145,120,251,241, 19,168, 81,250,235,207,243, 15, 95, 53,177,233,149,145,179,124,242,232, 56, 56,182, 89, 60, + 64,235,147, 88,118, 92,254,189,115,203,154,151,111,158, 9, 11,128, 38,229, 5,216, 88, 37, 5,120,112,148, 94,255,193, 5,227, + 63,200,170, 78,208,156, 17,211, 95, 96,105,200, 8, 46,195,254, 67, 87,123, 98,113,115,100, 84,254,226, 69,141,192, 76, 1,236, +182, 67,138,164,127,127,255, 3,251, 97,160,222, 24,176,120, 98,100,252, 7, 26, 54,253,255,243,247,191,252,204, 70,180,141, 92, + 72, 35,157,255,225, 28,120,161,137,160,240, 54, 60,225,229, 38, 26, 27, 84,122,226, 0,192,172, 11,204,180,192,130, 15, 82,116, +174, 1, 3, 32, 87, 89, 89, 25,104,251,196,137, 19,129,141,208,119,239,240,173,139, 46, 1,131, 29, 59,118,124,125,137, 50,247, + 5, 44, 73,239,223,191,207,128,119,121, 60,230, 26,120, 96,161, 9, 44,136,129,225,235, 99,111, 47,141,123,156, 20, 88, 38, 90, +233,233,189,125,240, 0, 88, 62,222,130,205,179,171, 74, 74, 22, 21, 21, 29, 61,122, 84, 77, 77, 77, 71, 90, 26,207,240, 46,242, +248, 38,241, 99,157,200,131,158,192,206, 59, 16,221,187, 7,109,111,194,151,121,226,153,100,231,145, 22,251,254,252, 5,176, 93, +249, 21,216,127,121,243,154,145, 17,180, 30, 13,216,127,135, 36,179,251,215,174,255,254,245, 19,207,244, 58, 74,143,202,209, 30, +136,224, 83, 67,196,116,216,191,188, 57, 5, 44, 55, 65,206,224,230,222,136,212,240, 52,177, 13,164,105, 57, 98,178,253,213, 25, + 79, 6, 3, 99,151, 87,217, 86, 18,211,142, 1, 75, 82, 65, 54,198,183,239,222,179, 48, 50,178,224,237, 67,197,197,197,193,217, +155, 55,111,246,242,246,220,178,105,203,170, 85,171, 26,170,107,119, 29,216,203,204,194, 44, 45, 35, 13, 12, 72, 6,182, 65, 87, +116, 50,144,123, 79, 31, 64, 0,177, 32,149,155,191, 85, 19,218,160,227, 68,167,254,116,154,177, 48,204, 79, 97,208,118,174,183, + 48, 96,248,246,224,127,147, 9,195,251,167, 95,127,255,223, 96,132,189, 84,190,121,235,215,145, 19, 32,237,255,152, 57, 32,157, +203, 59,159,158,215,229, 36,125,251,246,243,211,119,208, 88,231, 47, 38,118, 39,143, 16,172,122,107,171, 19,118,108, 5, 47, 48, +254, 11,217, 59,252,199, 67,151, 49, 34,171,143,139,139,157, 15, 60,214,201,250,239,135,180, 40,142,156, 9,218, 89, 2, 42,248, + 32, 13,147,127,140, 32, 8,217, 95, 4, 42,183,254,227,235,197,126,251,198,249,253,251,103, 96,195, 19,216,238, 4,150,150, 64, + 67,192,173,206,127,223, 64, 91, 40, 24,129, 34,191,129,205, 56, 38, 70,108,118,130,203,196,255,240,210,243, 63,114, 11, 20,214, +220, 4, 41,137, 73, 12,196,181,127,246,250,241,235, 36,143,247,255,255,255,253,251,119, 93, 93, 93, 96, 39,253,193,131, 7,171, +192, 59,109, 32,197, 40, 4,116,116,116, 16, 44, 61,129, 32, 35, 35, 3, 83, 48, 56, 62,158,129,136,229,241,144,237, 61,200,192, +215,193,129,224,252,146, 4,108,129, 4,114, 11, 20,216,216, 52, 81, 87,103,251,250, 21,191,151, 41,201, 21,200,229, 35,242,170, + 88, 6, 34,246, 26,113, 74, 74,124,187,125,231,239,159, 63,159,222,127, 0,183,232, 65, 21,240,251,151,175, 62,189,127, 15,116, + 21,158, 38, 39,218,160, 39,176,147,142,188, 32, 9,121, 24, 20, 71,186,188,120, 98, 63,100,198,149, 97,227,106,208,178, 36, 35, +251, 8, 33, 49, 3, 90,150, 30,255, 81, 74, 79,134,217, 6, 25,117, 47,254,253,211, 95,112,234,148,135,184,246,150,151,192,114, +147,151,149,216, 21,202,192,200,221,119, 96,159,147,171,243,166,181, 27,154, 59, 59,202, 63,126, 4,182,104, 86,174, 92, 43, 34, + 34,242,232,211,240, 25,235, 4, 8, 32, 68,209, 9, 47, 55, 65,227,247,241,160,149,240,160, 1, 53,134,189, 12, 87,247,194,219, +164, 32,101,122, 56,205, 18, 21, 50,244, 74,136,251,251, 31,222, 60,252,255,229,235, 39,102, 22,126, 6, 38,174,178, 30, 2,107, +182, 61,188,117, 54, 76,173, 96, 96,250,198, 0,107, 32,242,240,240,255,253,253,158,225,255,215,135,199,102,153,232,201,225,157, +165, 1,109,227, 1, 22, 96,160, 62, 54, 35,120,204,145, 17, 54,220,136,145, 50,144, 65,122, 70,217,148,201,109,159, 63,127,100, + 97, 97,130,205, 56,129, 90,157, 95,190,252, 2,246,211,129,165, 49, 51, 11, 83, 87,251, 4, 76,141,158,254, 22, 64,114,231,230, + 19,127,193,163, 93,255, 33, 78,128,206, 10, 65,109,143, 79, 9,193,227,223,148,230,148, 7,119, 31,144, 17, 97,192, 86,231,123, +240,220, 52,176,203,105,102,102,246,250,245,235,187,119,239,130,150,203,252,251,183,118,237, 90,130,165,103, 78,124, 60,167,152, +152, 15,182,206,117, 14,184,232,228,196, 93, 8,150,130, 27,164,104,122,165, 81,199, 76, 9, 2, 96, 11,212, 26,220, 2, 21,227, +228,212,177,178,162,105,226, 70, 43, 25,129, 33,134, 54, 95, 68,176,244, 20, 86, 85,249,252,254, 61, 11, 59,219,207,159, 63,254, +254, 6,166,137,127,188,130,130, 31,223,189, 3,150,155,248,155,156,240, 37,241,144,129, 78, 96,135, 29, 88,116,194, 71, 57,113, +173,144, 87,147,124,255,230,237,155, 85,171, 17, 75, 0,195,162,147,223,253, 82, 37,173, 20,196,232,161, 99,136, 48, 18,108,123, + 50,108,135,110,163, 84,217, 8,221,191,247,241,247, 95,226,221,224,228,224,116, 81,240,162,155,183, 71,106,108,178,158,190,238, +166,141,155,143, 95, 56,155,150,150,246,136, 6,199,112, 80, 2,208,110, 78, 38,233, 34,101,128, 0,194,185,155, 8,178, 80, 9, + 82,128, 34,139,224, 7, 58, 58,214,147, 38, 45,202,203,143,148,150, 7,198,247, 79, 86,118,142, 39,207, 63,217,251,198, 17,227, + 20, 67, 67,165,132,132,176, 5,243,214, 49,252,123, 8,236,179,255,249,241, 93, 90,146, 95,142,239, 15,193,134, 24,176,172,250, + 15,130, 12,144,182, 31, 35,168, 25, 8,110,131, 18, 97,105, 78,110, 21,144,172,170,204, 99,102,102,250, 15,234, 17, 3, 27,158, +127,191,124, 1, 21,156, 76, 76,140,211,167,227, 59, 81,198,221, 23, 84,128,110,219,112,244, 63,162,224, 4, 37,202,228,244, 72, +130,246,126,252,242, 17,235, 22,117,130, 0,152,123,129, 13, 79, 96,207,253,211,167, 79,204,204,204, 64,134,132,132,196,239,223, +191,145,215, 45, 2, 75, 79, 92, 59, 50, 33,205, 67, 65,178, 22, 33, 9, 65, 42, 35, 18,203, 74, 76, 32,142, 99,137, 46, 46, 64, +246, 88, 39, 90,153,136,117,158,157,224,194,120, 5, 51, 83, 32,121,227,224,193, 31,223,190,255,251,251, 87,211,216, 88,215,202, + 14,216,157,199,155, 40, 25, 31,222,191, 11, 26, 89,102, 96, 72, 10,130, 14, 93, 3, 69,144,217, 88, 23,176,221,122, 14, 76, 18, +130,225,209, 41, 15, 31,191, 56,113,104, 11, 80,100,213,210,185,230,118, 62,188,226, 54,196, 4, 84, 24,104, 67, 23,225,125,150, +127, 25,217,177,138, 63, 10,148,216,254,236, 7,181, 74, 37,125, 48, 56,115,230,204,222, 19, 7,133, 69,132, 7,243,129, 53,228, +221,255, 14, 16, 64,132, 55, 98,146,106,162,178,134,233,214,157,119, 2,188,185,196,164,101,223,125,254, 99,239, 29, 75,188, 94, + 75, 83, 13, 75,211,170,244,244, 58, 6,134,151,130,188, 44,114, 66,255, 8,107,137, 14,167, 60,236,218,218, 39, 1,201,188,188, +220,223,191,126, 1,251,233, 92, 92, 92,253,253,253, 68,234,245, 10, 0,157, 5,181,117,253, 17, 70, 70,166,180,172, 24, 58,196, + 52,176,236, 0,182, 61,127,253,250, 5, 41, 80, 32, 69,201,112, 61, 75,137,224,254, 78,226, 1, 49, 39, 36,225, 2, 26,246,246, +196, 43,126,126,239,166,185,170, 12,217,118,189,253,165,194, 35,174,226, 18,106, 67,170, 70, 92,231,122, 32, 1,166, 63,140,236, +223,153,176,207, 16,222,253,252, 71,141, 23, 79,129, 64,206,242, 53, 19, 19,147,193,156,186, 48,231,133,136, 31,247, 4, 8, 32, + 70,242,134, 72, 71,193,192, 2,206,159, 55,190,163, 30,169, 57, 10, 70,193, 40,160, 39, 0, 8,160,209, 83,226,135, 36, 24, 45, + 55, 71,193, 40, 24, 88, 0, 16, 64,163, 69,231, 40, 24, 5,163, 96, 20,144, 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2, +146, 1, 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8, 32,154, 92,235, 54,170,119, 84,239,224,212, 11,217,139, 57, + 26, 86, 35, 92, 47, 85, 0, 64, 0,177,160, 37, 44, 98,244, 96, 77,124,148,232, 29, 5, 36, 1, 92,249,127, 20,144, 17, 80,184, +212,176,255,253,255,147, 25,177, 28,231,209,163, 71, 79,159, 62,101,103,103, 23, 17, 17,145,147,147,163,155, 23,224,231, 99, 13, +230, 28,244,234,213,171,167, 79,159,226, 87, 35, 45, 45, 45,134,109, 53, 49, 37,122, 7, 22, 0, 4, 16,250, 50, 46,130,251,222, +240, 28,144,131,166, 23,243, 0, 52,154,158,108, 70,255,108,137, 95, 65, 65, 65,129,166,166, 38,217,218, 67, 67, 67, 93, 92, 92, +112,105,164, 86,233,233,238,238, 14, 36,119,238,220, 73, 7,189, 95,191,126, 93,187,118, 45,228, 90,183,224,224, 96, 67,220,183, + 83, 96,250,151,224,181,110, 51,102,204,192, 90, 79,227, 15, 40, 60,178,240,114, 19,152,183,127,254,252, 9,180,130,131,131,227, +199,143, 31,192, 50,244,244,233,211,250,250,250, 42, 42, 42,184,140,181,182,182, 38,232,175,231,207,159, 3,139, 69,130,202,128, +229, 38,228, 80, 65, 98,194,138,152,181,189, 97, 97, 97, 88,211, 21, 90,154,148,151,151, 7,146,159, 63,127, 6,250, 29, 18,119, +120,210, 36,176,236, 43, 42, 42,194, 99,233,251,247,239,205,205,205,177, 6, 53, 80,175,150,150, 22, 30,189, 47, 95,190,172,173, +173, 29,132, 21, 6, 64, 0,177,140,182,197,200, 6, 27,103,120,224,146, 10,200,220, 65, 73, 3, 28, 87,193,186,103,207, 30,100, + 54, 60, 29,223,191,127, 31,114,173, 27, 73, 33,112,249,242,101, 72,241,135,108, 20,169, 32, 35, 35, 35, 59, 59,155,152, 43,104, + 32,247,106,196,197,197, 1, 51, 82,111,111,175,130,130,130,160, 32,225,253, 84,192, 50,107,251,246,237, 16,182,135,135,199,142, + 29, 59,176,178,241, 4, 50, 60, 97, 0, 25,198,198,198,240,203, 68,137, 73, 48, 31, 63,126,132,180,119,128,101, 52, 39, 39, 39, +176, 24,253,240,225, 3, 63, 63,255,169, 83,167,128,130,120, 74, 79, 29, 29, 29, 96, 65, 3, 47,242,144, 91,142,144,131,253, 79, +156, 56, 17, 21, 21, 69, 76, 8, 19, 89,110, 66,192,132, 9, 19, 40, 79,216,220,220,220,215,174, 93, 99,101,101,253,245,235, 23, + 48,144,111,223,190, 93, 89, 89, 73, 80,215, 75,164, 3,101,108,109,109, 15, 31, 62, 12,231,190,121,243,134, 72,141,152,224, 1, + 81, 39,234, 83, 4,200,187,214, 13, 32, 0,115,103,140,194, 48, 8,133, 97,208,169, 7,112,234, 53,186,123, 16, 23,175,224,238, +216, 91,137, 55, 40,120, 28,215,126,228, 5,145,180, 77,172, 29,154, 55,133,192, 11, 34,143, 47,127,134,248,157, 20,157,165,148, +193, 84,114,158, 47,217,235,237,190,190, 72, 31,113,162, 93, 44,193,251,217, 97,163,117,131,119, 41, 37,224,178, 57,216, 98,176, +154,214, 77, 76, 27,223, 22,121, 51,231,220,180,110,135, 59, 79,222,148,243,117, 68,235, 6, 61, 71,226,231,239, 90, 55, 22,198, +222,246, 90, 55,230, 4,174, 29, 46, 24,196, 3,119,165,148,247,158,188, 73,176,189, 44, 90,183, 90,171,214,154, 71, 25, 99,192, +232,219, 94,225, 99,203,149,211, 30, 20, 26, 89,237,120,240,164, 66, 8,114,209,254,136,123,189,243,169, 8,155, 96, 46,198, 8, + 61, 25, 12,107,237, 32, 55,251,130,155,206,185,158,158, 18, 93,119, 6,233,143,168,153,214,186, 61, 5,224,238,236,109, 24, 6, +129, 48,106, 9,101, 2,216, 40,161, 98, 1,118, 97, 31,246, 96, 32, 40,169,243,236, 83,144, 18, 37, 4,156,159,194, 87, 32,100, +137,107,128,231,239, 40,238,251, 38, 58,219,229,239,124, 25, 12,142, 41,114,102,150,158,108,216,177,223, 1,155,122, 2,118,214, +218,229,190,109,210, 84, 32, 57,151,181,221,239, 69,108,221, 24,119,152, 23,158,183, 32, 21, 25, 70,236, 15, 5, 70,251,228,231, + 39,241,212,214,237,173,208,174,181,106,173,189,247,104,207,156,243,233,230,235,198, 4,134,150, 82,168,220, 59, 73,224,102,251, +165, 9, 58, 69,123,110,221,233, 71, 53, 62,196,100,173, 44,252,195,193, 70,226,165,148,156,115, 48,212, 24,195, 28,110,130, 81, + 10,118,165,212, 32, 55, 67, 8,114, 25, 31,180,231,171,136, 49,118,132, 39, 21, 61, 91,240,107,110,138, 43,209,148,173,219, 85, + 0, 81,179,232,196,236,102, 18, 57,119, 68,173,210,211,203,203,139,212,182, 39, 65, 23, 18, 52, 42, 56,103,231,218, 41,238, 3, + 53,206, 0,207, 87,100, 52, 57, 33,141, 77, 96,121, 7,108,183, 2,211, 46,217,247,190, 66, 52, 2, 75, 79, 92, 30,129,140,114, + 50,128,175,117, 3, 54, 51,225,103, 59, 66,174,117,131, 8,226,137,104, 96,127, 28, 62,110,238,233,233, 9,111,135,226,233,167, + 99,214,223,104,215,186, 1,131, 29,222,115,199, 10,238,220,185, 3,108,111, 2,203, 11, 32, 3,104,227,205,155, 55, 33,135, 6, + 64,174,117,251,251,247, 47,176, 96, 93,191,126, 61,158, 66, 16, 94,110, 2, 91,184,104,229, 56, 73,125,112,160, 98,136,131, 73, +109,126,146, 1,126,255,254,109,100,100,116,224,192, 1, 19, 19, 19, 96,172, 65,134, 68,128, 92,119,119,247, 63,127,254, 16, 83, +110, 2,201,214,214, 86, 92, 61,247,193, 9,224,183,185, 1, 25,196, 31, 20, 15, 16, 64,212, 44, 58,169, 62, 77, 68, 70,233, 9, +108,194,144,212,246,132, 36,202,165, 75,151,162,137,111,219,182, 13, 40, 72,164, 33, 39,238,107, 89, 40, 94, 35,175,159, 14,105, +158, 0,243, 3, 25,231,119,160, 93, 79, 68,204,180, 3,114,147, 19,237, 90, 55,242, 26,158,112, 19,240, 92,235, 6,111,102, 2, +115, 35,208,193,170,170,170,160,251,120,217,217,129,189,221,150,150, 22,130,109, 79,228, 49, 77, 92,227,158,100, 84,138,192, 34, + 12,174, 6,179,149, 1,108, 84,242,242,242, 2,201, 99,199,142, 1, 11, 80,200,133, 87,240,107,221, 64, 55, 87, 19,186,214, 13, +179,147, 14,175,231,128,145,245,138,196,187, 76,128, 73, 17, 18,221,100, 84,180,196,159,101, 3,140,136,210,210, 82, 72,142, 3, + 90, 7,236,173, 51,128,142, 52, 51, 4,214, 28,196,204,113, 83, 82, 74, 66,138, 93, 42, 26, 72,107, 0, 16,128,185, 51, 72, 1, + 16, 4,162,104,184,244, 44, 46, 58,130, 23,240, 72,222,197,195,120, 40,151, 61,154, 16, 65, 10, 53,147, 90,132,132,109, 10,223, +252, 63,147,205,223,203, 68,107,232,201,124,113, 25,217,182, 52,114, 19,201, 57, 87,167, 15,115,115,235,169, 39,136,228, 52,230, +234, 66,202,224,165,240,108,204,114, 98,253,188,247,112, 83,174,239,103, 75, 97,136,233,156,139, 49,114,158,158,220, 16,213,121, +215,214, 45,135,171,250,187, 63, 88, 9, 55, 83, 74,240, 29,202, 75,243,146,220,214,141,193, 51, 55, 37, 28,214,206,189,172, 29, +245, 30,195, 55,182,231, 58,137,100,184,117, 86,144,214,218, 90,203, 19,224,149, 17,219, 66, 8, 74,125,187,125, 6, 74,102,179, + 47, 11,112, 1, 55,229,207, 73, 40,205,210,176, 55,230, 58, 15, 1, 52,216,119, 19,145, 49,226, 9, 4,196, 55, 24,225,217, 12, +222,203, 32,190,220,132, 0, 35, 67,131,189,251,246, 47,219,199, 5, 41, 73,129, 45, 80,146,156, 10,204,192,123,192, 0, 82,146, + 18,209,114,132,230, 88,180,107,221, 72, 29,229,196,188,214,109,205,154, 53, 16, 41, 50, 0,193,107,221,128,217, 15,194, 88,185, +114,229,133, 11,160, 75,174, 86,172, 88, 1, 23,164,233,181,110,240,249,116,180, 26, 11,127, 51, 31,216,228, 4,150,143, 64, 23, +190,121,243, 6, 72,126, 3,131, 47, 95,190,124,250,244,233,227,199,143,192, 22, 40,176,213,249, 23,247, 93, 91,200,145,130, 54, +185, 71,252, 0, 11, 48, 49, 32, 59,155,248, 94, 5,217, 96,225,194,133,192, 18, 19, 88,110, 94,187,118, 13,216, 79, 7,150,155, +117,117,117,192, 90,173,178,178,146,152,162,211, 22, 27, 32,169,244, 4,102, 67,186,149,155, 40,163, 58, 36,222,233, 6, 4, 0, + 1,152, 59,131, 20,134, 65, 32,138, 10, 30,193,211,184,108,175,144,133,155,120,194,210, 22,114, 45,113,233,190, 47,177,136,104, + 91, 38,134,150,206, 34, 59, 3, 25,225,241,255, 68,252,127,250,155,232, 8, 55,233,254,128,169,201,206, 29,249, 41,231, 38,160, +132,155, 79, 79,122,187, 95,183, 76, 4, 48,170,206, 39, 92,166, 68,114,150,112,177,203, 86, 74,116, 78,104, 37, 84, 19,235,182, +139,155, 89,114,190, 20,152, 99,194, 51, 3, 23,207,254,182, 81,211, 84,199,186,205,243,122,171,105, 19,235,230,189,255,210,172, + 83, 13,197,186, 25, 99, 98,140,104,204, 16, 2,170,179,196,186,165,148, 96, 40,220, 4,160,205, 16,179,174, 98, 8, 84,119, 59, +253,135, 85,189,171, 40,174,191, 63, 27, 47, 20,155,114,183, 78,225,208,217, 14, 62,208, 90,203,147,166, 57,231,150,101,209, 90, + 75,208,121, 92, 57,230, 55,252,222,167,215,170, 83, 88, 15, 1,152, 59,131, 27, 0, 65, 24,138, 46,208, 17, 72,152,133,196,141, + 88,151, 19,147,248,245, 39, 77, 5, 36,149, 3,177, 39, 66,244, 98,241, 81,236,143,255,191,109,162,157,220,180,244,252, 84,111, + 14,199, 23, 61,125,245,230,112,108,197,155,195,120,179,117,163,181,198, 28,166,106,235,214,204,131,152,180,117,155, 40, 69,122, + 13, 60, 65, 12,166,128,155,122,252,239, 3,121,140, 49,210,193, 13,232,100,159,221, 78, 90, 83,176,118,163,120,234, 58,253,223, + 58,237, 34, 68, 78,177, 33,225,193,114, 65,170, 80, 97,146,235, 16, 66, 41,133,127,227,199, 9,157,236, 86, 91, 55,118,141,156, +245,254,113,135,214,140,158,187, 20,148,184,216,190, 68,203, 34, 39,103, 80,135,148,115, 70,201,153, 82, 2, 73, 69,164,214,234, + 68,167,178,143, 37,200, 26, 1,119,114,147, 29,246,166, 77,228,236,176,159, 2,136, 5, 51,165,146,237, 14,180,120, 69,174, 51, +145,171, 98,218,149,155,192, 8,163,112, 1, 7, 73,218, 31, 63,121,129, 75,138,147,147,139,160,118,172, 3,112, 68,102, 69,252, +215,186, 17,108,138, 98,189,214, 13,178,246,152, 96,179, 23,179, 58,204,205,205,197, 83,110, 66,128,144,144, 16,100, 40, 19,216, +130, 67,110,108,214,212,212,224, 79,114, 20,174,235, 68, 46, 31,209, 86,191, 18,172, 41,237,237,237,183,109,219,246,231,207,159, + 15, 31, 62,192, 47,106, 6, 54, 66,129, 92, 32,155,200, 81, 75,200, 64, 39,242,130, 36,228, 97, 80,252,229, 38, 60,180,233,185, +222, 14, 82,122, 2, 83,209,193,131, 7,129,209,212,222,222, 14,172,107,129,141,110, 14, 14, 14, 98, 6,100,200,104, 57, 34,235, + 29, 66, 0, 32,128, 88,240, 23,127,184,122, 34,180, 6,100,148,155,116, 78, 97, 45, 45, 45,248,247, 72, 16,172,102,200, 30,186, + 2,150, 53,202, 96,224,236,236, 12, 52, 4,235,181,110,184, 74, 79,200,213,108,192,108,143, 60,214, 9,105, 82,149,149,149,225, + 47,167,176,234, 37,181,131, 79,100, 99,147, 90,221, 32,228, 36,129,121,173, 27,254,210, 19, 24, 44,222,222,222,192,214, 19, 27, + 27, 27,176,135, 14, 44, 61,129,129, 44, 32, 32, 0,204,234,184,182, 36,162,229, 35,248, 4, 17,208, 94,160,122,120,222,193,149, +203, 32, 73, 2,109,235, 17,169, 99,217,152, 61,116,146,250,236,144,210, 19,190, 12, 62, 43, 43, 11,194, 0,182,190,241,104,121, +246,236, 25,242,186,247, 21, 43, 86, 16,220,153,142, 75, 47,253, 1,218, 52, 17,145, 0, 32,128, 88,168, 88, 50, 98,234,165, 79, + 57, 75,255,114, 19, 8, 68,193,128,108,237, 74, 96, 64,185, 51,224,230, 32, 55, 6,129,165, 39,174,208, 32,123,195, 37,133,122, +177,182, 64,137, 4,100,143,117,162, 5, 2,214,102, 62,193,100, 3,236,202, 0, 43,167,253,251,247, 67,110,211, 51, 48, 48, 8, + 11, 11, 35, 24,119, 39, 78,156,128, 55, 93,225, 34,200,108, 92,177, 9,175, 86, 33,101, 46, 48, 7, 17, 44,166,225, 32,140,178, +123,156,200,206, 65,210,210,210,129,129, 4, 46,136,111,110,110,166,186, 94,202, 1,252,110, 34,228, 66,147,200, 25,118,128, 0, + 98,161, 86,233, 51,122,150,207,192,130,225, 26,254, 84,244, 23,217, 70, 65,218,248,196,171, 7,182,169,137,220,159,142,167, 58, + 36,163,162,162, 86,221, 70, 42, 16, 19, 19, 35, 59,108, 41,209, 75,221,210,147,164,114, 19, 8, 0, 2,104,244, 90,183,161, 10, + 70,111,118, 27, 5,163, 96, 0, 1, 64, 0,141,158, 18, 63, 84,193,104,185, 57, 10, 70,193, 0, 2,128, 0, 26, 45, 58, 71,193, + 40, 24, 5,163,128,100, 0, 16, 64,163, 69,231, 40, 24, 5,163, 96, 20,144, 12, 0, 2,104,180,232, 28, 5,163, 96, 20,140, 2, +146, 1, 64, 0,209,240, 90,183,209, 43,180, 70,245, 14, 81,189,155,253,166, 16,175,215,119, 83, 14,181,244,110,244, 37, 65,175, +255,102, 20,189, 62, 54,210, 12,224,181,168,191,127,255,190,127,255,254,175, 95,191, 88, 88, 88,158, 60,121, 18,201,175,176,243, +204,153,239,122,178, 22, 22, 22,204,204,204,144,165, 93, 91,142, 60,165, 86, 88, 65,236,133, 3,200, 6,135,171, 87,175, 74, 73, + 73,189,123,247, 14, 72,114,114,114, 50,192,182, 54,160,217,139, 85,239,227, 43, 75,210,109, 31, 45, 59,163,198, 34,230,198,195, +203,135, 75,239,128, 95,235, 6, 16, 64, 36,108,196,196,191,177,129,146, 43,180,208,128,196,137,107,119, 94, 61,231,100,227, 80, +231,226,191, 99,167, 67,183,106,100, 72, 92,161, 53,216,192,205,155, 55,251,251,251,123,171, 64,236, 13,135, 65, 59,240,240, 40, +126,240,228,241,211, 39, 79,110,222,184,241,254,253,123,121,121,121, 30, 94, 94, 15, 87, 55,252,230,239,222,189,155,160, 27,214, +172, 89, 67,124, 76, 65,118, 82, 97,189,203, 8, 31, 8,125, 7,166,254,131,206, 16, 88, 45, 68,130, 70,227,126, 6,165,120,112, +242, 90,192,112,182,136,228,240, 13,121,131,176,119,141, 8, 30,133,192,114,231,235,215,175,187,118,237, 2, 38,227, 80, 86, 97, + 9, 89,209, 31, 95,191,115,126,251, 99, 93,146,106,231, 27,190,101,238,140,205,123,247,186,185,185,209, 33, 73,252,253,251, 23, +232, 6,125,125,125, 53, 53,181,115,231,206,253,248,241, 67, 85, 85, 21,243, 8, 74,172,224,207,159, 63, 23,207,156,151, 73, 54, + 44, 51,211, 62,177,171,103,237,101, 7, 85, 29, 39, 34,245,210, 25, 0, 4, 16, 81, 69, 39, 49, 91,209, 41,185, 66, 11, 14, 84, +207,221, 21,124,251,133,145,225,255,175,191,204,191,223,125,121,242,230,227,131, 41,103,121, 28,205, 69,180,241,205, 38,159,221, +159,174, 1, 93,117,199,188,126,215,191,195,167,255,167, 69, 48, 0, 69,138, 90, 73, 43, 4, 73,186, 66, 11, 87,153, 75,235,195, +104, 65,185, 56, 20,180, 88, 90, 72, 8,203, 86,247,119,239, 92,192, 65, 45, 72,159, 37,126,176,114,243, 63,184,220,180, 59,114, +228, 8,158,162, 83, 79,127,215,179,103,107, 23,205,135,114,111,221,184, 9, 36, 83, 18,215,125,252,146,243,249, 3,190, 10,114, +229,202,149,248,157, 65,228, 1,230, 88, 83,114, 70,122,250, 12,226,138, 93,228,139,228, 72, 0, 74,241,136, 99, 56,200, 40, 58, + 97,190,195,115, 74, 19, 4,220,189,123,247,192,170, 85, 77, 46, 97, 6,209, 89,108,226,130, 12, 44, 76, 12, 12, 76, 12,255,254, + 51,252, 99,253,247,243,191, 87,124,218,163, 73, 29,199,142, 29,179,178,178,162,117, 49,196,196,196,100, 96, 96,112,224,192, 1, + 96,233,105,102,102,246,226,197,139,139, 23, 47,234,233,233, 17,179,201, 27,232, 89,103, 39,215,246,190, 77,229, 9,151, 45, 60, + 50, 45,204,247,148, 76,126,162,102, 26,135, 85, 47,252,202, 63, 60, 62,194,117,229, 31,229, 0, 32,128, 88,136, 77,106, 46,171, +102,134,190, 39,190,244, 36,227, 10, 45,153,187, 47,141, 56, 5,217, 36,249,255, 50,252,231,252,192,245,226,245,235, 23,159, 63, + 42,178,243,220,216,121, 4, 24, 48,162,184, 75, 79, 96, 41,121,227, 46,211,255,255, 28,127, 25,217, 3, 92,127, 7,186,125,103, + 96,248, 7,171,171, 73, 76,231, 36,150,122,240,227,109,206,156, 57, 3,228,154, 84,220,235, 60, 11, 44,131,195, 8, 22,160,100, +223,136,137,104,205, 24, 27, 99,179,130,216,237,192,183,247,242,245,172,138,132,176,139, 67,151,171,185,124, 34,163,220,236,235, +235, 3,230,147,226, 54,232, 97,224,120,242, 6,176,220,180, 48, 95,107, 97,206,208,216,136, 16,140,138, 98, 0,159,235, 63,101, +249, 42,124,165, 39, 48, 59, 65, 78, 60, 1, 22, 31,225,225,225,144, 61,251, 4,139, 18,172,237, 77,200,142, 85,184, 59, 51, 50, +136, 45, 55,201, 4,198,125, 12,176,171,214, 64, 69,167, 81, 47,195,185, 98, 26, 89,181,111,223,190,233,129,105,138, 78,174, 12, +204, 63, 25, 89,153, 24, 89,152, 24,153, 89,255,255,103,252,247,245,207,255,191,127,129,141,145,212,248,172,172,186,252,187,226, +226, 36, 45,239, 39, 3, 0,243,130,164,164, 36, 48,156, 15, 30, 60,120,227,198, 13, 87, 87, 87, 75, 75,203,147, 39, 79,106,107, +107, 19,212,123,100,239,242, 32,131,111,103, 63, 51, 71,213,127,177, 49,156,152, 83, 16,222, 83,254,161,188,103,169,146, 97, 20, +158, 98, 17, 94,188, 0,163, 24, 77, 4,127, 70, 67,187,152, 8, 49,146, 64,196,106,119,128, 0, 98, 33,178,220, 4,113, 87, 11, + 18, 83,122,146,119,133,150,194,141,103,234,108,220,108,255,255,112,246,148,254,249,246,139,163,184,149,159,141,227, 7,235,247, +175, 63,190,115, 50, 48, 62, 63,120,130, 77, 70, 18,215, 21, 90, 55,238, 50,204, 90, 1, 44, 43,191,129, 17,131,173, 41, 83,160, + 27, 35,172,244,100, 0,182, 64,103,173, 32, 42,202, 73,189, 66, 11, 82,110, 66, 10, 77, 72,185, 9, 15,174, 78, 34, 74,207,187, + 29,119,113, 73, 41, 87,224, 75,220,192,246, 38,242, 49,189,168, 82,233, 96, 41,124,199,154,189,185, 44, 89, 51,197,255, 63,195, +127, 75,161, 26,107, 23,237, 35,187,175,246,174,142, 98, 88,253,191,190,104,154,148, 58,177,205,183, 47, 15,211,165, 57, 24,190, +189,189, 10,172,240,121,197,244, 32,229,230,244,233,211,177, 42,230, 21,184, 2, 44, 55, 33,236,147, 39, 25,204,205,161,226,240, +253,117,145, 97, 83,102,204,169,102,250, 39,139,167, 75, 78, 97,126, 6,198, 44,164,220, 68, 42, 73,211,103,204,192,158, 44,153, +194,222,195, 43, 94, 70, 48,254, 23,138, 42,203, 8,233, 67,131, 40,111,212,118, 54, 83,248,123, 72,247, 26, 8,254,253, 75, 40, + 40, 40,128,136, 3, 25,192, 50,148, 73, 53, 25,106, 48, 88, 13,154, 94,150,112,116,123,145,111,181, 0,201,226,182, 23,216, 47, +150,144, 87, 96,248,247,139,137,157,129,145,133,249,207,231,143, 63,238,221,127,253,228,169,140,149, 3, 35,155, 0,227,239, 95, + 12,204, 76,157,153, 37,174,179, 26,240, 95,252, 75, 48, 24,241, 20, 43,144, 6,224,247,239,223,133,132,132,128, 53, 43, 48,180, +239,223,191,191, 96,193, 2, 77, 77,205, 15, 31, 62, 16,108,212, 3,245,202, 51,157,148,148,243,248,112,240,242,199,247,236,139, +183,252,217,118, 98, 73, 94, 40, 39,203, 55, 96,172, 97, 41, 58, 7,182, 23, 15, 16, 64, 44,248, 11, 77,208,133,215,174,176,243, +102,246,132, 49,132, 18,174,162, 33, 37,230,183,111, 75,129,161,241,227,199, 60, 96, 62, 39,230, 10, 45,177,231,239,196,196, 57, + 56,234,179,254,190,121,247,231,217, 27, 22, 54, 86, 46, 70,102,110, 32, 98,102, 17, 98,229,120,255,249,195,243,125,199,248, 3, + 61,177,234, 69, 43, 25, 15,159,254, 7, 46, 58, 25,250,170, 25,255, 51, 50, 48,254, 39,182,249, 73,234, 21, 90,200,229, 38, 58, + 0,151,158, 36, 13,149, 10,166, 65,195,252,253,172,153,196, 56,149,236,134,115,245, 20, 63, 72,161,105,165, 13,186,155, 8, 72, + 30,187, 10, 42, 64, 27,251,178,103,206, 36,182,107, 3,204,188,233,133, 87, 32, 41,222,198,198, 6, 88,116,226, 42, 55,129,192, +206,230, 52,156,109,106,202, 48,123, 54,195,254,253, 12,170,170, 64,167, 34, 90,169, 6,186,215, 47, 93,148,197, 53,118, 70,124, +231, 29, 79,235, 30,185,220, 4, 15,119,226, 12,103, 96, 83, 20, 82,250, 97,173,159,254,193,114, 44,176,153, 0, 12,135,205,135, + 80,166, 32,166,207,152, 9,241,149,130,130, 2, 48,251, 76,156, 56, 17, 34, 14,100, 0,139,206,157, 59,119, 66, 14,247,131,148, +142,104,122, 33, 77, 96,160,174,212,212, 84, 44,227,128,176,112,152, 53,123, 54,208,222, 45,135,159,162,149, 35, 44,188,188, 12, +172,204,127,191,125,184,190,109,239,210, 85,107,166, 61, 3, 89,116,170,145, 79,213,206,235,231,163,199, 87, 47,158,189,124,255, +214,199, 23, 47,174, 92, 1, 70,156, 4, 25,133, 5,228,140,106,252,101,223,179,103,207,106,107,107,123,122,122,126,253,250, 5, +236, 46,240,242,242,126,253,250,245,212,169, 83,248,147, 37, 68,239,135, 39, 71, 27,231, 63,154, 91, 32,245,238, 43, 27, 27, 11, +147,140, 32,199,139, 55,191,210,187,254,232,155, 24,203,225,238, 73, 64, 10, 80,120, 68, 99, 50,240, 0,204,106, 0, 87, 59, 20, + 19, 0, 4, 16, 19,174,212, 6, 57,151, 16, 33,186,135,168,147, 5, 32,103, 27,127,251,182, 12, 82,110,194, 71,223,240,159,121, +204,114,224, 44,255,187,207,255,216, 88,126,157,189,250,243,250,189, 31,187, 14, 51,124,255,201,246,255, 63, 23, 3, 51, 11, 3, +227,207,127,127,222,253,252, 49,109,247, 22, 92,218,251,170, 65, 77, 75, 56, 0,179, 33, 41,255,255,205, 59,255,139, 90, 73,168, +154, 32, 87,104, 49, 16,113, 96, 59, 80, 22,249,144, 77, 68,147, 19,169,244,164,195,177,222,164,130,187,231,191, 0, 67, 6, 94, +110, 2, 65, 80, 61, 43,176,231,110,227, 10,236, 76,253, 7,203, 18, 6,203,150, 45, 43,110, 99,228, 17,213, 5,134,172, 71, 96, +230,145, 35, 71,240, 40,254,199,244, 88, 90, 10,229,180, 11,125,125, 80,185, 25, 23,135,210,187,151,149,125,138,167,195, 14, 4, +192,174, 58, 51, 42,128,139,224,119, 45,122, 74, 38,178,110, 64,202,213, 16,128,201,101,196, 86, 41,195, 53,186,185,185,161,181, +239,128, 13, 79,200, 61,166, 48,151,161,235,221, 48,115, 38,176, 92,131, 24, 14,247, 38,114, 32, 64,184, 88,237, 5,230, 23, 38, + 46,246,223, 47, 30,206,172,169, 89,240,245,195,123,123, 11,136,248,220, 37, 11, 26, 74, 82,212,138, 34,155, 46,239, 91,245,254, +190,171,159, 31,145,157, 42, 96, 65, 9,204, 5,231,207,159, 71,170,108,102, 96, 29,147,129, 4,200,229,203,151,129, 61,244,200, +200,200, 41, 83,166,124,249,242, 5,114, 76, 31,176, 45,204,195,195, 19, 22, 22,102,109,109,141,171,208, 4,233, 61,190,246,214, +206,162,162,202,222,205,245, 82,215,159,178,124,252,194,252,143,145,225,237,151, 95,255,133,149, 11,171, 90,125, 2, 98,112, 86, +114,192, 10, 16,156, 97,103,130, 1, 86, 6,241, 0, 82,110, 18,185, 55, 29, 32,128, 88,176, 22,154,100, 52,227,209, 68, 32,229, + 38,114, 83, 20,207, 21, 90, 44,111, 63,188,251,207,202,246,246, 29,199,134,125,140, 44, 76, 12, 63,126,253,255,252,149,241,207, + 31, 86, 96,139,227,255,191, 31,127,255,124,254,243,139,225, 31,206,177, 45,200,116, 80, 95, 53,150,120, 1, 79, 31,145,236, 29, + 98,174,208, 66,107,114,158,233, 80,194, 44, 70,137,185,132, 11,216, 55,199,211,115,167, 58,232,154, 81,108, 33, 88, 3, 47, 55, + 33, 0, 34, 98, 41,116, 21, 40, 75,208,193, 75,151, 46, 61,116,232,208,219,183,206,194,194,123,121, 68,116,128,169,133,137,137, + 9,207, 72,252,163, 71, 12,200, 53, 8, 48,113,153,153,129, 7, 91,111, 51, 76,157, 10, 21,124,247,142,129,133, 5,231, 88, 16, +193, 97, 77,226,167,137,176, 38, 90,252, 94,206,207,207,135,183, 28,145, 11, 65,252,134, 67, 14,253,131,140,114,194, 1,164,225, + 9,148, 66, 52, 60, 81, 65,178,180,218,173,171,215,158,130, 47,127,207,203,203,155, 52,105, 18,241,246,218,254, 20,248,255,239, + 75, 74, 91,181,110, 72,200,204,182, 54,248,201,196, 51,111, 95,129,246,198, 14, 31,222,189,123, 55,208,106,112, 6,255, 70,176, +220,132,116, 35,128,129, 3,108,217, 25, 24, 24, 0,203, 80,160,198,204,204,204,199,159,177, 84, 78, 79,158, 60,241,247,247, 7, +122,109,219,182,109,144, 11, 72, 24,192,211,229, 12,224, 19,178,241,204,228, 0,197,239,221,188,208, 80,150, 36,172,186,250,252, +234,248, 75,143, 25, 31,189,100, 97,248,207,244,243,215,239,119,255,133,179,147,179,200,155, 94, 39,227,220, 97,146,202, 77, 32, + 0, 8, 32,234, 44,137,159, 9, 3,176,134,216,127,204, 57, 13,184, 26, 76,237,215,158, 60, 58,253,230,217,213,251,247, 94,222, +127,240,233,193,147,207,143,159,254,249,246,253,247,239, 63,159,255,254,250,246,247,207,207,255,192,172,243,255, 63,161,176,128, +207,167,223,184, 11, 98, 3, 27,155,224,246, 38, 83,111, 53, 57, 39,225, 19, 83, 51, 3,139, 72,120, 41, 9, 97, 35,139, 32, 23, +166, 4,154,234,239,103, 65,250,233, 16, 68,235,210, 19,220,192, 4, 7,212, 43,208,121,239,235, 26,127,151, 21,212, 3, 25,192, +166, 40, 49,237,205, 64,187, 67,192,158,132,224,137,189,253,213,160,116,111,103,103,135,167,171, 14,234,183,202,200, 42, 43, 51, +192,209,141, 27, 12,144, 67,133, 84, 85,255, 3, 11, 22, 33, 33, 16, 82, 81, 97,112,117, 39, 80, 50,194, 91,154,200, 77, 48, 8, +151,194, 68,139, 71, 13,176,172, 65, 43,254,160, 29,157,190, 62,252,171,166, 92, 92, 92,224,151,169, 33, 3,160, 32, 74,195, 19, + 21, 28,186,246, 40, 41, 57,251,236,178,101,149,149,149,152,229, 53,196,222,189,123,247, 98, 45, 23,236,180,228,230,205,157,106, + 28, 21,213,222,222,142,213,106, 96,177,235,236,236, 76,100, 49, 4,140, 83,160, 45,192,192, 1,170,135,212,139,144, 38, 39,228, + 38, 62, 76,240,251,247,239, 45, 91,182, 92,187,118,237,246,237,219,192, 30, 58,144,203, 0,190, 26, 47, 32, 32,128, 96,107,236, +231,207,159,103,215, 70,253,184, 53,121,231,193,187,247,159, 51,127,250,202,244,247, 63,195,211,175,156,217, 69,213, 4,245, 2, +235, 63,200,106, 51, 32, 9,169, 11, 33,183, 46, 3,117, 65, 24,180,203, 71, 0, 1,196,132,153,152,144,187, 39,200,221, 79, 98, +140,131,140, 13,113,113, 69, 35,207,105, 48, 16,186, 66,139,149,141, 25, 24, 88, 79,190,126,120,244,241,221,235, 79,239, 63,254, +248,241,254,215,247,215, 63,191, 63,255,241,237,233,143, 47,239,126,255,124,255,239,247, 47,212,129, 42,148,250,214, 20,251,208, +103, 74, 56,207,127, 96, 63,134,129,141,200, 57, 31,242,174,208,194,210, 85, 39,186,220,196, 63, 29, 68, 35,112,116,207, 85, 8, + 67, 67,204, 29,216, 91,135,163,222, 85, 81,140, 12,140,248,147,169,191,205,193,248, 34, 80,185, 9, 76, 33, 27,143, 58, 48,128, +143,179, 36,104,163,154,134, 58, 82,225,203, 48,101, 10,195,157, 59,160,182,103, 99,227,127, 56,192,117,147, 48,188,213,249, 23, + 12, 32, 99,157,127, 97,128,212,161, 79, 82, 1,164,121,136,214,214, 3,182, 67,129,222,199,213,114,132,183,122,176,150,185, 88, + 5, 17,195,244,236, 31, 24,153,120,230, 84,181,242,108,217, 3,204, 50,240,147,235,210, 85,117,242,141,173,184,184,184,128, 21, + 85,109,109,237,158, 61,123, 48, 79, 86,159,251,244,214,115,109, 45,105,105,233,127,255,254, 97, 45,118,177, 10,226,138,104,248, +228, 53,176,153,201, 0, 91, 12,139,245,114, 1,136,103,101,101,101, 31, 61,122, 4,108,216,170,168,168,176,176,176, 64,106, 59, + 11, 11, 11, 98,154,135,202, 26,134,179,118, 9, 92,218, 86,111,107,169,201,205,193,196,205,245,151,147,253,167,167, 63, 81, 35, +132,192,242, 10, 94,178, 83,210, 97, 39,181,201, 9, 4, 0, 1,196,132,171, 54,134, 23,160,255,119,135, 18,211,175,129, 3,200, +173, 85,144, 18, 19, 66, 18,188, 66, 75,211,202,234, 15, 15,215,251,255,127,175,125,125,127,229,227,219,171,159,222, 92,253,244, +238,218,215,119,119,190,189,127,251,243,199,151, 63,127,158,125,251,138,231, 50,172, 64, 55,198,190,106,102, 32,250,207,192,252, +159,145, 41, 45,130, 49, 53,130, 45, 57, 92, 84, 89, 89,252, 31, 3, 43, 3, 3, 35, 49,229, 38,169, 87,104,193, 21, 67, 74, 73, +204,178,114,245,234,213,196,220, 36, 3,185, 17,179,226,108, 5,164, 36,133,180, 64,105, 7, 74,194,150, 31,127,215,122,236, 42, +116,194, 26,216,228, 4,246,214, 33,236,214,236, 45, 51,112, 79, 19, 1,179, 83,127, 13, 67, 66,145,179,192,137, 61,142, 93,246, + 76,222, 12, 7, 14, 28, 32, 50, 73,200,203,203,195,217, 78, 78, 12, 2, 2,192, 70, 61,131, 39,234,156,159,137,169, 41,193,177, + 78,228,246, 38, 68,132,152, 86, 39,218, 96, 37,210, 12, 3, 81, 77, 18, 96,235, 18,237,148,117, 96,241, 71,204, 66,125,120,173, +128,204,253,135,187, 5, 0,106,166, 49, 50,254,251,246,147, 85, 66, 62,189,165, 37,129, 91, 64,224,192,113,104, 71, 62, 38,161, +161,103,206,237,190,229,117,186, 78, 97,130,138,187, 55,109,194,172,218, 3, 50,210,181,117,116, 32, 83, 88,240,170, 5, 94,247, + 32,115,177,118,207,129,197, 34,100, 22, 8, 50,184, 9, 47, 37,129,205, 76,200, 84, 12,176, 12,197,213,228, 4,202,178,178,178, + 2, 27,152,192,174, 58,176, 76,231,228,228, 20, 21, 21, 21, 16, 16,192,127, 39, 7, 92, 47, 59, 59,123,112,198,164, 5,167, 77, + 30, 60,254, 36,206,207,108,169,206,168,167,248,159,155,143,143, 97,112, 3,128, 0, 98,193, 83,156,163, 12, 25, 16,215,234, 68, +190, 66, 75, 72,104, 53, 3,113, 87,104,125,209, 87,249,118,235,214,183, 63, 63, 63,125,253,118,247,247,111,214,127,160, 14,255, +199,223, 63,254,129,211,221,182,151,247,191,254,249,141,183, 7,205, 88,212,138, 72, 22,224, 65,207,127,127, 25,126, 94,191,243, +121,222,202, 79, 68,150,155, 12, 36, 94,161, 5,114, 79,103, 24,214, 96,129, 20,163, 4, 7, 58,129, 5, 37,214, 27, 49, 25,104, +185,152, 93,213,249, 19,195,170,255,144,134, 39,100,196, 19,216, 91, 63,118, 85,187,103, 85, 84,213, 84,111,252, 14, 6,182, 55, + 97,235,240, 15,128, 7, 40, 93,254,255, 95, 13, 78, 33,255, 87,175,198,183, 28, 42, 36, 40,120,247,206, 93, 12,224,133,156,142, +142,208, 52, 5,140,219, 45, 91, 24,124,124, 64,108,115, 75, 11, 61,109, 29, 98,198, 58, 73, 93,206, 9,247, 17, 48,102,153,152, +152,144, 75, 46, 96, 51,133,152,245,240,144,193, 65,248,136, 39,164, 5,138,191,201,201,128, 52, 47,138, 60, 87, 78,240,130, 88, + 96,208,252,249,252,153, 85, 68,136,153,139, 71, 59, 56,164,201,205,181, 10,178,192,200,208,232,239,247, 31,172,194,226,186, 22, + 14, 10, 50,138,147,174, 31,215,209,209,121,126, 26,229,126,151, 12, 80,210, 5,133,108, 22,176,212, 3,175, 97,250,131, 20, 86, +192,134, 32, 80, 4,190,236,201, 27,181,121, 5, 44, 19, 33, 29,115, 72,219, 13,173, 99, 14,100,227, 41, 55, 33,206, 6, 22,148, +192, 54,230,141, 27, 55,206,157, 59, 7,140, 35,110,110,238,111,223,190, 17, 57, 40, 41, 46, 46,238,239,239,127,226,200,169, 9, +171,119,243, 49,178,169,139,255,188,243,134,219, 70,253, 55,188,108,197, 53,112, 9, 20,135,103, 88, 60, 83,237,180,104,114, 2, + 1, 64, 0,177, 16,147,242, 64,142, 32, 98,101, 18, 37, 87,104, 73,137,137, 95,254,241,224, 35,211,191, 23, 63,190, 48,252,254, +253, 23, 24, 94, 12, 12,215,191,124,120,250,237, 19, 17, 87,104,253, 7,182, 52,103,173,248, 15, 31,235,212, 80,254,195,204,240, +149,164,114,147,129,244, 43,180,192, 43,153,128,221,138, 51,240, 18, 19,216,121,135,148,155, 38, 38, 38, 4,155,156,100,223,136, + 9, 94,180,240,222,213,117, 22,230,152, 44, 68, 42, 61, 29,223,213,108,109,217, 91,170,167,250, 30, 95,245,223, 82,232, 42,100, + 93,231,137,247, 45,192,174,122,107,246,102, 6,134,103,120,236, 5,150,155,192,196, 26, 24, 24, 56,123,246, 39, 72, 98,102,132, +205,245, 66, 54, 56, 65,192,230,195,150,152,122,179,243,114,167, 78,154, 12,108,114, 34,187,215,203,139,161,174,142, 97,231,110, + 11, 39,188,107,215, 32,189,191,144,144, 16, 96,247, 28,235,242,120, 34,203, 80,200,146,120,228,177,179, 25, 32,193,116, 60,171, +148,224, 49, 2,108,105, 66,138, 78, 96, 11,148,152, 38, 39,121,243, 21,192,102,218,139,135, 15, 20,149, 85,255,253,249,201,248, +231, 47, 11, 47, 31,175,145, 9,143,161,233,191,175,127,254,126,251,249,255,207, 95,134,191,255,202,167,247,132, 71,133, 99, 54, +232,254,172, 16,196, 99, 50,154,172,255,102,116, 5,192,194, 17, 88,110, 66,178, 0,252, 62, 34,228,210, 19,191, 7,213,213,213, + 39, 79,158,252,250,245,107, 87, 87,215, 51,103,206, 0,203, 77,160, 22,130, 55,208, 64,244, 90,152,155,103, 36,103,220,127,114, + 63, 54, 57,227,228,238,133,207, 63,191, 51,177,119, 21,151, 81, 67,107,156, 98,109,177,194, 11, 40,204,149,240,196, 44,137,167, + 4, 0, 4, 16, 11,145,201,142,200,246, 38,114, 89, 64,210, 21, 90, 63,237,141,213, 24,140,159,206, 92,192,192,201,241,254,255, +159, 95,127,254,252,251,255, 79,152,159,255,201,215,143, 4,247,213,160, 45, 63,130,141,117,254, 37,169,220,100, 32,125, 15, 37, +100, 29, 40,164,148,132,140, 39, 32,151,155, 4,141, 34,251, 70, 76,100,237, 24,129, 76,184,201, 42,172,247, 20,216, 49,191,181, +135,175,119,117,228,241, 85,192, 54, 8, 35,176, 23, 15,106,141,226, 45, 55, 33, 17, 7, 46, 34, 63,129, 83, 45, 3, 90,153,176, +160,119, 47,144,228,150, 3,166, 96, 44, 71, 45, 0, 27,149, 64, 19, 68,196,128,109,207,117,240,108,243,249,179,154,161,177,142, +184,140, 43,203,127,124,229, 11,174, 86, 39,124,160,147,200, 25,118, 96,238, 2,150,158,104,151,226, 18, 44, 55,145, 71, 60, 33, + 25,152, 96,147,147,108,224,228,228,148,189,106, 86,211,231, 15, 6,246, 54, 76,226,130, 32,235,126,255, 7,109,166,100, 96,101, +100,102, 97,100, 99,158, 61,163,143,207,217, 68, 89, 89,153,234,171,193, 33, 29,243,233,211,167, 3, 73,125,125,125,146,244,222, +189,123,119,239,222,189,192, 88,176,181,181, 5, 6, 47,218, 16, 39, 48,202,128,113,141,235, 46, 98, 96, 43,117,209,130,133,108, +204,236, 33,145, 33, 64, 53, 54, 94, 41, 40, 37,254,159, 63, 16,189,148,220,212, 75, 35, 0, 16, 64, 84,187,135,157, 42, 87,104, + 57,166, 39,220,187,123,239,220,246,157, 95,127,254, 2,118, 55,148,205,140, 60,228, 34, 9,150, 65,100, 31,210, 1, 41,251,200, +187, 66, 11,110, 2,100, 37, 19,176,184,132,151,191,196,184,135,146, 27, 49,211,211, 5,113,249, 26,216,222, 36,210, 16, 53,151, + 79, 51, 93,224, 38, 16,187, 11, 19, 92, 62, 50,198, 23, 65, 79,100,128,164,103,160, 32,176,196,228,150, 11, 37,168,253,229,115, +183, 89,179,220,254, 49, 61,230,231,251, 8,228, 66, 54, 95, 18, 76,130,228,173, 61,194, 83,122,146,161, 17, 62,226, 73, 82,147, + 19, 79,139, 9,251, 24,142,178,178, 68, 94,222,132, 93,187,238, 53,111, 8,101, 21, 22, 0, 31,225,241,253,219,159,252,146, 74, +102, 46,161,109, 11,103, 94, 20, 97,116, 35,101, 19,250,223,191,127,136, 25,235, 39,178, 99,142,203,119,183,110,221, 2,146, 26, + 26, 26,111,223,190,101, 97, 97, 1,150,119,194,194,194, 12,176, 19, 73,216,216, 64,243,180, 88,139, 78,160,174, 83,167, 78,253, +251,195,104,101,173,255,228,201, 19,160,202, 95,191,126,201,200,200, 64,164, 62,126,252, 8,108, 92, 3, 13, 97,103,103,199,211, + 98,131,148,170,200, 12,146, 58,236,228,245,214,129, 0, 32,128, 88, 24,104, 3,200, 47,206,148,149,148,114, 50,233, 86,117,144, +125,133, 22,102, 1, 74,134,189,228, 89,135,199,181,180, 62,245, 3,220,168,100, 64,235, 37, 19, 83,104, 34, 3,166,127,178,159, + 63,200, 18,169,216, 21, 12,168,232, 5,242, 14,131, 0,182, 52, 9,142, 84,226, 31,244, 36,178, 24,226,226,226, 10, 12, 12,132, + 28, 28,247, 8,118,112,220,209,189,187, 33, 7,199, 57, 91, 56,227,210, 59,251,125,123,170, 96, 37,138, 16,222,147,150,112,149, +158,100,248,209,212,212, 20,178,132,243,223,191,127,192,178,143, 1,124, 91, 61,144,228,225,225, 97, 0, 47, 81, 2,146,172,172, +172, 88,253,235,227,227, 3, 81, 0,212,251,227,199, 15, 6,208, 66,224, 71, 64, 18,178,226, 2, 34, 2, 44, 82,177,182, 58, 7, +246, 96, 51,128, 0, 26,189,214,109, 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52,122, 74,252, 40, 24, 5,163, 96, 20,144, 12, 0, + 2,104,180,232, 28, 5,163, 96, 20,140, 2,146, 1, 64, 0,141, 22,157,163, 96, 20,140,130, 81, 64, 50, 0, 8, 32,150,209, 32, + 24, 42,192,144,232,227,176,224,224,252,232, 64,246, 40, 24, 5,180, 1, 0, 1, 68,195,107,221,232,160,215, 72,230, 38, 7,227, +117, 22,166,103, 76, 12,223,192, 39,115, 50,255, 3,239, 88, 7, 47,156,249, 15,217,133,201,204,240,171,180, 21,180,225, 23,109, + 66,108, 40,250, 87,134,148, 41,197, 39,168,139, 51, 70,175,117, 27,213, 59,170,151,138, 0, 32,128,134,118,171,179,169, 99, 85, +106, 4,155,166,242,239, 27,119,255, 67, 86,194,247, 85, 51, 21,181, 34, 54,219,245,214, 48, 1,139, 81,228,189, 70, 88,192,255, +255,191, 94, 60,248,248,235, 31,104,223, 39, 35,147,128,184, 20, 49,123,111,145, 1, 47, 47,239,231,207,159,127,188,185,197, 33, +162, 54, 90, 27, 19, 4,215,111,158,251,245,227,155,190,190, 13, 73,186,176, 46,211, 35,114,121, 10, 37,122, 33, 64, 81, 81, 17, +178, 70, 10,114,110, 27, 73, 46, 71, 62,251,134,188, 21, 78,163, 96, 16, 2,128, 0, 66, 47, 58, 23, 46,154,139, 95, 67,124, 92, + 50, 46, 41, 74,244,146, 13,102,175,248,213, 87,141,124, 80, 60,162,220, 4,150,152,140,160,197,195,255, 53,148, 65, 27,219,247, + 61,196, 97,196,159, 95, 30, 23,166,157,122,243,247,233,247,127,175,126, 49, 62,100, 19, 96, 85, 54,214,178,114,230, 0, 95,130, + 74, 16,108, 57,112, 99,211, 52, 22,134,159,191,128, 6, 49,176, 95, 59,118,236,251,153,171,188, 28,252,164,149,161, 63, 94,221, +226, 16, 27,254,197,238,165,139,123, 20,100,126,234, 42,255,255,247,239,239,199,215, 43,158,190,100,250,242, 83,210,196,216,150, + 72,237, 31, 95,207, 97,102,134,174,222,191, 51,161,194,160,233, 23,241, 86, 35,151,119,107,215,174, 45, 41, 41, 33,201,229,192, +114,179,160,160,128,145,145,177,191,191,159,140,226,143,204, 43,225, 70, 6,192,127,172, 26,164,113, 51,107,246,108, 92, 53, 34, +124,201, 39,100,183, 59,124,207, 59, 36,180,105,119,173, 27, 64, 0,209,175,213,201,196, 64,253,173, 84,189,213,236,140, 12, 63, +193,165, 36, 3,252, 82, 76, 91, 83,248,165,152,255,145, 47,197,244,193,113,212, 52, 51,195, 63, 69, 17,158,207,223, 94, 51,255, +249,203,248,231,255,223,207,223, 95,156,216,188,243,226, 9,219,248, 66, 33,240,166, 8, 60, 96,201,254,103,140, 10,126, 12, 12, +219, 24,152,152, 24, 88, 65,167,218, 91, 57,240,232,106,189,152,191,225, 33, 7,151, 60,225, 18,243,253, 45, 19,245,207, 86,230, +156, 12, 63,255, 48, 48, 92,179,154, 96, 42,242,230,172,143,157,198, 32, 79,235, 23,206,239, 97,103,121,199,194,244,235,199,143, 191, 31,191,114,218,216, 17, 62, 31,236,218,141,115,188, 28,111,157,172,217, 21,228,149,249,248,248,127,255,249,243,250,245, 27, -241, 71,143,111,223,189,119,236,232, 59, 43,107,127, 98,236, 5,150,155,127,239,180,146,237, 89,178,119,190, 66,206, 45,134,239, - 97,199,115, 86,241, 96, 3,123,246,236, 1,214, 19, 40,219,246,105, 83,142, 64, 82, 19,244, 58, 27, 82,181, 61, 90,199,120, 50, - 5,150, 32, 25, 96, 7,240, 35, 76, 74,153,241,213, 44,124, 50,214, 10,105,251,246,237, 16,182,135,135,199,142, 29, 59,176,178, - 9,183,126,144,102, 17,136, 95,231, 14, 16, 64,216,139,206,163, 71, 78, 90,219,152, 83, 55, 92,255, 17, 58,173,157,200, 83,187, - 81,204,100,100,186,125, 7, 84,104, 82,120, 41,230,131, 39,207,182,188, 96,120,242,141,225,207,127, 6, 30, 38, 6, 22, 86,102, -182, 47,175, 15,172,156, 29,144, 81,134,107,239, 45, 16,172, 88,191,143,209, 32, 29,178,207, 12,212,234,252,247,143,129,229, 47, -176, 12,229, 21, 20, 10,118,120,181,118,231, 79, 14, 65,124, 13,201, 31, 95, 31, 38,250,125,224, 21,151, 96,248,251, 15,212, 98, -253,253,135, 83, 92,241,163,144,244,146,195, 7, 98,108,165,232,147,181, 72, 45, 55,175, 92, 59,247,255,231, 3,121,201, 31,252, -124,236, 76, 76, 92,223,191,255,121,251,238,251,193, 61, 19, 56,248,140,204,205,236,240,104,228, 96,126,173,166,248, 95, 91, 91, -243,249,139,247,103,207,159,251,242,229, 43, 63, 63,175,146,146, 60, 19, 51,235,223,191,143,206, 95, 56, 98,104, 96, 51,104, 11, - 32, 96,147, 19,126,120, 48,176,237, 9, 44, 61,103, 99,107, 4, 17, 83, 81,209,217,229,144,221,101,107,214,172,161,245, 85,230, -240, 6,224,204,153, 51, 72,181,135, 73, 62, 24,162,247,239, 74, 1,120, 11,146,110,225,137,118, 25, 17,241,251, 50, 1, 2, 8, -103,171, 19, 88,122, 2, 73, 82, 11,208, 35,121,183,177,138,219, 76, 82, 37, 62, 44, 32,249,153,152, 2,180,180, 5,116,142, 63, -176, 51, 78,240, 82, 76, 13,101, 70, 92, 29,246,223, 76,172, 51,164,130,159, 9,252, 99, 96, 98,230,101,248,169,118,111,223,163, -119,223, 62, 48, 49,127,124,118,255,241,227, 7,242,242,216,183, 75,158, 62,123,246,141,128,169, 24, 43, 43, 43, 27,107,192,172, -136,159, 43,130, 32,226, 9,153,150,225,190,162,210, 18, 28,202, 34,239,159,226, 62,129,228,199,219, 91,193,142, 31,129,133, 44, -195,143,159,160, 50,247,207, 95, 96,209,201,198,206,198,196,200,240, 75,213,126,197,198,153, 17,254, 78,131,176, 16,249,249,245, -169,162,244,119, 17, 97,110, 25,105, 9, 46,110,174,135, 15,159,254,253,251, 79, 90,138,247,234,245,227, 23, 56,185, 13,116,177, - 31,204,122,249,242, 17, 61,181, 95,114,114,138,215,174, 63, 60,123,246,250,235, 55,159,129,241, 44, 40,200,249,237,219, 23, 67, - 67,237, 15, 31, 62, 62, 61,123,254,226,101, 78,125, 93,227, 65,232,101,180,171, 50, 8, 94,146,129,220, 15, 69,107,212, 3,217, -240,206, 41, 25,189,254,230,230,102, 95, 95, 95, 82,247, 74, 2, 75, 79,160,189,171, 86,173,194,211, 8,128,223,193,139,232, 88, -128, 47,216, 0,138, 27, 26, 26,162, 21,145,152,197, 10,252, 88, 0,240,217,236, 25, 36, 53,108,145,245, 50,135,127,248,183, 82, - 96, 64, 98, 25,238, 41,226,175,117, 3, 8, 32, 2,235, 58,129, 5, 40,164, 12, 37, 18, 96, 45, 34,137, 44, 55, 33,224,224,193, -131, 79,193,128,164,211,162, 48, 47,197,132, 84, 92,125,213,140,189, 53,140,192,114,243, 63, 3, 43,206, 32, 96,102, 81, 53,119, -179,119,244,176,183,119, 53,180,243,226,241,203,119, 16, 6,234,253,199,194,200,112,229, 50, 78,191,223,185,123,159, 87, 88,134, -149,141,133,141, 21,180, 21,155, 61, 98, 29, 4, 93,185,116,143,225,199, 15, 32, 50,144,251,136,199,193,202,130,239,165,197, 57, - 24,190,255,248,240,234,211,130,165, 23,213, 77,167,206,158,117,242,247,215,143,192,130, 24, 8,222,136,152,158,166,236, 92, 37, -146,192,249,243,231,225,247, 19,224,111,114,114,176, 60,231,228,100,229, 96,103, 83, 84, 84, 48, 49, 51, 19, 20, 20,100, 97, 97, -102, 99, 99, 22, 18,228,120,250,248, 1,206,250,249,255, 83, 94, 30,206,111,223,255, 92,185,114,251,217,139,143,143,158,124,186, -117,239,215,243, 23,159, 95,191,254,112,251,214, 61, 21,101,101,105, 41,190,183,175, 31, 13,218, 38, 39,218, 41,241,248, 47,201, - 64, 73, 90,224, 35,127,176, 94, 9, 71, 94,163, 21, 88,156,225,191,150, 18, 19,236,221,187,119,245,234,213,144,147,189,240, 52, -211,144,175,111, 67,190,152, 8,217, 58, 92, 86, 67,140,133,156, 39, 79, 94, 75,124, 85, 33, 55,118, 89, 6, 6,252,199,151, 0, -251,227,158,158,158,144, 94, 57,132, 1, 97,123,192, 0, 49, 77, 78,228,202, 0,200, 38,178,207, 14, 16, 64, 68,141,117,146,215, - 2, 37, 27,220,190, 13,106,186, 2, 75, 79,105,105,105,226, 58,239,140,125,213,255,193, 13, 79, 6,120, 51, 19,233, 82, 76,136, -248, 47,159, 24, 98, 58,176, 76,255,249,196,212,133, 57, 24, 31,253, 0, 54, 25,191,127,255,140, 75,229,147, 71,143, 36,181,153, - 88,152, 89,152, 65, 93,206,223,112,241,199,119, 63, 3, 11, 68,160,189,124,255,241, 77, 98, 24, 72,126,100,248, 14,172,183, 24, -239,222,122,221, 53,239,161, 93, 96,194, 39, 41, 77,182,231, 47, 88,249,133,254,255,251,203, 43, 42,115,231,194, 78, 83, 99, 99, - 26, 21,148,200, 77, 9, 32,151,200,102,194,251,119,175, 68,120, 25,255,252,253,247,235,247,159,215,111,222,177,178,113,252,252, -249,251,247,159,191,127,254,252,251,243,247,255,135,247,111,112,105,100, 99,253,202,193, 41,243,246,237,199, 79,159,191,189,123, -255,157, 79, 88,223, 74, 79,239,212,209, 29, 82,191,254,124,252,244, 81, 93, 93,153,157,141,229,235,231,119,131,179,201,137,124, - 33, 48, 4, 0, 91,157, 68,142,120, 66,238, 94,199, 20,196,223,211,132, 31,126,154,145, 33,228,236,140, 56,239, 3,152, 35,128, -228,166, 77,155,222,188,121, 67,228, 57, 47,123,246,236,129,148,155, 16,245,107,215,174,197, 85,126,193, 47,168, 96,128, 93, 76, - 4, 57,190, 19,114,254, 49,124,156, 20, 87,185, 15, 57,114, 9, 72, 66,218,170, 88, 61,136, 43, 47, 3,157, 23, 98,185,103, 37, - 3, 67,120,255, 87,166,240, 15, 88,245,154,225,184, 13, 0,121, 76, 19,215,184, 39,141,210, 6, 64, 0, 81,127, 55, 17, 90, 27, -147,164, 38,231,199,143, 31,145, 11, 80, 96,178, 35,216, 20, 74,141, 0, 54,250, 64,211, 65,192,242, 17,216,115,135, 32, 13,196, -149, 63,160, 38, 39,193,138,143,247,251, 91,190,239,111, 56,191,190,229,254,250, 90,253,229,217,243,111,127,124,248,199,248,135, -129,129, 95, 2,207,218,177,255,127,127,126,102,102, 6,182, 89, 17, 97,168,122, 32,205,203, 81, 17,210,234,188,247,140, 29,143, -157,160,130,245,219, 15, 96, 33,251,228,246, 75,113,105, 89, 13, 77, 77,160,160, 0,203, 31, 22,208,197, 46,192,226,152,233,201, -163, 71, 52, 42, 55,145,155, 18, 16, 46, 36, 63, 16,108, 53,252,253,203,240,245,219,239,175, 95,127,125,250,244,243,229,203,247, -207,158,189,249,252,249,231,151, 47,191,191,124,249,245,245,235,239,143, 31,112,182,178,127,254,252,243,227,199,223,223,191,127, -241,242,178,201, 74,243,113,113,131,154, 24, 74,202, 10, 50, 82,124,252,124, 28,255,255,255,253,253,231,223,207,159, 95, 7,103, -147, 19,237, 66, 96,120,241, 71,176,225,137,121, 51, 7, 4, 0, 5, 9,158,102,141,212,255, 69, 0, 72, 52, 1, 11, 80, 96,105, - 72, 76,159, 12,216,222, 92,179,102, 13,188,220, 4,146, 33, 33, 33,184, 10, 62,160,225,152, 23,108, 64,146, 4, 92, 28,232, 30, - 66, 71,246,253, 71, 27,118, 67, 30,172,192,165, 71, 68, 68,132, 17,214,182, 36, 85, 47,181, 0,176,249, 9, 65,196,107, 1, 8, - 32,162, 90,157,116,107,111,194,178,232, 95, 34,207,151, 75, 13,103,215, 84,254,117, 3,118, 23, 47,176, 0,133, 92, 41, 12,107, -129, 66,250,236,204,189,213,140,127, 25,120, 14,225, 24,235,252,247,231,183,218,177,153,236,140,255, 94,255, 98, 98,248,251,231, -241,243,167,115,158, 50,177, 50,252,255,200,204,104,110,136,115,221,140,140,140,244,161, 69,165, 94, 21,235,153, 56, 56,248,248, -248, 23,105,231, 51,252,255,201, 96, 35, 5,154, 32,252,249,131,225, 31,195,233,107,188, 12, 42, 56, 93,126,239, 5,187,190, 8, -176,113,202,232,110, 42, 46,242,246,246,217, 31,207,148,133,222, 30,145, 41,103,101, 6,250,157,233,239,143,207,100,220,129, 76, - 12,128,180, 55, 33, 77, 3,228,117, 27,144, 11, 99,241,235, 21, 20, 18,125,118,255, 10, 59, 27,243,175,223,255,126,252,124,242, -248,201,219,119,239, 63,189,123,247,237,237,187,239, 64, 36, 32,164,128, 75,227,203, 55,255, 95,188,124,163,169,169,252,225,253, -123, 86, 22,166, 79,159,159,124,253,240, 79, 75,229,171,184,168, 40, 23, 23, 23, 59, 59, 39,176,243,206,200, 44, 56, 56, 59,236, - 88, 47, 98,131,140,120,226,215, 8,105,147,162,221, 69, 76,228,253, 28,112, 16, 22, 22, 6,111,133, 65, 78,149, 5,198, 90,112, -112, 48,176,224,198,191,204, 27,173,189, 9, 1,200,109, 88,148, 62, 16,142, 11, 54, 32,226,192,212, 2,185, 61, 13, 34,254, 24, -155,189, 64, 53, 89, 89,153,144,115,163,193, 5, 46,244,160, 63,160, 46,136,251,241,148,185, 64,189, 83, 29, 5,195, 39,124, 67, -235,185, 3, 69, 32,122,147, 28, 89,105, 93,110, 34,179,137,236,176, 3, 4, 16, 11, 45, 10, 77, 96, 75, 19, 50, 95, 68, 82,147, - 19, 14,144,203, 77, 96,123, 27,207,217,242, 26, 42,255, 32,203, 54,109, 77, 25, 14,159,198, 50,244, 9,190, 20,243,239,127, 6, - 96, 63, 28,103,251, 26,216, 65,222,120,249,209,219,223,255,127,252, 97,248,250,151,225,221, 31,166,255, 12,255,223,124,255,175, -238,225,203,199,195,139,179, 12, 50, 50,124,242,228,201,179,171,251, 21,140, 60,216,216,216, 65, 51,236, 76,192,146,247, 23,164, -246,220,116,232,215, 63, 21, 31, 60,126, 60,125,139, 77, 95,249, 51, 80, 49, 7, 19,163,181,167,146,245,239,139, 12,140,236, 43, - 95,178,254,250,245,239,239,143, 47, 39,230,148,218,153,235,211, 40,161, 64, 14, 3,135,220, 19, 11,169,207,137, 41, 55,129, 64, - 95,215,248,250,149,179,255,159,126,250,246,253,247,123,246, 31,255, 25,222,255,248,241, 7,216, 2,125,245,230,219,179,231, 95, -108, 29,113, 46,198,250,254, 75,228,222,253,215, 74,138,114,138,138,192,110,251, 27, 65,129,191,170,170,252, 98,162, 74, 28,156, -156, 31, 62,124, 57,123,238,198,147,167,159, 36,100,180, 7, 79,113,249, 31,124, 0, 51,164,200,130,151, 92, 88,215,102, 98,169, -223,144,214,213, 64,238, 34, 70, 46, 58,251,250,250,118,237,218,133, 75, 47, 36, 70, 32, 71, 89, 67, 46,125, 66, 46,236, 32, 69, - 39,176,229,136,167,183,142,212,217,223, 75,210,185,221,184, 46,216,128,136, 19,188, 17, 19,232,242,105,211,166, 67, 70,114, 13, - 12,244,225, 3,148,176, 86, 36,206,147, 64, 33,122,153,194,222, 67,244,134, 90,178,195, 3, 38,172,255, 43, 3,161,147,176,129, -229, 3,124,241,128,167,167, 39, 60,118, 72,234,167,167,149,119, 32,138,142,206, 10, 34, 75, 79,128, 0, 98, 25, 36, 45, 77, 8, -136,136,136, 32, 73, 61, 35,108, 64, 51,208,141, 49,208,141, 9,154, 28, 25,255,167, 69, 0,131,144,245,223,127,126,101,101,190, -127, 12,175, 25, 25,254,254,195,189,224, 12, 88,176,126,252,199,252,230,247,191, 63,255,254,127,250,253,255,243,239,127,191,152, - 89,148, 28,157,237,237, 60,241, 88,173,161,166,254,220,228,217,153, 51, 75,111,125,122,163, 98, 25, 4,106, 96,130, 78,108,101, -188,112,239,243,249,251,220,191, 85,163,240,187,252,159,134,253,166, 3, 43,252, 44,217,160,121, 8, 88,178,255, 3,141,141,254, -254,254,249,217,165,253, 74,210,194,192,162,153, 70,129, 12,185, 74, 1,210,222,132,116,193,136,159,180,149,145, 87, 63,115, 98, -167,152, 8,176,177,200, 2,238,137,255,253,244,249,215,187,247,223,101, 21,181,109,172,236,113,233,242,242, 10,222,181,125,254, -137, 83, 87,109,173,245,229,229,229,127,255,250, 97,104,160,199,205,207,255,240,222,163,167,207, 62, 28, 61,126,253,253,103,254, - 64, 75,251,193, 83,116,102, 66, 47,203,100,204, 4, 22, 37,224,162,240, 31, 82,137,201,196,196,136,231,138, 52,208,245,106,136, -179,149, 25,255,253,251, 7,111,120, 66,110, 33,246,240,112,135, 21,207, 12,222,209,181,152, 61, 83, 92,229, 29, 80, 22,127,185, -137, 12,128, 42,113,181, 49,241,164, 10,204, 11, 54,224,226,120, 14,144,135,151,185,144,139, 51,145, 39,118, 8,142, 2, 33,235, - 93, 85,200,131, 92,161,192,185, 59, 47,254,198, 21, 32,200,227,155,116, 30,235, 4, 8, 32,236, 69,167,149,181, 25,133,227, 11, -228,181, 55,225, 30, 38, 18, 92,191,251, 95, 19, 58,172, 73,224, 82, 76, 27,211,223, 2,234,184,138,206,255, 63,254, 50,252, 1, -109,195,252,207, 38,165, 42, 37, 33,175, 99,106, 41, 35, 69,120,135,172,163,131, 35, 15, 15,207,129,253, 59, 54,238, 91,200,176, - 21,122, 31,203,172, 75, 6, 6, 70,166,196, 56,254,133,124,196,252,221,203, 12,101,191, 26, 40,240, 2, 19,206,135, 47,191, 63, -191,126,116,231,200,186, 31, 55,118,154,152, 24, 3,139,102,218, 21, 13,192,110, 59, 48, 63, 64,110,139, 66, 91,125, 66, 32, 90, -193,229,227,173, 27,215,158,221,123, 8, 44, 65,254,254,253,207,193, 41,164,166,169, 19, 24, 64,224,118, 13, 49,105,189, 19,167, -118, 0, 91,169,186, 58, 74,210, 82, 34,143, 30,191,124,127,249,238,205, 91,143,246,238,187,244,240,233,255,148,212, 92, 34, 29, -112,127,203,103,178,125,253,224,193, 3, 34, 85,254, 91, 41, 72,188,172,239, 38,188,122,239,206,135, 55, 60, 65,125,252,123, 11, -144, 21,160,233,197,218, 8, 69, 46,101, 72,107, 88,144,152,133,113, 93,176, 65,204,197, 27,240, 34, 18, 77, 25, 49,181,242,191, -135,107,215, 76,136, 3, 53,153, 45, 81, 58,230,112, 46,174,162,115, 96,119,103, 1, 4, 16, 11, 85, 2,157, 42,128,140,227,242, -103,175,248, 11, 43, 40, 9, 92,138,121,228,244, 47, 31,156,101, 17,227,231, 95,127,126,253, 97,120,249,139, 33, 44, 50,149,143, -143,159,120, 7,152,154,152, 2,209,233, 51,167, 25, 24,160, 35,169, 68,150,155, 16,240, 91, 59,106,214,185,211,204,199,174,126, -120,125,231,204, 75,254,155,143,252,149,101,197, 29, 28, 29,128,102,210, 58,180,129, 37, 38,121, 27, 75,128,165, 39, 16, 93,184, -124,246,229,139,151,220,220,220,120, 26,155, 40, 89, 72,207, 24,136,150, 46,153,121,237,230, 73, 73,113, 30, 14, 14,214, 47, 95, -126, 61,125,254,137,145, 69, 54, 37, 53,142, 72,171,121,132,138,200,246, 47,100,121,230, 0,128,115,197, 12,202,137,136,229, 77, -103,139,104, 87,246,129,251,212, 66,176, 2,151,156, 98, 5, 87, 73, 71,176, 4, 36,239,102, 14,184, 55,145,251,233,244, 7,192, - 78, 58,114,159,157, 72, 0, 16, 64,232, 69, 39, 37,219,204,105,177, 69,157, 24,112,227, 46, 19,120, 67,209,255, 52, 88,119, 31, - 54,195,254, 47, 45,156,101,214,202, 63, 4,130,128,141,253,135,160,204,215,207, 63, 24,184, 65, 55,195,144,225, 0, 96, 73,167, -153,117,192, 68,230,163,128,176,138, 46,137,247,232,128,139, 90, 80, 65,105,203,192, 0, 44,130,233, 80,104, 82,167,215,175,107, -204,160, 75,178,174,232,152,244, 35,199, 14,190,126,251,250,251,139,111, 28, 28,194, 50,138,122, 68,150,188, 12,148, 93, 68, 67, -149, 75,108,254,255,255,199, 64,222,102,226,123, 11,160, 83,237,247, 22,210, 58, 94, 72,234,164, 15, 18,224,230, 19, 78,176,253, -104, 70,155,177, 78,159,152, 90,200, 28, 17,176,244, 68, 22, 36, 70, 47, 64, 0, 13,135,243, 58,255, 51, 64,124,241, 7,121,211, +241, 71,143,111,223,189,119,236,232, 59, 43,107,127, 98,236, 5,150,155,127,239,180,146,237,108,178,119,190, 66,206, 45,134,239, + 97,199,115, 86,241, 96, 3,123,246,236, 1,214, 19, 40,219,246,105, 83,142, 64,202, 46,232,117, 54,164,106,123,180,142,241,100, + 10,172,248, 99,128, 29,192,143, 48, 41,101,198, 87,179,240,201, 88, 43,164,237,219,183, 67,216, 30, 30, 30, 59,118,236,192,202, + 38,220,250, 65,154, 69, 32,126,157, 59, 64, 0, 97, 47, 58,143, 30, 57,105,109, 99, 78,221,112,253, 71,232,180,118, 34, 79,237, + 70, 49,147,145,233,246, 29, 80,161, 73,225,165,152, 15,158, 60,219,242,130,225,201, 55,134, 63,255, 25,120,152, 24, 88, 88,153, +217,190,188, 62,176,114,118, 64, 70, 25,174,189,183, 64,176, 98,253, 62, 70,131,116,200, 62, 51, 80,171,243,223, 63, 6,150,191, +192, 50,148, 87, 80, 40,216,225,213,218,157, 63, 57, 4,241, 53, 36,127,124,125,152,232,247,129, 87, 92,130,225,239, 63, 80,139, +245,247, 31, 78,113,197,143, 66,210, 75, 14, 31,136,177,149,162,127, 54, 59,127,254,188,161,161, 33,126, 53, 87,174,157,251,255, +243,129,188,228, 15,126, 62,118, 38, 38,174,239,223,255,188,125,247,253,224,158, 9, 28,124, 70,230,102,118,120, 52,114, 48,191, + 86, 83,252,175,173,173,249,252,197,251,179,231,207,125,249,242,149,159,159, 87, 73, 73,158,137,153,245,239,223, 71,231, 47, 28, + 49, 52,176, 25,180, 5, 16,176,201, 9, 63, 60, 24,216,246, 4,150,158,179,177, 53,130, 8,151, 17,116,111,117, 66,118,151,173, + 89,179,134,214, 87,153,195, 27,128, 51,103,206, 32,213, 30, 38,249, 96,136,222,191, 43, 5,224, 45, 72,186,133, 39,218,101, 68, +196,239,203, 4, 8, 32,156,173, 78, 96,233, 9, 36, 73, 45, 64,143,228,221,198, 42,110, 51, 73,149,248,176,128,180,183,137, 41, + 64, 75, 91, 64,231,248, 3, 59,227, 4, 47,197,212, 80,102,196,213, 97,255,205,196, 58, 67, 42,248,153,192, 63, 6, 38,102, 94, +134,159,106,247,246, 61,122,247,237, 3, 19,243,199,103,247, 31, 63,126, 32, 47,143,125,187,228,233,179,103,223, 8,152,138,177, +178,178,178,177, 6,204,138,248,185, 34, 8, 34,158,144,105, 25,238, 43, 42, 45,193,161, 44,242,254, 41,238, 19, 72,126,188,189, + 21,236,248, 17, 88,200, 50,252,248, 9, 42,115,255,252, 5, 22,157,108,236,108, 76,140, 12,191, 84,237, 87,108,156, 25,225,239, + 68,231,114, 19,126, 88, 44, 30,240,243,235, 83, 69,233,239, 34,194,220, 50,210, 18, 92,220, 92, 15, 31, 62,253,251,247,159,180, + 20,239,213,235,199, 47,112,114, 27,232, 98, 63,152,245,242,229, 35,122,106,191,228,228, 20,175, 93,127,120,246,236,245,215,111, + 62, 3,227, 89, 80,144,243,219,183, 47,134,134,218, 31, 62,124,124,122,246,252,197,203,156,250,186,198,131,176,220, 68,187, 42, +131,224, 37, 25,200,253, 80,180, 3,211,128,108,120,231,148,140, 94,127,115,115,179,175,175, 47,169,123, 37,129,165, 39,208,222, + 85,171, 86,225,105, 4,192,239,224, 69,116, 44,192, 23,108, 0,197,209,106, 83,172, 55, 98,194,143, 5, 0,159,205,158, 65, 82, +195, 22, 89, 47,115,248,135,127, 43, 5, 6, 36,150,225,158, 34,254, 90, 55,128, 0, 34,176,174, 19, 88,128, 66,202, 80, 34, 1, +214, 34,146,200,114, 19, 2, 14, 30, 60,248, 20, 12, 72, 58, 45, 10,243, 82, 76, 72,197,213, 87,205,216, 91,195, 8, 44, 55,255, + 51,176,226, 12, 2,102, 22, 85,115, 55,123, 71, 15,123,123, 87, 67, 59, 47, 30,191,124, 7, 97,160,222,127, 44,140, 12, 87, 46, +227,244,251,157,187,247,121,133,101, 88,217, 88,216, 88, 65,135, 83,176, 71,172,131,160, 43,151,238, 49,252,248, 1, 68, 6,114, + 31,241, 56, 88, 89,240,189,180, 56, 7,195,247, 31, 31, 94,125, 90,176,244,162,186,233,212,217,179, 78,254,254,250, 17, 88, 16, + 3,193, 27, 17,211,211,148,157,171, 68, 70,185, 73, 80, 25,176,201,201,193,242,156,147,147,149,131,157, 77, 81, 81,193,196,204, + 76, 80, 80,144,133,133,153,141,141, 89, 72,144,227,233,227, 7, 56,235,231,255, 79,121,121, 56,191,125,255,115,229,202,237,103, + 47, 62, 62,122,242,233,214,189, 95,207, 95,124,126,253,250,195,237, 91,247, 84,148,149,165,165,248,222,190,126, 52,104,155,156, +104,167,196,227,191, 36, 3, 37,105,129,143,252,193,122, 37, 28,121,141, 86, 96,113,134,255, 90, 74, 76,176,119,239,222,213,171, + 87, 67, 78,246,194,211, 76, 67,190,190, 13,249, 98, 34,100,235,112, 89, 13, 49, 22,114,158, 60,121, 45,241, 85,133,220,216,101, + 25, 24,240, 31, 95, 2,236,143,123,122,122, 66,122,229, 16, 6,132,237, 1, 3,196, 52, 57,145, 43, 3, 32,155,200, 62, 59, 64, + 0, 17, 53,214, 73, 94, 11,148,108,112,251, 54,168,233, 10, 44, 61,165,165,165,137,235,188, 51,246, 85,255, 7, 55, 60, 25,224, +205, 76,164, 75, 49, 33,226,191,124, 98,136, 48,136,145,233, 63,159,152,186, 48, 7,227,163, 31,192, 38,227,247,239,159,113,169, +124,242,232,145,164, 54, 19, 11, 51, 11, 51,168,203,249, 27, 46,254,248,238,103, 96,129, 8,180,151,239, 63,190, 73, 12, 3,201, +143, 12,223,129,245, 22,227,221, 91,175,187,230, 61,180, 11, 76,248, 36,165,201,246,252, 5, 43,191,208,255,127,127,121, 69,101, +238, 92,216,105,106,108, 76,163,130, 18,185, 41, 1, 47, 55, 9, 38,253,247,239, 94,137,240, 50,254,249,251,239,215,239, 63,175, +223,188, 99,101,227,248,249,243,247,239, 63,127,255,252,249,247,231,239,255, 15,239,223,224,210,200,198,250,149,131, 83,230,237, +219,143,159, 62,127,123,247,254, 59,159,176,190,149,158,222,169,163, 59,164,126,253,249,248,233,163,186,186, 50, 59, 27,203,215, +207,239, 6,103,147, 19,249, 66, 96, 8, 0,182, 58,137, 28,241,132,220,189,142, 41,136,191,167, 9, 63,252, 52, 35, 67,200,217, + 25,113,222, 7, 48, 71, 0,201, 77,155, 54,189,121,243,134,200,115, 94,246,236,217, 3, 41, 55, 33,234,215,174, 93,139,171,252, + 66,238,115, 64, 46, 38,130, 28,223, 9, 57,255, 24, 62, 78,138,171,220,135, 28,185, 4, 36, 33,109, 85,172, 30,196,149,151,129, +206, 11,177,220,179,146,129, 33,188,255, 43, 83,248, 7,172,122,205,112,220, 6,128, 60,166,137,107,220,147, 70,105, 3, 32,128, +168,191,155, 8,173,141, 73, 82,147,243,227,199,143,200, 5, 40, 48,217, 17,108,123,166, 70, 0, 27,125,160,233, 32, 96,249, 8, +236,185, 67,144, 6,226,202, 31, 80,147,147, 96,197,199,251,253, 45,223,247, 55,156, 95,223,114,127,125,173,254,242,236,249,183, + 63, 62,252, 99,252,195,192,192, 47,129,103,237,216,255,191, 63, 63, 51, 51, 3,219,172,136, 48, 84, 61,144,230,229,168, 8,105, +117,222,123,198,142,199, 78, 80,193,250,237, 7,176,144,125,114,251,165,184,180,172,134,166, 38, 80, 80,128,229, 15, 11,232, 98, + 23, 96,113,204,244,228,209, 35, 26,149,155,200, 77, 9, 8, 23,210,111, 34,216, 19,252,251,151,225,235,183,223, 95,191,254,250, +244,233,231,203,151,239,159, 61,123,243,249,243,207, 47, 95,126,127,249,242,235,235,215,223, 31, 63,224,108,101,255,252,249,231, +199,143,191,191,127,255,226,229,101,147,149,230,227,226, 6, 53, 49,148,148, 21,100,164,248,248,249, 56,254,255,255,251,251,207, +191,159, 63,191, 14,206, 38, 39,218,133,192,240,226,143, 96,195, 19,243,102, 14, 8, 0, 10, 18, 60,205, 26,169,255,139, 0,144, + 98, 11, 88,128, 2, 75, 67, 98,250,100,192,246,230,154, 53,107,224,229, 38,144, 12, 9, 9,193, 85,240, 1, 13,199,188, 96, 3, + 82,155,194,197,129,238, 33,116,100,223,127,180, 97, 55,228,193, 10, 92,122, 68, 68, 68, 24, 97,109, 75, 82,245, 82, 11, 0,155, +159, 16, 68,188, 22,128, 0, 34,170,213, 73,183,246, 38, 44,139,254, 37,242,136,198,212,112,118, 77,229, 95, 55, 96,119,241, 2, + 11, 80,200,149,194,176, 22, 40,164,207,206,220, 91,205,248,151,129,231, 16,142,177,206,127,127,126,171, 29,155,201,206,248,239, +245, 47, 38,134,191,127, 30, 63,127, 58,231, 41, 19, 43,195,255,143,204,140,230,134, 56,215,205,200,200, 72, 31, 90, 84,234, 85, +177,158,137,131,131,143,143,127,145,118, 62,195,255,159, 12, 54, 82,160, 9,194,159, 63, 24,254, 49,156,190,198,203,160,130,211, +229,247, 94,176,235,139, 0, 27,167,140,238,166,226, 34,111,111,159,253,241, 76, 89,232,237, 17,153,114, 86,102,160,223,153,254, +254,248, 76,198, 29,200,196, 0, 72,123, 19,210, 52,128,175,219,192, 28,210,194, 10, 4,133, 68,159,221,191,194,206,198,252,235, +247,191, 31, 63,159, 60,126,242,246,221,251, 79,239,222,125,123,251,238, 59, 16, 9, 8, 41,224,210,248,242,205,255, 23, 47,223, +104,106, 42,127,120,255,158,149,133,233,211,231, 39, 95, 63,252,211, 82,249, 42, 46, 42,202,197,197,197,206,206, 9,236,188, 51, + 50, 11, 14,206, 14, 59,214,139,216, 32, 35,158,248, 53, 66,218,164,104,119, 17, 19,121, 63, 7, 28,132,133,133,193, 91, 97,144, + 83,101,129,177, 22, 28, 28, 12, 44,184,241, 47,243, 70,107,111, 66, 0,114, 27, 22,165, 15,132,227,130, 13,136, 56, 48,181, 64, +110, 79,131,136, 63,198,102, 47, 80, 77, 86, 86, 38,228,220,104,112,129, 11,233,243,129, 26,170, 16,247,227, 41,115,129,122,167, + 58, 10,134, 79,248,134,214,115, 7,138, 64,244, 38, 57,178,210,186,220, 68,102, 19,217, 97, 7, 8, 32, 22, 90, 20,154,192,150, + 38,100,190,136,164, 38, 39, 28, 32,151,155,192,246, 54,158,179,229, 53, 84,254, 65,150,109,218,154, 50, 28, 62,141,101,232, 19, +124, 41,230,223,255, 12,192,126, 56,206,246, 53,176,131,188,241,242,163,183,191,255,255,248,195,240,245, 47,195,187, 63, 76,255, + 25,254,191,249,254, 95,221,195,151,143,135, 23,103, 25,100,100,248,228,201,147,103, 87,247, 43, 24,121,176,177,177,131,102,216, +153,128, 37,239, 47, 72,237,185,233,208,175,127, 42, 62,120,252,120,250, 22,155,190,242,103,160, 98, 14, 38, 70,107, 79, 37,235, +223, 23, 25, 24,217, 87,190,100,253,245,235,223,223, 31, 95, 78,204, 41,181, 51,215,167, 81, 66,129, 28, 6, 14,185, 39, 22,152, + 25,136,105,111, 66,128,190,174,241,245, 43,103,255, 63,253,244,237,251,239,247,236, 63,254, 51,188,255,241,227, 15,176, 5,250, +234,205,183,103,207,191,216, 58,226, 92,140,245,253,151,200,189,251,175,149, 20,229, 20, 21,129,221,246, 55,130, 2,127, 85, 85, +249,197, 68,149, 56, 56, 57, 63,124,248,114,246,220,141, 39, 79, 63, 73,200,104, 15,158,226,242, 63,248,238, 16, 72,145, 5, 47, +185,176,174,205,196, 82,191, 33,173,171,129,220, 69,140, 92,116,246,245,245,237,218,181, 11,151, 94, 72,140, 64,142,178,134, 92, +250,132, 92,216, 65,138, 78, 96,203, 17, 79,111, 29,169,179,191,151,164,115,187,113, 93,176, 1, 17, 39,120, 35, 38,208,229,211, +166, 77,135,140,228, 26, 24,232,195, 7, 40, 97,173, 72,156, 39,129, 66,244, 50,133,189,135,232, 13,181,100,135, 7, 76, 88,255, + 87, 6, 6, 6,252, 45, 78, 96,249, 0, 95, 60,224,233,233, 9,143, 29,146,250,233,105,229, 29,136,162,163,179,130,200,210, 19, + 32,128, 88, 6, 73, 75, 19, 2, 34, 34, 34, 72, 82,207, 8, 27,208, 12,116, 99, 12,116, 99,130, 38, 71,198,255,105, 17,192, 32, +100,253,247,159, 95, 89,153,239, 31,195,107, 70,134,191,255,112, 47, 56, 3, 22,172, 31,255, 49,191,249,253,239,207,191,255,159, +126,255,255,252,251,223, 47,102, 22, 37, 71,103,123, 59, 79, 60, 86,107,168,169, 63, 55,121,118,230,204,210, 91,159,222,168, 88, + 6,129, 26,152,160, 19, 91, 25, 47,220,251,124,254, 62,247,111,213, 40,252, 46,255,167, 97,191,233,192, 10, 63, 75, 54,104, 30, + 2,150,236,255, 64, 99,163,191,191,127,126,118,105,191,146,180, 48,176,104,166, 81, 32, 67,174, 82,128,223,229, 66,210,140,173, +140,188,250,153, 19, 59,197, 68,128,141, 69, 22,112, 79,252,239,167,207,191,222,189,255, 46,171,168,109, 99,101,143, 75,151,151, + 87,240,174,237,243, 79,156,186,106,107,173, 47, 47, 47,255,251,215, 15, 67, 3, 61,110,126,254,135,247, 30, 61,125,246,225,232, +241,235,239, 63,243, 7, 90,218, 15,158,162, 51, 19,122, 89, 38, 99, 38,176, 40, 1, 23,133,255,144, 74, 76, 38, 38, 70, 60, 87, +164,129,174, 87,251, 15, 47, 58, 24,255,253,251, 7,111,120, 66,110, 33,246,240,112,135, 21,207, 12,222,209,181,152, 61, 83, 92, +229, 29, 80, 22,127,185,137, 12,128, 42,113,181, 49,241,164, 10,204, 11, 54,224,226,120, 14,144,135,151,185,144,139, 51,145, 39, +118, 8, 14,160, 35,235, 93, 85,200,131, 92,161,192,185, 59, 47,254,198, 21, 32,200,227,155,116, 30,235, 4, 8, 32,236, 69,167, +149,181, 25,133,227, 11,228,181, 55,225, 30, 38, 18, 92,191,251, 95, 19, 58,172, 73,224, 82, 76, 27,211,223, 2,234,184,138,206, +255, 63,254, 50,252, 1,109,195,252,207, 38,165, 42, 37, 33,175, 99,106, 41, 35, 69,120,135,172,163,131, 35, 15, 15,207,129,253, + 59, 54,238, 91,200,176, 21,122, 31,203,172, 75, 6, 6, 70,166,196, 56,254,133,124,196,252,221,203, 12,101,191, 26, 40,240, 2, + 19,206,135, 47,191, 63,191,126,116,231,200,186, 31, 55,118,154,152, 24, 3,139,102,218, 21, 13,192,238, 57,164, 5, 65, 76, 63, + 29, 37, 90,193,229,227,173, 27,215,158,221,123, 8, 44, 65,254,254,253,207,193, 41,164,166,169, 19, 24, 64,224,160,120, 49,105, +189, 19,167,118, 0, 91,169,186, 58, 74,210, 82, 34,143, 30,191,124,127,249,238,205, 91,143,246,238,187,244,240,233,255,148,212, + 92, 34, 29,112,127,203,103,178,125,253,224,193, 3, 34, 85,254, 91, 41, 72,188,172,239, 38,188,122,239,206,135, 55, 60, 65,125, +252,123, 11,144, 21,160,233,197,218, 8, 69, 46,101, 72,107, 88,144,152,133,113, 93,176, 65,204,197, 27,240, 34, 18, 77, 25, 49, + 21,243,191,135,107,215, 76,136, 3, 53,153, 45, 81, 58,230,112, 46,174,162,115, 96,119,103, 1, 4, 16, 11, 85, 2,157, 42,128, +140,227,242,103,175,248, 11, 43, 40, 9, 92,138,121,228,244, 47, 31,156,101, 17,227,231, 95,127,126,253, 97,120,249,139, 33, 44, + 50,149,143,143,159,120, 7,152,154,152, 2,209,233, 51,167, 25, 24,160, 35,169, 68,150,155, 16,240, 91, 59,106,214,185,211,204, +199,174,126,120,125,231,204, 75,254,155,143,252,149,101,197, 29, 28, 29,128,102,210, 58,180, 73, 45, 52,145, 75, 79, 32,186,112, +249,236,203, 23, 47,185,185,185,241, 52, 54, 81,178,144,158, 49, 16, 45, 93, 50,243,218,205,147,146,226, 60, 28, 28,172, 95,190, +252,122,250,252, 19, 35,139,108, 74,106, 28,145, 86,243, 8, 21,145,237, 95,200,242,204, 1, 0,231,138, 25,148, 19, 17,203,155, +206, 22,209,174,236, 3,247,169,133, 96, 5, 46, 57,197, 10,174,146,142, 96, 9, 72,222,205, 28,112,111, 34,247,211,233, 15,128, +157,116,228, 62, 59,145, 0, 32,128,208,139, 78, 74,182,153,211, 98,139, 58, 49,224,198, 93, 38,240,134,162,255,105,176,238, 62, +108,134,253, 95, 90, 56,203,172,149,127, 8, 4, 1, 27,251, 15, 65,153,175,159,127, 48,112,131,110,134, 33,195, 1,192,146, 78, + 51,235,128,137,204, 71, 1, 97, 21, 93, 18,239,209, 1, 23,181,160,130,210,150,129, 1, 88, 4,211,161,208,164, 78,175, 95,215, +152, 65,151,100, 93,209, 49,233, 71,142, 29,124,253,246,245,247, 23,223, 56, 56,132,101, 20,245,136, 44,121, 25, 40,187,136,134, + 42,151,216,252,255,255,143,129,188,205,196,247, 22, 64,167,218,239, 45,164,117,188,144,212, 73, 31, 36,192,205, 39,156, 96,251, +209,140, 54, 99,157, 62, 49,181,144, 57, 34, 96,233,137, 44, 72,140, 94,128, 0, 26, 14,231,117,254,135, 94,170,248, 7,121,211, 58,184, 41,202,172,170,194,193,192,240,133, 96,165,231,145, 69,233,185,150,133, 37,165,148,123,100,168,148,155, 20,141,228, 88, 217, 15,126, 71,206,122,223,145, 38, 88,129, 34,180, 90,136,124,189,192,150,230,217, 34,134, 81,128, 3,132,100, 79, 25,192, 26, 17, 94,122,146, 84,110, 2, 1, 64, 0,141, 94,235, 54,100,192,232, 81,199,163, 96, 20, 12, 30, 0, 16, 64,163,167,196, 15, 25, @@ -774,7 +769,7 @@ char datatoc_blenderbuttons[]= { 102, 50,252,235, 17, 28, 15,106, 21,176,176, 18, 44, 55,129,160,118,202, 84, 32,130,148,155,192, 22,104,169, 27,184,173, 41,202, 134,199,229,231,249,183,185,133, 72, 37,202,103,177, 50,241,112, 51,112, 49, 49, 48, 75,139, 91,219, 4, 59,223,147,234,199,223, 85, 7,185,112,225, 66, 72,137,137, 70,194, 21, 16, 9, 14, 31, 62, 60, 90,204,209,168,220,108,173, 42, 4,118, 19,231, 76,238, - 65, 46, 55,129, 34, 83,166, 76,193,147, 38,145,203, 77,204, 52,233,105, 13, 62, 95,134,151,155,200,114, 19, 81,122,146,114,197, + 65, 46, 55,129, 34, 83,166, 76,193,147, 38,145,203, 77,204, 52,233,105, 13, 62, 45,129,151,155,200,114, 19, 81,122,146,114,197, 14,253, 1, 64, 0,177,224,106,114,246,214, 36,167, 69,185, 67, 68,102, 45,219, 89,220, 66, 84, 51, 24,222,228,212,242,176,104, 88, 3, 58, 22, 38,140, 71,140,152,134, 39, 90,185, 9, 44, 52,191,127,124, 11,233, 47, 67,164,128, 34,184,244,162,197, 25, 48, 194, 78, 45,237,128,244, 29, 32, 82, 64, 17, 60, 86, 43, 43, 43,191, 5, 3, 96, 25,202,196,196, 4,108, 7, 1,203, 77, 96, 97, @@ -1345,5 +1340,5 @@ char datatoc_blenderbuttons[]= { 253,140,127,102,144,212,176,163,252,218, 47,178, 11, 2,202,155, 90, 3, 84,159,255,135,237,119,165, 95, 88, 81,226,113, 82,179, 193,160,106,227, 51,192,102, 77,137,159,250,160,220,210,129,109,117,210,183,156, 37, 39, 49, 99, 54, 60,137,111,216,193, 1, 64, 0,141, 94,235, 54, 10, 70,193, 40, 24, 5, 36, 3,128, 0, 26, 61, 37,126, 20,140,130, 81, 48, 10, 72, 6, 0, 1, 52, 90,116, -142,130, 81, 48, 10, 70, 1,201, 0, 32,192, 0,101,219, 21, 50,159,249,152,197, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, +142,130, 81, 48, 10, 70, 1,201, 0, 32,192, 0, 22,250,234,193,136,156, 34, 9, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, }; diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c new file mode 100644 index 00000000000..3d54106d153 --- /dev/null +++ b/source/blender/src/butspace.c @@ -0,0 +1,166 @@ +/** + * $Id: + * + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#include <time.h> +#include <math.h> +#include <stdlib.h> +#include <string.h> + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "MEM_guardedalloc.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" + +#include "BKE_global.h" + +#include "BLI_blenlib.h" + +#include "BIF_gl.h" +#include "BIF_graphics.h" +#include "BIF_keyval.h" +#include "BIF_mainqueue.h" +#include "BIF_resources.h" +#include "BIF_screen.h" +#include "BIF_mywindow.h" +#include "BIF_space.h" +#include "BIF_glutil.h" +#include "BIF_interface.h" + +#include "BIF_butspace.h" + +/* here the calls for building the button main/tabs tree */ + + +static void context_scene_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + if(sbuts->tab[CONTEXT_SCENE] == TAB_SCENE_RENDER) + render_panels(); + +} + +static void context_object_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + +} + +static void context_types_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + +} + +static void context_shading_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + +} + +static void context_editing_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + +} + +static void context_logic_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + +} + +static void context_script_buttons(ScrArea *sa, SpaceButs *sbuts) +{ + + /* select tabs */ + +} + +/* callback */ +void drawbutspace(ScrArea *sa, void *spacedata) +{ + SpaceButs *sbuts= sa->spacedata.first; + View2D *v2d= &sbuts->v2d; + + myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); + + glClearColor(0.73, 0.73, 0.73, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + + uiSetButLock(G.scene->id.lib!=0, "Can't edit library data"); + uiFreeBlocksWin(&sa->uiblocks, sa->win); + + /* select the context to be drawn, per contex/tab the actual context is tested */ + switch(sbuts->mainb) { + case CONTEXT_SCENE: + context_scene_buttons(sa, sbuts); + break; + case CONTEXT_OBJECT: + context_object_buttons(sa, sbuts); + break; + case CONTEXT_TYPES: + context_types_buttons(sa, sbuts); + break; + case CONTEXT_SHADING: + context_shading_buttons(sa, sbuts); + break; + case CONTEXT_EDITING: + context_editing_buttons(sa, sbuts); + break; + case CONTEXT_SCRIPT: + context_script_buttons(sa, sbuts); + break; + case CONTEXT_LOGIC: + context_logic_buttons(sa, sbuts); + break; + } + + uiClearButLock(); + + myortho2(-0.5, (float)(sa->winx)-.05, -0.5, (float)(sa->winy)-0.5); + draw_area_emboss(sa); + myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); + + /* always in end */ + sa->win_swap= WIN_BACK_OK; +} + diff --git a/source/blender/src/buttons.c b/source/blender/src/buttons.c index f8e0cc1975c..ae384661a1d 100644 --- a/source/blender/src/buttons.c +++ b/source/blender/src/buttons.c @@ -7299,7 +7299,7 @@ static void do_constraintbuts(unsigned short event) /* ***************************<>******************************** */ -void drawbutspace(ScrArea *sa, void *spacedata) +void drawbutspace_old(ScrArea *sa, void *spacedata) { SpaceButs *sbuts= curarea->spacedata.first; View2D *v2d= &sbuts->v2d; diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c new file mode 100644 index 00000000000..884dc2bdcbd --- /dev/null +++ b/source/blender/src/buttons_scene.c @@ -0,0 +1,922 @@ +/** + * $Id: + * + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +#include <time.h> +#include <math.h> +#include <stdlib.h> +#include <string.h> + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "MEM_guardedalloc.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" + +#include "BKE_global.h" +#include "BKE_main.h" +#include "BKE_library.h" + +#include "BLI_blenlib.h" + +#include "BSE_filesel.h" + +#include "BIF_gl.h" +#include "BIF_graphics.h" +#include "BIF_keyval.h" +#include "BIF_mainqueue.h" +#include "BIF_resources.h" +#include "BIF_screen.h" +#include "BIF_mywindow.h" +#include "BIF_space.h" +#include "BIF_glutil.h" +#include "BIF_interface.h" +#include "BIF_toolbox.h" + +#include "BIF_butspace.h" + +#include "interface.h" +#include "mydevice.h" +#include "blendef.h" + +/* -----includes for this file specific----- */ + +#include "render.h" +#include "DNA_image_types.h" +#include "BKE_writeavi.h" +#include "BKE_image.h" +#include "BIF_renderwin.h" +#include "BIF_writeimage.h" +#include "BIF_writeavicodec.h" + +#ifdef WITH_QUICKTIME +#include "quicktime_export.h" +#endif + + +/* here the calls for scene buttons + - render + - world + - anim settings, audio +*/ + +static void output_pic(char *name) +{ + strcpy(G.scene->r.pic, name); + allqueue(REDRAWBUTSRENDER, 0); +} + +static void backbuf_pic(char *name) +{ + Image *ima; + + strcpy(G.scene->r.backbuf, name); + allqueue(REDRAWBUTSRENDER, 0); + + ima= add_image(name); + if(ima) { + free_image_buffers(ima); /* force read again */ + ima->ok= 1; + } +} + +static void ftype_pic(char *name) +{ + strcpy(G.scene->r.ftype, name); + allqueue(REDRAWBUTSRENDER, 0); +} + + +static void scene_change_set(Scene *sc, Scene *set) { + if (sc->set!=set) { + sc->set= set; + + allqueue(REDRAWBUTSRENDER, 0); + allqueue(REDRAWVIEW3D, 0); + } +} + +static void run_playanim(char *file) { + extern char bprogname[]; /* usiblender.c */ + char str[FILE_MAXDIR+FILE_MAXFILE]; + int pos[2], size[2]; + + calc_renderwin_rectangle(R.winpos, pos, size); + + sprintf(str, "%s -a -p %d %d \"%s\"", bprogname, pos[0], pos[1], file); + system(str); +} + +void do_render_panels(unsigned short event) +{ + ScrArea *sa; + ID *id; + char file[FILE_MAXDIR+FILE_MAXFILE]; + + switch(event) { + + case B_DORENDER: + BIF_do_render(0); + break; + case B_RTCHANGED: + allqueue(REDRAWALL, 0); + break; + case B_PLAYANIM: +#ifdef WITH_QUICKTIME + if(G.scene->r.imtype == R_QUICKTIME) + makeqtstring(file); + else +#endif + makeavistring(file); + if(BLI_exist(file)) { + run_playanim(file); + } + else { + makepicstring(file, G.scene->r.sfra); + if(BLI_exist(file)) { + run_playanim(file); + } + else error("Can't find image: %s", file); + } + break; + + case B_DOANIM: + BIF_do_render(1); + break; + + case B_FS_PIC: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_fileselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic); + break; + case B_FS_BACKBUF: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_fileselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic); + break; + case B_IS_BACKBUF: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_imageselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic); + break; + case B_FS_FTYPE: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_fileselect(FILE_SPECIAL, "SELECT FTYPE", G.scene->r.ftype, ftype_pic); + break; + case B_IS_FTYPE: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_imageselect(FILE_SPECIAL, "SELECT FTYPE", G.scene->r.ftype, ftype_pic); + break; + + case B_PR_PAL: + G.scene->r.xsch= 720; + G.scene->r.ysch= 576; + G.scene->r.xasp= 54; + G.scene->r.yasp= 51; + G.scene->r.size= 100; + G.scene->r.frs_sec= 25; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWBUTSRENDER, 0); + allqueue(REDRAWVIEWCAM, 0); + break; + +#ifdef WITH_QUICKTIME + case B_FILETYPEMENU: + allqueue(REDRAWBUTSRENDER, 0); +#if defined (_WIN32) || defined (__APPLE__) + // fall through to codec settings if this is the first + // time R_AVICODEC is selected for this scene. + if (((G.scene->r.imtype == R_AVICODEC) + && (G.scene->r.avicodecdata == NULL)) || + ((G.scene->r.imtype == R_QUICKTIME) + && (G.scene->r.qtcodecdata == NULL))) { + } else { + break; + } +#else /* libquicktime */ + if(G.scene->r.imtype == R_QUICKTIME) { + /* i'm not sure if this should be here... */ + /* set default quicktime codec */ + if (!G.scene->r.qtcodecdata) { + G.scene->r.qtcodecdata = MEM_callocN(sizeof(QtCodecData), + "QtCodecData"); + qtcodec_idx = 1; + } + + qt_init_codecs(); + if (qtcodec_idx < 1) qtcodec_idx = 1; + + G.scene->r.qtcodecdata->fourcc = + qtcodecidx_to_fcc(qtcodec_idx-1); + qt_init_codecdata(G.scene->r.qtcodecdata); +/* I'm not sure if this is really needed, so don't remove it yet */ +#if 0 + /* get index of codec that can handle a given fourcc */ + if (qtcodec_idx < 1) + qtcodec_idx = get_qtcodec_idx(G.scene->r.qtcodecdata->fourcc)+1; + + /* no suitable codec found, alert user */ + if (qtcodec_idx < -1) { + error("no suitable codec found!"); + qtcodec_idx = 1; + } +#endif /* 0 */ + } +#endif /*_WIN32 || __APPLE__ */ + + case B_SELECTCODEC: +#if defined (_WIN32) || defined (__APPLE__) + if ((G.scene->r.imtype == R_QUICKTIME)) /* || (G.scene->r.qtcodecdata)) */ + get_qtcodec_settings(); +#ifdef _WIN32 + else + get_avicodec_settings(); +#endif /* _WIN32 */ +#else /* libquicktime */ + if (!G.scene->r.qtcodecdata) { + G.scene->r.qtcodecdata = MEM_callocN(sizeof(QtCodecData), + "QtCodecData"); + qtcodec_idx = 1; + } + if (qtcodec_idx < 1) { + qtcodec_idx = 1; + qt_init_codecs(); + } + + G.scene->r.qtcodecdata->fourcc = qtcodecidx_to_fcc(qtcodec_idx-1); + /* if the selected codec differs from the previous one, reinit it */ + qt_init_codecdata(G.scene->r.qtcodecdata); + allqueue(REDRAWBUTSRENDER, 0); +#endif /* _WIN32 || __APPLE__ */ + break; +#endif /* WITH_QUICKTIME */ + + case B_PR_FULL: + G.scene->r.xsch= 1280; + G.scene->r.ysch= 1024; + G.scene->r.xasp= 1; + G.scene->r.yasp= 1; + G.scene->r.size= 100; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWBUTSRENDER, 0); + allqueue(REDRAWVIEWCAM, 0); + break; + case B_PR_PRV: + G.scene->r.xsch= 640; + G.scene->r.ysch= 512; + G.scene->r.xasp= 1; + G.scene->r.yasp= 1; + G.scene->r.size= 50; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_CDI: + G.scene->r.xsch= 384; + G.scene->r.ysch= 280; + G.scene->r.xasp= 1; + G.scene->r.yasp= 1; + G.scene->r.size= 100; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.15, 0.85, 0.15, 0.85); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_PAL169: + G.scene->r.xsch= 720; + G.scene->r.ysch= 576; + G.scene->r.xasp= 64; + G.scene->r.yasp= 45; + G.scene->r.size= 100; + G.scene->r.frs_sec= 25; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_D2MAC: + G.scene->r.xsch= 1024; + G.scene->r.ysch= 576; + G.scene->r.xasp= 1; + G.scene->r.yasp= 1; + G.scene->r.size= 50; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_MPEG: + G.scene->r.xsch= 368; + G.scene->r.ysch= 272; + G.scene->r.xasp= 105; + G.scene->r.yasp= 100; + G.scene->r.size= 100; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_PC: + G.scene->r.xsch= 640; + G.scene->r.ysch= 480; + G.scene->r.xasp= 100; + G.scene->r.yasp= 100; + G.scene->r.size= 100; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_PRESET: + G.scene->r.xsch= 720; + G.scene->r.ysch= 576; + G.scene->r.xasp= 54; + G.scene->r.yasp= 51; + G.scene->r.size= 100; + G.scene->r.mode= R_OSA+R_SHADOW+R_FIELDS; + G.scene->r.imtype= R_TARGA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_PANO: + G.scene->r.xsch= 36; + G.scene->r.ysch= 176; + G.scene->r.xasp= 115; + G.scene->r.yasp= 100; + G.scene->r.size= 100; + G.scene->r.mode |= R_PANORAMA; + G.scene->r.xparts= 16; + G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWVIEWCAM, 0); + allqueue(REDRAWBUTSRENDER, 0); + break; + case B_PR_NTSC: + G.scene->r.xsch= 720; + G.scene->r.ysch= 480; + G.scene->r.xasp= 10; + G.scene->r.yasp= 11; + G.scene->r.size= 100; + G.scene->r.frs_sec= 30; + G.scene->r.mode &= ~R_PANORAMA; + G.scene->r.xparts= G.scene->r.yparts= 1; + + BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); + allqueue(REDRAWBUTSRENDER, 0); + allqueue(REDRAWVIEWCAM, 0); + break; + + case B_SETBROWSE: + id= (ID*) G.scene->set; + + if (G.buts->menunr==-2) { + activate_databrowse(id, ID_SCE, 0, B_SETBROWSE, &G.buts->menunr, do_render_panels); + } else if (G.buts->menunr>0) { + Scene *newset= (Scene*) BLI_findlink(&G.main->scene, G.buts->menunr-1); + + if (newset==G.scene) + error("Not allowed"); + else if (newset) + scene_change_set(G.scene, newset); + } + break; + case B_CLEARSET: + scene_change_set(G.scene, NULL); + break; + } +} + +static uiBlock *edge_render_menu(void *arg_unused) +{ + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, + "edge render", UI_EMBOSSX, UI_HELV, + curarea->win); + + /* use this for a fake extra empy space around the buttons */ + uiDefBut(block, LABEL, 0, "", +/* 285, -20, 230, 100, NULL, */ + 285, -20, 230, 120, NULL, + 0, 0, 0, 0, ""); + + uiDefButS(block, NUM, 0,"Eint:", + 295,50,70,19, + &G.scene->r.edgeint, 0.0, 255.0, 0, 0, + "Sets edge intensity for Toon shading"); + uiBlockSetCol(block, BUTGREEN); + uiDefButI(block, TOG, 0,"Shift", + 365,50,70,19, + &G.compat, 0, 0, 0, 0, + "For unified renderer: use old offsets for edges"); + uiDefButI(block, TOG, 0,"All", 435,50,70,19, + &G.notonlysolid, 0, 0, 0, 0, + "For unified renderer: also consider transparent " + "faces for toon shading"); + + /* colour settings for the toon shading */ + uiBlockSetCol(block, BUTGREY); + uiDefButF(block, COL, B_EDGECOLSLI, "", + 295,-10,30,60, + &(G.scene->r.edgeR), 0, 0, 0, 0, + ""); + + uiDefButF(block, NUMSLI, 0, "R ", + 325, 30, 180,19, + &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0, + "For unified renderer: Colour for edges in toon shading mode."); + uiDefButF(block, NUMSLI, 0, "G ", + 325, 10, 180,19, + &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0, + "For unified renderer: Colour for edges in toon shading mode."); + uiDefButF(block, NUMSLI, 0, "B ", + 325, -10, 180,19, + &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0, + "For unified renderer: Colour for edges in toon shading mode."); + + uiDefButS(block, NUM, 0,"AntiShift", + 365,70,140,19, + &(G.scene->r.same_mat_redux), 0, 255.0, 0, 0, + "For unified renderer: reduce intensity on boundaries " + "with identical materials with this number."); + + uiBlockSetDirection(block, UI_TOP); + + return block; +} + +static uiBlock *post_render_menu(void *arg_unused) +{ + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, "post render", UI_EMBOSSX, UI_HELV, curarea->win); + + /* use this for a fake extra empy space around the buttons */ + uiDefBut(block, LABEL, 0, "", -10, 10, 200, 80, NULL, 0, 0, 0, 0, ""); + + uiDefButF(block, NUMSLI, 0,"Add:", 0,60,180,19, + &G.scene->r.postadd, -1.0, 1.0, 0, 0, ""); + uiDefButF(block, NUMSLI, 0,"Mul:", 0,40,180,19, + &G.scene->r.postmul, 0.01, 4.0, 0, 0, ""); + uiDefButF(block, NUMSLI, 0,"Gamma:", 0,20,180,19, + &G.scene->r.postgamma, 0.2, 2.0, 0, 0, ""); + + uiBlockSetDirection(block, UI_TOP); + + return block; +} + + +static uiBlock *framing_render_menu(void *arg_unused) +{ + uiBlock *block; + short yco = 60, xco = 0; + int randomcolorindex = 1234; + + block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSSX, UI_HELV, curarea->win); + + /* use this for a fake extra empy space around the buttons */ + uiDefBut(block, LABEL, 0, "", -10, -10, 300, 100, NULL, 0, 0, 0, 0, ""); + + uiDefBut(block, LABEL, B_NOP, "Framing:", xco, yco, 68,19, 0, 0, 0, 0, 0, ""); + uiDefButC(block, ROW, 0, "Stretch", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_SCALE , 0, 0, "Stretch or squeeze the viewport to fill the display window"); + uiDefButC(block, ROW, 0, "Expose", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_EXTEND, 0, 0, "Show the entire viewport in the display window, viewing more horizontally or vertically"); + uiDefButC(block, ROW, 0, "Bars", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_BARS , 0, 0, "Show the entire viewport in the display window, using bar horizontally or vertically"); + + yco -= 20; + xco = 35; + + uiDefButF(block, COL, randomcolorindex, "", 0, yco - 58 + 18, 33, 58, &G.scene->framing.col[0], 0, 0, 0, 0, ""); + + uiDefButF(block, NUMSLI, 0, "R ", xco,yco,243,18, &G.scene->framing.col[0], 0.0, 1.0, randomcolorindex, 0, "Set the red component of the bars"); + yco -= 20; + uiDefButF(block, NUMSLI, 0, "G ", xco,yco,243,18, &G.scene->framing.col[1], 0.0, 1.0, randomcolorindex, 0, "Set the green component of the bars"); + yco -= 20; + uiDefButF(block, NUMSLI, 0, "B ", xco,yco,243,18, &G.scene->framing.col[2], 0.0, 1.0, randomcolorindex, 0, "Set the blue component of the bars"); + + uiBlockSetDirection(block, UI_TOP); + + return block; +} + + +static char *imagetype_pup(void) +{ + static char string[1024]; + char formatstring[1024]; + + strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); + +#ifdef __sgi + strcat(formatstring, "|%s %%x%d"); // add space for Movie +#endif + + strcat(formatstring, "|%s %%x%d"); // add space for PNG + +#ifdef _WIN32 + strcat(formatstring, "|%s %%x%d"); // add space for AVI Codec +#endif + +#ifdef WITH_QUICKTIME + if(G.have_quicktime) + strcat(formatstring, "|%s %%x%d"); // add space for Quicktime +#endif + + if(G.have_quicktime) { + sprintf(string, formatstring, + "AVI Raw", R_AVIRAW, + "AVI Jpeg", R_AVIJPEG, +#ifdef _WIN32 + "AVI Codec", R_AVICODEC, +#endif +#ifdef WITH_QUICKTIME + "QuickTime", R_QUICKTIME, +#endif + "Targa", R_TARGA, + "Targa Raw", R_RAWTGA, + "PNG", R_PNG, + "Jpeg", R_JPEG90, + "HamX", R_HAMX, + "Iris", R_IRIS, + "Iris + Zbuffer", R_IRIZ, + "Ftype", R_FTYPE, + "Movie", R_MOVIE + ); + } else { + sprintf(string, formatstring, + "AVI Raw", R_AVIRAW, + "AVI Jpeg", R_AVIJPEG, +#ifdef _WIN32 + "AVI Codec", R_AVICODEC, +#endif + "Targa", R_TARGA, + "Targa Raw", R_RAWTGA, + "PNG", R_PNG, + "Jpeg", R_JPEG90, + "HamX", R_HAMX, + "Iris", R_IRIS, + "Iris + Zbuffer", R_IRIZ, + "Ftype", R_FTYPE, + "Movie", R_MOVIE + ); + } + + return (string); +} + +#ifdef _WIN32 +static char *avicodec_str(void) +{ + static char string[1024]; + + sprintf(string, "Codec: %s", G.scene->r.avicodecdata->avicodecname); + + return string; +} +#endif + +static void test_scenepoin_but(char *name, ID **idpp) +{ + ID *id; + + if( *idpp ) (*idpp)->us--; + + id= G.main->scene.first; + while(id) { + if( strcmp(name, id->name+2)==0 ) { + *idpp= id; + id_us_plus(id); + return; + } + id= id->next; + } + *idpp= 0; +} + +static void render_panel_output() +{ + ID *id; + int a,b; + uiBlock *block; + char *strp; + + + block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSSX, UI_HELV, curarea->win); + uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204); + if( uiIsPanelClosed(block) ) return; // does draw when closed + + uiDefBut(block, TEX,0,"", 30, 170, 268, 19,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to"); + uiDefBut(block, BUT,B_FS_PIC," ", 8, 170, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name"); + uiDefBut(block, TEX,0,"", 30, 148, 268, 19,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering"); + uiDefBut(block, BUT,B_FS_BACKBUF," ", 15, 148, 10, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image"); + uiDefBut(block, TEX,0,"", 30, 125, 268, 19,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type"); + uiDefBut(block, BUT,B_FS_FTYPE," ", 15, 125, 10, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image"); + uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 131, 95, 20, 19, 0, 0, 0, 0, 0, "Remove Set link"); + uiBlockSetCol(block, BUTSALMON); + uiDefBut(block, BUT,B_IS_BACKBUF," ", 8, 148, 10, 19, 0, 0, 0, 0, 0, "Open Imageselect to get Backbuf image"); + uiDefBut(block, BUT,B_IS_FTYPE," ", 8, 125, 10, 19, 0, 0, 0, 0, 0, "Open Imageselect to get Ftype image"); + uiBlockSetCol(block, BUTGREY); + + /* SET BUTTON */ + id= (ID *)G.scene->set; + IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr)); + if(strp[0]) + uiDefButS(block, MENU, B_SETBROWSE, strp, 8, 96, 20, 19, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set"); + MEM_freeN(strp); + + uiBlockSetCol(block, BUTBLUE); + + if(G.scene->set) { + uiSetButLock(1, NULL); + uiDefIDPoinBut(block, test_scenepoin_but, 0, "", 25, 97, 104, 19, &(G.scene->set), "Name of the Set"); + uiClearButLock(); + } + + + uiDefButS(block, TOG|BIT|0, 0,"Backbuf", 8, 70, 62, 19, &G.scene->r.bufflag, 0, 0, 0, 0, "Enable/Disable use of Backbuf image"); + + uiBlockSetCol(block, BUTGREY); + + for(b=0; b<3; b++) + for(a=0; a<3; a++) + uiDefButS(block, TOG|BIT|(3*b+a), 800,"", (short)(9+18*a),(short)(7+12*b),16,10, &R.winpos, 0, 0, 0, 0, "Render window placement on screen"); + + uiDefButS(block, ROW, B_REDR, "DispView", 72, 7, 65, 19, &R.displaymode, 0.0, (float)R_DISPLAYVIEW, 0, 0, "Sets render output to display in 3D view"); + uiDefButS(block, ROW, B_REDR, "DispWin", 139, 7, 62, 19, &R.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output to display in a seperate window"); + + uiDefButS(block, TOG|BIT|4, 0, "Extensions", 228, 8, 67, 18, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations"); + + /* Toon shading buttons */ + uiDefButS(block, TOG|BIT|5, 0,"Edge", 154, 70, 47, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon shading"); + uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings |>> ", 204, 71, 93, 19, "Display edge settings"); + + /* unified render buttons */ + if(G.scene->r.mode & R_UNIFIED) { + uiDefBlockBut(block, post_render_menu, NULL, "Post process |>> ", 205, 48, 92, 19, "Only for unified render"); + if (G.scene->r.mode & R_GAMMA) { + uiDefButF(block, NUMSLI, 0,"Gamma:", 8, 48, 143, 19, + &(G.scene->r.gamma), 0.2, 5.0, B_GAMMASLI, 0, + "The gamma value for blending oversampled images (1.0 = no correction)."); + } + } + + uiScalePanelBlock(block); // scales and centers + uiDrawBlock(block); +} + +static void render_panel_render() +{ + uiBlock *block; + + + block= uiNewBlock(&curarea->uiblocks, "render_panel_render", UI_EMBOSSX, UI_HELV, curarea->win); + uiNewPanel(curarea, block, "Render", "Render", 320, 0, 318, 204); + if( uiIsPanelClosed(block) ) return; // does draw when closed + + uiBlockSetCol(block, BUTSALMON); + + uiDefBut(block, BUT,B_DORENDER,"RENDER", 369,142,192,47, 0, 0, 0, 0, 0, "Start the rendering"); + + uiBlockSetCol(block, BUTGREY); + + uiDefButS(block, TOG|BIT|0, 0, "OSA", 369,114,124,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)"); + uiDefButF(block, NUM,B_DIFF,"Bf:", 495,90,65,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 0, "Sets motion blur factor"); + uiDefButS(block, TOG|BIT|14, 0, "MBLUR", 495,114,66,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation"); + + uiDefButS(block, ROW,B_DIFF,"5", 369,90,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Sets oversample level to 5"); + uiDefButS(block, ROW,B_DIFF,"8", 400,90,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Sets oversample level to 8 (Recommended)"); + uiDefButS(block, ROW,B_DIFF,"11", 431,90,33,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Sets oversample level to 11"); + uiDefButS(block, ROW,B_DIFF,"16", 466,90,28,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Sets oversample level to 16"); + + uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,42,99,31,&G.scene->r.xparts,1.0, 64.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)"); + uiDefButS(block, NUM,B_DIFF,"Yparts:", 472,42,86,31,&G.scene->r.yparts,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in"); + + uiDefButS(block, ROW,800,"Sky", 369,11,38,24,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky"); + uiDefButS(block, ROW,800,"Premul", 410,11,54,24,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance"); + uiDefButS(block, ROW,800,"Key", 467,11,44,24,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and colour values remain unchanged"); + + uiBlockSetCol(block, BUTGREY); + uiDefButS(block, TOG|BIT|1,0,"Shadow", 565,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation"); + uiDefButS(block, TOG|BIT|4,0,"EnvMap", 626,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map renering"); + uiDefButS(block, TOG|BIT|10,0,"Pano", 565,142,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)"); + uiDefButS(block, TOG|BIT|8,0,"Radio", 626,142,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering"); + + uiDefButS(block, ROW,B_DIFF,"100%", 565,114,121,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size"); + uiDefButS(block, ROW,B_DIFF,"75%", 565,90,36,20,&G.scene->r.size,1.0,75.0, 0, 0, "Set render size to 3/4 of defined size"); + uiDefButS(block, ROW,B_DIFF,"50%", 604,90,40,20,&G.scene->r.size,1.0,50.0, 0, 0, "Set render size to 1/2 of defined size"); + uiDefButS(block, ROW,B_DIFF,"25%", 647,90,39,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size"); + + uiDefButS(block, TOG|BIT|6,0,"Fields", 564,42,90,31,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering"); + + uiDefButS(block, TOG|BIT|13,0,"Odd", 655,57,30,16,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)"); + uiDefButS(block, TOG|BIT|7,0,"x", 655,42,30,15,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations"); + + uiDefButS(block, TOG|BIT|9,REDRAWVIEWCAM, "Border", 565,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image"); + uiDefButS(block, TOG|BIT|2,0, "Gamma", 626,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction"); + + + uiScalePanelBlock(block); // scales and centers + uiDrawBlock(block); +} + +static void render_panel_anim() +{ + uiBlock *block; + + + block= uiNewBlock(&curarea->uiblocks, "render_panel_anim", UI_EMBOSSX, UI_HELV, curarea->win); + uiNewPanel(curarea, block, "Anim", "Render", 640, 0, 318, 204); + if( uiIsPanelClosed(block) ) return; // does draw when closed + + + uiBlockSetCol(block, BUTSALMON); + uiDefBut(block, BUT,B_DOANIM,"ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Start rendering a sequence"); + + uiBlockSetCol(block, BUTBLUE); + + uiDefButS(block, TOG|BIT|0, 0, "Do Sequence", 692,114,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)"); + uiDefButS(block, TOG|BIT|1, 0, "Render Daemon", 692,90,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Let external network render current scene"); + + uiBlockSetCol(block, BUTGREY); + uiDefBut(block, BUT,B_PLAYANIM, "PLAY", 692,40,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)"); + uiDefButS(block, NUM, B_RTCHANGED, "rt:", 790,40,95,33, &G.rt, 0.0, 256.0, 0, 0, "General testing/debug button"); + + uiDefButS(block, NUM,REDRAWSEQ,"Sta:", 692,10,94,24, &G.scene->r.sfra,1.0,18000.0, 0, 0, "The start frame of the animation"); + uiDefButS(block, NUM,REDRAWSEQ,"End:", 790,10,95,24, &G.scene->r.efra,1.0,18000.0, 0, 0, "The end frame of the animation"); + + uiScalePanelBlock(block); // scales and centers + uiDrawBlock(block); +} + +static void render_panel_format() +{ + uiBlock *block; + int yofs; + + + block= uiNewBlock(&curarea->uiblocks, "render_panel_format", UI_EMBOSSX, UI_HELV, curarea->win); + uiNewPanel(curarea, block, "Format", "Render", 960, 0, 318, 204); + if( uiIsPanelClosed(block) ) return; // does draw when closed + + uiDefBlockBut(block, framing_render_menu, NULL, "Game framing settings |>> ", 892, 169, 227, 20, "Display game framing settings"); + + uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeX:", 892 ,136,112,27, &G.scene->r.xsch, 4.0, 10000.0, 0, 0, "The image width in pixels"); + uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeY:", 1007,136,112,27, &G.scene->r.ysch, 4.0,10000.0, 0, 0, "The image height in scanlines"); + uiDefButS(block, NUM,REDRAWVIEWCAM,"AspX:", 892 ,114,112,20, &G.scene->r.xasp, 1.0,200.0, 0, 0, "The horizontal aspect ratio"); + uiDefButS(block, NUM,REDRAWVIEWCAM,"AspY:", 1007,114,112,20, &G.scene->r.yasp, 1.0,200.0, 0, 0, "The vertical aspect ratio"); + + + yofs = 54; + +#ifdef __sgi + yofs = 76; + uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie"); + uiBlockSetCol(block, BUTGREEN); + uiDefButS(block, TOG|BIT|12,0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware"); + uiBlockSetCol(block, BUTGREY); +#endif + + uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format"); + uiBlockSetCol(block, BUTGREEN); + uiDefButS(block, TOG|BIT|11,0, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image"); + uiBlockSetCol(block, BUTGREY); + + yofs -= 22; + + if(G.scene->r.quality==0) G.scene->r.quality= 90; + +#ifdef WITH_QUICKTIME + if (G.scene->r.imtype == R_AVICODEC || G.scene->r.imtype == R_QUICKTIME) { +#else /* WITH_QUICKTIME */ + if (0) { +#endif + if(G.scene->r.imtype == R_QUICKTIME) { +#ifdef WITH_QUICKTIME +#if defined (_WIN32) || defined (__APPLE__) + glColor3f(0.65, 0.65, 0.7); + glRecti(892,yofs+46,892+225,yofs+45+20); + if(G.scene->r.qtcodecdata == NULL) + uiDefBut(block, LABEL, 0, "Codec: not set", 892,yofs+44,225,20, 0, 0, 0, 0, 0, ""); + else + uiDefBut(block, LABEL, 0, G.scene->r.qtcodecdata->qtcodecname, 892,yofs+44,225,20, 0, 0, 0, 0, 0, ""); + uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime"); +#else /* libquicktime */ + if (!G.scene->r.qtcodecdata) G.scene->r.qtcodecdata = MEM_callocN(sizeof(QtCodecData), "QtCodecData"); + uiDefButI(block, MENU, B_SELECTCODEC, qtcodecs_pup(), 892,yofs, 112, 20, &qtcodec_idx, 0, 0, 0, 0, "Codec"); + /* make sure the codec stored in G.scene->r.qtcodecdata matches the selected + * one, especially if it's not set.. */ + if (!G.scene->r.qtcodecdata->fourcc) { + G.scene->r.qtcodecdata->fourcc = qtcodecidx_to_fcc(qtcodec_idx-1); + qt_init_codecdata(G.scene->r.qtcodecdata); + } + + yofs -= 22; + uiDefBlockBut(block, qtcodec_menu, NULL, "Codec Settings |>> ", 892,yofs, 227, 20, "Edit Codec settings for QuickTime"); + yofs +=22; + +#endif /* libquicktime */ +#endif /* WITH_QUICKTIME */ + } else { +#ifdef _WIN32 + glColor3f(0.65, 0.65, 0.7); + glRecti(892,yofs+46,892+225,yofs+45+20); + if(G.scene->r.avicodecdata == NULL) + uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+43,225,20, 0, 0, 0, 0, 0, ""); + else + uiDefBut(block, LABEL, 0, avicodec_str(), 892,yofs+43,225,20, 0, 0, 0, 0, 0, ""); +#endif + uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI"); + } + } else { + uiDefButS(block, NUM,0, "Quality:", 892,yofs,112,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies"); + } + uiDefButS(block, NUM,REDRAWSEQ,"Frs/sec:", 1006,yofs,113,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second"); + + + + uiDefButS(block, ROW,B_DIFF,"BW", 892, 10,74,20, &G.scene->r.planes, 5.0,(float)R_PLANESBW, 0, 0, "Images are saved with BW (grayscale) data"); + uiDefButS(block, ROW,B_DIFF,"RGB", 968, 10,74,20, &G.scene->r.planes, 5.0,(float)R_PLANES24, 0, 0, "Images are saved with RGB (color) data"); + uiDefButS(block, ROW,B_DIFF,"RGBA", 1044, 10,75,20, &G.scene->r.planes, 5.0,(float)R_PLANES32, 0, 0, "Images are saved with RGB and Alpha data (if supported)"); + + + uiDefBut(block, BUT,B_PR_PAL, "PAL", 1146,170,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 54x51, 25 fps"); + uiDefBut(block, BUT,B_PR_NTSC, "NTSC", 1146,150,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x480, Aspect ratio - 10x11, 30 fps"); + uiDefBut(block, BUT,B_PR_PRESET, "Default", 1146,130,100,18, 0, 0, 0, 0, 0, "Same as PAL, with render settings (OSA, Shadows, Fields)"); + uiDefBut(block, BUT,B_PR_PRV, "Preview", 1146,110,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x512, Render size 50%"); + uiDefBut(block, BUT,B_PR_PC, "PC", 1146,90,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100"); + uiDefBut(block, BUT,B_PR_PAL169, "PAL 16:9",1146,70,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 64x45"); + uiDefBut(block, BUT,B_PR_PANO, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings"); + uiDefBut(block, BUT,B_PR_FULL, "FULL", 1146,30,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1280x1024, Aspect ratio - 1x1"); + uiDefButS(block, TOG|BIT|15, B_REDR, "Unified Renderer", 1146,10,100,18, &G.scene->r.mode, 0, 0, 0, 0, "Use the unified renderer."); + + + uiScalePanelBlock(block); // scales and centers + uiDrawBlock(block); +} + + +void render_panels() +{ + + render_panel_output(); + render_panel_render(); + render_panel_anim(); + render_panel_format(); + +} diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 0cb9b75bf73..7c0949a0a74 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -126,7 +126,7 @@ void meshactionbuts(SpaceAction *saction, Key *key) * correctly *grumble* */ mywinset(curarea->win); - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); sprintf(str, "actionbuttonswin %d", curarea->win); block= uiNewBlock (&curarea->uiblocks, str, @@ -302,7 +302,7 @@ static void draw_channel_names(void) bAction *act; Key *key; - myortho2 (0, NAMEWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); // Scaling + myortho2(0, NAMEWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); // Scaling /* Blank out the area */ if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { @@ -343,8 +343,7 @@ static void draw_channel_names(void) } } - myortho2 (0, NAMEWIDTH, 0, - (ofsy+G.v2d->mask.ymax) - + myortho2(0, NAMEWIDTH, 0, (ofsy+G.v2d->mask.ymax) - (ofsy+G.v2d->mask.ymin-SCROLLB)); // Scaling glShadeModel(GL_SMOOTH); @@ -615,8 +614,7 @@ void drawactionspace(ScrArea *sa, void *spacedata) glClearColor(.45, .45, .45, 0.0); glClear(GL_COLOR_BUFFER_BIT); - myortho2 (G.v2d->cur.xmin, G.v2d->cur.xmax, - G.v2d->cur.ymin, G.v2d->cur.ymax); + myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); /* Draw backdrop */ calc_ipogrid(); @@ -643,14 +641,13 @@ void drawactionspace(ScrArea *sa, void *spacedata) ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, - G.v2d->cur.ymin, G.v2d->cur.ymax); + myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); draw_cfra_action(); /* Draw scroll */ - mywinset(curarea->win); + mywinset(curarea->win); // reset scissor too if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); if(G.v2d->scroll) drawscroll(0); } @@ -664,6 +661,9 @@ void drawactionspace(ScrArea *sa, void *spacedata) meshactionbuts(G.saction, key); } + mywinset(curarea->win); // reset scissor too + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); + draw_area_emboss(sa); curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 4e06155742f..a2e456c6a53 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -32,6 +32,7 @@ #include <stdio.h> #include <math.h> +#include <string.h> #ifdef HAVE_CONFIG_H #include <config.h> @@ -115,7 +116,6 @@ static void scroll_prstr(float x, float y, float val, char dir, int disptype) len= strlen(str); if(dir=='h') x-= 4*len; - else y-= 4*len; if(dir=='v' && disptype==IPO_DISPDEGR) { str[len]= 186; /* Degree symbol */ @@ -389,7 +389,7 @@ void test_view2d(View2D *v2d, int winx, int winy) v2d->cur.xmax=v2d->cur.xmin+((float)winx); if(v2d->keepzoom & V2D_KEEPZOOM) { - /* do not test for min/max: usiig curarea try to fixate zoom */ + /* do not test for min/max: use curarea try to fixate zoom */ zoom= ((float)winx)/dx; if(zoom<v2d->minzoom || zoom>v2d->maxzoom) { @@ -450,9 +450,6 @@ void test_view2d(View2D *v2d, int winx, int winy) } - - - if(v2d->keeptot) { dx= cur->xmax-cur->xmin; dy= cur->ymax-cur->ymin; @@ -527,9 +524,9 @@ void test_view2d(View2D *v2d, int winx, int winy) /* dx/dy is the total aspect */ /* this exception is for buttons...keepzoom doesnt work proper */ - if(v2d->keepzoom) fac= dy; - else fac= dx/dy; - + //if(v2d->keepzoom) fac= dy; + //else fac= dx/dy; +fac= dx/dy; if(fac>1.0) { /* portrait window: correct for x */ @@ -574,23 +571,23 @@ void calc_scrollrcts(View2D *v2d, int winx, int winy) if(v2d->scroll & L_SCROLL) { v2d->vert= v2d->mask; v2d->vert.xmax= SCROLLB; - v2d->mask.xmin= SCROLLB+1; + v2d->mask.xmin= SCROLLB; } else if(v2d->scroll & R_SCROLL) { v2d->vert= v2d->mask; v2d->vert.xmin= v2d->vert.xmax-SCROLLB; - v2d->mask.xmax= v2d->vert.xmin-1; + v2d->mask.xmax= v2d->vert.xmin; } if(v2d->scroll & B_SCROLL) { v2d->hor= v2d->mask; v2d->hor.ymax= SCROLLH; - v2d->mask.ymin= SCROLLH+1; + v2d->mask.ymin= SCROLLH; } else if(v2d->scroll & T_SCROLL) { v2d->hor= v2d->mask; v2d->hor.ymin= v2d->hor.ymax-SCROLLH; - v2d->mask.ymax= v2d->hor.ymin-1; + v2d->mask.ymax= v2d->hor.ymin; } } } @@ -643,42 +640,38 @@ void drawscroll(int disptype) { rcti vert, hor; float fac, dfac, val, fac2, tim; - unsigned int dark, darker, light; + unsigned int darker, dark, light, lighter; vert= (G.v2d->vert); hor= (G.v2d->hor); - darker= 0x525252; - dark= 0x656565; + darker= 0x404040; + dark= 0x858585; light= 0x989898; + lighter= 0xc0c0c0; - cpack(dark); if(G.v2d->scroll & HOR_SCROLL) { + cpack(light); glRecti(hor.xmin, hor.ymin, hor.xmax, hor.ymax); - glColor3ub(0, 0, 0); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRecti(hor.xmin, hor.ymin, hor.xmax, hor.ymax); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* slider */ fac= (G.v2d->cur.xmin- G.v2d->tot.xmin)/(G.v2d->tot.xmax-G.v2d->tot.xmin); if(fac<0.0) fac= 0.0; - horxmin= hor.xmin+fac*(hor.xmax-hor.xmin) + 1; + horxmin= hor.xmin+fac*(hor.xmax-hor.xmin); fac= (G.v2d->cur.xmax- G.v2d->tot.xmin)/(G.v2d->tot.xmax-G.v2d->tot.xmin); if(fac>1.0) fac= 1.0; - horxmax= hor.xmin+fac*(hor.xmax-hor.xmin) -1; - - if(horxmin > horxmax-2) horxmin= horxmax-2; - - glColor3ub(0x78, 0x78, 0x78); - glRecti(horxmin, hor.ymin+1, horxmax, hor.ymax-1); + horxmax= hor.xmin+fac*(hor.xmax-hor.xmin); - cpack(light); - sdrawline(horxmin, hor.ymax-1, horxmax, hor.ymax-1); /* top */ - sdrawline(horxmin, hor.ymin+1, horxmin, hor.ymax-1); /* left */ - cpack(darker); - sdrawline(horxmin, hor.ymin+1, horxmax, hor.ymin+1); /* bottom */ - sdrawline(horxmax, hor.ymin+1, horxmax, hor.ymax-1); /* right */ + if(horxmin > horxmax) horxmin= horxmax; + cpack(dark); + glRecti(horxmin, hor.ymin, horxmax, hor.ymax); + + /* decoration bright line */ + cpack(lighter); + sdrawline(hor.xmin, hor.ymax, hor.xmax, hor.ymax); + /* the numbers: convert ipogrid_startx and -dx to scroll coordinates */ fac= (ipogrid_startx- G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); fac= hor.xmin+fac*(hor.xmax-hor.xmin); @@ -708,35 +701,33 @@ void drawscroll(int disptype) val+= ipogrid_dx; } } - cpack(dark); + if(G.v2d->scroll & VERT_SCROLL) { + cpack(light); glRecti(vert.xmin, vert.ymin, vert.xmax, vert.ymax); glColor3ub(0, 0, 0); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRecti(vert.xmin, vert.ymin, vert.xmax, vert.ymax); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - /* slider */ fac= (G.v2d->cur.ymin- G.v2d->tot.ymin)/(G.v2d->tot.ymax-G.v2d->tot.ymin); if(fac<0.0) fac= 0.0; - vertymin= vert.ymin+fac*(vert.ymax-vert.ymin) + 1; + vertymin= vert.ymin+fac*(vert.ymax-vert.ymin); fac= (G.v2d->cur.ymax- G.v2d->tot.ymin)/(G.v2d->tot.ymax-G.v2d->tot.ymin); if(fac>1.0) fac= 1.0; - vertymax= vert.ymin+fac*(vert.ymax-vert.ymin) -1; - - if(vertymin > vertymax-2) vertymin= vertymax-2; + vertymax= vert.ymin+fac*(vert.ymax-vert.ymin); - glColor3ub(0x78, 0x78, 0x78); - glRecti(vert.xmin+1, vertymin, vert.xmax-1, vertymax); + if(vertymin > vertymax) vertymin= vertymax; - cpack(light); - - sdrawline(vert.xmin+1, vertymax, vert.xmax-1, vertymax); /* top */ - sdrawline(vert.xmin+1, vertymin, vert.xmin+1, vertymax); /* left */ + cpack(dark); + glRecti(vert.xmin, vertymin, vert.xmax, vertymax); + + /* decoration black line */ cpack(darker); - sdrawline(vert.xmin+1, vertymin, vert.xmax-1, vertymin); /* bottom */ - sdrawline(vert.xmax-1, vertymin, vert.xmax-1, vertymax); /* right */ - + if(G.v2d->scroll & HOR_SCROLL) + sdrawline(vert.xmax, vert.ymin+SCROLLH, vert.xmax, vert.ymax); + else + sdrawline(vert.xmax, vert.ymin, vert.xmax, vert.ymax); + /* the numbers: convert ipogrid_starty and -dy to scroll coordinates */ fac= (ipogrid_starty- G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin); fac= vert.ymin+SCROLLH+fac*(vert.ymax-vert.ymin-SCROLLH); @@ -763,7 +754,7 @@ void drawscroll(int disptype) glColor3ub(0, 0, 0); val= ipogrid_starty; while(fac < vert.ymax) { - scroll_prstr((float)(vert.xmax)-3.0, fac, val, 'v', disptype); + scroll_prstr((float)(vert.xmax)-14.0, fac, val, 'v', disptype); fac+= dfac; val+= ipogrid_dy; } @@ -788,11 +779,13 @@ static void draw_ipobuts(SpaceIpo *sipo) if(tot<area->winy) sipo->butofs= 0; } - drawedge(v2d->mask.xmax+3, 0, v2d->mask.xmax+3, area->winy); glColor3ub(0x7f, 0x70, 0x70); - glRects(v2d->mask.xmax+6, 0, area->winx, area->winy); + glRects(v2d->mask.xmax, 0, area->winx, area->winy); + cpack(0x0); + sdrawline(v2d->mask.xmax, 0, v2d->mask.xmax, area->winy); + if(sipo->totipo==0) return; if(sipo->editipo==0) return; @@ -1412,7 +1405,7 @@ void drawipospace(ScrArea *sa, void *spacedata) if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { /* ortho at pixel level curarea */ - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); if(v2d->scroll) { drawscroll(disptype); @@ -1427,6 +1420,9 @@ void drawipospace(ScrArea *sa, void *spacedata) draw_ipogrid(); } + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); + draw_area_emboss(sa); + curarea->win_swap= WIN_BACK_OK; } @@ -1457,78 +1453,79 @@ void scroll_ipobuts() } } - - +/* total mess function, especially with mousewheel, needs cleanup badly (ton) */ int view2dzoom(unsigned short event) { float fac, dx, dy, wtemp; short mval[2], mvalo[2]; - + areawinset(curarea->win); /* from buttons */ curarea->head_swap= 0; getmouseco_areawin(mvalo); - while( (get_mbut()&(L_MOUSE|M_MOUSE)) || - (event==WHEELUPMOUSE) || - (event==WHEELDOWNMOUSE) ) { - - /* regular mousewheel: zoom regular - * alt-shift mousewheel: zoom y only - * alt-ctrl mousewheel: zoom x only - */ + while( (get_mbut()&(L_MOUSE|M_MOUSE)) || (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) { + + /* regular mousewheel: zoom regular + * alt-shift mousewheel: zoom y only + * alt-ctrl mousewheel: zoom x only + */ if (event==WHEELUPMOUSE) { if(U.uiflag & WHEELZOOMDIR) - wtemp = -0.1154; + wtemp = -0.0375; else - wtemp = 0.1154; - + wtemp = 0.03; + if(curarea->spacetype!=SPACE_BUTS) wtemp*= 3; + dx= (float)(wtemp*(G.v2d->cur.xmax-G.v2d->cur.xmin)); dy= (float)(wtemp*(G.v2d->cur.ymax-G.v2d->cur.ymin)); - - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case 0: - break; - case (LR_SHIFTKEY|LR_ALTKEY): - dx = 0; - break; - case (LR_CTRLKEY|LR_ALTKEY): - dy = 0; - break; - default: - return 0; - break; - } - } + + switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { + case 0: + break; + case (LR_SHIFTKEY|LR_ALTKEY): + dx = 0; + break; + case (LR_CTRLKEY|LR_ALTKEY): + dy = 0; + break; + default: + if(curarea->spacetype==SPACE_BUTS); // exception + else return 0; + break; + } + } else if (event==WHEELDOWNMOUSE) { if(U.uiflag & WHEELZOOMDIR) - wtemp = 0.1154; + wtemp = 0.03; else - wtemp = -0.1154; + wtemp = -0.0375; + if(curarea->spacetype!=SPACE_BUTS) wtemp*= 3; + dx= (float)(wtemp*(G.v2d->cur.xmax-G.v2d->cur.xmin)); dy= (float)(wtemp*(G.v2d->cur.ymax-G.v2d->cur.ymin)); - - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case 0: - break; - case (LR_SHIFTKEY|LR_ALTKEY): - dx = 0; - break; - case (LR_CTRLKEY|LR_ALTKEY): - dy = 0; - break; - default: - return 0; - break; - } - - } - else { - getmouseco_areawin(mval); + + switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { + case 0: + break; + case (LR_SHIFTKEY|LR_ALTKEY): + dx = 0; + break; + case (LR_CTRLKEY|LR_ALTKEY): + dy = 0; + break; + default: + if(curarea->spacetype==SPACE_BUTS); + else return 0; + break; + } + } + else { + getmouseco_areawin(mval); fac= 0.001*(mval[0]-mvalo[0]); dx= fac*(G.v2d->cur.xmax-G.v2d->cur.xmin); fac= 0.001*(mval[1]-mvalo[1]); dy= fac*(G.v2d->cur.ymax-G.v2d->cur.ymin); - } + } if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { G.v2d->cur.xmin+= dx; @@ -1537,17 +1534,17 @@ int view2dzoom(unsigned short event) G.v2d->cur.ymin+= dy; G.v2d->cur.ymax-= dy; } - + test_view2d(G.v2d, curarea->winx, curarea->winy); /* cur min max rects */ scrarea_do_windraw(curarea); screen_swapbuffers(); } else BIF_wait_for_statechange(); - /* return if we were using the mousewheel - */ - if ( (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) return 1; + /* return if we were using the mousewheel + */ + if ( (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) return 1; } - return 1; + return 1; } void center_currframe(void) @@ -1570,6 +1567,7 @@ void center_currframe(void) curarea->head_swap= 0; } +/* total mess function, especially with mousewheel, needs cleanup badly (ton) */ int view2dmove(unsigned short event) { /* return 1 when something was done */ @@ -1585,10 +1583,12 @@ int view2dmove(unsigned short event) * or if the mousewheel is being used. * Return if zooming was done. */ - if ( (G.qual & LR_CTRLKEY) || - (event==WHEELUPMOUSE) || - (event==WHEELDOWNMOUSE) ) { - if (view2dzoom(event)) { + + + if ( (G.qual & LR_CTRLKEY) || (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) { + /* patch for buttonswin, standard scroll no zoom */ + if(curarea->spacetype==SPACE_BUTS && (G.qual & LR_CTRLKEY)==0); + else if (view2dzoom(event)) { curarea->head_swap= 0; return 0; } @@ -1643,63 +1643,59 @@ int view2dmove(unsigned short event) * is used with the ctrl key then scroll left * and right. */ - if (event==WHEELUPMOUSE) { - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case (LR_SHIFTKEY): - dx = 0.0; - dy= facy*10.0; - break; - case (LR_CTRLKEY): - dx= facx*10.0; - dy = 0.0; - break; - default: - return 0; - break; - } - } - else if (event==WHEELDOWNMOUSE) { - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case (LR_SHIFTKEY): - dx = 0.0; - dy= -facy*10.0; - break; - case (LR_CTRLKEY): - dx= -facx*10.0; - dy = 0.0; - break; - default: - return 0; - break; - } - } - else { - getmouseco_areawin(mval); - dx= facx*(mvalo[0]-mval[0]); - dy= facy*(mvalo[1]-mval[1]); - } - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - - G.v2d->cur.xmin+= left*dx; - G.v2d->cur.xmax+= right*dx; - G.v2d->cur.ymin+= left*dy; - G.v2d->cur.ymax+= right*dy; + if (event==WHEELUPMOUSE || event==WHEELDOWNMOUSE) { + if(event==WHEELDOWNMOUSE) { + facx= -facx; facy= -facy; + } + + switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { + case (LR_SHIFTKEY): + dx = 0.0; + dy= facy*20.0; + break; + case (LR_CTRLKEY): + dx= facx*20.0; + dy = 0.0; + break; + default: + if(curarea->spacetype==SPACE_BUTS) { + if(G.buts->align==BUT_HORIZONTAL) { + dx= facx*30; dy= 0.0; + } else { + dx= 0.0; dy= facy*30; + } + } + else return 0; + break; + } + } + else { + getmouseco_areawin(mval); + dx= facx*(mvalo[0]-mval[0]); + dy= facy*(mvalo[1]-mval[1]); + } + + if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { + + G.v2d->cur.xmin+= left*dx; + G.v2d->cur.xmax+= right*dx; + G.v2d->cur.ymin+= left*dy; + G.v2d->cur.ymax+= right*dy; - test_view2d(G.v2d, curarea->winx, curarea->winy); + test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_do_windraw(curarea); - screen_swapbuffers(); + scrarea_do_windraw(curarea); + screen_swapbuffers(); - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; + mvalo[0]= mval[0]; + mvalo[1]= mval[1]; - } - else BIF_wait_for_statechange(); - /* return if we were using the mousewheel - */ - if ( (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) return 1; - } + } + else BIF_wait_for_statechange(); + /* return if we were using the mousewheel + */ + if ( (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) return 1; + } curarea->head_swap= 0; return 1; diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c index beabfaf2bb2..f19a294aaad 100644 --- a/source/blender/src/drawnla.c +++ b/source/blender/src/drawnla.c @@ -93,7 +93,7 @@ static void draw_nlatree(void) bActionStrip *strip; bConstraintChannel *conchan; - myortho2 (0, NLAWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); // Scaling + myortho2(0, NLAWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); // Scaling /* Blank out the area */ if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { @@ -191,7 +191,7 @@ static void draw_nlatree(void) } } - myortho2 (0, NLAWIDTH, 0, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin-SCROLLB)); // Scaling + myortho2(0, NLAWIDTH, 0, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin-SCROLLB)); // Scaling glShadeModel(GL_SMOOTH); @@ -450,7 +450,7 @@ void drawnlaspace(ScrArea *sa, void *spacedata) glClearColor(.45, .45, .45, 0.0); glClear(GL_COLOR_BUFFER_BIT); - myortho2 (G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); + myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); /* Draw backdrop */ calc_ipogrid(); @@ -466,15 +466,19 @@ void drawnlaspace(ScrArea *sa, void *spacedata) draw_cfra_action(); /* Draw scroll */ - mywinset(curarea->win); + mywinset(curarea->win); // reset scissor too if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); if(G.v2d->scroll) drawscroll(0); } /* Draw channel names */ draw_nlatree(); + mywinset(curarea->win); // reset scissor too + myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5); + draw_area_emboss(sa); + curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c index 67472cdd51c..7ddb9361428 100644 --- a/source/blender/src/drawoops.c +++ b/source/blender/src/drawoops.c @@ -426,11 +426,12 @@ void drawoopsspace(ScrArea *sa, void *spacedata) mywinset(curarea->win); + /* ortho at pixel level curarea */ + myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5); if(G.v2d->scroll) { - /* ortho at pixel level curarea */ - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); drawscroll(0); } + draw_area_emboss(sa); uiDrawBlock(block); diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index bba768a894b..76371a52e6d 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -642,18 +642,17 @@ void drawseqspace(ScrArea *sa, void *spacedata) /* restore viewport */ mywinset(curarea->win); + /* ortho at pixel level curarea */ + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); + if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - - /* ortho at pixel level curarea */ - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); - if(G.v2d->scroll) { drawscroll(0); } - - } + draw_area_emboss(sa); + curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/drawsound.c b/source/blender/src/drawsound.c index 47163cc4ee3..f205f9a154f 100644 --- a/source/blender/src/drawsound.c +++ b/source/blender/src/drawsound.c @@ -197,15 +197,16 @@ void drawsoundspace(ScrArea *sa, void *spacedata) /* restore viewport */ mywinset(curarea->win); + /* ortho at pixel level curarea */ + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); + if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - - /* ortho at pixel level curarea */ - myortho2(-0.5, curarea->winx+0.5, -0.5, curarea->winy+0.5); - if(G.v2d->scroll) { drawscroll(0); } } + myortho2(-0.5, curarea->winx-0.5, -0.5, curarea->winy-0.5); + draw_area_emboss(sa); curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c index 6623b101208..35b80755c7c 100644 --- a/source/blender/src/drawtext.c +++ b/source/blender/src/drawtext.c @@ -32,6 +32,7 @@ #include <stdlib.h> #include <math.h> +#include <string.h> #ifdef HAVE_CONFIG_H #include <config.h> @@ -290,11 +291,13 @@ static void draw_cursor(SpaceText *st) { glColor3f(0.75, 0.44, 0.44); - if(st->showlinenrs) + if(st->showlinenrs) { if (!x) x= TXT_OFFSET + TEXTXLOC -4; - else + } + else { if (!x) x= TXT_OFFSET - 4; - + } + if (!x) x= TXT_OFFSET-10; while (linef && linef != linel) { h= txt_get_span(text->lines.first, linef) - st->top; @@ -549,7 +552,9 @@ void drawtextspace(ScrArea *sa, void *spacedata) glClearColor(0.6, 0.6, 0.6, 1.0); glClear(GL_COLOR_BUFFER_BIT); - myortho2(-0.5, curarea->winrct.xmax-curarea->winrct.xmin-0.5, -0.5, curarea->winrct.ymax-curarea->winrct.ymin-0.5); + myortho2(-0.5, (float)(sa->winx)-.05, -0.5, (float)(sa->winy)-0.5); + + draw_area_emboss(sa); text= st->text; if(!text) return; diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 4dfba6a17f6..3970f70ed5b 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -803,7 +803,7 @@ static void draw_view_icon(void) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glRasterPos2f(5.0, 5.0); + glRasterPos2f(curarea->winx-25.0, 5.0); BIF_draw_icon(icon); glBlendFunc(GL_ONE, GL_ZERO); @@ -990,6 +990,11 @@ void drawview3dspace(ScrArea *sa, void *spacedata) if(G.scene->radio) RAD_drawall(G.vd->drawtype>=OB_SOLID); + if(G.zbuf) { + G.zbuf= FALSE; + glDisable(GL_DEPTH_TEST); + } + persp(0); if(G.vd->persp>1) drawviewborder(); @@ -999,15 +1004,12 @@ void drawview3dspace(ScrArea *sa, void *spacedata) ob= OBACT; if(ob!=0 && (U.uiflag & DRAWVIEWINFO)) draw_selected_name(ob->id.name+2); + draw_area_emboss(sa); + persp(1); curarea->win_swap= WIN_BACK_OK; - if(G.zbuf) { - G.zbuf= FALSE; - glDisable(GL_DEPTH_TEST); - } - if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT)) { G.vd->flag |= V3D_NEEDBACKBUFDRAW; addafterqueue(curarea->win, BACKBUFDRAW, 1); diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 45e4d2c724c..18a2f6194b9 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -527,14 +527,14 @@ void free_editArmature(void) static EditBone * get_nearest_editbonepoint (int findunsel, int *selmask){ EditBone *ebone; - GLuint buffer[MAXPICKBUF]; + unsigned int buffer[MAXPICKBUF]; short hits; int i, takeNext=0; int sel; unsigned int hitresult, hitbone, firstunSel=-1; glInitNames(); - hits=selectprojektie(buffer, 0, 0, 0, 0); + hits= selectprojektie(buffer, 0, 0, 0, 0); /* See if there are any selected bones in this group */ if (hits){ @@ -606,7 +606,7 @@ static EditBone * get_nearest_editbonepoint (int findunsel, int *selmask){ static void * get_nearest_bone (int findunsel){ void *firstunSel=NULL, *data; - GLuint buffer[MAXPICKBUF]; + unsigned int buffer[MAXPICKBUF]; short hits; int i, takeNext=0; int sel; @@ -615,7 +615,7 @@ static void * get_nearest_bone (int findunsel){ EditBone *ebone; glInitNames(); - hits=selectprojektie(buffer, 0, 0, 0, 0); + hits= selectprojektie(buffer, 0, 0, 0, 0); /* See if there are any selected bones in this group */ @@ -1788,7 +1788,7 @@ void armaturebuts(void) /* Dist and weight buttons */ uiBlockSetCol(block, BUTGREY); - but=uiDefButI(block, MENU, REDRAWVIEW3D, + but=uiDefButS(block, MENU, REDRAWVIEW3D, "Skinnable %x0|" "Unskinnable %x1|" "Head %x2|" @@ -1901,7 +1901,7 @@ static void build_bonestring (char *string, EditBone *bone){ static void validate_editbonebutton(EditBone *eBone){ EditBone *prev; - bAction *act; + bAction *act=NULL; bActionChannel *chan; Base *base; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 19666e70934..7d14d7f476f 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -140,7 +140,6 @@ #include "BDR_editobject.h" #include "BDR_drawobject.h" #include "BDR_editcurve.h" -#include "BDR_editface.h" #include "render.h" #include <time.h> @@ -221,11 +220,14 @@ void free_and_unlink_base(Base *base) void delete_obj(int ok) { Base *base; +extern int undo_push(char *); if(G.obpose) return; if(G.obedit) return; if(G.scene->id.lib) return; +//if (undo_push("Erase")) return; + base= FIRSTBASE; while(base) { Base *nbase= base->next; @@ -1397,7 +1399,7 @@ void special_editmenu(void) if(me==0 || me->tface==0) return; - nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5|Clr Tex%x6| Shared%x7| Light%x8| Invisible%x9| Collision%x10|Sel Same UV%x11"); + nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5|Clr Tex%x6| Shared%x7| Light%x8| Invisible%x9| Collision%x10"); for(a=me->totface, tface= me->tface; a>0; a--, tface++) { if(tface->flag & SELECT) { @@ -1424,8 +1426,6 @@ void special_editmenu(void) tface->mode &= ~TF_INVISIBLE; break; case 10: tface->mode &= ~TF_DYNAMIC; break; - case 11: - get_same_uv(); break; } } } @@ -3514,7 +3514,7 @@ void headerprint(char *str) { areawinset(curarea->headwin); - headerbox(0xA09090, curarea->winx); + headerbox(curarea); cpack(0x0); glRasterPos2i(20+curarea->headbutofs, 6); BMF_DrawString(G.font, str); diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index e6aed8817a5..b6081a8226b 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -91,6 +91,7 @@ #include "BIF_toolbox.h" #include "BIF_usiblender.h" #include "BIF_keyval.h" +#include "BIF_resources.h" #include "BSE_edit.h" #include "BSE_filesel.h" @@ -120,7 +121,7 @@ static void wait_for_event(void); static Window *mainwin= NULL; static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1; -static short dodrawscreen= 0; +static short dodrawscreen= 1; static ScrArea *areawinar[MAXWIN]; static ScrArea *g_activearea= NULL; short winqueue_break= 0; @@ -223,11 +224,11 @@ static ScrEdge *screen_find_active_scredge(bScreen *sc, short *mval) for (se= sc->edgebase.first; se; se= se->next) { if (scredge_is_horizontal(se)) { - if (abs(mval[1]-se->v1->vec.y)<=EDGEWIDTH2 && + if (abs(mval[1]-se->v1->vec.y)<=2 && abs(mval[0]-se->v1->vec.x)<=abs(se->v2->vec.x-se->v1->vec.x)) return se; } else { - if (abs(mval[0]-se->v1->vec.x)<=EDGEWIDTH2 && + if (abs(mval[0]-se->v1->vec.x)<=2 && abs(mval[1]-se->v1->vec.y)<=abs(se->v2->vec.y-se->v1->vec.y)) return se; } @@ -290,30 +291,30 @@ void areawinset(short win) if(win) mywinset(win); } -void headerbox(int selcol, int width) +#define SCR_BACK 0.55 +#define SCR_ROUND 9 + +void headerbox(ScrArea *area) { - if(selcol) glClearColor(.75, .75, .75, 0.0); - else glClearColor(.65, .65, .65, 0.0); - - glClear(GL_COLOR_BUFFER_BIT); + float width= area->winx; - glColor3ub(0, 0, 0); - sdrawbox(0, 0, width, HEADERY); + glClearColor(SCR_BACK, SCR_BACK, SCR_BACK, 0.0); + glClear(GL_COLOR_BUFFER_BIT); - glColor3ub(220, 220, 220); - sdrawline(0, HEADERY-1, width, HEADERY-1); - - glColor3ub(176, 176, 176); - sdrawline(0, HEADERY-2, width, HEADERY-2); + if(area_is_active_area(area)) BIF_set_color(HEADERCOLSEL, COLORSHADE_MEDIUM); + else BIF_set_color(HEADERCOL, COLORSHADE_MEDIUM); - glColor3ub(128, 128, 128); - sdrawline(0, 2, width, 2); - - glColor3ub(64, 64, 64); - sdrawline(0, 1, width, 1); + /* weird values here... is because of window matrix that centres buttons */ + if(area->headertype==HEADERTOP) { + uiSetRoundBox(3); + uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-1, SCR_ROUND); + } + else { + uiSetRoundBox(12); + uiRoundBoxEmboss(-0.5+area->headbutofs, -2.0, width-1.5+area->headbutofs, HEADERY+10, SCR_ROUND); + } - glColor3ub(0, 0, 0); - sdrawline(0, 0, width, 0); + uiSetRoundBox(15); } int area_is_active_area(ScrArea *area) @@ -326,8 +327,11 @@ void scrarea_do_headdraw(ScrArea *area) if (area->headertype) { areawinset(area->headwin); - headerbox(area_is_active_area(area), area->winx+100); - + headerbox(area); + + /* we make scissor test slightly smaller not to destroy rounded headers */ + glScissor(area->headrct.xmin+5, area->headrct.ymin, area->winx-10, HEADERY); + switch(area->spacetype) { case SPACE_FILE: file_buttons(); break; case SPACE_INFO: info_buttons(); break; @@ -343,7 +347,8 @@ void scrarea_do_headdraw(ScrArea *area) case SPACE_ACTION: action_buttons(); break; case SPACE_NLA: nla_buttons(); break; } - + + //glScissor(area->winrct.xmin, area->winrct.xmax, area->winx, area->winy); area->head_swap= WIN_BACK_OK; } } @@ -352,9 +357,9 @@ void scrarea_do_headchange(ScrArea *area) float ofs= area->headbutofs; if (area->headertype==HEADERDOWN) { - bwin_ortho2(area->headwin, 0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, +0.6, area->headrct.ymax-area->headrct.ymin+0.6); + bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -2.5, area->headrct.ymax-area->headrct.ymin-2.5); } else if (area->headertype==HEADERTOP) { - bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -0.5, area->headrct.ymax-area->headrct.ymin-0.5); + bwin_ortho2(area->headwin, -0.5+ofs, area->headrct.xmax-area->headrct.xmin-0.5+ofs, -1.5, area->headrct.ymax-area->headrct.ymin-1.5); } } @@ -378,6 +383,7 @@ static void scrarea_change_headertype(ScrArea *sa, int newtype) } testareas(); + mainqenter(DRAWEDGES, 1); winqueue_break= 1; } @@ -566,8 +572,31 @@ void splash(void *data, int datasize, char *string) oldwin = mywinget(); mywinset(G.curscreen->mainwin); + if (string) { + int x, y, maxy; + unsigned int *rect; + + rect = bbuf->rect; + maxy = MIN2(bbuf->y, 18); + + for (y = 0; y < maxy; y++) { + for (x = 0; x < bbuf->x; x++) { + *rect = 0xffffffff; + rect++; + } + } + } glDrawBuffer(GL_FRONT); + /* + // this dims the whole screen a bit. I didn't like it afterall + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0.0,0.0,0.0,0.3); + glRecti(0, 0, G.curscreen->sizex, G.curscreen->sizey); + glDisable(GL_BLEND); + */ + glRasterPos2i((prefsizx-bbuf->x)/2, (prefsizy-bbuf->y)/2); glDrawPixels(bbuf->x, bbuf->y, GL_RGBA, GL_UNSIGNED_BYTE, bbuf->rect); @@ -875,10 +904,15 @@ static ScrArea *screen_find_area_for_pt(bScreen *sc, short *mval) { ScrArea *sa; - for (sa= sc->areabase.first; sa; sa= sa->next) - if (BLI_in_rcti(&sa->totrct, mval[0], mval[1])) - return sa; + /* hotspot area of 1 pixel extra */ + for (sa= sc->areabase.first; sa; sa= sa->next) { + if( sa->totrct.xmin + 1 < mval[0] ) + if( sa->totrct.ymin + 1 < mval[1] ) + if( sa->totrct.xmax - 1 > mval[0] ) + if( sa->totrct.ymax - 1 > mval[1] ) + return sa; + } return NULL; } @@ -1342,11 +1376,11 @@ void calc_arearcts(ScrArea *sa) if(sa->headertype) { sa->headrct= sa->totrct; if(sa->headertype==HEADERDOWN) { - sa->headrct.ymax= sa->headrct.ymin+HEADERY-1; + sa->headrct.ymax= sa->headrct.ymin+HEADERY; sa->winrct.ymin= sa->headrct.ymax+1; } else if(sa->headertype==HEADERTOP) { - sa->headrct.ymin= sa->headrct.ymax-HEADERY+1; + sa->headrct.ymin= sa->headrct.ymax-HEADERY; sa->winrct.ymax= sa->headrct.ymin-1; } } @@ -1386,7 +1420,8 @@ static void closeheadwin(ScrArea *sa) static void closeareawin(ScrArea *sa) { uiFreeBlocksWin(&sa->uiblocks, sa->win); - + uiFreePanels(&sa->panels); + if(sa->win) mywinclose(sa->win); sa->win= 0; } @@ -1404,15 +1439,19 @@ static void del_area(ScrArea *sa) if(sa==g_activearea) g_activearea= 0; } +/* sa2 to sa1 */ static void copy_areadata(ScrArea *sa1, ScrArea *sa2) { + sa1->headertype= sa2->headertype; sa1->spacetype= sa2->spacetype; Mat4CpyMat4(sa1->winmat, sa2->winmat); freespacelist(&sa1->spacedata); - duplicatespacelist(sa1, &sa1->spacedata, &sa2->spacedata); + + BLI_freelistN(&sa1->panels); + duplicatelist(&sa1->panels, &sa2->panels); } static ScrArea *screen_addarea(bScreen *sc, ScrVert *v1, ScrVert *v2, ScrVert *v3, ScrVert *v4, short headertype, short spacetype) @@ -1635,6 +1674,15 @@ void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char a mainqenter_ext(evt, val, ascii); } +/* ScrVert ordering in a ScrArea: + +2---------3 +| | +| | +1---------4 + +*/ + static bScreen *addscreen(char *name) /* use setprefsize() if you want something else than a full windpw */ { /* this function sets variabele G.curscreen, @@ -1690,10 +1738,10 @@ static bScreen *addscreen(char *name) /* use setprefsize() if you want somethin glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glDrawBuffer(GL_FRONT); - glClearColor(.45, .45, .45, 0.0); + /* for visual speed, but still needed? */ + glClearColor(.55, .55, .55, 0.0); glClear(GL_COLOR_BUFFER_BIT); - glDrawBuffer(GL_BACK); + window_swap_buffers(mainwin); warp_pointer(sc->sizex/2, sc->sizey/2); @@ -1874,7 +1922,7 @@ void area_fullscreen(void) /* with curarea */ curarea= old; G.curscreen= oldscreen; /* needed because of setscreen */ - /* vopy area */ + /* copy area */ copy_areadata(newa, curarea); curarea->full= oldscreen; @@ -2572,6 +2620,7 @@ static void moveareas(ScrEdge *edge) doit= delta= 0; getmouseco_sc(mvalo); draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); + while (!doit) { short val; unsigned short event= extern_qread(&val); @@ -2587,9 +2636,12 @@ static void moveareas(ScrEdge *edge) delta= CLAMPIS(delta, -smaller, bigger); draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - } else if (event==LEFTMOUSE) { + + } + else if (event==LEFTMOUSE) { doit= 1; - } else if (val) { + } + else if (val) { if (ELEM(event, ESCKEY, RIGHTMOUSE)) doit= -1; else if (ELEM(event, SPACEKEY, RETKEY)) @@ -2729,99 +2781,105 @@ int select_area(int spacetype) /* ************ END JOIN/SPLIT/MOVE ************** */ /* **************** DRAW SCREENEDGES ***************** */ -#define EDGE_EXTEND 3 -void drawedge(short x1, short y1, short x2, short y2) +void draw_area_emboss(ScrArea *sa) { - static unsigned int edcol[EDGEWIDTH]= {0x0, 0x505050, 0x909090, 0xF0F0F0, 0x0}; - int a; - if(x1==x2) { /* vertical */ - if (y2<y1) { - SWAP(short, y1, y2); - } - if (y1==0) y1-= EDGE_EXTEND; - if (y2==G.curscreen->sizey) y2+= EDGE_EXTEND; - - x1+= EDGEWIDTH2; - x2+= EDGEWIDTH2; + /* set transp line */ + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glBegin(GL_LINES); - for(a=0; a<EDGEWIDTH; a++) { - int rounding= abs(a-EDGEWIDTH2); - - cpack(edcol[a]); - glVertex2i(x1-a, y1+rounding); - glVertex2i(x2-a, y2-rounding); - } - glEnd(); + /* right */ + glColor4ub(0,0,0, 80); + sdrawline(sa->winx-1, 0, sa->winx-1, sa->winy-1); + + /* bottom */ + if(sa->headertype!=HEADERDOWN) { + glColor4ub(0,0,0, 128); + sdrawline(0, 0, sa->winx-1, 0); } - else { /* horizontal */ - if (x2<x1) { - SWAP(short, x1, x2); - } - if (x1==0) x1-= EDGE_EXTEND; - if (x2==G.curscreen->sizex) x2+= EDGE_EXTEND; + + /* top */ + if(sa->headertype!=HEADERTOP) { + glColor4ub(255,255,255, 128); + sdrawline(0, sa->winy-1, sa->winx-1, sa->winy-1); + } + /* left */ + glColor4ub(255,255,255, 80); + sdrawline(0, 0, 0, sa->winy); - y1-= EDGEWIDTH2; - y2-= EDGEWIDTH2; - - glBegin(GL_LINES); - for(a=0; a<EDGEWIDTH; a++) { - int rounding= abs(a-EDGEWIDTH2); - - cpack(edcol[a]); - glVertex2i(x1+rounding, y1+a); - glVertex2i(x2-rounding, y2+a); - } - glEnd(); + glDisable( GL_BLEND ); + + + /* for test */ + if(FALSE && sa->spacetype==SPACE_VIEW3D) { + cpack(0xA0A0A0); + uiSetRoundBox(31); + uiRoundBoxEmboss(5.0, 5.0, 25.0, 100.0, 8.0); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glRasterPos2f(8.0, 10.0); + BIF_draw_icon(ICON_MATERIAL_HLT); + glRasterPos2f(8.0, 30.0); + BIF_draw_icon(ICON_IPO_HLT); + glRasterPos2f(8.0, 50.0); + BIF_draw_icon(ICON_HOME); + glRasterPos2f(8.0, 70.0); + BIF_draw_icon(ICON_BORDERMOVE); + + glBlendFunc(GL_ONE, GL_ZERO); + glDisable(GL_BLEND); } } -static void drawscredge(ScrEdge *se) + +void drawscredge_area(ScrArea *sa) { - bScreen *sc; - vec2s *v1, *v2; + short x1= sa->v1->vec.x; + short y1= sa->v1->vec.y; + short x2= sa->v3->vec.x; + short y2= sa->v3->vec.y; + + /* this to fill the (undrawn) edge area with back color first */ + glColor3f(SCR_BACK,SCR_BACK,SCR_BACK); + sdrawline(x2, y1, x2, y2); + sdrawline(x1, y1, x2, y1); - sc= G.curscreen; + cpack(0x0); - v1= &(se->v1->vec); - v2= &(se->v2->vec); + /* right border area */ + if(sa->headertype==HEADERTOP) sdrawline(x2, y1, x2, y2-SCR_ROUND); + else if(sa->headertype==HEADERDOWN) sdrawline(x2, y1+SCR_ROUND, x2, y2); + else sdrawline(x2, y1, x2, y2); + + /* left border area */ + if(sa->headertype==HEADERTOP) sdrawline(x1, y1, x1, y2-SCR_ROUND); + else if(sa->headertype==HEADERDOWN) sdrawline(x1, y1+SCR_ROUND, x1, y2); + else sdrawline(x1, y1, x1, y2); + + /* top border area */ + if(sa->headertype==HEADERTOP) sdrawline(x1+SCR_ROUND, y2, x2-SCR_ROUND, y2); + else sdrawline(x1, y2, x2, y2); + + /* bottom border area */ + if(sa->headertype==HEADERDOWN) sdrawline(x1+SCR_ROUND, y1, x2-SCR_ROUND, y1); + else sdrawline(x1, y1, x2, y1); - /* do not draw borders screen© */ - /* bcause of different framebuffer resoltions (PC/SGI etc files) - * a bit rounding here? should be looked at further... - */ - se->border= 1; - if(v1->x<=1 && v2->x<=1) return; - if(v1->x>=sc->sizex-2 && v2->x>=sc->sizex-2) return; - if(v1->y<=1 && v2->y<=1) return; - if(v1->y>=sc->sizey-2 && v2->y>=sc->sizey-2) return; - se->border= 0; - - drawedge(v1->x, v1->y, v2->x, v2->y); } void drawscreen(void) { - ScrEdge *se; - - mywinset(G.curscreen->mainwin); - myortho2(-0.5, (float)G.curscreen->sizex-0.5, -0.6, (float)G.curscreen->sizey-0.6); + ScrArea *sa; - /* two times, because there is no 'win_swap' for this available */ - glDrawBuffer(GL_FRONT); - se= G.curscreen->edgebase.first; - while(se) { - drawscredge(se); - se= se->next; - } + mywinset(G.curscreen->mainwin); + myortho2(-0.5, (float)G.curscreen->sizex-0.5, -0.51, (float)G.curscreen->sizey-0.51); - glDrawBuffer(GL_BACK); - se= G.curscreen->edgebase.first; - while(se) { - drawscredge(se); - se= se->next; + sa= G.curscreen->areabase.first; + while(sa) { + drawscredge_area(sa); + sa= sa->next; } } diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 5c98b465d01..703905362ff 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -91,6 +91,7 @@ #include "BIF_editview.h" #include "BIF_space.h" #include "BIF_screen.h" +#include "BIF_resources.h" #include "BLO_readfile.h" @@ -104,6 +105,7 @@ #include "interface.h" #include "nla.h" + #if defined WIN32 || defined __BeOS int fnmatch(){return 0;} #else @@ -886,12 +888,12 @@ static void draw_filescroll(SpaceFile *sfile) if(scrollrct.ymin+10 >= scrollrct.ymax) return; - cpack(0x707070); + cpack(0x808080); glRecti(scrollrct.xmin, scrollrct.ymin, scrollrct.xmax, scrollrct.ymax); uiEmboss(scrollrct.xmin, scrollrct.ymin, scrollrct.xmax, scrollrct.ymax, 1); - cpack(0x909090); + glColor3f(.715, .715, .715); glRecti(bar.xmin+2, bar.ymin+2, bar.xmax-2, bar.ymax-2); uiEmboss(bar.xmin+2, bar.ymin+2, bar.xmax-2, bar.ymax-2, filescrollselect); @@ -912,13 +914,13 @@ static void printregel(SpaceFile *sfile, struct direntry *files, int x, int y) switch(files->flags & (HILITE + ACTIVE)) { case HILITE+ACTIVE: - boxcol= (0xC09090); + boxcol= (0xD0A0A0); break; case HILITE: - boxcol= (0x909090); + boxcol= (0xA0A0A0); break; case ACTIVE: - boxcol= (0xB08080); + boxcol= (0xC0A0A0); break; } @@ -1070,7 +1072,7 @@ static void set_active_file(SpaceFile *sfile, int act) glScissor(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx-12, curarea->winy); if( calc_filesel_regel(sfile, old, &x, &y) ) { - regelrect(0x717171, x, y); + regelrect(0x888888, x, y); printregel(sfile, sfile->filelist+old, x, y); } if( calc_filesel_regel(sfile, newi, &x, &y) ) { @@ -1098,7 +1100,7 @@ static void draw_filetext(SpaceFile *sfile) /* box */ - cpack(0x717171); + cpack(0x888888); glRecti(textrct.xmin, textrct.ymin, textrct.xmax, textrct.ymax); /* collums */ @@ -1131,7 +1133,7 @@ static void draw_filetext(SpaceFile *sfile) /* clear drawing errors, with text at the right hand side: */ uiEmboss(textrct.xmin, textrct.ymin, textrct.xmax, textrct.ymax, 1); - glColor3f(.5625, .5625, .5625); + glColor3f(.715, .715, .715); glRecti(textrct.xmax+2, textrct.ymin, textrct.xmax+10, textrct.ymax); } @@ -1144,9 +1146,9 @@ void drawfilespace(ScrArea *sa, void *spacedata) char name[20]; char *menu; - myortho2(-0.5, curarea->winrct.xmax-curarea->winrct.xmin-0.5, -0.5, curarea->winrct.ymax-curarea->winrct.ymin-0.5); + myortho2(-0.5, sa->winx-0.5, -0.5, sa->winy-0.5); - glClearColor(.56, .56, .56, 0.0); + glClearColor(.715, .715, .715, 0.0); /* headercol */ glClear(GL_COLOR_BUFFER_BIT); sfile= curarea->spacedata.first; @@ -1166,6 +1168,7 @@ void drawfilespace(ScrArea *sa, void *spacedata) /* HEADER */ sprintf(name, "win %d", curarea->win); block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSSF, UI_HELV, curarea->win); + uiBlockSetCol(block, BUTGREY); uiSetButLock( sfile->type==FILE_MAIN && sfile->returnfunc, NULL); @@ -1199,6 +1202,8 @@ void drawfilespace(ScrArea *sa, void *spacedata) /* others diskfree etc ? */ scrarea_queue_headredraw(curarea); + myortho2(-0.5, (float)(sa->winx)-0.5, -0.5, (float)(sa->winy)-0.5); + draw_area_emboss(sa); curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index 8308b3f995b..b30206b7323 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -30,6 +30,7 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ +#include <stdlib.h> #include <string.h> #include <math.h> @@ -198,7 +199,7 @@ static void test_idbutton_cb(void *namev, void *arg2_unused) test_idbutton(name+2); } -#define SPACEICONMAX 13 /* See release/datafiles/blenderbuttons */ +#define SPACEICONMAX 14 /* See release/datafiles/blenderbuttons */ #include "BIF_poseobject.h" @@ -220,12 +221,20 @@ extern char versionstr[]; /* from blender.c */ */ -/* - * The next define turns the newest menu structure on. - * There are some loose ends here at the moment so leave this undefined for now. +/* View3d->modeselect + * This is a bit of a dodgy hack to enable a 'mode' menu with icons+labels rather than those buttons. + * I know the implementation's not good - it's an experiment to see if this approach would work well + * + * This can be cleaned when I make some new 'mode' icons. */ -/* #define EXPERIMENTAL_MENUS */ - + +#define V3D_OBJECTMODE_SEL ICON_ORTHO +#define V3D_EDITMODE_SEL ICON_EDITMODE_HLT +#define V3D_FACESELECTMODE_SEL ICON_FACESEL_HLT +#define V3D_VERTEXPAINTMODE_SEL ICON_VPAINT_HLT +#define V3D_TEXTUREPAINTMODE_SEL ICON_TPAINT_HLT +#define V3D_WEIGHTPAINTMODE_SEL ICON_WPAINT_HLT +#define V3D_POSEMODE_SEL ICON_POSE_HLT #define XIC 20 #define YIC 20 @@ -664,6 +673,11 @@ void do_global_buttons(unsigned short event) scrarea_queue_winredraw(curarea); scrarea_queue_headredraw(curarea); break; + case B_REDRCURW3D: + allqueue(REDRAWVIEW3D, 0); + scrarea_queue_winredraw(curarea); + scrarea_queue_headredraw(curarea); + break; case B_EDITBROWSE: if(ob==0) return; if(ob->id.lib) return; @@ -1408,13 +1422,13 @@ void do_global_buttons(unsigned short event) case B_USERPREF: allqueue(REDRAWINFO, 0); -// BIF_printf("userpref %d\n", U.userpref); break; + case B_DRAWINFO: /* is button from space.c *info* */ allqueue(REDRAWVIEW3D, 0); break; - case B_FLIPINFOMENU: /* is button uit space.c *info* */ + case B_FLIPINFOMENU: /* is button from space.c *info* */ scrarea_queue_headredraw(curarea); break; @@ -1585,6 +1599,7 @@ void do_global_buttons(unsigned short event) allqueue(REDRAWHEADERS, 0); break; + } } @@ -2416,119 +2431,6 @@ static void write_runtime_check(char *str) } /* end keyed functions */ - -static void do_info_filemenu(void *arg, int event) -{ - ScrArea *sa; - char dir[FILE_MAXDIR]; - - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - /* these are no defines, easier this way, the codes are in the function below */ - switch(event) { - case 0: - if (okee("ERASE ALL")) { - if (!BIF_read_homefile()) - error("No file ~/.B.blend"); - } - break; - case 1: - activate_fileselect(FILE_BLENDER, "LOAD FILE", G.sce, BIF_read_file); - break; - case 2: - { - char *s= MEM_mallocN(strlen(G.sce) + 11 + 1, "okee_reload"); - strcpy(s, "Open file: "); - strcat(s, G.sce); - if (okee(s)) - BIF_read_file(G.sce); - MEM_freeN(s); - } - break; - case 3: - activate_fileselect(FILE_LOADLIB, "LOAD LIBRARY", G.lib, 0); - break; - case 4: - strcpy(dir, G.sce); - untitled(dir); - activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file); - break; - case 5: - strcpy(dir, G.sce); - if (untitled(dir)) { - activate_fileselect(FILE_BLENDER, "SAVE FILE", dir, BIF_write_file); - } else { - BIF_write_file(dir); - free_filesel_spec(dir); - } - break; - case 6: - mainqenter(F3KEY, 1); - break; - case 7: - write_vrml_fs(); - break; - case 8: - write_dxf_fs(); - break; - case 9: - write_videoscape_fs(); - break; -/* - case 20: - strcpy(dir, G.sce); - activate_fileselect(FILE_SPECIAL, "INSTALL LICENSE KEY", dir, loadKeyboard); - break; - case 21: - SHOW_LICENSE_KEY(); - break; -*/ - case 22: - activate_fileselect(FILE_SPECIAL, "WRITE RUNTIME", "", write_runtime_check); - break; - case 23: - activate_fileselect(FILE_SPECIAL, "WRITE DYNAMIC RUNTIME", "", write_runtime_check_dynamic); - break; - case 30: - // import menu, no handling - break; - -#ifdef EXPERIMENTAL_MENUS - case 10: - check_packAll(); - break; - case 11: - unpackAll(PF_WRITE_LOCAL); - G.fileflags &= ~G_AUTOPACK; - break; - case 12: - if (buttons_do_unpack() != RET_CANCEL) { - /* Clear autopack bit only if user selected one of the unpack options */ - G.fileflags &= ~G_AUTOPACK; - } - break; - case 13: -#else /* EXPERIMENTAL_MENUS */ - case 10: -#endif /* EXPERIMENTAL_MENUS */ - exit_usiblender(); - break; - } - allqueue(REDRAWINFO, 0); -} - -void do_info_file_optionsmenu(void *arg, int event) -{ - G.fileflags ^= (1 << event); - - // allqueue(REDRAWINFO, 0); -} - -//#ifdef NEW_WINDOW_TYPE_MENUS - static char *windowtype_pup(void) { static char string[1024]; @@ -2565,6 +2467,15 @@ static char *windowtype_pup(void) return (string); } +/************************** MAIN MENU *****************************/ +/************************** FILE *****************************/ + +void do_info_file_optionsmenu(void *arg, int event) +{ + G.fileflags ^= (1 << event); + + // allqueue(REDRAWINFO, 0); +} static uiBlock *info_file_optionsmenu(void *arg_unused) { @@ -2574,7 +2485,8 @@ static uiBlock *info_file_optionsmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "runtime_options", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_info_file_optionsmenu, NULL); uiBlockSetXOfs(block,-40); // offset to parent button - + uiBlockSetCol(block, MENUCOL); + /* flags are case-values */ uiDefBut(block, BUTM, 1, "Compress File", xco, yco-=20, 100, 19, NULL, 0.0, 0.0, 0, G_FILE_COMPRESS_BIT, "Enables file compression"); /* @@ -2607,7 +2519,7 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "add_surfacemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetXOfs(block, -40); // offset to parent button - + uiBlockSetCol(block, MENUCOL); uiBlockSetEmboss(block, UI_EMBOSSW); uiDefBut(block, LABEL, 0, "Size options:", xco, yco-=20, 114, 19, 0, 0.0, 0.0, 0, 0, ""); @@ -2646,302 +2558,237 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused) return block; } -static uiBlock *info_file_importmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, xco = 20; - block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetXOfs(block, -40); // offset to parent button - - uiBlockSetEmboss(block, UI_EMBOSSW); +static void do_info_file_importmenu(void *arg, int event) +{ + ScrArea *sa; - /* flags are defines */ - uiDefBut(block, LABEL, 0, "VRML 2.0 options", xco, yco, 125, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, TOG|BIT|0, 0, "SepLayers", xco, yco-=20, 75, 19, &U.vrmlflag, 0.0, 0.0, 0, 0, "Separates Empties, Lamps, etc. into Layers"); - uiDefButS(block, TOG|BIT|1, 0, "Scale 1/100", xco, yco-=20, 75, 19, &U.vrmlflag, 0.0, 0.0, 0, 0, "Scales scene by 1/100 (3DS VRML)"); - uiDefButS(block, TOG|BIT|2, 0, "Two Sided", xco, yco-=20, 75, 19, &U.vrmlflag, 0.0, 0.0, 0, 0, "Enables import of two sided faces"); + if(curarea->spacetype==SPACE_INFO) { + sa= closest_bigger_area(); + areawinset(sa->win); + } - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; + /* these are no defines, easier this way, the codes are in the function below */ + switch(event) { + + case 0: + break; + } + allqueue(REDRAWINFO, 0); } -static uiBlock *info_filemenu(void *arg_unused) +static uiBlock *info_file_importmenu(void *arg_unused) { uiBlock *block; - short xco=0; + short yco = 20, menuwidth = 120; - block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_filemenu, NULL); + block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_info_file_importmenu, NULL); + //uiBlockSetXOfs(block, -50); // offset to parent button + uiBlockSetCol(block, MENUCOL); - uiDefBut(block, BUTM, 1, "New|Ctrl X", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Starts a new project (WARNING! Closes current project!)"); - uiDefBut(block, BUTM, 1, "Open|F1", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Opens a new file"); - uiDefBut(block, BUTM, 1, "Reopen Last|Ctrl O", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Reverts to the last version saved to file"); - uiDefBut(block, BUTM, 1, "Append|Shift F1", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "Appends contents of a file to the current project"); - uiDefBlockBut(block, info_file_importmenu, NULL, "Import Settings|>>", 0, xco-=20, 160, 19, ""); + uiDefBut(block, BUTM, 1, "Python scripts go here somehow!", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Save As|F2", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "Saves to a new file"); - uiDefBut(block, BUTM, 1, "Save|Ctrl W", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "Saves to the current file"); + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); - uiDefBlockBut(block, info_file_optionsmenu, NULL, "File options|>>", 0, xco-=20, 160, 19, "Opens the File Options menu"); + return block; +} - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); +static void do_info_file_exportmenu(void *arg, int event) +{ + ScrArea *sa; - uiDefBut(block, BUTM, 1, "Save Runtime", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 22, "Creates a runtime executable with the current project"); -#ifdef _WIN32 - uiDefBut(block, BUTM, 1, "Save dynamic Runtime", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 23, "Creates a dynamic runtime executable with the current project (requieres extenal python20.dll)"); -#endif - uiDefBlockBut(block, info_runtime_optionsmenu, NULL, "Runtime options|>>", 0, xco-=20, 160, 19, "Opens the File Options menu"); + if(curarea->spacetype==SPACE_INFO) { + sa= closest_bigger_area(); + areawinset(sa->win); + } - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Save Image|F3", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 6, "Saves the rendered image to a file"); - uiDefBut(block, BUTM, 1, "Save VRML 1.0|Ctrl F2", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, "Saves the current scene to a file in VRML 1.0 format"); - uiDefBut(block, BUTM, 1, "Save DXF|Shift F2", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, "Saves the current scene to a file in DXF format"); - uiDefBut(block, BUTM, 1, "Save VideoScape|Alt W", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 9, "Saves the current scene to a file in VideoScape format"); + /* these are no defines, easier this way, the codes are in the function below */ + switch(event) { + + case 0: + write_vrml_fs(); + break; + case 1: + write_dxf_fs(); + break; + case 2: + write_videoscape_fs(); + break; + } + allqueue(REDRAWINFO, 0); +} +static uiBlock *info_file_exportmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20; - /* - if (LICENSE_KEY_VALID) { - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Show License Key", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 1, 21, "Show the personal information stored in your Blender License Key"); - uiDefIconBut(block, BUTM, 1, ICON_PUBLISHER, 141,xco, 19, 19, NULL, 0.0, 0.0, 1, 21, "Show the personal information stored in your Blender License Key"); - } else if (I_AM_PUBLISHER) { - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Install License Key", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 1, 20, "Install your Blender License Key"); - uiDefIconBut(block, BUTM, 1, ICON_PUBLISHER, 141,xco, 19, 19, NULL, 0.0, 0.0, 1, 20, "Install your Blender License Key"); - } - */ - - - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 1, 0, ""); - -#ifdef EXPERIMENTAL_MENUS - uiDefBut(block, BUTM, 1, "Pack Data", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, "Saves a copy of all packed external files inside the project file"); - uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, "Removes all packed files from the project and saves them to the current directory"); - uiDefBut(block, BUTM, 1, "Advanced Unpack", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Quit | Q", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, "Quits Blender immediately (WARNING! Save your project first!)"); -#else /* EXPERIMENTAL_MENUS */ - uiDefBut(block, BUTM, 1, "Quit | Q", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, "Quits Blender immediately (WARNING! Save your project first!)"); -#endif /* EXPERIMENTAL_MENUS */ - uiBlockSetDirection(block, UI_DOWN); + block= uiNewBlock(&curarea->uiblocks, "exportmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_info_file_exportmenu, NULL); + //uiBlockSetXOfs(block, -50); // offset to parent button + uiBlockSetCol(block, MENUCOL); + + uiDefBut(block, BUTM, 1, "VRML 1.0...|Ctrl F2", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, 1, "DXF...|Shift F2", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, BUTM, 1, "Videoscape...|Alt W", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiTextBoundsBlock(block, 80); + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); return block; } -static void do_info_editmenu(void *arg, int event) -{ - /* needed to check for valid selected objects */ - Base *base=NULL; - Object *ob=NULL; - base= BASACT; - if (base) ob= base->object; +static void do_info_filemenu(void *arg, int event) +{ + ScrArea *sa; + char dir[FILE_MAXDIR]; + + if(curarea->spacetype==SPACE_INFO) { + sa= closest_bigger_area(); + areawinset(sa->win); + } + /* these are no defines, easier this way, the codes are in the function below */ switch(event) { - case 0: - /* (De)Select All */ - if(select_area(SPACE_VIEW3D)) mainqenter(AKEY, 1); - break; - /* Border Select */ - case 1: - if(select_area(SPACE_VIEW3D)) mainqenter(BKEY, 1); + if (okee("Erase All")) { + if (!BIF_read_homefile()) + error("No file ~/.B.blend"); + } break; - case 2: - /* Circle Select */ - /*if(select_area(SPACE_VIEW3D)) { - ; - }*/ + case 1: /* open */ + activate_fileselect(FILE_BLENDER, "Open", G.sce, BIF_read_file); break; - case 3: - /* Duplicate */ - if(select_area(SPACE_VIEW3D)) { - duplicate_context_selected(); + case 2: /* reopen last */ + { + char *s= MEM_mallocN(strlen(G.sce) + 11 + 1, "okee_reload"); + strcpy(s, "Open file: "); + strcat(s, G.sce); + if (okee(s)) BIF_read_file(G.sce); + MEM_freeN(s); } break; - case 4: - /* Delete */ - if(select_area(SPACE_VIEW3D)) { - delete_context_selected(); - } + case 3: /* append */ + activate_fileselect(FILE_LOADLIB, "Load Library", G.lib, 0); + break; + case 4: /* save */ + strcpy(dir, G.sce); + untitled(dir); + activate_fileselect(FILE_BLENDER, "Save As", dir, BIF_write_file); break; case 5: - /* Edit Mode */ - if(select_area(SPACE_VIEW3D)) { - blenderqread(TABKEY, 1); + strcpy(dir, G.sce); + if (untitled(dir)) { + activate_fileselect(FILE_BLENDER, "Save As", dir, BIF_write_file); + } else { + BIF_write_file(dir); + free_filesel_spec(dir); } break; - case 6: - /* Grabber */ - if(select_area(SPACE_VIEW3D)) { - transform('g'); - } + case 6: /* save image */ + mainqenter(F3KEY, 1); break; - case 7: - /* Rotate */ - if(select_area(SPACE_VIEW3D)) { - transform('r'); - } +/* + case 20: + strcpy(dir, G.sce); + activate_fileselect(FILE_SPECIAL, "INSTALL LICENSE KEY", dir, loadKeyboard); break; - case 8: - /* Scale */ - if(select_area(SPACE_VIEW3D)) { - transform('s'); - } + case 21: + SHOW_LICENSE_KEY(); break; - case 9: - /* Shear */ - /* check that a valid object is selected to prevent crash */ - if (!ob) error ("Only selected objects can be sheared"); - else if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) { - error("Only editable 3D objects can be sheared"); - } - else if ((base->lay & G.vd->lay)==0) { - error("Only objects on visible layers can be sheared"); - } - else { - if (!G.obedit) { - enter_editmode(); - /* ### put these into a deselectall_gen() */ - if(G.obedit->type==OB_MESH) deselectall_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) deselectall_nurb(); - else if(G.obedit->type==OB_MBALL) deselectall_mball(); - else if(G.obedit->type==OB_LATTICE) deselectall_Latt(); - else if(G.obedit->type==OB_ARMATURE) deselectall_armature(); - /* ### */ - } - if(select_area(SPACE_VIEW3D)) { - transform('S'); - } - } - if(select_area(SPACE_VIEW3D)) { - transform('S'); - } +*/ + case 22: /* save runtime */ + activate_fileselect(FILE_SPECIAL, "Save Runtime", "", write_runtime_check); break; - case 10: - /* Warp/Bend */ - /* check that a valid object is selected to prevent crash */ - if (!ob) error("Only selected objects can be warped"); - else if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) { - error("Only editable 3D objects can be warped"); - } - else if ((base->lay & G.vd->lay)==0) { - error("Only objects on visible layers can be warped"); - } - else { - if (!G.obedit) { - enter_editmode(); - /* ### put these into a deselectall_gen() */ - if(G.obedit->type==OB_MESH) deselectall_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) deselectall_nurb(); - else if(G.obedit->type==OB_MBALL) deselectall_mball(); - else if(G.obedit->type==OB_LATTICE) deselectall_Latt(); - else if(G.obedit->type==OB_ARMATURE) deselectall_armature(); - /* ### */ - } - if(select_area(SPACE_VIEW3D)) { - transform('w'); - } - } + case 23: /* save dynamic runtime */ + activate_fileselect(FILE_SPECIAL, "Save Dynamic Runtime", "", write_runtime_check_dynamic); break; - case 11: - /* Snap */ - if(select_area(SPACE_VIEW3D)) { - snapmenu(); + case 10: /* pack data */ + check_packAll(); + break; + case 11: /* unpack to current dir */ + unpackAll(PF_WRITE_LOCAL); + G.fileflags &= ~G_AUTOPACK; + break; + case 12: /* unpack data */ + if (buttons_do_unpack() != RET_CANCEL) { + /* Clear autopack bit only if user selected one of the unpack options */ + G.fileflags &= ~G_AUTOPACK; } break; + case 13: + exit_usiblender(); + break; + case 31: /* save default settings */ + BIF_write_homefile(); + break; } allqueue(REDRAWINFO, 0); } - - -static uiBlock *info_editmenu(void *arg_unused) +static uiBlock *info_filemenu(void *arg_unused) { -/* static short tog=0; */ uiBlock *block; - short xco= 0; + short yco=0; + short menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "info_filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_info_filemenu, NULL); + uiBlockSetCol(block, MENUCOL); - block= uiNewBlock(&curarea->uiblocks, "editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_editmenu, NULL); - - uiDefBut(block, BUTM, 1, "(De)Select All|A", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, "Toggles between selecting all objects in the scene and selecting no objects"); - uiDefBut(block, BUTM, 1, "Border Select|B", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, "Selects objects in a rectangular area (press B again to activate circle select in edit mode)"); - - /* uiDefBut(block, BUTM, 1, "Circle Select", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 2, "Select objects in a circular area"); */ - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Duplicate|Shift D", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 3, "Creates a copy of the selected object(s)"); - uiDefBut(block, BUTM, 1, "Delete|X", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 4, "Deletes the selected object(s)"); - uiDefBut(block, BUTM, 1, "Edit Mode|Tab", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 5, "Toggles the current object between object mode and edit mode"); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Grabber|G", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 6, "Moves the selected object(s)"); - uiDefBut(block, BUTM, 1, "Rotate|R", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 7, "Rotates the selected object(s)"); - uiDefBut(block, BUTM, 1, "Scale|S", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 8, "Scales the selected object(s)"); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Shear|Ctrl S", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 9, "Shears the selected object(s)"); - uiDefBut(block, BUTM, 1, "Warp/Bend|Shift W", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 10, "Warps or bends the selected objects"); - uiDefBut(block, BUTM, 1, "Snap Menu|Shift S", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 11, "Activates the snap menu"); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New|Ctrl X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reopen Last|Ctrl O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...|F2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); +#ifdef _WIN32 + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); +#endif + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append...|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, ""); + uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Data", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, ""); +// uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, "Removes all packed files from the project and saves them to the current directory"); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack Data...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender| Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiBlockSetDirection(block, UI_DOWN); uiTextBoundsBlock(block, 80); - + return block; } + + + +/**************************** ADD ******************************/ + static void do_info_add_meshmenu(void *arg, int event) { switch(event) { -#ifdef EXPERIMENTAL_MENUS - /* Maarten's proposal for a new Add Mesh menu */ - case 0: - /* Line */ - //add_primitiveMesh(4); - break; - case 1: - /* Circle */ - if(select_area(SPACE_VIEW3D)) { - add_primitiveMesh(4); - } - break; - case 2: - /* Plane */ - add_primitiveMesh(0); - break; - case 3: - /* Cube */ - add_primitiveMesh(1); - break; - case 4: - /* UVsphere */ - add_primitiveMesh(11); - break; - case 5: - /* IcoSphere */ - add_primitiveMesh(12); - break; - case 6: - /* Cylinder */ - add_primitiveMesh(5); - break; - case 7: - /* Tube */ - add_primitiveMesh(6); - break; - case 8: - /* Cone */ - add_primitiveMesh(7); - break; - case 9: - /* Grid */ - add_primitiveMesh(10); - break; -#else /* EXPERIMENTAL_MENUS*/ case 0: /* Plane */ add_primitiveMesh(0); @@ -2978,7 +2825,6 @@ static void do_info_add_meshmenu(void *arg, int event) /* Grid */ add_primitiveMesh(10); break; -#endif /* EXPERIMENTAL_MENUS */ default: break; } @@ -2989,36 +2835,22 @@ static uiBlock *info_add_meshmenu(void *arg_unused) { /* static short tog=0; */ uiBlock *block; - short xco= 0; + short yco= 0; block= uiNewBlock(&curarea->uiblocks, "add_meshmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_info_add_meshmenu, NULL); - -#ifdef EXPERIMENTAL_MENUS - /* Maarten's proposal for a new Add Mesh menu */ - uiDefBut(block, BUTM, 1, "Line|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Adds a Mesh Line"); - uiDefBut(block, BUTM, 1, "Circle|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Adds a Mesh Circle"); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Plane|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Adds a Mesh Plane"); - uiDefBut(block, BUTM, 1, "Cube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "Adds a Mesh Cube"); - uiDefBut(block, BUTM, 1, "UVsphere", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "Adds a Mesh Sphere"); - uiDefBut(block, BUTM, 1, "IcoSphere|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "Adds a Mesh Isocohedron Sphere"); - uiDefBut(block, BUTM, 1, "Cylinder With Caps|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 6, "Adds a Mesh Cylinder with caps"); - uiDefBut(block, BUTM, 1, "Cylinder Without Caps|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, "Adds a Mesh Cylinder without caps"); - uiDefBut(block, BUTM, 1, "Cone|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, "Adds a Mesh Cone"); - uiDefBut(block, BUTM, 1, "Grid|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 9, "Adds a Mesh Grid"); -#else /* EXPERIMENTAL_MENUS */ - uiDefBut(block, BUTM, 1, "Plane|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Adds a Mesh Plane"); - uiDefBut(block, BUTM, 1, "Cube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Adds a Mesh Cube"); - uiDefBut(block, BUTM, 1, "Circle|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Adds a Mesh Circle"); - uiDefBut(block, BUTM, 1, "UVsphere", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "Adds a Mesh Sphere"); - uiDefBut(block, BUTM, 1, "IcoSphere|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "Adds a Mesh Isocohedron Sphere"); - uiDefBut(block, BUTM, 1, "Cylinder|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "Adds a Mesh Cylinder with closed ends"); - uiDefBut(block, BUTM, 1, "Tube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 6, "Adds a Mesh Tube with open ends"); - uiDefBut(block, BUTM, 1, "Cone|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, "Adds a Mesh Cone"); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Grid|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, "Adds a Mesh Grid"); -#endif /* EXPERIMENTAL_MENUS */ + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plane|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cube|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UVsphere", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "IcoSphere|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cylinder|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tube|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cone|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grid|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -3060,17 +2892,18 @@ static uiBlock *info_add_curvemenu(void *arg_unused) { /* static short tog=0; */ uiBlock *block; - short xco= 0; + short yco= 0; block= uiNewBlock(&curarea->uiblocks, "add_curvemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_info_add_curvemenu, NULL); - - uiDefBut(block, BUTM, 1, "Bezier Curve|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Adds a Bezier Curve"); - uiDefBut(block, BUTM, 1, "Bezier Circle|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Adds a Bezier Circle"); - uiDefBut(block, BUTM, 1, "NURBS Curve|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Adds a NURBS Curve"); - uiDefBut(block, BUTM, 1, "NURBS Circle", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "Adds a NURBS Circle"); - uiDefBut(block, BUTM, 1, "Path|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "Adds a Path"); + uiBlockSetCol(block, MENUCOL); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Path|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -3116,18 +2949,18 @@ static uiBlock *info_add_surfacemenu(void *arg_unused) { /* static short tog=0; */ uiBlock *block; - short xco= 0; + short yco= 0; block= uiNewBlock(&curarea->uiblocks, "add_surfacemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_info_add_surfacemenu, NULL); - - uiDefBut(block, BUTM, 1, "NURBS Curve|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Adds a NURBS Curve"); - uiDefBut(block, BUTM, 1, "NURBS Circle|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Adds a NURBS Circle"); - uiDefBut(block, BUTM, 1, "NURBS Surface|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Adds a NURBS Surface"); - uiDefBut(block, BUTM, 1, "NURBS Tube", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "Adds a NURBS Tube"); - uiDefBut(block, BUTM, 1, "NURBS Sphere|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "Adds a NURBS Sphere"); - uiDefBut(block, BUTM, 1, "NURBS Donut|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "Adds a NURBS Donut (Torus)"); - + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Surface|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Tube", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Sphere|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Donut|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -3173,12 +3006,13 @@ static uiBlock *info_add_metamenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "add_metamenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_info_add_metamenu, NULL); - - uiDefBut(block, BUTM, 1, "Meta Ball|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Add a ball"); - uiDefBut(block, BUTM, 1, "Meta Tube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Add a tube"); - uiDefBut(block, BUTM, 1, "Meta Plane|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Add a square"); - uiDefBut(block, BUTM, 1, "Meta Elipsoid|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "Add a elipsoid"); - uiDefBut(block, BUTM, 1, "Meta Cube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "Add a circle"); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,"Meta Ball|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Tube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Plane|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Ellipsoid|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Cube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -3238,212 +3072,444 @@ static uiBlock *info_addmenu(void *arg_unused) { /* static short tog=0; */ uiBlock *block; - short xco= 0; - + short yco= 0; + block= uiNewBlock(&curarea->uiblocks, "addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_info_addmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBlockBut(block, info_add_meshmenu, NULL, ICON_RIGHTARROW_THIN, "Mesh", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, info_add_curvemenu, NULL, ICON_RIGHTARROW_THIN, "Curve", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, info_add_surfacemenu, NULL, ICON_RIGHTARROW_THIN, "Surface", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, info_add_metamenu, NULL, ICON_RIGHTARROW_THIN, "Meta", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice|", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 9, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text|", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty|", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); +// uiDefBut(block, BUTM, 1, "Armature|", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 8, "Adds an Armature"); +// uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera|", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp|", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefBlockBut(block, info_add_meshmenu, NULL, "Mesh|>>", 0, xco-=20, 120, 19, "Opens the Add Mesh menu"); - uiDefBlockBut(block, info_add_curvemenu, NULL, "Curve|>>", 0, xco-=20, 120, 19, "Opens the Add Curve menu"); - uiDefBlockBut(block, info_add_surfacemenu, NULL, "Surface|>>", 0, xco-=20, 120, 19, "Opens the Add Surface menu"); - uiDefBlockBut(block, info_add_metamenu, NULL, "Meta|>>", 0, xco-=20, 120, 19, "Click to open the Add Meta menu"); - - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Text|", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 3, "Adds a Text object"); - uiDefBut(block, BUTM, 1, "Empty|", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 5, "Adds an Empty object"); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Camera|", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 6, "Adds a Camera"); - uiDefBut(block, BUTM, 1, "Lamp|", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 7, "Adds a Lamp"); -// uiDefBut(block, BUTM, 1, "Armature|", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 8, "Adds an Armature"); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Lattice|", 0, xco-=20, 120, 19, NULL, 0.0, 0.0, 1, 9, "Adds a Lattice"); - uiBlockSetDirection(block, UI_DOWN); uiTextBoundsBlock(block, 80); return block; } -static void do_info_viewmenu(void *arg, int event) +/************************** GAME *****************************/ + +static void do_info_gamemenu(void *arg, int event) { - switch(event) { - case 0: - if(select_area(SPACE_VIEW3D)) mainqenter(PAD1, 1); + switch (event) { + case G_FILE_ENABLE_ALL_FRAMES_BIT: + case G_FILE_SHOW_FRAMERATE_BIT: + case G_FILE_SHOW_DEBUG_PROPS_BIT: + case G_FILE_AUTOPLAY_BIT: + G.fileflags ^= (1 << event); break; + default: + ; /* ignore the rest */ + } +} + +static uiBlock *info_gamemenu(void *arg_unused) +{ +/* static short tog=0; */ + uiBlock *block; + short yco= 0; + short menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "gamemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_info_gamemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, B_STARTGAME, ICON_BLANK1, "Start Game|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, ""); + + + if(G.fileflags & (1 << G_FILE_ENABLE_ALL_FRAMES_BIT)) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, ""); + } + + if(G.fileflags & (1 << G_FILE_SHOW_FRAMERATE_BIT)) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE_BIT, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE_BIT, ""); + } + + if(G.fileflags & (1 << G_FILE_SHOW_DEBUG_PROPS_BIT)) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS_BIT, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS_BIT, ""); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, ""); + + if(G.fileflags & (1 << G_FILE_AUTOPLAY_BIT)) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Autostart", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY_BIT, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Autostart", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY_BIT, ""); + } + + uiBlockSetDirection(block, UI_DOWN); + uiTextBoundsBlock(block, 50); + + return block; +} +/************************** TIMELINE *****************************/ + +static void do_info_timelinemenu(void *arg, int event) +{ + /* needed to check for valid selected objects */ + Base *base=NULL; + Object *ob=NULL; + //char file[FILE_MAXDIR+FILE_MAXFILE]; + + base= BASACT; + if (base) ob= base->object; + + switch(event) { case 1: - if(select_area(SPACE_VIEW3D)) mainqenter(PAD3, 1); + /* Show Keyframes */ + if (!ob) error("Select an object before showing its keyframes"); + else set_ob_ipoflags(); break; case 2: - if(select_area(SPACE_VIEW3D)) mainqenter(PAD7, 1); + /* Show and select Keyframes */ + if (!ob) error("Select an object before showing and selecting its keyframes"); + else select_select_keys(); + break; + case 3: + /* select next keyframe */ + if (!ob) error("Select an object before selecting its next keyframe"); + else nextkey_obipo(1); + break; + case 4: + /* select previous keyframe */ + if (!ob) error("Select an object before selecting its previous keyframe"); + else nextkey_obipo(-1); + break; + case 5: + /* next keyframe */ + if (!ob) error("Select an object before going to its next keyframe"); + else movekey_obipo(1); + break; + case 6: + /* previous keyframe */ + if (!ob) error("Select an object before going to its previous keyframe"); + else movekey_obipo(-1); break; - case 3: - if(select_area(SPACE_VIEW3D)) mainqenter(PAD0, 1); + case 7: + /* next frame */ + CFRA++; + update_for_newframe(); break; - case 4: - if(select_area(SPACE_VIEW3D)) mainqenter(PADPLUSKEY, 1); + case 8: + /* previous frame */ + CFRA--; + if(CFRA<1) CFRA=1; + update_for_newframe(); break; - case 5: - if(select_area(SPACE_VIEW3D)) mainqenter(PADMINUS, 1); + case 9: + /* forward 10 frames */ + CFRA+= 10; + update_for_newframe(); break; - case 6: - if(select_area(SPACE_VIEW3D)) mainqenter(CKEY, 1); + case 10: + /* back 10 frames */ + CFRA-= 10; + if(CFRA<1) CFRA=1; + update_for_newframe(); break; - case 7: - if(select_area(SPACE_VIEW3D)) mainqenter(HOMEKEY, 1); + case 11: + /* end frame */ + CFRA= EFRA; + update_for_newframe(); + break; + case 12: + /* start frame */ + CFRA= SFRA; + update_for_newframe(); break; } allqueue(REDRAWINFO, 0); } -static uiBlock *info_viewmenu(void *arg_unused) +static uiBlock *info_timelinemenu(void *arg_unused) { /* static short tog=0; */ uiBlock *block; - short xco= 0; - - block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_viewmenu, NULL); + short yco= 0; + short menuwidth=120; - // uiBlockSetCol(block, BUTBLUE); + block= uiNewBlock(&curarea->uiblocks, "timelinemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_info_timelinemenu, NULL); + uiBlockSetCol(block, MENUCOL); - uiDefBut(block, BUTM, 1, "Front|NumPad 1", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 0, "Sets current viewport to Front view"); - uiDefBut(block, BUTM, 1, "Right|NumPad 3", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 1, "Sets current viewport to Right view"); - uiDefBut(block, BUTM, 1, "Top|NumPad 7", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 2, "Sets current viewport to Top view"); - uiDefBut(block, BUTM, 1, "Camera|NumPad 0", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 3, "Sets current viewport to Camera view"); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Keyframes|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show and Select Keyframes|Shift K",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Next Keyframe|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Previous Keyframe|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Keyframe|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Keyframe|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Frame|RightArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Frame|LeftArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Forward 10 Frames|UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Back 10 Frames|DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "End Frame|Shift RightArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Start Frame|Shift LeftArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Zoom In|NumPad +", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 4, "Zooms In current viewport"); - uiDefBut(block, BUTM, 1, "Zoom Out|NumPad -", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 5, "Zooms Out current viewport"); - - uiDefBut(block, SEPR, 0, "", 0, xco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Center|C", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 6, "Centers selected item in current viewport"); - uiDefBut(block, BUTM, 1, "View All|Home", 0, xco-=20, 140, 19, NULL, 0.0, 0.0, 0, 7, "Zooms In or Out to fit all objects in current viewport"); - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 50); - + uiTextBoundsBlock(block, 80); + return block; } -static void do_game_menu(void *arg, int event) +/************************** RENDER *****************************/ + +/* copied from buttons.c. .. probably not such a good idea!? */ +static void run_playanim(char *file) { + extern char bprogname[]; /* usiblender.c */ + char str[FILE_MAXDIR+FILE_MAXFILE]; + int pos[2], size[2]; + + calc_renderwin_rectangle(R.winpos, pos, size); + + sprintf(str, "%s -a -p %d %d \"%s\"", bprogname, pos[0], pos[1], file); + system(str); +} + +static void do_info_rendermenu(void *arg, int event) { - switch (event) { - case G_FILE_ENABLE_ALL_FRAMES_BIT: - case G_FILE_SHOW_FRAMERATE_BIT: - case G_FILE_SHOW_DEBUG_PROPS_BIT: - case G_FILE_AUTOPLAY_BIT: - G.fileflags ^= (1 << event); + char file[FILE_MAXDIR+FILE_MAXFILE]; + + extern void makeavistring(char *string); + extern void makeqtstring (char *string); + + switch(event) { + + case 0: + BIF_do_render(0); + break; + case 1: + BIF_do_render(1); + break; + case 2: + if(select_area(SPACE_VIEW3D)) { + BIF_do_ogl_render(curarea->spacedata.first, 0 ); + } + break; + case 3: + if(select_area(SPACE_VIEW3D)) { + BIF_do_ogl_render(curarea->spacedata.first, 1 ); + } + break; + case 4: + BIF_toggle_render_display(); + break; + case 5: +#ifdef WITH_QUICKTIME + if(G.scene->r.imtype == R_QUICKTIME) + makeqtstring(file); + else +#endif + makeavistring(file); + if(BLI_exist(file)) { + run_playanim(file); + } + else { + makepicstring(file, G.scene->r.sfra); + if(BLI_exist(file)) { + run_playanim(file); + } + else error("Can't find image: %s", file); + } + break; + case 6: + /* dodgy hack turning on SHIFT key to do a proper render border select + strangely, set_render_border(); won't work :( + + This code copied from toolbox.c */ + + if(select_area(SPACE_VIEW3D)) { + mainqenter(LEFTSHIFTKEY, 1); + mainqenter(BKEY, 1); + mainqenter(BKEY, 0); + mainqenter(EXECUTE, 1); + mainqenter(LEFTSHIFTKEY, 0); + } + + break; + + case 7: + extern_set_butspace(F10KEY); break; - default: - ; /* ignore the rest */ } + allqueue(REDRAWINFO, 0); } -static uiBlock *info_gamemenu(void *arg_unused) +static uiBlock *info_rendermenu(void *arg_unused) { +/* static short tog=0; */ uiBlock *block; short yco= 0; + short menuwidth=120; - block= uiNewBlock(&curarea->uiblocks, "gamemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetCol(block, BUTBLUE); - uiBlockSetDirection(block, UI_DOWN); -#if GAMEBLENDER == 1 - uiDefBut(block, BUTM, B_STARTGAME, "Starts Game|P", - 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 0, 0, - "Start the game (press the Escape key to stop)"); - - uiDefBut(block, SEPR, 0, "", - -20, yco-=6, 180, 6, NULL, 0.0, 0.0, 1, 0, ""); -#endif - /* flags are case-values */ - uiBlockSetButmFunc(block, do_game_menu, NULL); - uiDefBut(block, BUTM, 1, "Enable All Frames", - 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES_BIT, - "Toggles between draw all frames on (no frames dropped) and off (full speed)"); - uiDefBut(block, BUTM, 1, "Show framerate and profile", - 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE_BIT, - "Toggles between showing and not showing the framerate and profile"); - uiDefBut(block, BUTM, 1, "Show debug properties", - 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS_BIT, - "Toggles between showing and not showing debug properties"); - uiDefBut(block, SEPR, 0, "", -20, yco-=6, 180, 6, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Autostart", - 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY_BIT, - "Toggles between automatic game start on and off"); + block= uiNewBlock(&curarea->uiblocks, "rendermenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_info_rendermenu, NULL); + uiBlockSetCol(block, MENUCOL); - uiTextBoundsBlock(block, 50); - /* Toggle buttons */ -#if GAMEBLENDER == 1 - yco= -26; -#else - yco= 0; -#endif - uiBlockSetEmboss(block, UI_EMBOSSW); - /* flags are defines */ + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Current Frame|F12", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Animation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiBlockSetButmFunc(block, NULL, NULL); // to prevent it from calling the menu function - uiDefIconButI(block, ICONTOG|BIT|G_FILE_ENABLE_ALL_FRAMES_BIT, - 0, ICON_CHECKBOX_DEHLT, -20, yco-=20, 19, 19, - &G.fileflags, 0.0, 0.0, 0, 0, ""); - uiDefIconButI(block, ICONTOG|BIT|G_FILE_SHOW_FRAMERATE_BIT, - 0, ICON_CHECKBOX_DEHLT, -20, yco-=20, 19, 19, - &G.fileflags, 0.0, 0.0, 0, 0, ""); - uiDefIconButI(block, ICONTOG|BIT|G_FILE_SHOW_DEBUG_PROPS_BIT, - 0, ICON_CHECKBOX_DEHLT, -20, yco-=20, 19, 19, - &G.fileflags, 0.0, 0.0, 0, 0, ""); - yco-=6; - uiDefIconButI(block, ICONTOG|BIT|G_FILE_AUTOPLAY_BIT, - 0, ICON_CHECKBOX_DEHLT, -20, yco-=20, 19, 19, - &G.fileflags, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "OpenGL Preview Current Frame",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "OpenGL Preview Animation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Render Buffer|F11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Rendered Animation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Render Border|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Settings|F10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + + uiBlockSetDirection(block, UI_DOWN); + uiTextBoundsBlock(block, 80); return block; } -#ifndef EXPERIMENTAL_MENUS -/* In the Maarten's new menu structure proposal, the tools menu moved to the file menu */ -static void do_info_toolsmenu(void *arg, int event) +/************************** HELP *****************************/ + +static void do_info_help_websitesmenu(void *arg, int event) { + /* these are no defines, easier this way, the codes are in the function below */ + switch(event) { + case 0: /* */ + + break; + } + allqueue(REDRAWVIEW3D, 0); +} + + +static uiBlock *info_help_websitesmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "info_help_websitesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_info_help_websitesmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Blender Website *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Blender E-shop *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Development Community *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "User Community *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "...? *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + + return block; +} + + +static void do_info_helpmenu(void *arg, int event) +{ switch(event) { + case 0: - check_packAll(); break; case 1: - unpackAll(PF_WRITE_LOCAL); - G.fileflags &= ~G_AUTOPACK; - break; - case 2: - if (buttons_do_unpack() != RET_CANCEL) { - // clear autopack bit only if - // user selected one of the unpack options - G.fileflags &= ~G_AUTOPACK; + /* dodgy hack turning on CTRL ALT SHIFT key to do a benchmark + * rather than copying lines and lines of code from toets.c :( + */ + + if(select_area(SPACE_VIEW3D)) { + mainqenter(LEFTSHIFTKEY, 1); + mainqenter(LEFTCTRLKEY, 1); + mainqenter(LEFTALTKEY, 1); + mainqenter(TKEY, 1); + mainqenter(TKEY, 0); + mainqenter(EXECUTE, 1); + mainqenter(LEFTSHIFTKEY, 0); + mainqenter(LEFTCTRLKEY, 0); + mainqenter(LEFTALTKEY, 0); } break; } allqueue(REDRAWINFO, 0); } -static uiBlock *info_toolsmenu(void *arg_unused) +static uiBlock *info_helpmenu(void *arg_unused) { /* static short tog=0; */ uiBlock *block; - short xco= 0; + short yco= 0; + short menuwidth=120; - block= uiNewBlock(&curarea->uiblocks, "toolsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_toolsmenu, NULL); - // uiBlockSetCol(block, BUTBLUE); + block= uiNewBlock(&curarea->uiblocks, "info_helpmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_info_helpmenu, NULL); + uiBlockSetCol(block, MENUCOL); - uiDefBut(block, BUTM, 1, "Pack Data", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "Saves a copy of all packed external files inside the project file"); - uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "Removes all packed files from the project and saves them to the current directory"); - uiDefBut(block, BUTM, 1, "Advanced Unpack", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "-- Placeholders only --", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tutorials *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "User Manual *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Python Scripting Reference *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, info_help_websitesmenu, NULL, ICON_RIGHTARROW_THIN, "Websites", 0, yco-=20, 120, 19, ""); - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 20); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Benchmark", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, B_SHOWSPLASH, ICON_BLANK1, "About Blender...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Release Notes *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiBlockSetDirection(block, UI_DOWN); + uiTextBoundsBlock(block, 80); + return block; } -#endif /* EXPERIMENTAL_MENUS */ + + +/************************** END MAIN MENU *****************************/ static void info_text(int x, int y) @@ -3478,10 +3544,10 @@ static void info_text(int x, int y) fac2 = 1.0; fac3 = 0.9; } else { - hsize = 150; + hsize = 142; /* promise! Never change these lines again! (zr & ton did!) */ - fac1= fabs(hashvectf[ 2*G.version+5]); - fac2= 0.5+0.1*hashvectf[ G.version+4]; /* was '4 and 3', for 2.28a patch... */ + fac1= fabs(hashvectf[ 2*G.version+4]); + fac2= 0.5+0.1*hashvectf[ G.version+3]; fac3= 0.7; } @@ -3489,7 +3555,6 @@ static void info_text(int x, int y) headerstr= g_progress_info; } else { headerstr= versionstr; - headerstr= "www.blender.org 2.28c"; /* patch! */ } swatch_color= hsv_to_cpack(fac1, fac2, fac3); @@ -3502,8 +3567,8 @@ static void info_text(int x, int y) glRasterPos2i(x, y); BIF_DrawString(G.font, headerstr, (U.transopts & TR_MENUS), 0); - - glRasterPos2i(x-20+hsize, y); + + glRasterPos2i(x+120, y); BIF_DrawString(G.font, infostr, (U.transopts & TR_MENUS), 0); } @@ -3528,7 +3593,7 @@ void info_buttons(void) sprintf(naam, "header %d", curarea->headwin); block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSN, UI_HELV, curarea->headwin); uiBlockSetCol(block, BUTGREY); - + if(U.uiflag & FLIPINFOMENU) { uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, xco,2,XIC,YIC-2, @@ -3543,38 +3608,38 @@ void info_buttons(void) if(U.uiflag & FLIPINFOMENU) { } else { uiBlockSetEmboss(block, UI_EMBOSSP); + if(area_is_active_area(curarea)) uiBlockSetCol(block, HEADERCOLSEL); + else uiBlockSetCol(block, HEADERCOL); xmax= GetButStringLength("File"); - uiDefBlockBut(block, info_filemenu, NULL, "File", xco, 3, xmax, 15, ""); - xco+= xmax; - - xmax= GetButStringLength("Edit"); - uiDefBlockBut(block, info_editmenu, NULL, "Edit", xco, 3, xmax, 15, ""); + uiDefBlockBut(block, info_filemenu, NULL, "File", xco, 0, xmax, 21, ""); xco+= xmax; xmax= GetButStringLength("Add"); - uiDefBlockBut(block, info_addmenu, NULL, "Add", xco, 3, xmax, 15, ""); + uiDefBlockBut(block, info_addmenu, NULL, "Add", xco, 0, xmax, 21, ""); xco+= xmax; - xmax= GetButStringLength("View"); - uiDefBlockBut(block, info_viewmenu, NULL, "View", xco, 3, xmax, 15, ""); + xmax= GetButStringLength("Timeline"); + uiDefBlockBut(block, info_timelinemenu, NULL, "Timeline", xco, 0, xmax, 21, ""); xco+= xmax; + xmax= GetButStringLength("Game"); - uiDefBlockBut(block, info_gamemenu, NULL, "Game", xco, 3, xmax, 15, ""); + uiDefBlockBut(block, info_gamemenu, NULL, "Game", xco, 0, xmax, 21, ""); xco+= xmax; -#ifndef EXPERIMENTAL_MENUS - // In the Maarten's new menu structure proposal, the tools menu moved to the file menu + xmax= GetButStringLength("Render"); + uiDefBlockBut(block, info_rendermenu, NULL, "Render", xco, 0, xmax, 21, ""); + xco+= xmax; - xmax= GetButStringLength("Tools"); - uiDefBlockBut(block, info_toolsmenu, NULL, "Tools", xco, 3, xmax, 15, ""); + xmax= GetButStringLength("Help"); + uiDefBlockBut(block, info_helpmenu, NULL, "Help", xco, 0, xmax, 21, ""); xco+= xmax; -#endif // EXPERIMENTAL_MENUS } /* pack icon indicates a packed file */ - + uiBlockSetCol(block, BUTGREY); + if (G.fileflags & G_AUTOPACK) { uiBlockSetEmboss(block, UI_EMBOSSN); uiDefIconBut(block, LABEL, 0, ICON_PACKAGE, xco, 0, XIC, YIC, &G.fileflags, 0.0, 0.0, 0, 0, "Indicates this is a Packed file. See File menu."); @@ -3629,19 +3694,7 @@ void info_buttons(void) 0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */ } #endif -/* -#ifdef _WIN32 // FULLSCREEN - if(U.uiflag & FLIPFULLSCREEN) { - uiDefIconButS(block, TOG|BIT|7, B_FLIPFULLSCREEN, ICON_WINDOW_WINDOW, - (short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC, - &(U.uiflag), 0, 0, 0, 0, "Toggle Blender fullscreen"); - } else { - uiDefIconButS(block, TOG|BIT|7, B_FLIPFULLSCREEN, ICON_WINDOW_FULLSCREEN, - (short)(curarea->winx-(XIC*2)-2), 0,XIC,YIC, - &(U.uiflag), 0, 0, 0, 0, "Toggle Blender fullscreen"); - } -#endif -*/ + } uiDrawBlock(block); @@ -3714,6 +3767,2574 @@ void seq_buttons() /* ********************** END SEQ ****************************** */ /* ********************** VIEW3D ****************************** */ +void do_layer_buttons(short event) +{ + static int oldlay= 1; + + if(G.vd==0) return; + if(G.vd->localview) return; + + if(event==-1 && (G.qual & LR_CTRLKEY)) { + G.vd->scenelock= !G.vd->scenelock; + do_view3d_buttons(B_SCENELOCK); + } else if (event==-1) { + if(G.vd->lay== (2<<20)-1) { + if(G.qual & LR_SHIFTKEY) G.vd->lay= oldlay; + } + else { + oldlay= G.vd->lay; + G.vd->lay= (2<<20)-1; + } + + if(G.vd->scenelock) handle_view3d_lock(); + scrarea_queue_winredraw(curarea); + } + else { + if(G.qual & LR_ALTKEY) { + if(event<11) event+= 10; + } + if(G.qual & LR_SHIFTKEY) { + if(G.vd->lay & (1<<event)) G.vd->lay -= (1<<event); + else G.vd->lay += (1<<event); + } + do_view3d_buttons(event+B_LAY); + } + /* redraw seems double: but the queue nicely handles that */ + scrarea_queue_headredraw(curarea); + + if(curarea->spacetype==SPACE_OOPS) allqueue(REDRAWVIEW3D, 1); /* 1==also do headwin */ + +} + +static void do_view3d_view_cameracontrolsmenu(void *arg, int event) +{ + switch(event) { + case 0: /* Orbit Left */ + persptoetsen(PAD4); + break; + case 1: /* Orbit Right */ + persptoetsen(PAD6); + break; + case 2: /* Orbit Up */ + persptoetsen(PAD8); + break; + case 3: /* Orbit Down */ + persptoetsen(PAD2); + break; + case 4: /* Zoom In */ + persptoetsen(PADPLUSKEY); + break; + case 5: /* Zoom Out */ + persptoetsen(PADMINUS); + break; + case 6: /* Reset Zoom */ + persptoetsen(PADENTER); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_view_cameracontrolsmenu(void *arg_unused) +{ +/* static short tog=0; */ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_view_cameracontrolsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_viewmenu(void *arg, int event) +{ + extern int play_anim(int mode); + + float *curs; + + switch(event) { + case 0: /* User */ + G.vd->viewbut = 0; + G.vd->persp = 1; + break; + case 1: /* Camera */ + persptoetsen(PAD0); + break; + case 2: /* Top */ + persptoetsen(PAD7); + break; + case 3: /* Front */ + persptoetsen(PAD1); + break; + case 4: /* Side */ + persptoetsen(PAD3); + break; + case 5: /* Perspective */ + G.vd->persp=1; + break; + case 6: /* Orthographic */ + G.vd->persp=0; + break; + case 7: /* Local View */ + G.vd->localview= 1; + initlocalview(); + break; + case 8: /* Global View */ + G.vd->localview= 0; + endlocalview(curarea); + break; + case 9: /* Frame All (Home) */ + view3d_home(0); + break; + case 10: /* Center at Cursor */ + curs= give_cursor(); + G.vd->ofs[0]= -curs[0]; + G.vd->ofs[1]= -curs[1]; + G.vd->ofs[2]= -curs[2]; + scrarea_queue_winredraw(curarea); + break; + case 11: /* Center View to Selected */ + centreview(); + break; + case 12: /* Align View to Selected */ + mainqenter(PADASTERKEY, 1); + break; + case 13: /* Play Back Animation */ + play_anim(0); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_viewmenu(void *arg_unused) +{ +/* static short tog=0; */ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + /* + * Reverse the menu order depending if the header is on top or bottom. + * Is more usable/logical this way by using motor memory to remember the + * positioning of menu items - remembering a distance that the mouse + * pointer has to travel, rather than a specific x,y co-ordinate down the list. + */ + if(curarea->headertype==HEADERTOP) { + + if ((G.vd->viewbut == 0) && !(G.vd->persp == 2)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + if (G.vd->persp == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + if (G.vd->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + if (G.vd->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + if (G.vd->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(G.vd->persp==1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + if(G.vd->persp==0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + if(!G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "Viewport Navigation", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, ""); + else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + + } else { + + if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, ""); + else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "Viewport Navigation", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(!G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + if(G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(G.vd->persp==0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + if(G.vd->persp==1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if (G.vd->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + if (G.vd->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + if (G.vd->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + if (G.vd->persp == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + if ((G.vd->viewbut == 0) && !(G.vd->persp == 2)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + + return block; +} + +static void do_view3d_select_objectmenu(void *arg, int event) +{ + extern void borderselect(void); + extern void deselectall(void); + + switch(event) { + + case 0: /* border select */ + borderselect(); + break; + case 1: /* Select/Deselect All */ + deselectall(); + break; + case 2: /* Select Linked */ + selectlinks(); + break; + case 3: /* Select Grouped */ + group_menu(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_select_objectmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_objectmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked...|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grouped...|Shift G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grouped...|Shift G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked...|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_meshmenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_mesh(); + break; + case 3: /* Inverse */ + selectswap_mesh(); + break; + case 4: /* select linked vertices */ + G.qual |= LR_CTRLKEY; + selectconnected_mesh(); + G.qual &= ~LR_CTRLKEY; + break; + case 5: /* select random */ + // selectrandom_mesh(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + + +static uiBlock *view3d_select_meshmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_meshmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Loop|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random Vertices...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connected Vertices|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connected Vertices|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random Vertices...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Loop|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_curvemenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_nurb(); + break; + case 3: /* Inverse */ + selectswapNurb(); + break; + //case 4: /* select connected control points */ + //G.qual |= LR_CTRLKEY; + //selectconnected_nurb(); + //G.qual &= ~LR_CTRLKEY; + //break; + case 5: /* select row (nurb) */ + selectrow_nurb(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + + +static uiBlock *view3d_select_curvemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_curvemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + if (OBACT->type == OB_SURF) { + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Control Point Row|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + } + /* commented out because it seems to only like the LKEY method - based on mouse pointer position :( */ + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connected Control Points|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + } else { + + /* commented out because it seems to only like the LKEY method - based on mouse pointer position :( */ + //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connected Control Points|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + if (OBACT->type == OB_SURF) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Control Point Row|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + } + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_metaballmenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_mball(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + + +static uiBlock *view3d_select_metaballmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_metaballmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_latticemenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_Latt(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_select_latticemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_latticemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_armaturemenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_armature(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_select_armaturemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_armaturemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_pose_armaturemenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_posearmature(1); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_pose_armaturemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_select_faceselmenu(void *arg, int event) +{ + extern void borderselect(void); + + switch(event) { + case 0: /* border select */ + borderselect(); + break; + case 2: /* Select/Deselect all */ + deselectall_tface(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_select_faceselmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_select_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_select_faceselmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_edit_object_transformmenu(void *arg, int event) +{ + switch(event) { + case 0: /* clear origin */ + clear_object('o'); + break; + case 1: /* clear size */ + clear_object('s'); + break; + case 2: /* clear rotation */ + clear_object('r'); + break; + case 3: /* clear location */ + clear_object('g'); + break; + case 4: /* apply deformation */ + make_duplilist_real(); + break; + case 5: /* apply size/rotation */ + apply_object(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_object_transformmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_object_transformmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Size/Rotation|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Size|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_object_parentmenu(void *arg, int event) +{ + switch(event) { + case 0: /* clear parent */ + clear_parent(); + break; + case 1: /* make parent */ + make_parent(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_object_parentmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_parentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_object_parentmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_object_trackmenu(void *arg, int event) +{ + switch(event) { + case 0: /* clear track */ + clear_track(); + break; + case 1: /* make track */ + make_track(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_object_trackmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_trackmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_object_trackmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Track...|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Track...|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_objectmenu(void *arg, int event) +{ + /* needed to check for valid selected objects */ + Base *base=NULL; + Object *ob=NULL; + + base= BASACT; + if (base) ob= base->object; + + switch(event) { + + case 0: /* transform properties*/ + blenderqread(NKEY, 1); + break; + case 1: /* delete */ + delete_context_selected(); + break; + case 2: /* duplicate */ + duplicate_context_selected(); + break; + case 3: /* duplicate linked */ + G.qual |= LR_ALTKEY; + adduplicate(0); + G.qual &= ~LR_ALTKEY; + break; + case 4: /* make links */ + linkmenu(); + break; + case 5: /* make single user */ + single_user(); + break; + case 6: /* copy properties */ + copymenu(); + break; + case 7: /* boolean operation */ + special_editmenu(); + break; + case 8: /* join objects */ + if( (ob= OBACT) ) { + if(ob->type == OB_MESH) join_mesh(); + else if(ob->type == OB_CURVE) join_curve(OB_CURVE); + else if(ob->type == OB_SURF) join_curve(OB_SURF); + else if(ob->type == OB_ARMATURE) join_armature(); + } + break; + case 9: /* convert object type */ + convertmenu(); + break; + case 10: /* move to layer */ + movetolayer(); + break; + case 11: /* insert keyframe */ + common_insertkey(); + break; + case 12: /* snap */ + snapmenu(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_objectmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + //uiDefIconTextBlockBut(block, 0, NULL, ICON_RIGHTARROW_THIN, "Move", 0, yco-=20, 120, 19, ""); + //uiDefIconTextBlockBut(block, 0, NULL, ICON_RIGHTARROW_THIN, "Rotate", 0, yco-=20, 120, 19, ""); + //uiDefIconTextBlockBut(block, 0, NULL, ICON_RIGHTARROW_THIN, "Scale", 0, yco-=20, 120, 19, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Linked|Alt D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Links...|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Single User...|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Properties...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_object_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_object_trackmenu, NULL, ICON_RIGHTARROW_THIN, "Track", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if (OBACT && OBACT->type == OB_MESH) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + } + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Join Objects|Ctrl J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Join Objects|Ctrl J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + if (OBACT && OBACT->type == OB_MESH) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_object_trackmenu, NULL, ICON_RIGHTARROW_THIN, "Track", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_object_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Properties...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Single User...|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Links...|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Linked|Alt D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + + +static void do_view3d_edit_propfalloffmenu(void *arg, int event) +{ + extern int prop_mode; + + switch(event) { + case 0: /* proportional edit - sharp*/ + prop_mode = 0; + break; + case 1: /* proportional edit - smooth*/ + prop_mode = 1; + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_propfalloffmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + extern int prop_mode; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_propfalloffmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_propfalloffmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if (prop_mode==0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + if (prop_mode==1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_mesh_verticesmenu(void *arg, int event) +{ + extern float doublimit; + + switch(event) { + + case 0: /* make vertex parent */ + make_parent(); + break; + case 1: /* remove doubles */ + notice("Removed: %d", removedoublesflag(1, doublimit)); + break; + case 2: /* smooth */ + vertexsmooth(); + break; + case 3: /* separate */ + separate_mesh(); + break; + case 4: /*split */ + split_mesh(); + break; + case 5: /*merge */ + mergemenu(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_mesh_verticesmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_verticesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_mesh_verticesmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge...|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Split|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Doubles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_mesh_edgesmenu(void *arg, int event) +{ + extern short editbutflag; + float fac; + short randfac; + + switch(event) { + + case 0: /* subdivide smooth */ + subdivideflag(1, 0.0, editbutflag | B_SMOOTH); + break; + case 1: /*subdivide fractal */ + randfac= 10; + if(button(&randfac, 1, 100, "Rand fac:")==0) return; + fac= -( (float)randfac )/100; + subdivideflag(1, fac, editbutflag); + break; + case 2: /* subdivide */ + subdivideflag(1, 0.0, editbutflag); + break; + case 3: /* knife subdivide */ + // KnifeSubdivide(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_mesh_edgesmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_edgesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_mesh_edgesmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Knife Subdivide|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Fractal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Smooth", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_mesh_facesmenu(void *arg, int event) +{ + switch(event) { + case 0: /* Fill Faces */ + fill_mesh(); + break; + case 1: /* Beauty Fill Faces */ + beauty_fill(); + break; + case 2: /* Quads to Tris */ + convert_to_triface(0); + allqueue(REDRAWVIEW3D, 0); + countall(); + makeDispList(G.obedit); + break; + case 3: /* Tris to Quads */ + join_triangles(); + break; + case 4: /* Flip triangle edges */ + edge_flip(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_mesh_facesmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_facesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_mesh_facesmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Beauty Fill|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Quads to Triangles|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Triangles to Quads|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Triangle Edges|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_mesh_normalsmenu(void *arg, int event) +{ + switch(event) { + case 0: /* flip */ + flip_editnormals(); + break; + case 1: /* recalculate inside */ + righthandfaces(2); + break; + case 2: /* recalculate outside */ + righthandfaces(1); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_mesh_normalsmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_normalsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_mesh_normalsmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Outside|Ctrl N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Inside|Ctrl Shift N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_meshmenu(void *arg, int event) +{ + switch(event) { + + case 0: /* Undo Editing */ + remake_editMesh(); + break; + case 1: /* transform properties */ + blenderqread(NKEY, 1); + break; + case 2: /* Extrude */ + extrude_mesh(); + break; + case 3: /* duplicate */ + duplicate_context_selected(); + break; + case 4: /* Make Edge/Face */ + addedgevlak_mesh(); + break; + case 5: /* delete */ + delete_context_selected(); + break; + case 6: /* Shrink/Fatten Along Normals */ + transform('N'); + break; + case 7: /* Shear */ + transform('S'); + break; + case 8: /* Warp */ + transform('w'); + break; + case 9: /* proportional edit (toggle) */ + if(G.f & G_PROPORTIONAL) G.f &= ~G_PROPORTIONAL; + else G.f |= G_PROPORTIONAL; + break; + case 10: /* show hidden vertices */ + reveal_mesh(); + break; + case 11: /* hide selected vertices */ + hide_mesh(0); + break; + case 12: /* hide deselected vertices */ + hide_mesh(1); + break; + case 13: /* insert keyframe */ + common_insertkey(); + break; + case 14: /* snap */ + snapmenu(); + break; + case 15: /* move to layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_meshmenu(void *arg_unused) +{ + + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_meshmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + /* + uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Move", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Rotate", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Scale", 0, yco-=20, 120, 19, ""); + */ + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_mesh_verticesmenu, NULL, ICON_RIGHTARROW_THIN, "Vertices", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_edgesmenu, NULL, ICON_RIGHTARROW_THIN, "Edges", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Faces", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_normalsmenu, NULL, ICON_RIGHTARROW_THIN, "Normals", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(G.f & G_PROPORTIONAL) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } + uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Vertices", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Vertices|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Vertices|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Vertices|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Vertices|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Vertices", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + if(G.f & G_PROPORTIONAL) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_mesh_normalsmenu, NULL, ICON_RIGHTARROW_THIN, "Normals", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Faces", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_edgesmenu, NULL, ICON_RIGHTARROW_THIN, "Edges", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_mesh_verticesmenu, NULL, ICON_RIGHTARROW_THIN, "Vertices", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_edit_curve_controlpointsmenu(void *arg, int event) +{ + switch(event) { + case 0: /* tilt */ + transform('t'); + break; + case 1: /* clear tilt */ + clear_tilt(); + break; + case 2: /* Free */ + sethandlesNurb(3); + makeDispList(G.obedit); + break; + case 3: /* vector */ + sethandlesNurb(2); + makeDispList(G.obedit); + break; + case 4: /* smooth */ + sethandlesNurb(1); + makeDispList(G.obedit); + break; + case 5: /* make vertex parent */ + make_parent(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_curve_controlpointsmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_controlpointsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_curve_controlpointsmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if (OBACT->type == OB_CURVE) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Tilt|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Free/Aligned|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + } + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_curve_segmentsmenu(void *arg, int event) +{ + switch(event) { + case 0: /* subdivide */ + subdivideNurb(); + break; + case 1: /* switch direction */ + switchdirectionNurb2(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_curve_segmentsmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_segmentsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_curve_segmentsmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Direction", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_edit_curvemenu(void *arg, int event) +{ + switch(event) { + + case 0: /* Undo Editing */ + remake_editNurb(); + break; + case 1: /* transformation properties */ + blenderqread(NKEY, 1); + break; + case 2: /* insert keyframe */ + common_insertkey(); + break; + case 4: /* extrude */ + if (OBACT->type == OB_CURVE) { + addvert_Nurb('e'); + } else if (OBACT->type == OB_SURF) { + extrude_nurb(); + } + break; + case 5: /* duplicate */ + duplicate_context_selected(); + break; + case 6: /* make segment */ + addsegment_nurb(); + break; + case 7: /* toggle cyclic */ + makecyclicNurb(); + makeDispList(G.obedit); + break; + case 8: /* delete */ + delete_context_selected(); + break; + case 9: /* proportional edit (toggle) */ + if(G.f & G_PROPORTIONAL) G.f &= ~G_PROPORTIONAL; + else G.f |= G_PROPORTIONAL; + break; + case 10: /* show hidden control points */ + revealNurb(); + break; + case 11: /* hide selected control points */ + hideNurb(0); + break; + case 12: /* hide deselected control points */ + hideNurb(1); + break; + case 13: /* Shear */ + transform('S'); + break; + case 14: /* Warp */ + transform('w'); + break; + case 15: /* snap */ + snapmenu(); + break; + case 16: /* move to layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_curvemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_curvemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Segment|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Cyclic|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_curve_controlpointsmenu, NULL, ICON_RIGHTARROW_THIN, "Control Points", 0, yco-=20, menuwidth, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_curve_segmentsmenu, NULL, ICON_RIGHTARROW_THIN, "Segments", 0, yco-=20, menuwidth, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(G.f & G_PROPORTIONAL) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } + uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Control Points|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Control Points|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + if (OBACT->type == OB_SURF) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Control Points|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if (OBACT->type == OB_SURF) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Control Points|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Control Points|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Control Points|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + if(G.f & G_PROPORTIONAL) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_curve_segmentsmenu, NULL, ICON_RIGHTARROW_THIN, "Segments", 0, yco-=20, menuwidth, 19, ""); + uiDefIconTextBlockBut(block, view3d_edit_curve_controlpointsmenu, NULL, ICON_RIGHTARROW_THIN, "Control Points", 0, yco-=20, menuwidth, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Cyclic|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Segment|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_edit_metaballmenu(void *arg, int event) +{ + switch(event) { + case 1: /* duplicate */ + duplicate_context_selected(); + break; + case 2: /* delete */ + delete_context_selected(); + break; + case 3: /* Shear */ + transform('S'); + break; + case 4: /* Warp */ + transform('w'); + break; + case 5: /* move to layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_metaballmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_metaballmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_edit_text_charsmenu(void *arg, int event) +{ + switch(event) { + case 0: /* copyright */ + do_textedit(0,0,169); + break; + case 1: /* registered trademark */ + do_textedit(0,0,174); + break; + case 2: /* degree sign */ + do_textedit(0,0,176); + break; + case 3: /* Multiplication Sign */ + do_textedit(0,0,215); + break; + case 4: /* Circle */ + do_textedit(0,0,138); + break; + case 5: /* superscript 1 */ + do_textedit(0,0,185); + break; + case 6: /* superscript 2 */ + do_textedit(0,0,178); + break; + case 7: /* superscript 3 */ + do_textedit(0,0,179); + break; + case 8: /* double >> */ + do_textedit(0,0,187); + break; + case 9: /* double << */ + do_textedit(0,0,171); + break; + case 10: /* Promillage */ + do_textedit(0,0,139); + break; + case 11: /* dutch florin */ + do_textedit(0,0,164); + break; + case 12: /* british pound */ + do_textedit(0,0,163); + break; + case 13: /* japanese yen*/ + do_textedit(0,0,165); + break; + case 14: /* german S */ + do_textedit(0,0,223); + break; + case 15: /* spanish question mark */ + do_textedit(0,0,191); + break; + case 16: /* spanish exclamation mark */ + do_textedit(0,0,161); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_text_charsmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_text_charsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_edit_text_charsmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copyright|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Registered Trademark|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Degree Sign|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Multiplication Sign|Alt x", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Circle|Alt .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 1|Alt 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 2|Alt 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 3|Alt 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Double >>|Alt >", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Double <<|Alt <", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Promillage|Alt %", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dutch Florin|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "British Pound|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Japanese Yen|Alt Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "German S|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spanish Question Mark|Alt ?", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spanish Exclamation Mark|Alt !", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + + return block; +} + +static void do_view3d_edit_textmenu(void *arg, int event) +{ + switch(event) { + + case 0: /* Undo Editing */ + remake_editText(); + break; + case 1: /* paste from file buffer */ + paste_editText(); + break; + case 2: /* move to layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_textmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_textmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_textmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste From Buffer File|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_text_charsmenu, NULL, ICON_RIGHTARROW_THIN, "Special Characters", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_text_charsmenu, NULL, ICON_RIGHTARROW_THIN, "Special Characters", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste From Buffer File|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_edit_latticemenu(void *arg, int event) +{ + switch(event) { + + case 0: /* Undo Editing */ + remake_editLatt(); + break; + case 1: /* snap */ + snapmenu(); + break; + case 2: /* insert keyframe */ + common_insertkey(); + break; + case 3: /* Shear */ + transform('S'); + break; + case 4: /* Warp */ + transform('w'); + break; + case 5: /* proportional edit (toggle) */ + if(G.f & G_PROPORTIONAL) G.f &= ~G_PROPORTIONAL; + else G.f |= G_PROPORTIONAL; + break; + case 6: /* move to layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_latticemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_latticemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(G.f & G_PROPORTIONAL) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + } + uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + if(G.f & G_PROPORTIONAL) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_edit_armaturemenu(void *arg, int event) +{ + switch(event) { + + case 0: /* Undo Editing */ + remake_editArmature(); + break; + case 1: /* transformation properties */ + blenderqread(NKEY, 1); + break; + case 2: /* snap */ + snapmenu(); + break; + case 3: /* extrude */ + extrude_armature(); + break; + case 4: /* duplicate */ + duplicate_context_selected(); + break; + case 5: /* delete */ + delete_context_selected(); + break; + case 6: /* Shear */ + transform('S'); + break; + case 7: /* Warp */ + transform('w'); + break; + case 8: /* Move to Layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_edit_armaturemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_edit_armaturemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + + return block; +} + +static void do_view3d_pose_armature_transformmenu(void *arg, int event) +{ + switch(event) { + case 0: /* clear origin */ + clear_object('o'); + break; + case 1: /* clear size */ + clear_object('s'); + break; + case 2: /* clear rotation */ + clear_object('r'); + break; + case 3: /* clear location */ + clear_object('g'); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_pose_armature_transformmenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_pose_armature_transformmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Size|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_pose_armaturemenu(void *arg, int event) +{ + switch(event) { + + case 0: /* transform properties */ + blenderqread(NKEY, 1); + break; + case 1: /* insert keyframe */ + common_insertkey(); + break; + case 2: /* Move to Layer */ + movetolayer(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_pose_armaturemenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_pose_armaturemenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBlockBut(block, view3d_pose_armature_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + } else { + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, view3d_pose_armature_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + + return block; +} + + +static void do_view3d_paintmenu(void *arg, int event) +{ + switch(event) { + case 0: /* undo vertex painting */ + vpaint_undo(); + break; + case 1: /* undo weight painting */ + wpaint_undo(); + break; + case 2: /* clear vertex colors */ + clear_vpaint(); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *view3d_paintmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_paintmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + if (G.f & G_VERTEXPAINT) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + if (G.f & G_WEIGHTPAINT) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Weight Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + if (G.f & G_TEXTUREPAINT) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if (G.f & G_VERTEXPAINT) { + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + } + + } else { + + if (G.f & G_VERTEXPAINT) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + } + + if (G.f & G_TEXTUREPAINT) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + if (G.f & G_WEIGHTPAINT) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Weight Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + if (G.f & G_VERTEXPAINT) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + +static void do_view3d_facesel_propertiesmenu(void *arg, int event) +{ + extern TFace *lasttface; + set_lasttface(); + + switch(event) { + case 0: /* textured */ + lasttface->mode ^= TF_TEX; + break; + case 1: /* tiled*/ + lasttface->mode ^= TF_TILES; + break; + case 2: /* light */ + lasttface->mode ^= TF_LIGHT; + break; + case 3: /* invisible */ + lasttface->mode ^= TF_INVISIBLE; + break; + case 4: /* collision */ + lasttface->mode ^= TF_DYNAMIC; + break; + case 5: /* shared vertex colors */ + lasttface->mode ^= TF_SHAREDCOL; + break; + case 6: /* two sided */ + lasttface->mode ^= TF_TWOSIDE; + break; + case 7: /* use object color */ + lasttface->mode ^= TF_OBCOL; + break; + case 8: /* halo */ + lasttface->mode ^= TF_BILLBOARD; + break; + case 9: /* billboard */ + lasttface->mode ^= TF_BILLBOARD2; + break; + case 10: /* shadow */ + lasttface->mode ^= TF_SHADOW; + break; + case 11: /* text */ + lasttface->mode ^= TF_BMFONT; + break; + case 12: /* opaque blend mode */ + lasttface->transp = TF_SOLID; + break; + case 13: /* additive blend mode */ + lasttface->transp |= TF_ADD; + break; + case 14: /* alpha blend mode */ + lasttface->transp = TF_ALPHA; + break; + } + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSGAME, 0); +} + +static uiBlock *view3d_facesel_propertiesmenu(void *arg_unused) +{ + extern TFace *lasttface; + uiBlock *block; + short yco = 20, menuwidth = 120; + + /* to display ticks/crosses depending on face properties */ + set_lasttface(); + + block= uiNewBlock(&curarea->uiblocks, "view3d_facesel_propertiesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_view3d_facesel_propertiesmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if (lasttface->mode & TF_TEX) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Textured", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Textured", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + + if (lasttface->mode & TF_TILES) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Tiled", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Tiled", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + + if (lasttface->mode & TF_LIGHT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Light", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Light", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + + if (lasttface->mode & TF_INVISIBLE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Invisible", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Invisible", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + + if (lasttface->mode & TF_DYNAMIC) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Collision", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Collision", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + + if (lasttface->mode & TF_SHAREDCOL) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Shared Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Shared Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + + if (lasttface->mode & TF_TWOSIDE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Two Sided", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Two Sided", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + + if (lasttface->mode & TF_OBCOL) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Use Object Color", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Use Object Color", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + + if (lasttface->mode & TF_BILLBOARD) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Halo", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Halo", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + + if (lasttface->mode & TF_BILLBOARD2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Billboard", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Billboard", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); + + if (lasttface->mode & TF_SHADOW) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Shadow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Shadow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); + + if (lasttface->mode & TF_BMFONT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if (lasttface->transp == TF_SOLID) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Opaque Blend Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Opaque Blend Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); + + if (lasttface->transp == TF_ADD) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Additive Blend Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Additive Blend Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); + + if (lasttface->transp == TF_ALPHA) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Alpha Blend Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Alpha Blend Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + +static void do_view3d_faceselmenu(void *arg, int event) +{ + /* code copied from buttons.c :( + would be nice if it was split up into functions */ + Mesh *me; + Object *ob; + extern TFace *lasttface; /* caches info on tface bookkeeping ?*/ + + ob= OBACT; + + switch(event) { + case 0: /* copy draw mode */ + case 1: /* copy UVs */ + case 2: /* copy vertex colors */ + me= get_mesh(ob); + if(me && me->tface) { + + TFace *tface= me->tface; + int a= me->totface; + + set_lasttface(); + if(lasttface) { + + while(a--) { + if(tface!=lasttface && (tface->flag & TF_SELECT)) { + if(event==0) { + tface->mode= lasttface->mode; + tface->transp= lasttface->transp; + } else if(event==1) { + memcpy(tface->uv, lasttface->uv, sizeof(tface->uv)); + tface->tpage= lasttface->tpage; + tface->tile= lasttface->tile; + + if(lasttface->mode & TF_TILES) tface->mode |= TF_TILES; + else tface->mode &= ~TF_TILES; + + } else if(event==2) memcpy(tface->col, lasttface->col, sizeof(tface->col)); + } + tface++; + } + } + do_shared_vertexcol(me); + } + break; + case 3: /* clear vertex colors */ + clear_vpaint_selectedfaces(); + break; + // case 3: /* uv calculation */ + // uv_autocalc_tface(); + // break; + case 4: /* show hidden faces */ + reveal_tface(); + break; + case 5: /* hide selected faces */ + hide_tface(); + break; + case 6: /* hide deselected faces */ + G.qual |= LR_SHIFTKEY; + hide_tface(); + G.qual &= ~LR_SHIFTKEY; + break; + case 7: /* rotate UVs */ + rotate_uv_tface(); + break; + } + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSGAME, 0); + allqueue(REDRAWIMAGE, 0); +} + +static uiBlock *view3d_faceselmenu(void *arg_unused) +{ + uiBlock *block; + short yco= 0, menuwidth=120; + + set_lasttface(); + + block= uiNewBlock(&curarea->uiblocks, "view3d_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); + uiBlockSetButmFunc(block, do_view3d_faceselmenu, NULL); + uiBlockSetCol(block, MENUCOL); + + if(curarea->headertype==HEADERTOP) { + + uiDefIconTextBlockBut(block, view3d_facesel_propertiesmenu, NULL, ICON_RIGHTARROW_THIN, "Active Draw Mode", 0, yco-=20, 120, 19, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Draw Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy UVs & Textures", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + /* for some reason calling this from the header messes up the 'from window' + * UV calculation :( + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Calculate UVs", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + */ + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate UVs|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Faces|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Faces|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate UVs|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + /* for some reason calling this from the header messes up the 'from window' + * UV calculation :( + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Calculate UVs", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + */ + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy UVs & Textures", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Draw Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefIconTextBlockBut(block, view3d_facesel_propertiesmenu, NULL, ICON_RIGHTARROW_THIN, "Active Draw Mode", 0, yco-=20, 120, 19, ""); + + } + + uiBlockSetDirection(block, UI_TOP); + uiTextBoundsBlock(block, 50); + return block; +} + + +static char *view3d_modeselect_pup(void) +{ + static char string[1024]; + char formatstring[1024]; + + strcpy(formatstring, "Mode: %%t"); + + strcat(formatstring, "|%s %%x%d"); // add space in the menu for Object + + /* if active object is an armature */ + if (OBACT && OBACT->type==OB_ARMATURE) { + strcat(formatstring, "|%s %%x%d"); // add space in the menu for pose + } + + /* if active object is a mesh */ + if (OBACT && OBACT->type == OB_MESH) { + strcat(formatstring, "|%s %%x%d|%s %%x%d|%s %%x%d"); // add space in the menu for faceselect, vertex paint, texture paint + + /* if active mesh has an armature */ + if ((((Mesh*)(OBACT->data))->dvert)) { + strcat(formatstring, "|%s %%x%d"); // add space in the menu for weight paint + } + } + + /* if active object is editable */ + if (OBACT && ((OBACT->type == OB_MESH) || (OBACT->type == OB_ARMATURE) + || (OBACT->type == OB_CURVE) || (OBACT->type == OB_SURF) || (OBACT->type == OB_FONT) + || (OBACT->type == OB_MBALL) || (OBACT->type == OB_LATTICE))) { + strcat(formatstring, "|%s %%x%d"); // add space in the menu for Edit + } + + /* + * fill in the spaces in the menu with appropriate mode choices depending on active object + */ + + /* if active object is an armature */ + if (OBACT && OBACT->type==OB_ARMATURE) { + sprintf(string, formatstring, + "Object", V3D_OBJECTMODE_SEL, + "Edit", V3D_EDITMODE_SEL, + "Pose", V3D_POSEMODE_SEL + ); + } + /* if active object is a mesh with armature */ + else if ((OBACT && OBACT->type == OB_MESH) && ((((Mesh*)(OBACT->data))->dvert))) { + sprintf(string, formatstring, + "Object", V3D_OBJECTMODE_SEL, + "Edit", V3D_EDITMODE_SEL, + "Face Select", V3D_FACESELECTMODE_SEL, + "Vertex Paint", V3D_VERTEXPAINTMODE_SEL, + "Texture Paint", V3D_TEXTUREPAINTMODE_SEL, + "Weight Paint", V3D_WEIGHTPAINTMODE_SEL + ); + } + /* if active object is a mesh */ + else if (OBACT && OBACT->type == OB_MESH) { + sprintf(string, formatstring, + "Object", V3D_OBJECTMODE_SEL, + "Edit", V3D_EDITMODE_SEL, + "Face Select", V3D_FACESELECTMODE_SEL, + "Vertex Paint", V3D_VERTEXPAINTMODE_SEL, + "Texture Paint", V3D_TEXTUREPAINTMODE_SEL + ); + } + /* if active object is editable */ + else if (OBACT && ((OBACT->type == OB_MESH) || (OBACT->type == OB_ARMATURE) + || (OBACT->type == OB_CURVE) || (OBACT->type == OB_SURF) || (OBACT->type == OB_FONT) + || (OBACT->type == OB_MBALL) || (OBACT->type == OB_LATTICE))) { + sprintf(string, formatstring, + "Object", V3D_OBJECTMODE_SEL, + "Edit", V3D_EDITMODE_SEL + ); + } + /* if active object is not editable */ + else { + sprintf(string, formatstring, + "Object", V3D_OBJECTMODE_SEL + ); + } + + return (string); +} + void do_view3d_buttons(short event) { @@ -3909,7 +6530,83 @@ void do_view3d_buttons(short event) viewmove(1); scrarea_queue_headredraw(curarea); break; - + case B_MODESELECT: + if (G.vd->modeselect == V3D_OBJECTMODE_SEL) { + G.vd->flag &= ~V3D_MODE; + G.f &= ~G_VERTEXPAINT; /* Switch off vertex paint */ + G.f &= ~G_TEXTUREPAINT; /* Switch off texture paint */ + G.f &= ~G_WEIGHTPAINT; /* Switch off weight paint */ + G.f &= ~G_FACESELECT; /* Switch off face select */ + if (G.obpose) exit_posemode(1); /* exit posemode */ + if(G.obedit) exit_editmode(1); /* exit editmode */ + } else if (G.vd->modeselect == V3D_EDITMODE_SEL) { + if(!G.obedit) { + G.vd->flag &= ~V3D_MODE; + G.f &= ~G_VERTEXPAINT; /* Switch off vertex paint */ + G.f &= ~G_TEXTUREPAINT; /* Switch off texture paint */ + G.f &= ~G_WEIGHTPAINT; /* Switch off weight paint */ + if (G.obpose) exit_posemode(1); /* exit posemode */ + + enter_editmode(); + } + } else if (G.vd->modeselect == V3D_FACESELECTMODE_SEL) { + if ((G.obedit) && (G.f & G_FACESELECT)) { + exit_editmode(1); /* exit editmode */ + } else if ((G.f & G_FACESELECT) && (G.f & G_VERTEXPAINT)) { + G.f &= ~G_VERTEXPAINT; + } else if ((G.f & G_FACESELECT) && (G.f & G_TEXTUREPAINT)) { + G.f &= ~G_TEXTUREPAINT; + } else { + G.vd->flag &= ~V3D_MODE; + G.f &= ~G_VERTEXPAINT; /* Switch off vertex paint */ + G.f &= ~G_TEXTUREPAINT; /* Switch off texture paint */ + G.f &= ~G_WEIGHTPAINT; /* Switch off weight paint */ + if (G.obpose) exit_posemode(1); /* exit posemode */ + if (G.obedit) exit_editmode(1); /* exit editmode */ + + set_faceselect(); + } + } else if (G.vd->modeselect == V3D_VERTEXPAINTMODE_SEL) { + if (!(G.f & G_VERTEXPAINT)) { + G.vd->flag &= ~V3D_MODE; + G.f &= ~G_TEXTUREPAINT; /* Switch off texture paint */ + G.f &= ~G_WEIGHTPAINT; /* Switch off weight paint */ + if (G.obpose) exit_posemode(1); /* exit posemode */ + if(G.obedit) exit_editmode(1); /* exit editmode */ + + set_vpaint(); + } + } else if (G.vd->modeselect == V3D_TEXTUREPAINTMODE_SEL) { + if (!(G.f & G_TEXTUREPAINT)) { + G.vd->flag &= ~V3D_MODE; + G.f &= ~G_VERTEXPAINT; /* Switch off vertex paint */ + G.f &= ~G_WEIGHTPAINT; /* Switch off weight paint */ + if (G.obpose) exit_posemode(1); /* exit posemode */ + if(G.obedit) exit_editmode(1); /* exit editmode */ + + G.f |= G_TEXTUREPAINT; /* Switch on texture paint flag */ + } + } else if (G.vd->modeselect == V3D_WEIGHTPAINTMODE_SEL) { + if (!(G.f & G_WEIGHTPAINT) && (OBACT && OBACT->type == OB_MESH) && ((((Mesh*)(OBACT->data))->dvert))) { + G.vd->flag &= ~V3D_MODE; + G.f &= ~G_VERTEXPAINT; /* Switch off vertex paint */ + G.f &= ~G_TEXTUREPAINT; /* Switch off texture paint */ + if (G.obpose) exit_posemode(1); /* exit posemode */ + if(G.obedit) exit_editmode(1); /* exit editmode */ + + set_wpaint(); + } + } else if (G.vd->modeselect == V3D_POSEMODE_SEL) { + if (!G.obpose) { + G.vd->flag &= ~V3D_MODE; + if(G.obedit) exit_editmode(1); /* exit editmode */ + + enter_posemode(); + } + } + allqueue(REDRAWVIEW3D, 0); + break; + default: if(event>=B_LAY && event<B_LAY+31) { @@ -3948,45 +6645,6 @@ void do_view3d_buttons(short event) } } -void do_layer_buttons(short event) -{ - static int oldlay= 1; - - if(G.vd==0) return; - if(G.vd->localview) return; - - if(event==-1 && (G.qual & LR_CTRLKEY)) { - G.vd->scenelock= !G.vd->scenelock; - do_view3d_buttons(B_SCENELOCK); - } else if (event==-1) { - if(G.vd->lay== (2<<20)-1) { - if(G.qual & LR_SHIFTKEY) G.vd->lay= oldlay; - } - else { - oldlay= G.vd->lay; - G.vd->lay= (2<<20)-1; - } - - if(G.vd->scenelock) handle_view3d_lock(); - scrarea_queue_winredraw(curarea); - } - else { - if(G.qual & LR_ALTKEY) { - if(event<11) event+= 10; - } - if(G.qual & LR_SHIFTKEY) { - if(G.vd->lay & (1<<event)) G.vd->lay -= (1<<event); - else G.vd->lay += (1<<event); - } - do_view3d_buttons(event+B_LAY); - } - /* redraw seems double: but the queue nicely handles that */ - scrarea_queue_headredraw(curarea); - - if(curarea->spacetype==SPACE_OOPS) allqueue(REDRAWVIEW3D, 1); /* 1==also do headwin */ - -} - void do_nla_buttons(unsigned short event) { View2D *v2d; @@ -4122,28 +6780,162 @@ void view3d_buttons(void) { uiBlock *block; int a; - short xco; + short xco = 0; char naam[20]; + short xmax; sprintf(naam, "header %d", curarea->headwin); block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin); - uiBlockSetCol(block, BUTBLUE); + uiBlockSetCol(block, MIDGREY); curarea->butspacetype= SPACE_VIEW3D; - + uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), 6,0,XIC,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - /* FULL WINDOW */ - xco= 25; - if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); - else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); + xco+= XIC+18; + + /* pull down menus */ + uiBlockSetEmboss(block, UI_EMBOSSP); + if(area_is_active_area(curarea)) uiBlockSetCol(block, HEADERCOLSEL); + else uiBlockSetCol(block, HEADERCOL); - /* HOME */ - uiDefIconBut(block, BUT, B_HOME, ICON_HOME, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms window to home view showing all items (HOMEKEY)"); + /* compensate for local mode when setting up the viewing menu/iconrow values */ + if(G.vd->view==7) G.vd->viewbut= 1; + else if(G.vd->view==1) G.vd->viewbut= 2; + else if(G.vd->view==3) G.vd->viewbut= 3; + else G.vd->viewbut= 0; + + xmax= GetButStringLength("View"); + uiDefBlockBut(block, view3d_viewmenu, NULL, "View", xco, 0, xmax, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Select"); + if (G.obedit) { + if (OBACT && OBACT->type == OB_MESH) { + uiDefBlockBut(block, view3d_select_meshmenu, NULL, "Select", xco, 0, xmax, 20, ""); + } else if (OBACT && (OBACT->type == OB_CURVE || OBACT->type == OB_SURF)) { + uiDefBlockBut(block, view3d_select_curvemenu, NULL, "Select", xco, 0, xmax, 20, ""); + } else if (OBACT && OBACT->type == OB_FONT) { + uiDefBlockBut(block, view3d_select_meshmenu, NULL, "Select", xco, 0, xmax, 20, ""); + } else if (OBACT && OBACT->type == OB_MBALL) { + uiDefBlockBut(block, view3d_select_metaballmenu, NULL, "Select", xco, 0, xmax, 20, ""); + } else if (OBACT && OBACT->type == OB_LATTICE) { + uiDefBlockBut(block, view3d_select_latticemenu, NULL, "Select", xco, 0, xmax, 20, ""); + } else if (OBACT && OBACT->type == OB_ARMATURE) { + uiDefBlockBut(block, view3d_select_armaturemenu, NULL, "Select", xco, 0, xmax, 20, ""); + } + } else if (G.f & G_FACESELECT) { + if (OBACT && OBACT->type == OB_MESH) { + uiDefBlockBut(block, view3d_select_faceselmenu, NULL, "Select", xco, 0, xmax, 20, ""); + } + } else if (G.obpose) { + if (OBACT && OBACT->type == OB_ARMATURE) { + uiDefBlockBut(block, view3d_select_pose_armaturemenu, NULL, "Select", xco, 0, xmax, 20, ""); + } + } else if ((G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_WEIGHTPAINT)) { + uiDefBut(block, LABEL,0,"", xco, 0, xmax, 20, 0, 0, 0, 0, 0, ""); + } else { + uiDefBlockBut(block, view3d_select_objectmenu, NULL, "Select", xco, 0, xmax, 20, ""); + } + xco+= xmax; + + if ((G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_WEIGHTPAINT)) { + xmax= GetButStringLength("Paint"); + uiDefBlockBut(block, view3d_paintmenu, NULL, "Paint", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (G.obedit) { + if (OBACT && OBACT->type == OB_MESH) { + xmax= GetButStringLength("Mesh"); + uiDefBlockBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (OBACT && OBACT->type == OB_CURVE) { + xmax= GetButStringLength("Curve"); + uiDefBlockBut(block, view3d_edit_curvemenu, NULL, "Curve", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (OBACT && OBACT->type == OB_SURF) { + xmax= GetButStringLength("Surface"); + uiDefBlockBut(block, view3d_edit_curvemenu, NULL, "Surface", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (OBACT && OBACT->type == OB_FONT) { + xmax= GetButStringLength("Text"); + uiDefBlockBut(block, view3d_edit_textmenu, NULL, "Text", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (OBACT && OBACT->type == OB_MBALL) { + xmax= GetButStringLength("Metaball"); + uiDefBlockBut(block, view3d_edit_metaballmenu, NULL, "Metaball", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (OBACT && OBACT->type == OB_LATTICE) { + xmax= GetButStringLength("Lattice"); + uiDefBlockBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco, 0, xmax, 20, ""); + xco+= xmax; + } else if (OBACT && OBACT->type == OB_ARMATURE) { + xmax= GetButStringLength("Armature"); + uiDefBlockBut(block, view3d_edit_armaturemenu, NULL, "Armature", xco, 0, xmax, 20, ""); + xco+= xmax; + } + } else if (G.f & G_FACESELECT) { + if (OBACT && OBACT->type == OB_MESH) { + xmax= GetButStringLength("Face"); + uiDefBlockBut(block, view3d_faceselmenu, NULL, "Face", xco, 0, xmax, 20, ""); + xco+= xmax; + } + } else if (G.obpose) { + if (OBACT && OBACT->type == OB_ARMATURE) { + xmax= GetButStringLength("Armature"); + uiDefBlockBut(block, view3d_pose_armaturemenu, NULL, "Armature", xco, 0, xmax, 20, ""); + xco+= xmax; + } + } else { + xmax= GetButStringLength("Object"); + uiDefBlockBut(block, view3d_edit_objectmenu, NULL, "Object", xco, 0, xmax, 20, ""); + xco+= xmax; + } + + /* end pulldowns, other buttons: */ + uiBlockSetCol(block, MIDGREY); + uiBlockSetEmboss(block, UI_EMBOSSX); + + /* mode */ + G.vd->modeselect = V3D_OBJECTMODE_SEL; + if (G.f & G_WEIGHTPAINT) G.vd->modeselect = V3D_WEIGHTPAINTMODE_SEL; + else if (G.f & G_VERTEXPAINT) G.vd->modeselect = V3D_VERTEXPAINTMODE_SEL; + else if (G.f & G_TEXTUREPAINT) G.vd->modeselect = V3D_TEXTUREPAINTMODE_SEL; + else if(G.f & G_FACESELECT) G.vd->modeselect = V3D_FACESELECTMODE_SEL; + if (G.obpose) G.vd->modeselect = V3D_POSEMODE_SEL; + if (G.obedit) G.vd->modeselect = V3D_EDITMODE_SEL; + + G.vd->flag &= ~V3D_MODE; + if(G.obedit) G.vd->flag |= V3D_EDITMODE; + if(G.f & G_VERTEXPAINT) G.vd->flag |= V3D_VERTEXPAINT; + if(G.f & G_WEIGHTPAINT) G.vd->flag |= V3D_WEIGHTPAINT; +#ifdef NAN_TPT + if (G.f & G_TEXTUREPAINT) G.vd->flag |= V3D_TEXTUREPAINT; +#endif /* NAN_TPT */ + if(G.f & G_FACESELECT) G.vd->flag |= V3D_FACESELECT; + if(G.obpose){ + G.vd->flag |= V3D_POSEMODE; + } + + xco+= 16; - xco+= XIC+8; + uiDefIconTextButS(block, MENU, B_MODESELECT, (G.vd->modeselect),view3d_modeselect_pup() , + xco,0,120,20, &(G.vd->modeselect), 0, 0, 0, 0, "Mode:"); + + xco+= 120; + xco +=14; + + //uiDefIconTextButS(block, MENU, REDRAWVIEW3D, (ICON_BBOX+G.vd->drawtype-1), "Viewport Shading%t|Bounding Box %x1|Wireframe %x2|Solid %x3|Shaded %x4|Textured %x5", + // xco,0,124,20, &(G.vd->drawtype), 0, 0, 0, 0, "Viewport Shading"); + + uiDefButS(block, MENU, REDRAWVIEW3D, "Viewport Shading%t|Bounding Box %x1|Wireframe %x2|Solid %x3|Shaded %x4|Textured %x5", + xco,0,110,20, &(G.vd->drawtype), 0, 0, 0, 0, "Viewport Shading"); + + xco+=110; + + xco+= 14; + /* LAYERS */ if(G.vd->localview==0) { - /* LAYERS */ + for(a=0; a<10; a++) { uiDefButI(block, TOG|BIT|(a+10), B_LAY+10+a, "",(short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility"); uiDefButI(block, TOG|BIT|a, B_LAY+a, "", (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility"); @@ -4153,34 +6945,13 @@ void view3d_buttons(void) /* LOCK */ uiDefIconButS(block, ICONTOG, B_SCENELOCK, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.vd->scenelock), 0, 0, 0, 0, "Locks layers and used Camera to Scene"); - xco+= XIC; + xco+= 14; } - else xco+= (10+2)*(XIC/2)+10; - - /* LOCALVIEW */ - uiDefIconButS(block, ICONROW, B_LOCALVIEW, ICON_LOCALVIEW, xco+=XIC,0,XIC,YIC, &(G.vd->localview), 0.0, 1.0, 0, 0, "Toggles Local View (NumPad /)"); - - /* PERSP */ - xco+= XIC/2; - uiDefIconButS(block, ICONROW, B_PERSP, ICON_ORTHO, xco+=XIC,0,XIC,YIC, &(G.vd->persp), 0.0, 2.0, 0, 0, "Toggles Perspective mode (NumPad 5, Numpad 0)"); - - xco+= XIC/2; - /* VIEW */ - - if(G.vd->view==7) G.vd->viewbut= 1; - else if(G.vd->view==1) G.vd->viewbut= 2; - else if(G.vd->view==3) G.vd->viewbut= 3; - else G.vd->viewbut= 0; - - uiDefIconButS(block, ICONROW, B_VIEWBUT, ICON_VIEW_AXIS_NONE2, xco+=XIC,0,XIC,YIC, &G.vd->viewbut, 0.0, 3.0, 0, 0, "Selects Top, Front or Side views (Numpad 7, 1, 3)"); - - /* DRAWTYPE */ - xco+= XIC/2; - uiDefIconButS(block, ICONROW, B_REDR, ICON_BBOX, xco+=XIC,0,XIC,YIC, &(G.vd->drawtype), 1.0, 5.0, 0, 0, "Sets view draw mode to Boundbox, Wire, Solid, or Shaded (ZKEY, SHIFT+Z)"); + else xco+= (10+1)*(XIC/2)+10+4; /* VIEWMOVE */ - xco+= XIC/2; + uiDefIconButI(block, TOG, B_VIEWTRANS, ICON_VIEWMOVE, xco+=XIC,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Translates view (SHIFT+MiddleMouse)"); uiDefIconButI(block, TOG, B_VIEWZOOM, ICON_VIEWZOOM, xco+=XIC,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (CTRL+MiddleMouse)"); @@ -4191,65 +6962,14 @@ void view3d_buttons(void) uiDefIconButS(block, ROW, 1, ICON_CURSOR, xco+=XIC,0,XIC,YIC, &G.vd->around, 3.0, 1.0, 0, 0, "Enables Rotation or Scaling around cursor (DOTKEY)"); uiDefIconButS(block, ROW, 1, ICON_ROTATECOLLECTION, xco+=XIC,0,XIC,YIC, &G.vd->around, 3.0, 2.0, 0, 0, "Enables Rotation or Scaling around individual object centers"); - /* mode */ - G.vd->flag &= ~V3D_MODE; - if(G.obedit) G.vd->flag |= V3D_EDITMODE; - if(G.f & G_VERTEXPAINT) G.vd->flag |= V3D_VERTEXPAINT; - if(G.f & G_WEIGHTPAINT) G.vd->flag |= V3D_WEIGHTPAINT; -#ifdef NAN_TPT - if (G.f & G_TEXTUREPAINT) G.vd->flag |= V3D_TEXTUREPAINT; -#endif /* NAN_TPT */ - if(G.f & G_FACESELECT) G.vd->flag |= V3D_FACESELECT; - if(G.obpose){ - G.vd->flag |= V3D_POSEMODE; - } - xco+= XIC/2; - /* If there is a posable object hilighted & selected, display this button */ - if (OBACT){ - if (OBACT->type==OB_ARMATURE){ - uiDefIconButS(block, ICONTOG|BIT|7, B_POSEMODE, ICON_POSE_DEHLT, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Toggles PoseMode (CTRL+TAB)"); - } - } - uiDefIconButS(block, ICONTOG|BIT|4, B_EDITMODE, ICON_EDITMODE_DEHLT, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Toggles EditMode (TAB)"); - if (!G.obpose && !G.obedit) - { - xco+= XIC/2; - /* Only if mesh is selected */ - if (OBACT && OBACT->type == OB_MESH){ - uiDefIconButS(block, ICONTOG|BIT|5, B_VPAINT, ICON_VPAINT_DEHLT, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Toggles VertexPaint Mode (VKEY)"); - /* Only if deformable mesh is selected */ - if ((((Mesh*)(OBACT->data))->dvert)) - uiDefIconButS(block, ICONTOG|BIT|9, B_WPAINT, ICON_WPAINT_DEHLT, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Toggles WeightPaint Mode"); -#ifdef NAN_TPT - uiDefIconButS(block, ICONTOG|BIT|8, B_TEXTUREPAINT, ICON_TPAINT_DEHLT, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Toggles TexturePaint Mode"); -#endif /* NAN_TPT */ - uiDefIconButS(block, ICONTOG|BIT|6, B_FACESEL, ICON_FACESEL_DEHLT, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Toggles FaceSelect Mode (FKEY)"); - } - } - if (G.obpose){ - /* Copy paste - WAS in action window */ - xco+= XIC/2; - // xco-= XIC/2; // Used in action window - if(curarea->headertype==HEADERTOP) { - uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the current pose to the buffer"); - uiSetButLock(G.obpose->id.lib!=0, "Can't edit library data"); - uiDefIconBut(block, BUT, B_ACTPASTE, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the pose from the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEFLIP, ICON_PASTEFLIPUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the mirrored pose from the buffer"); - } - else { - uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the current pose to the buffer"); - uiSetButLock(G.obpose->id.lib!=0, "Can't edit library data"); - uiDefIconBut(block, BUT, B_ACTPASTE, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the pose from the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEFLIP, ICON_PASTEFLIPDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the mirrored pose from the buffer"); - } -// xco+=XIC/2; // Used in action window - } + + if(G.vd->bgpic) { xco+= XIC/2; uiDefIconButS(block, TOG|BIT|1, B_REDR, ICON_IMAGE_COL, xco+=XIC,0,XIC,YIC, &G.vd->flag, 0, 0, 0, 0, "Displays a Background picture"); } - if(G.obedit) { + if(G.obedit && (OBACT->type == OB_MESH || OBACT->type == OB_CURVE || OBACT->type == OB_SURF || OBACT->type == OB_LATTICE)) { extern int prop_mode; xco+= XIC/2; uiDefIconButI(block, ICONTOG|BIT|14, B_PROPTOOL, ICON_GRID, xco+=XIC,0,XIC,YIC, &G.f, 0, 0, 0, 0, "Toggles Proportional Vertex Editing (OKEY)"); @@ -4260,16 +6980,12 @@ void view3d_buttons(void) } xco+=XIC; - uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Renders this view (Hold SHIFT for Anim render)"); - xco+=XIC; -#if GAMEBLENDER == 1 - uiDefIconBut(block, BUT, B_STARTGAME, ICON_GAME, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Starts game (PKEY)"); -#endif /* Always do this last */ curarea->headbutlen= xco+2*XIC; uiDrawBlock(block); + } /* ********************** VIEW3D ****************************** */ @@ -4550,6 +7266,7 @@ void do_buts_buttons(short event) switch(event) { case B_BUTSHOME: G.v2d->cur= G.v2d->tot; + uiSetPanel_view2d(curarea); test_view2d(G.v2d, curarea->winx, curarea->winy); scrarea_queue_winredraw(curarea); break; @@ -4774,7 +7491,7 @@ void buts_buttons(void) short xco; int alone, local, browse; char naam[20]; - short type; + short type, t_base= -2; void *data=NULL; char str[256]; @@ -4797,24 +7514,30 @@ void buts_buttons(void) ob= OBACT; /* choice menu */ + + uiBlockSetCol(block, MIDGREY); + uiBlockSetEmboss(block, UI_EMBOSST); + xco+= 2*XIC; - uiDefIconButS(block, ROW, B_REDR, ICON_EYE, xco+=XIC, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_VIEW, 0, 0, "View buttons"); - - uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_LAMP, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_LAMP, 0, 0, "Lamp buttons (F4)"); - uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_MAT, 0, 0, "Material buttons (F5)"); - uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_TEXTURE, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_TEX, 0, 0, "Texture buttons (F6)"); - uiDefIconButS(block, ROW, B_REDR, ICON_ANIM, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_ANIM, 0, 0, "Animation buttons (F7)"); - uiDefIconButS(block, ROW, B_REDR, ICON_GAME, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_GAME, 0, 0, "Realtime buttons (F8)"); - uiDefIconButS(block, ROW, B_REDR, ICON_EDIT, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_EDIT, 0, 0, "Edit buttons (F9)"); - uiDefIconButS(block, ROW, B_REDR, ICON_CONSTRAINT,xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_CONSTRAINT, 0, 0, "Constraint buttons"); - uiDefIconButS(block, ROW, B_REDR, ICON_SPEAKER,xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_SOUND, 0, 0, "Sound buttons"); - uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_WORLD, xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_WORLD, 0, 0, "World buttons"); - uiDefIconButS(block, ROW, B_REDR, ICON_PAINT,xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_FPAINT, 0, 0, "Paint buttons"); - uiDefIconButS(block, ROW, B_REDR, ICON_RADIO,xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_RADIO, 0, 0, "Radiosity buttons"); - uiDefIconButS(block, ROW, B_REDR, ICON_SCRIPT,xco+=30, 0, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_SCRIPT, 0, 0, "Script buttons"); - uiDefIconButS(block, ROW, B_REDR, ICON_SCENE, xco+=30, 0, 50, YIC, &(G.buts->mainb), 1.0, (float)BUTS_RENDER, 0, 0, "Display buttons (F10)"); + uiDefIconButS(block, ROW, B_REDR, ICON_EYE, xco+=XIC, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_VIEW, 0, 0, "View buttons"); + + uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_LAMP, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_LAMP, 0, 0, "Lamp buttons (F4)"); + uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_MAT, 0, 0, "Material buttons (F5)"); + uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_TEXTURE, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_TEX, 0, 0, "Texture buttons (F6)"); + uiDefIconButS(block, ROW, B_REDR, ICON_ANIM, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_ANIM, 0, 0, "Animation buttons (F7)"); + uiDefIconButS(block, ROW, B_REDR, ICON_GAME, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_GAME, 0, 0, "Realtime buttons (F8)"); + uiDefIconButS(block, ROW, B_REDR, ICON_EDIT, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_EDIT, 0, 0, "Edit buttons (F9)"); + uiDefIconButS(block, ROW, B_REDR, ICON_CONSTRAINT,xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_CONSTRAINT, 0, 0, "Constraint buttons"); + uiDefIconButS(block, ROW, B_REDR, ICON_SPEAKER,xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_SOUND, 0, 0, "Sound buttons"); + uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_WORLD, xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_WORLD, 0, 0, "World buttons"); + uiDefIconButS(block, ROW, B_REDR, ICON_PAINT,xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_FPAINT, 0, 0, "Paint buttons"); + uiDefIconButS(block, ROW, B_REDR, ICON_RADIO,xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_RADIO, 0, 0, "Radiosity buttons"); + uiDefIconButS(block, ROW, B_REDR, ICON_SCRIPT,xco+=30, t_base, 30, YIC, &(G.buts->mainb), 1.0, (float)BUTS_SCRIPT, 0, 0, "Script buttons"); + uiDefIconButS(block, ROW, B_REDR, ICON_SCENE, xco+=30, t_base, 50, YIC, &(G.buts->mainb), 1.0, (float)BUTS_RENDER, 0, 0, "Display buttons (F10)"); xco+= 80; - + + uiBlockSetCol(block, BUTGREY); + uiBlockSetEmboss(block, UI_EMBOSSX); buttons_active_id(&id, &idfrom); @@ -5237,7 +7960,6 @@ void do_text_buttons(unsigned short event) break; case B_TEXTDELETE: - if(!okee("Really delete text?")) return; text= st->text; if (!text) return; @@ -5247,7 +7969,7 @@ void do_text_buttons(unsigned short event) unlink_text(text); free_libblock(&G.main->text, text); - + break; /* diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 96f12c98f7c..87a662c4e50 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -66,8 +66,10 @@ #include "BLI_editVert.h" #include "DNA_screen_types.h" +#include "DNA_space_types.h" #include "DNA_userdef_types.h" +#include "BKE_blender.h" #include "BKE_utildefines.h" #include "BKE_global.h" @@ -82,6 +84,7 @@ #include "BIF_space.h" #include "BIF_glutil.h" #include "BIF_interface.h" +#include "BIF_butspace.h" #include "BSE_view.h" @@ -184,6 +187,7 @@ struct uiBlock { uiBlock *next, *prev; ListBase buttons; + Panel *panel; char name[UI_MAX_NAME_STR]; @@ -214,6 +218,11 @@ struct uiBlock { #define UI_NEED_DRAW_FRONT 1 #define UI_HAS_DRAW_FRONT 2 +/* panel drawing defines */ +#define PNL_GRID 4 +#define PNL_DIST 8 +#define PNL_SAFETY 8 +#define PNL_HEADER 20 /* ************ GLOBALS ************* */ @@ -226,12 +235,18 @@ static void *UIafterfunc_arg; static uiFont UIfont[UI_ARRAY]; // no init needed static uiBut *UIbuttip; -/* ****************************** */ +/* ************* PROTOTYPES ***************** */ static void ui_check_but(uiBut *but); static void ui_set_but_val(uiBut *but, double value); static double ui_get_but_val(uiBut *but); +static void ui_draw_panel(uiBlock *block); +static void ui_panel_push(uiBlock *block); +static void ui_panel_pop(uiBlock *block); +static void ui_drag_panel(uiBlock *block); +static void ui_do_panel(uiBlock *block, uiEvent *uevent); + /* ****************************** */ static int uibut_contains_pt(uiBut *but, short *pt) @@ -395,29 +410,36 @@ static void ui_endpupdraw(uiSaveUnder *su) glDrawBuffer(GL_BACK); } + static void ui_draw_icon(uiBut *but, BIFIconID icon) { - float xs, ys; + float xs=0, ys=0; - /* check for left aligned icons (in case of IconTextBut) */ + /* check for aligned icons (in case of IconTextBut) */ if (but->type == ICONTEXTROW) { xs= (but->x1+but->x2- BIF_get_icon_width(icon))/2.0; ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0; } - else if(but->flag & UI_ICON_LEFT) { - if (but->type==BUTM) { - xs= but->x1+1.0; - } - else { - xs= but->x1+6.0; - } - ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0; - } else { - xs= (but->x1+but->x2- BIF_get_icon_width(icon))/2.0; - ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0; + if(but->flag & UI_ICON_LEFT) { + if (but->type==BUTM) { + xs= but->x1+1.0; + } + else { + xs= but->x1+6.0; + } + ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0; + } + if(but->flag & UI_ICON_RIGHT) { + xs= but->x2-17.0; + ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0; + } + if (!((but->flag & UI_ICON_RIGHT) || (but->flag & UI_ICON_LEFT))) { + xs= (but->x1+but->x2- BIF_get_icon_width(icon))/2.0; + ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0; + } } - /* END check for left aligned icons (in case of IconTextBut) */ + /* END check for aligned icons (in case of IconTextBut) */ glRasterPos2f(xs, ys); @@ -449,6 +471,7 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon) glPixelZoom(1.0, 1.0); } +/* not used static void ui_draw_outlineX(float x1, float y1, float x2, float y2, float asp1) { float vec[2]; @@ -474,9 +497,9 @@ static void ui_draw_outlineX(float x1, float y1, float x2, float y2, float asp1) } -static void ui_emboss_X(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +static void ui_emboss_R(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) { - /* paper */ + if(flag & UI_SELECT) { if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_DARK); else BIF_set_color(bc, COLORSHADE_GREY); @@ -486,111 +509,753 @@ static void ui_emboss_X(BIFColorID bc, float asp, float x1, float y1, float x2, else BIF_set_color(bc, COLORSHADE_MEDIUM); } - glRectf(x1+1, y1+1, x2-1, y2-1); + uiSetRoundBox(15); + uiRoundBox(x1, y1, x2, y2, 6); + cpack(0x0); + uiSetRoundBox(16+15); + uiRoundRect(x1, y1, x2, y2, 6); + uiSetRoundBox(15); +} - x1+= asp; - x2-= asp; - y1+= asp; - y2-= asp; +*/ - /* below */ - if(flag & UI_SELECT) BIF_set_color(bc, COLORSHADE_MEDIUM); - else BIF_set_color(bc, COLORSHADE_DARK); - fdrawline(x1, y1, x2, y1); +static void ui_emboss_X(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +{ + + float asp1; + + asp1= asp; + + /*x1+= asp1;*/ + x2-= asp1; + /*y1+= asp1;*/ + y2-= asp1; + + /* SHADED BUTTON */ + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_HILITE); + else BIF_set_color(bc, COLORSHADE_HILITE); + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT); + BIF_set_color(bc, COLORSHADE_LIGHT); + } + + glVertex2f(x2,(y2-(y2-y1)/3)); + glVertex2f(x1,(y2-(y2-y1)/3)); + glEnd(); + + + glShadeModel(GL_FLAT); + glBegin(GL_QUADS); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT); + BIF_set_color(bc, COLORSHADE_LIGHT); + } + + glVertex2f(x1,(y2-(y2-y1)/3)); + glVertex2f(x2,(y2-(y2-y1)/3)); + glVertex2f(x2,y2); + glVertex2f(x1,y2); + + glEnd(); + /* END SHADED BUTTON */ + + /* OUTER SUNKEN EFFECT */ + /* left */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x1-1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x1-1,y2); + glEnd(); + /* right */ - fdrawline(x2, y1, x2, y2); + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x2+1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + fdrawline(x1, y1-1, x2, y1-1); + /* END OUTER SUNKEN EFFECT */ + + /* INNER OUTLINE */ + glShadeModel(GL_FLAT); /* top */ - if(flag & UI_SELECT) BIF_set_color(bc, COLORSHADE_DARK); - else BIF_set_color(bc, COLORSHADE_WHITE); + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE); + BIF_set_color(bc, COLORSHADE_WHITE); + } + + fdrawline(x1, (y2-1), x2, y2-1); + + /* bottom */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM); + BIF_set_color(bc, COLORSHADE_LMEDIUM); + } + fdrawline(x1, (y1+1), x2, y1+1); + + /* left */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(bc, COLORSHADE_WHITE); + glVertex2f(x1+1,y1+2); + BIF_set_color(bc, COLORSHADE_LGREY); + glVertex2f(x1+1,y2); + glEnd(); + + } + + /* right */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(bc, COLORSHADE_LGREY); + glVertex2f(x2-1,y1+2); + BIF_set_color(bc, COLORSHADE_WHITE); + glVertex2f(x2-1,y2); + glEnd(); + + } + /* END INNER OUTLINE */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + BIF_set_color(BUTGREY, COLORSHADE_GREY); fdrawline(x1, y2, x2, y2); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + fdrawline(x1, y1, x2, y1); + + /* top */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y2, x2, y2); /* left */ - fdrawline(x1, y1, x1, y2); + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ - /* outline */ - glColor3ub(0,0,0); - ui_draw_outlineX(x1, y1, x2, y2, asp); } -static void ui_emboss_A(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +static void ui_emboss_TEX(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) { - short a; - /* paper */ + float asp1; + + asp1= asp; + + /*x1+= asp1;*/ + x2-= asp1; + /*y1+= asp1;*/ + y2-= asp1; + + /* FLAT TEXT/NUM FIELD */ + glShadeModel(GL_FLAT); + glBegin(GL_QUADS); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM); + else BIF_set_color(bc, COLORSHADE_LMEDIUM); + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + glVertex2f(x2,y2); + glVertex2f(x1,y2); + + glEnd(); + /* END FLAT TEXT/NUM FIELD */ + + /* OUTER SUNKEN EFFECT */ + /* left */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x1-1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x2+1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + fdrawline(x1, y1-1, x2, y1-1); + /* END OUTER SUNKEN EFFECT */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + BIF_set_color(BUTGREY, COLORSHADE_GREY); + fdrawline(x1, y2, x2, y2); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + fdrawline(x1, y1, x2, y1); + + /* top */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ +} + +static void ui_emboss_NUM(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +{ + + float asp1; + + asp1= asp; + + /*x1+= asp1;*/ + x2-= asp1; + /*y1+= asp1;*/ + y2-= asp1; + + /* FLAT TEXT/NUM FIELD */ + glShadeModel(GL_FLAT); + glBegin(GL_QUADS); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM); + else BIF_set_color(bc, COLORSHADE_LMEDIUM); + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + glVertex2f(x2,y2); + glVertex2f(x1,y2); + + glEnd(); + /* END FLAT TEXT/NUM FIELD */ + + /* OUTER SUNKEN EFFECT */ + /* left */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x1-1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x2+1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + fdrawline(x1, y1-1, x2, y1-1); + /* END OUTER SUNKEN EFFECT */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + BIF_set_color(BUTGREY, COLORSHADE_GREY); + fdrawline(x1, y2, x2, y2); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + fdrawline(x1, y1, x2, y1); + + /* top */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ + + /* SIDE ARROWS */ + /* left */ + glShadeModel(GL_FLAT); + glBegin(GL_TRIANGLES); + if(flag & UI_SELECT) { if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_DARK); - else BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_DARK); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + + glVertex2f((short)x1+5,(short)(y2-(y2-y1)/2)); + glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)+4); + glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)-4); + glEnd(); + + /* right */ + glShadeModel(GL_FLAT); + glBegin(GL_TRIANGLES); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_DARK); + else BIF_set_color(bc, COLORSHADE_DARK); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + + glVertex2f((short)x2-5,(short)(y2-(y2-y1)/2)); + glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)-4); + glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)+4); + glEnd(); + /* END SIDE ARROWS */ + +} + +static void ui_emboss_MENU(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +{ + + float asp1; + + asp1= asp; + + /*x1+= asp1;*/ + x2-= asp1; + /*y1+= asp1;*/ + y2-= asp1; + + /* SHADED BUTTON */ + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY); + else BIF_set_color(bc, COLORSHADE_LGREY); } else { if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_HILITE); - else BIF_set_color(bc, COLORSHADE_MEDIUM); + else BIF_set_color(bc, COLORSHADE_HILITE); + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT); + BIF_set_color(bc, COLORSHADE_LIGHT); } + + glVertex2f(x2,(y2-(y2-y1)/3)); + glVertex2f(x1,(y2-(y2-y1)/3)); + glEnd(); - glRectf(x1+1, y1+1, x2-1, y2-1); - x1+= asp; - x2-= asp; - y1+= asp; - y2-= asp; + glShadeModel(GL_FLAT); + glBegin(GL_QUADS); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT); + BIF_set_color(bc, COLORSHADE_LIGHT); + } - /* below */ - if(flag & UI_SELECT) BIF_set_color(bc, COLORSHADE_MEDIUM); - else BIF_set_color(bc, COLORSHADE_DARK); - fdrawline(x1, y1, x2, y1); + glVertex2f(x1,(y2-(y2-y1)/3)); + glVertex2f(x2,(y2-(y2-y1)/3)); + glVertex2f(x2,y2); + glVertex2f(x1,y2); + glEnd(); + /* END SHADED BUTTON */ + + /* OUTER SUNKEN EFFECT */ + /* left */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x1-1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x1-1,y2); + glEnd(); + /* right */ - fdrawline(x2, y1, x2, y2); + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x2+1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + fdrawline(x1, y1-1, x2, y1-1); + /* END OUTER SUNKEN EFFECT */ + + /* INNER OUTLINE */ + glShadeModel(GL_FLAT); /* top */ - if(flag & UI_SELECT) BIF_set_color(bc, COLORSHADE_DARK); - else BIF_set_color(bc, COLORSHADE_WHITE); + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE); + BIF_set_color(bc, COLORSHADE_WHITE); + } + + fdrawline(x1, (y2-1), x2, y2-1); + + /* bottom */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY); + else BIF_set_color(bc, COLORSHADE_LGREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM); + BIF_set_color(bc, COLORSHADE_LMEDIUM); + } + fdrawline(x1, (y1+1), x2, y1+1); + + /* left */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(bc, COLORSHADE_WHITE); + glVertex2f(x1+1,y1+2); + BIF_set_color(bc, COLORSHADE_LGREY); + glVertex2f(x1+1,y2); + glEnd(); + + } + + /* right */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(bc, COLORSHADE_LGREY); + glVertex2f(x2-1,y1+2); + BIF_set_color(bc, COLORSHADE_WHITE); + glVertex2f(x2-1,y2); + glEnd(); + + } + /* END INNER OUTLINE */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + BIF_set_color(BUTGREY, COLORSHADE_GREY); fdrawline(x1, y2, x2, y2); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + fdrawline(x1, y1, x2, y1); + + /* top */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y2, x2, y2); /* left */ - fdrawline(x1, y1, x1, y2); + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); - /* outline */ - glColor3ub(0,0,0); - ui_draw_outlineX(x1, y1, x2, y2, asp); + /* bottom */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ + /* DARKENED AREA */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); - /* code to draw side arrows as in iconrow */ - /* teken pijltjes, icon is standaard RGB */ - a= (y1+y2)/2; + glColor4ub(0, 0, 0, 30); + glRectf(x2-18, y1, x2, y2); - glColor3ub(0,0,0); - sdrawline((short)(x1-1), (short)(a-2), (short)(x1-1), (short)(a+2)); - sdrawline((short)(x1-2), (short)(a-1), (short)(x1-2), (short)(a+1)); - sdrawline((short)(x1-3), a, (short)(x1-3), a); - glColor3ub(255,255,255); - sdrawline((short)(x1-3), (short)(a-1), (short)(x1-1), (short)(a-3)); + glDisable(GL_BLEND); + /* END DARKENED AREA */ + + /* MENU DOUBLE-ARROW */ + glShadeModel(GL_FLAT); + glBegin(GL_TRIANGLES); + + BIF_set_color(bc, COLORSHADE_DARK); + + glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+1); + glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)+1); + glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)+4); + glEnd(); + + glBegin(GL_TRIANGLES); + + glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)); + glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)); + glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)-3); + glEnd(); + /* MENU DOUBLE-ARROW */ - x2+=1; +} + +static void ui_emboss_TABL(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +{ + + float asp1; - glColor3ub(0,0,0); - sdrawline((short)(x2+1), (short)(a-2), (short)(x2+1), (short)(a+2)); - sdrawline((short)(x2+2), (short)(a-1), (short)(x2+2), (short)(a+1)); - sdrawline((short)(x2+3), a, (short)(x2+3), a); - glColor3ub(255,255,255); - sdrawline((short)(x2+3), (short)(a-1), (short)(x2+1), (short)(a-3)); + asp1= asp; + + /*x1+= asp1;*/ + x2-= asp1; + /*y1+= asp1;*/ + y2-= asp1; + + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_MEDIUM); + else BIF_set_color(bc, COLORSHADE_MEDIUM); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_MEDIUM); + else BIF_set_color(bc, COLORSHADE_MEDIUM); + } + + + //BIF_set_color(bc, COLORSHADE_MEDIUM); + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT); + BIF_set_color(bc, COLORSHADE_LIGHT); + } + + + //BIF_set_color(bc, COLORSHADE_LIGHT); + + //glVertex2f(x2,(y1+(y2-y1)/2)); + glVertex2f(x2,(y2-(y2-y1)/3)); + glVertex2f(x1,(y2-(y2-y1)/3)); + glEnd(); + + + glShadeModel(GL_FLAT); + glBegin(GL_QUADS); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT); + BIF_set_color(bc, COLORSHADE_LIGHT); + } + + //BIF_set_color(bc, COLORSHADE_LIGHT); + + glVertex2f(x1,(y2-(y2-y1)/3)); + glVertex2f(x2,(y2-(y2-y1)/3)); + glVertex2f(x2,y2); + glVertex2f(x1,y2); + + glEnd(); + + + /* inner outline */ + glShadeModel(GL_FLAT); + + /* top */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY); + else BIF_set_color(bc, COLORSHADE_GREY); + } + else { + if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE); + BIF_set_color(bc, COLORSHADE_WHITE); + } + + fdrawline(x1, (y2-1), x2, y2-1); + + + /* left */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(bc, COLORSHADE_WHITE); + glVertex2f(x1+1,y1-1); + BIF_set_color(bc, COLORSHADE_MEDIUM); + glVertex2f(x1+1,y2); + glEnd(); + + } + + /* right */ + + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(bc, COLORSHADE_MEDIUM); + glVertex2f(x2-1,y1+2); + BIF_set_color(bc, COLORSHADE_WHITE); + glVertex2f(x2-1,y2); + glEnd(); + + } + + /* outer outline */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + BIF_set_color(BUTGREY, COLORSHADE_GREY); + fdrawline(x1, y2, x2, y2); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + fdrawline(x1, y1, x2, y1); + + /* top */ + BIF_set_color(BUTGREY, COLORSHADE_DARK); + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1, x1, y2); + + /* right */ + fdrawline(x2, y1, x2, y2); + + /* outer sunken effect */ + /* left */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + BIF_set_color(BUTGREY, COLORSHADE_LIGHT); + glVertex2f(x1-1,y1); + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x1-1,y2); + glEnd(); + + + + +} +static void ui_emboss_TABM(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +{ } +static void ui_emboss_TABR(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) +{ +} + void uiEmboss(float x1, float y1, float x2, float y2, int sel) { /* below */ - if(sel) glColor3ub(255,255,255); - else glColor3ub(0,0,0); + if(sel) glColor3ub(200,200,200); + else glColor3ub(50,50,50); fdrawline(x1, y1, x2, y1); /* right */ fdrawline(x2, y1, x2, y2); /* top */ - if(sel) glColor3ub(0,0,0); - else glColor3ub(255,255,255); + if(sel) glColor3ub(50,50,50); + else glColor3ub(200,200,200); fdrawline(x1, y2, x2, y2); /* left */ @@ -683,7 +1348,7 @@ static void ui_emboss_F(BIFColorID bc, float asp, float x1, float y1, float x2, fdrawbox(x1-asp1, y1-asp1, x2+asp1, y2+asp1); } -/* minimal for menu's */ +/* minimal for menus */ static void ui_emboss_M(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) { x1+= 1.0; @@ -692,22 +1357,27 @@ static void ui_emboss_M(BIFColorID bc, float asp, float x1, float y1, float x2, y2-= 1.0+asp; + BIF_set_color(bc, COLORSHADE_WHITE); + + fdrawbox(x1, y1, x2, y2); + + /* if(flag & UI_SELECT) { BIF_set_color(bc, COLORSHADE_LIGHT); - /* below */ + fdrawline(x1, y1, x2, y1); - /* right */ + fdrawline(x2, y1, x2, y2); } else if(flag & UI_ACTIVE) { BIF_set_color(bc, COLORSHADE_WHITE); - /* top */ + fdrawline(x1, y2, x2, y2); - /* left */ + fdrawline(x1, y1, x1, y2); } else { @@ -715,10 +1385,11 @@ static void ui_emboss_M(BIFColorID bc, float asp, float x1, float y1, float x2, fdrawbox(x1, y1, x2, y2); } + */ } -/* nothing! */ +/* nothing! */ static void ui_emboss_N(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int sel) { } @@ -726,48 +1397,177 @@ static void ui_emboss_N(BIFColorID bc, float asp, float x1, float y1, float x2, /* pulldown menu */ static void ui_emboss_P(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) { - - BIF_set_color(bc, COLORSHADE_MEDIUM); - glRectf(x1, y1, x2, y2); - + if(flag & UI_ACTIVE) { - BIF_set_color(BUTMACTIVE, COLORSHADE_MEDIUM); - glRectf(x1, y1, x2, y2); + BIF_set_color(bc, COLORSHADE_DARK); + glRectf(x1-1, y1, x2+2, y2); + + } else { + BIF_set_color(bc, COLORSHADE_MEDIUM); + glRectf(x1-1, y1, x2+2, y2); } - + + glDisable(GL_BLEND); + } static void ui_emboss_slider(uiBut *but, float fac) { float h; + float x1; + float y1; + float x2; + float y2; h= (but->y2-but->y1); - BIF_set_color(but->col, COLORSHADE_DARK); + x1= but->x1; x2= but->x2; + y1= but->y1; y2= but->y2; + + /* the slider background line */ + + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + + glVertex2f(x1,y1-4); + glVertex2f(x2-h,y1-4); + + BIF_set_color(BUTGREY, COLORSHADE_HILITE); + + glVertex2f(x2-h,y2+2); + glVertex2f(x1,y2+2); + + glEnd(); + + /*BIF_set_color(but->col, COLORSHADE_DARK); glRectf(but->x1, but->y1, but->x2, but->y2); glColor3ub(0,0,0); ui_draw_outlineX(but->x1+1, but->y1+1, but->x2-1, but->y2-1, but->aspect); + */ - /* the box */ - if(but->flag & UI_SELECT) BIF_set_color(but->col, COLORSHADE_LIGHT); + /* the movable slider */ + if(but->flag & UI_SELECT) BIF_set_color(but->col, COLORSHADE_WHITE); else BIF_set_color(but->col, COLORSHADE_GREY); - glRects(but->x1+fac, but->y1+1, but->x1+fac+h, but->y2-1); - BIF_set_color(but->col, COLORSHADE_WHITE); - fdrawline(but->x1+fac, but->y2-1, but->x1+fac+h, but->y2-1); - fdrawline(but->x1+fac, but->y1+1, but->x1+fac, but->y2-1); + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + BIF_set_color(BUTGREY, COLORSHADE_GREY); + + glVertex2f(x1,y1-4); + glVertex2f(x1+fac,y1-4); + + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + + glVertex2f(x1+fac,y2+2); + glVertex2f(x1,y2+2); + + glEnd(); + + + /* slider handle center */ + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); + glVertex2f(x1+fac-1,y1-4); + glVertex2f(x1+fac+2,y1-4); + BIF_set_color(BUTGREY, COLORSHADE_WHITE); + glVertex2f(x1+fac+2,y2+2); + glVertex2f(x1+fac-1,y2+2); + + glEnd(); + + /* slider handle left bevel */ + BIF_set_color(BUTGREY, COLORSHADE_WHITE); + fdrawline(x1+fac-1, y2+2, x1+fac-1, y1-4); + + /* slider handle right bevel */ + BIF_set_color(BUTGREY, COLORSHADE_GREY); + fdrawline(x1+fac+2, y2+2, x1+fac+2, y1-4); + + +/* + BIF_set_color(BUTGREY, COLORSHADE_WHITE); + fdrawline(x1+fac-1, y2+2, x1+fac+h-1, y2+2); + fdrawline(x1+fac-1, y1-4, x1+fac-1, y2+2); + + BIF_set_color(BUTGREY, COLORSHADE_GREY); + fdrawline(x1+fac-1, y1-4, x1+fac+h-1, y1-4); + fdrawline(x1+fac+h-1, y1-4, x1+fac+h-1, y2+2); +*/ - glColor3ub(0,0,0); - fdrawline(but->x1+fac, but->y1+1, but->x1+fac+h, but->y1+1); - fdrawline(but->x1+fac+h, but->y1+1, but->x1+fac+h, but->y2-1); } static void ui_draw_but_BUT(uiBut *but) { - float x; + float x=0.0; + + but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); + + if(but->embossfunc==ui_emboss_TABL) { + but->flag |= UI_TEXT_LEFT; + but->flag |= UI_ICON_RIGHT; + but->flag &= ~UI_ICON_LEFT; + } + //but->flag |= UI_TEXT_LEFT; + + /* check for button text label */ + if (but->type == ICONTEXTROW) { + ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); + } + else if(but->drawstr[0]!=0) { + + /* If there's an icon too (made with uiDefIconTextBut) then draw the icon + * and offset the text label to accomodate it + */ + if ( but->flag & UI_HAS_ICON) { + if (but->flag & UI_ICON_LEFT) { + ui_draw_icon(but, but->icon); + + if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } else if (but->flag & UI_ICON_RIGHT) { + ui_draw_icon(but, but->icon); + + if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } + } + else { + if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } + + if(but->flag & UI_SELECT) { + glColor3ub(255,255,255); + } else { + glColor3ub(0,0,0); + } + + glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); + + BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), but->flag & UI_SELECT); + } + /* if there's no text label, then check to see if there's an icon only and draw it */ + else if( but->flag & UI_HAS_ICON ) { + ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); + } +} + +static void ui_draw_but_MENU(uiBut *but) +{ + float x; + + but->embossfunc = ui_emboss_MENU; + but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); + but->flag |= UI_TEXT_LEFT; + /* check for button text label */ if (but->type == ICONTEXTROW) { ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); @@ -779,7 +1579,7 @@ static void ui_draw_but_BUT(uiBut *but) if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { ui_draw_icon(but, but->icon); - if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; + if(but->flag & UI_TEXT_LEFT) x= but->x1+28.0; else x= (but->x1+but->x2-but->strwidth+1)/2.0; } else { @@ -856,6 +1656,8 @@ static void ui_draw_but_TEX(uiBut *but) sel= but->flag; if(but->embossfunc==ui_emboss_F) sel |= UI_SELECT; + but->embossfunc = ui_emboss_TEX; + but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, sel); sel= but->flag & UI_SELECT; @@ -872,13 +1674,16 @@ static void ui_draw_but_TEX(uiBut *but) but->drawstr[pos]= ch; glColor3ub(255,0,0); - + glRects(but->x1+t, but->y1+2, but->x1+t+3, but->y2-2); } } if(but->drawstr[0]!=0) { + glColor3ub(255,255,255); + /* if(sel) glColor3ub(255,255,255); else glColor3ub(0,0,0); + */ if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; else x= (but->x1+but->x2-but->strwidth+1)/2.0; @@ -889,15 +1694,59 @@ static void ui_draw_but_TEX(uiBut *but) } } -static void ui_draw_but_BUTM(uiBut *but) +static void ui_draw_but_NUM(uiBut *but) { + float x; + but->embossfunc = ui_emboss_NUM; + + but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); + + /* check for button text label */ + if (but->type == ICONTEXTROW) { + ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); + } + else if(but->drawstr[0]!=0) { + + /* If there's an icon too (made with uiDefIconTextBut) then draw the icon + and offset the text label to accomodate it */ + if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { + ui_draw_icon(but, but->icon); + + if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } + else { + if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } + + if(but->flag & UI_SELECT) { + glColor3ub(255,255,255); + } else { + glColor3ub(0,0,0); + } + + glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); + + BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), but->flag & UI_SELECT); + } + /* if there's no text label, then check to see if there's an icon only and draw it */ + else if( but->flag & UI_HAS_ICON ) { + ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); + } + +} + +static void ui_draw_but_BUTM(uiBut *but) +{ + float x=0; short len; char *cpoin; int sel; - + but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - + /* check for button text label */ if(but->drawstr[0]!=0) { @@ -920,10 +1769,16 @@ static void ui_draw_but_BUTM(uiBut *but) /* If there's an icon too (made with uiDefIconTextBut) then draw the icon and offset the text label to accomodate it */ - if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { - ui_draw_icon(but, but->icon); + if ( but->flag & UI_HAS_ICON ) { + if (but->flag & UI_ICON_LEFT ) { + ui_draw_icon(but, but->icon); + + x= but->x1+22.0; + } else if (but->flag & UI_ICON_RIGHT) { + ui_draw_icon(but, but->icon); - x= but->x1+24.0; + x= but->x1+4.0; + } } else { x= but->x1+4.0; @@ -959,7 +1814,7 @@ static void ui_draw_but_LABEL(uiBut *but) /* check for button text label */ if(but->drawstr[0]!=0) { - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon + /* If there's an icon too (made with uiDefIconTextBut) then draw the icon and offset the text label to accomodate it */ if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { ui_draw_icon(but, but->icon); @@ -984,12 +1839,11 @@ static void ui_draw_but_LABEL(uiBut *but) static void ui_draw_but_SEPR(uiBut *but) { - float y= (but->y1+but->y2)/2.0; - - glColor3ub(0,0,0); - fdrawline(but->x1, y+but->aspect, but->x2, y+but->aspect); - glColor3ub(255,255,255); - fdrawline(but->x1, y, but->x2, y); + //float y= (but->y1+but->y2)/2.0; + + BIF_set_color(but->col, COLORSHADE_HILITE); + glRectf(but->x1-2, but->y1-1, but->x2+2, but->y2); + } static void ui_draw_but_LINK(uiBut *but) @@ -1019,16 +1873,17 @@ static void ui_draw_but(uiBut *but) case BUT: case ROW: - case TOG: + case TOG: case TOGR: case TOGN: - case ICONTOG: - case NUM: + case ICONTOG: case KEYEVT: case IDPOIN: ui_draw_but_BUT(but); break; - + case NUM: + ui_draw_but_NUM(but); + break; case TEX: ui_draw_but_TEX(but); break; @@ -1084,21 +1939,27 @@ static void ui_draw_but(uiBut *but) case MENU: - ui_draw_but_BUT(but); + ui_draw_but_MENU(but); - /* when sufficient space: darw symbols */ + /* when sufficient space: darw symbols if(but->strwidth+10 < but->x2-but->x1) { - int h; + + + + + int h; + h= but->y2- but->y1; x1= but->x2-0.66*h; x2= x1+.33*h; y1= but->y1+.42*h; y2= y1+.16*h; - + glColor3ub(0,0,0); glRecti(x1, y1, x2, y2); glColor3ub(255,255,255); glRecti(x1-1, y1+1, x2-1, y2+1); - } + + }*/ break; case NUMSLI: @@ -1172,40 +2033,314 @@ static void ui_draw_but(uiBut *but) } } +/* --------- generic helper drawng calls ---------------- */ + +/* supposes you draw the actual box atop of this. */ +void uiSoftShadow(float minx, float miny, float maxx, float maxy, float rad, int alpha) +{ + + glShadeModel(GL_SMOOTH); + glEnable(GL_BLEND); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + + /* quads start left-top, clockwise */ + + /* left */ + glBegin(GL_POLYGON); + glColor4ub(0, 0, 0, 0); + glVertex2f( minx-rad, maxy-rad); + glColor4ub(0, 0, 0, alpha); + glVertex2f( minx+rad, maxy-rad); + glColor4ub(0, 0, 0, alpha); + glVertex2f( minx+rad, miny+rad); + glColor4ub(0, 0, 0, 0); + glVertex2f( minx-rad, miny-rad); + glEnd(); + + /* bottom */ + glBegin(GL_POLYGON); + glColor4ub(0, 0, 0, alpha); + glVertex2f( minx+rad, miny+rad); + glColor4ub(0, 0, 0, alpha); + glVertex2f( maxx-rad, miny+rad); + glColor4ub(0, 0, 0, 0); + glVertex2f( maxx+rad, miny-rad); + glColor4ub(0, 0, 0, 0); + glVertex2f( minx-rad, miny-rad); + glEnd(); + + /* right */ + glBegin(GL_POLYGON); + glColor4ub(0, 0, 0, alpha); + glVertex2f( maxx-rad, maxy-rad); + glColor4ub(0, 0, 0, 0); + glVertex2f( maxx+rad, maxy-rad); + glColor4ub(0, 0, 0, 0); + glVertex2f( maxx+rad, miny-rad); + glColor4ub(0, 0, 0, alpha); + glVertex2f( maxx-rad, miny+rad); + glEnd(); + + glDisable(GL_BLEND); + glShadeModel(GL_FLAT); +} + + +#define UI_RB_ALPHA 16 +static int roundboxtype= 15; + +void uiSetRoundBox(int type) +{ + roundboxtype= type; +} + +void gl_round_box_topshade(float minx, float miny, float maxx, float maxy, float rad) +{ + float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + char col[7]= {140, 165, 195, 210, 230, 245, 255}; + int a; + char alpha=255; + + if(roundboxtype & UI_RB_ALPHA) alpha= 128; + + /* mult */ + for(a=0; a<7; a++) { + vec[a][0]*= rad; vec[a][1]*= rad; + } + + /* shades from grey->white->grey */ + glBegin(GL_LINE_STRIP); + + if(roundboxtype & 3) { + /* corner right-top */ + glColor4ub(140, 140, 140, alpha); + glVertex2f( maxx, maxy-rad); + for(a=0; a<7; a++) { + glColor4ub(col[a], col[a], col[a], alpha); + glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]); + } + glColor4ub(255, 255, 255, alpha); + glVertex2f( maxx-rad, maxy); + + + /* corner left-top */ + glVertex2f( minx+rad, maxy); + for(a=0; a<7; a++) { + glColor4ub(col[6-a], col[6-a], col[6-a], alpha); + glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]); + } + glVertex2f( minx, maxy-rad); + } + else { + glColor4ub(255, 255, 255, alpha); + glVertex2f( minx, maxy); + glVertex2f( maxx, maxy); + } + + glEnd(); +} + + +void gl_round_box(float minx, float miny, float maxx, float maxy, float rad) +{ + float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + int a; + + /* mult */ + for(a=0; a<7; a++) { + vec[a][0]*= rad; vec[a][1]*= rad; + } + + /* start with corner right-bottom */ + if(roundboxtype & 4) { + glVertex2f( maxx-rad, miny); + for(a=0; a<7; a++) { + glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]); + } + glVertex2f( maxx, miny+rad); + } + else glVertex2f( maxx, miny); + + /* corner right-top */ + if(roundboxtype & 2) { + glVertex2f( maxx, maxy-rad); + for(a=0; a<7; a++) { + glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]); + } + glVertex2f( maxx-rad, maxy); + } + else glVertex2f( maxx, maxy); + + /* corner left-top */ + if(roundboxtype & 1) { + glVertex2f( minx+rad, maxy); + for(a=0; a<7; a++) { + glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]); + } + glVertex2f( minx, maxy-rad); + } + else glVertex2f( minx, maxy); + + /* corner left-bottom */ + if(roundboxtype & 8) { + glVertex2f( minx, miny+rad); + for(a=0; a<7; a++) { + glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]); + } + glVertex2f( minx+rad, miny); + } + else glVertex2f( minx, miny); + +} + +/* for headers and floating panels */ +void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad) +{ + float color[4]; + + if(roundboxtype & UI_RB_ALPHA) { + glGetFloatv(GL_CURRENT_COLOR, color); + color[3]= 0.5; + glColor4fv(color); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + } + + /* solid part */ + glBegin(GL_POLYGON); + gl_round_box(minx, miny, maxx, maxy, rad); + glEnd(); + + /* set antialias line */ + glEnable( GL_LINE_SMOOTH ); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + + gl_round_box_topshade(minx+1, miny+1, maxx-1, maxy-1, rad); + + if(roundboxtype & UI_RB_ALPHA) glColor4ub(0,0,0, 128); else glColor4ub(0,0,0, 255); + glBegin(GL_LINE_LOOP); + gl_round_box(minx, miny, maxx, maxy, rad); + glEnd(); + + glDisable( GL_BLEND ); + glDisable( GL_LINE_SMOOTH ); + + +} + +/* plain antialiased unfilled rectangle */ +void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad) +{ + float color[4]; + + if(roundboxtype & UI_RB_ALPHA) { + glGetFloatv(GL_CURRENT_COLOR, color); + color[3]= 0.5; + glColor4fv(color); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + } + + /* set antialias line */ + glEnable( GL_LINE_SMOOTH ); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + + glBegin(GL_LINE_LOOP); + gl_round_box(minx, miny, maxx, maxy, rad); + glEnd(); + + glDisable( GL_BLEND ); + glDisable( GL_LINE_SMOOTH ); +} + + + +/* plain antialiased filled box */ +void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad) +{ + float color[4]; + + if(roundboxtype & UI_RB_ALPHA) { + glGetFloatv(GL_CURRENT_COLOR, color); + color[3]= 0.5; + glColor4fv(color); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + } + + /* solid part */ + glBegin(GL_POLYGON); + gl_round_box(minx, miny, maxx, maxy, rad); + glEnd(); + + /* set antialias line */ + glEnable( GL_LINE_SMOOTH ); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + + glBegin(GL_LINE_LOOP); + gl_round_box(minx, miny, maxx, maxy, rad); + glEnd(); + + glDisable( GL_BLEND ); + glDisable( GL_LINE_SMOOTH ); +} + + + + void uiDrawMenuBox(float minx, float miny, float maxx, float maxy) { + BIF_set_color(MENUCOL, COLORSHADE_MEDIUM); glRectf(minx, miny, maxx, maxy); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glColor4ub(0, 0, 0, 100); + fdrawline(minx+4, miny, maxx+1, miny); + fdrawline(maxx+1, miny, maxx+1, maxy-4); + + glColor4ub(0, 0, 0, 80); fdrawline(minx+4, miny-1, maxx+1, miny-1); fdrawline(maxx+1, miny-1, maxx+1, maxy-4); - glColor4ub(0, 0, 0, 75); + glColor4ub(0, 0, 0, 55); fdrawline(minx+4, miny-2, maxx+2, miny-2); fdrawline(maxx+2, miny-2, maxx+2, maxy-4); - glColor4ub(0, 0, 0, 50); + glColor4ub(0, 0, 0, 35); fdrawline(minx+4, miny-3, maxx+3, miny-3); fdrawline(maxx+3, miny-3, maxx+3, maxy-4); + glColor4ub(0, 0, 0, 20); + fdrawline(minx+4, miny-4, maxx+4, miny-4); + fdrawline(maxx+4, miny-4, maxx+4, maxy-4); + + glColor4ub(0, 0, 0, 10); + fdrawline(minx+4, miny-5, maxx+5, miny-5); + fdrawline(maxx+5, miny-5, maxx+5, maxy-4); + glDisable(GL_BLEND); /* below */ - glColor3ub(0,0,0); - fdrawline(minx, miny, maxx, miny); + //glColor3ub(0,0,0); + //fdrawline(minx, miny, maxx, miny); /* right */ - fdrawline(maxx, miny, maxx, maxy); + //fdrawline(maxx, miny, maxx, maxy); /* top */ - glColor3ub(255,255,255); - fdrawline(minx, maxy, maxx, maxy); + //glColor3ub(255,255,255); + //fdrawline(minx, maxy, maxx, maxy); /* left */ - fdrawline(minx, miny, minx, maxy); + //fdrawline(minx, miny, minx, maxy); + } static void ui_draw_linkline(uiBut *but, uiLinkLine *line) @@ -1282,24 +2417,33 @@ void uiBoundsBlock(uiBlock *block, int addval) { uiBut *bt; - block->minx= block->miny= 10000; - block->maxx= block->maxy= -10000; + if(block->buttons.first==NULL) { + if(block->panel) { + block->minx= 0.0; block->maxx= block->panel->sizex; + block->miny= 0.0; block->maxy= block->panel->sizey; + } + } + else { - bt= block->buttons.first; - while(bt) { - if(bt->x1 < block->minx) block->minx= bt->x1; - if(bt->y1 < block->miny) block->miny= bt->y1; - - if(bt->x2 > block->maxx) block->maxx= bt->x2; - if(bt->y2 > block->maxy) block->maxy= bt->y2; + block->minx= block->miny= 10000; + block->maxx= block->maxy= -10000; - bt= bt->next; - } + bt= block->buttons.first; + while(bt) { + if(bt->x1 < block->minx) block->minx= bt->x1; + if(bt->y1 < block->miny) block->miny= bt->y1; - block->minx -= addval; - block->miny -= addval; - block->maxx += addval; - block->maxy += addval; + if(bt->x2 > block->maxx) block->maxx= bt->x2; + if(bt->y2 > block->maxy) block->maxy= bt->y2; + + bt= bt->next; + } + + block->minx -= addval; + block->miny -= addval; + block->maxx += addval; + block->maxy += addval; + } } static void ui_positionblock(uiBlock *block, uiBut *but) @@ -1335,6 +2479,13 @@ static void ui_positionblock(uiBlock *block, uiBut *but) butrct.xmin= but->x1; butrct.xmax= but->x2; butrct.ymin= but->y1; butrct.ymax= but->y2; + + if(but->block->panel) { + butrct.xmin += but->block->panel->ofsx; + butrct.ymin += but->block->panel->ofsy; + butrct.xmax += but->block->panel->ofsx; + butrct.ymax += but->block->panel->ofsy; + } /* added this for submenu's... */ Mat4CpyMat4(UIwinmat, block->winmat); @@ -1383,14 +2534,15 @@ static void ui_positionblock(uiBlock *block, uiBut *but) else xof= but->x1 - block->minx; } - - // apply requested offset in the block xof += block->xofs; - yof += block->yofs; + if(but->block->panel) { + xof += but->block->panel->ofsx; + yof += but->block->panel->ofsy; + } } /* apply */ @@ -1479,29 +2631,27 @@ static void ui_autofill(uiBlock *block) block->autofill= 0; } -static void ui_drawblock_int(uiBlock *block) +void uiDrawBlock(uiBlock *block) { uiBut *but; if(block->autofill) ui_autofill(block); if(block->minx==0.0 && block->maxx==0.0) uiBoundsBlock(block, 0); + ui_panel_push(block); // panel matrix + if(block->flag & UI_BLOCK_LOOP) { BIF_set_color(block->col, COLORSHADE_HILITE); uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy); } + else if(block->panel) ui_draw_panel(block); for (but= block->buttons.first; but; but= but->next) { ui_draw_but(but); } ui_draw_links(block); - -} - -void uiDrawBlock(uiBlock *block) -{ - ui_drawblock_int(block); + ui_panel_pop(block); // matrix restored } /* ************* MENUBUTS *********** */ @@ -2906,6 +4056,61 @@ static uiBut *ui_but_last(uiBlock *block) /* *************************************************************** */ +static void setup_file(uiBlock *block) +{ + uiBut *but; + FILE *fp; + + fp= fopen("butsetup","w"); + if(fp==NULL); + else { + but= block->buttons.first; + while(but) { + if(but->rt[3]==1) + fprintf(fp,"%d,%d,%d,%d %s %s\n", (int)but->x1, (int)but->y1, (int)( but->x2-but->x1), (int)(but->y2-but->y1), but->str, but->tip); + but= but->next; + } + fclose(fp); + } +} + + +static void edit_but(uiBlock *block, uiBut *but, uiEvent *uevent) +{ + short dx, dy, mval[2], mvalo[2], didit=0; + + getmouseco_sc(mvalo); + while(TRUE) { + if( !(get_mbut() & L_MOUSE) ) break; + + getmouseco_sc(mval); + dx= (mval[0]-mvalo[0])/4; + dy= (mval[1]-mvalo[1])/4; + + if(dx!=0 || dy!=0) { + mvalo[0]= mval[0]; + mvalo[1]= mval[1]; + + cpack(0xc0c0c0); + glRectf(but->x1-2, but->y1-2, but->x2+2, but->y2+2); + + if((uevent->qual & LR_SHIFTKEY)==0) { + but->x1 += dx; + but->y1 += dy; + } + but->x2 += dx; + but->y2 += dy; + + ui_draw_but(but); + glFinish(); + didit= 1; + but->rt[3]= 1; + } + /* idle for this poor code */ + else PIL_sleep_ms(30); + } + if(didit) setup_file(block); +} /* is called when LEFTMOUSE is pressed or released * return: butval or zero @@ -2921,13 +4126,18 @@ static int ui_do_button(uiBlock *block, uiBut *but, uiEvent *uevent) } } else { - if( but->pointype ) { /* er there a pointer needed */ + if( but->pointype ) { /* there's a pointer needed */ if(but->poin==0 ) { printf("DoButton pointer error: %s\n",but->str); return 0; } } } + + if(G.rt==1 && (uevent->qual & LR_CTRLKEY)) { + edit_but(block, but, uevent); + return 0; + } block->flag |= UI_BLOCK_BUSY; @@ -3161,15 +4371,24 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) } Mat4CpyMat4(UIwinmat, block->winmat); + ui_panel_push(block); // push matrix; no return without pop! + uiGetMouse(mywinget(), uevent->mval); /* transformed mouseco */ - /* check boundbox */ + /* check boundbox and panel events */ if( block->minx <= uevent->mval[0] && block->maxx >= uevent->mval[0] ) { if( block->miny <= uevent->mval[1] && block->maxy >= uevent->mval[1] ) { inside= 1; } + else if(block->panel && uevent->event==LEFTMOUSE) { + if( block->maxy <= uevent->mval[1] && block->maxy+PNL_HEADER >= uevent->mval[1] ) { + ui_panel_pop(block); // pop matrix; no return without pop! + ui_do_panel(block, uevent); + return UI_EXIT_LOOP; // exit loops because of moving panels + } + } } - + switch(uevent->event) { case PAD8: case PAD2: case UPARROWKEY: @@ -3283,16 +4502,14 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) if(but->flag & UI_MOUSE_OVER) { if( (but->flag & UI_ACTIVE)==0) { but->flag |= UI_ACTIVE; - if(but->type != LABEL && - but->embossfunc != ui_emboss_N) ui_draw_but(but); + if(but->type != LABEL && but->embossfunc != ui_emboss_N) ui_draw_but(but); } } /* hilite case 2 */ if(but->flag & UI_ACTIVE) { if( (but->flag & UI_MOUSE_OVER)==0) { but->flag &= ~UI_ACTIVE; - if(but->type != LABEL && - but->embossfunc != ui_emboss_N) ui_draw_but(but); + if(but->type != LABEL && but->embossfunc != ui_emboss_N) ui_draw_but(but); } if(but->flag & UI_ACTIVE) active= 1; } @@ -3335,6 +4552,8 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) but= but->next; } + ui_panel_pop(block); // pop matrix; no return without pop! + /* the linkines... why not make buttons from it? Speed? Memory? */ if(uevent->val && (uevent->event==XKEY || uevent->event==DELKEY)) ui_delete_active_linkline(block); @@ -3457,13 +4676,14 @@ static void ui_do_but_tip(void) if (anyqtest()) return; else - PIL_sleep_ms(30); + PIL_sleep_ms(50); } /* Display the tip, and keep it displayed * as long as the mouse remains on top * of the button that owns it. */ + ui_panel_push(UIbuttip->block); // panel matrix su= ui_draw_but_tip(UIbuttip); while (1) { @@ -3484,6 +4704,7 @@ static void ui_do_but_tip(void) } ui_endpupdraw(su); + ui_panel_pop(UIbuttip->block); // panel matrix UIbuttip= NULL; } } @@ -3497,9 +4718,9 @@ int uiDoBlocks(ListBase *lb, int event) * is active. otherwise you have to press twice... */ - uiBlock *block; + uiBlock *block, *first; uiEvent uevent; - int retval= UI_NOTHING, cont= 1; + int retval= UI_NOTHING, cont= 1, dopop=0; if(lb->first==0) return UI_NOTHING; @@ -3524,14 +4745,14 @@ int uiDoBlocks(ListBase *lb, int event) /* first loop, for the normal blocks */ block= lb->first; while(block) { - + /* for pupmenus, the bgnpupdraw sets (and later restores) the active window. Then mousecoords get transformed OK. It looks double... but a call to ui_do_block otherwise doesnt get handled properly */ if(block->flag & UI_BLOCK_REDRAW) { if( block->flag & UI_BLOCK_LOOP) { - block->saveunder= ui_bgnpupdraw((int)block->minx-1, (int)block->miny-4, (int)block->maxx+4, (int)block->maxy+1, 1); + block->saveunder= ui_bgnpupdraw((int)block->minx-1, (int)block->miny-6, (int)block->maxx+6, (int)block->maxy+1, 1); block->frontbuf= UI_HAS_DRAW_FRONT; } uiDrawBlock(block); @@ -3539,6 +4760,7 @@ int uiDoBlocks(ListBase *lb, int event) } retval= ui_do_block(block, &uevent); + if(retval==UI_EXIT_LOOP) break; /* now a new block could be created for menus, this is inserted in the beginning of a list */ @@ -3550,8 +4772,11 @@ int uiDoBlocks(ListBase *lb, int event) block->frontbuf= UI_NEED_DRAW_FRONT; } - if(retval==UI_CONT || retval & UI_RETURN) break; - + /* to make sure the matrix of the panel works for menus too */ + dopop= 1; + if(retval==UI_CONT || (retval & UI_RETURN)) break; + first= lb->first; if(first->flag & UI_BLOCK_LOOP) break; + block= block->next; } @@ -3820,7 +5045,7 @@ uiBlock *uiNewBlock(ListBase *lb, char *name, short dt, short font, short win) } block= MEM_callocN(sizeof(uiBlock), "uiBlock"); - if(lb) BLI_addhead(lb, block); /* at the beginning of the list! */ + if(lb) BLI_addhead(lb, block); /* at the beginning of the list! for dynamical menus/blocks */ strcpy(block->name, name); /* draw win */ @@ -4069,7 +5294,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short else if(block->dt==UI_EMBOSSF) but->embossfunc= ui_emboss_F; else if(block->dt==UI_EMBOSSM) but->embossfunc= ui_emboss_M; else if(block->dt==UI_EMBOSSP) but->embossfunc= ui_emboss_P; - else if(block->dt==UI_EMBOSSA) but->embossfunc= ui_emboss_A; + else if(block->dt==UI_EMBOSST) but->embossfunc= ui_emboss_TABL; + else if(block->dt==UI_EMBOSSTABL) but->embossfunc= ui_emboss_TABL; + else if(block->dt==UI_EMBOSSTABM) but->embossfunc= ui_emboss_TABM; + else if(block->dt==UI_EMBOSSTABR) but->embossfunc= ui_emboss_TABR; else but->embossfunc= ui_emboss_N; but->pos= -1; /* cursor invisible */ @@ -4290,6 +5518,21 @@ void uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, sho ui_check_but(but); } +/* Block button containing both string label and icon */ +void uiDefIconTextBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip) +{ + uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); + + but->icon= (BIFIconID) icon; + but->flag|= UI_HAS_ICON; + + but->flag|= UI_ICON_LEFT; + but->flag|= UI_ICON_RIGHT; + + but->block_func= func; + ui_check_but(but); +} + void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip) { uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip); @@ -4312,6 +5555,7 @@ short pupmenu(char *instr) /* block stuff first, need to know the font */ block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); + uiBlockSetCol(block, MENUCOL); md= decompose_menu_string(instr); @@ -4531,3 +5775,473 @@ short pupmenu_col(char *instr, int maxrow) return val; } +/* ************** panels ************* */ + + +/* ofsx/ofsy only used for new panel definitions */ +void uiNewPanel(ScrArea *sa, uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey) +{ + Panel *pa; + + /* check if Panel exists, then use that one */ + pa= sa->panels.first; + while(pa) { + if( strncmp(pa->panelname, panelname, UI_MAX_NAME_STR)==0) { + if( strncmp(pa->tabname, tabname, UI_MAX_NAME_STR)==0) { + block->panel= pa; + return; + } + } + pa= pa->next; + } + + /* new panel */ + pa= MEM_callocN(sizeof(Panel), "new panel"); + BLI_addtail(&sa->panels, pa); + strncpy(pa->panelname, panelname, UI_MAX_NAME_STR); + strncpy(pa->tabname, tabname, UI_MAX_NAME_STR); + + pa->ofsx= ofsx & ~(PNL_GRID-1); + pa->ofsy= ofsy & ~(PNL_GRID-1); + pa->sizex= sizex; + pa->sizey= sizey; + + block->panel= pa; + +} + +void uiFreePanels(ListBase *lb) +{ + Panel *panel; + + while( (panel= lb->first) ) { + BLI_remlink(lb, panel); + MEM_freeN(panel); + } +} + + +void uiScalePanelBlock(uiBlock *block) +{ + uiBut *but; + float facx= 1.0, facy= 1.0; + int centrex= 0; + + if(block->panel==NULL) return; + + /* buttons min/max centered, offset calculated */ + uiBoundsBlock(block, 0); + + if( block->maxx-block->minx > block->panel->sizex - 2*PNL_SAFETY ) { + facx= (block->panel->sizex - (2*PNL_SAFETY))/( block->maxx-block->minx ); + } + else centrex= (block->panel->sizex-( block->maxx-block->minx ) - PNL_SAFETY)/2; + + if( block->maxy-block->miny > block->panel->sizey - 2*PNL_SAFETY ) { + facy= (block->panel->sizey - (2*PNL_SAFETY))/( block->maxy-block->miny ); + } + + but= block->buttons.first; + while(but) { + but->x1= PNL_SAFETY+centrex+ facx*(but->x1-block->minx); + but->y1= PNL_SAFETY+ facy*(but->y1-block->miny); + but->x2= PNL_SAFETY+centrex+ facx*(but->x2-block->minx); + but->y2= PNL_SAFETY+ facy*(but->y2-block->miny); + if(facx!=1.0) ui_check_but(but); /* for strlen */ + but= but->next; + } + + block->maxx= block->panel->sizex; + block->maxy= block->panel->sizey; + block->minx= block->miny= 0.0; + +} + +void uiSetPanel_view2d(ScrArea *sa) +{ + Panel *pa; + float minx=10000, maxx= -10000, miny=10000, maxy= -10000; + + if(sa->panels.first==NULL) return; + + pa= sa->panels.first; + while(pa) { + if(pa->ofsx < minx) minx= pa->ofsx; + if(pa->ofsx+pa->sizex > maxx) maxx= pa->ofsx+pa->sizex; + if(pa->ofsy < miny) miny= pa->ofsy; + if(pa->ofsy+pa->sizey+PNL_HEADER > maxy) maxy= pa->ofsy+pa->sizey+PNL_HEADER; + + pa= pa->next; + } + + G.v2d->tot.xmin= minx-PNL_DIST; + G.v2d->tot.xmax= maxx+PNL_DIST; + G.v2d->tot.ymin= miny-PNL_DIST; + G.v2d->tot.ymax= maxy+PNL_DIST; + + +} + +int uiIsPanelClosed(uiBlock *block) +{ + if(block->panel && (block->panel->flag & PNL_CLOSED)) { + uiDrawBlock(block); + return 1; + } + return 0; +} + +static void ui_panel_push(uiBlock *block) +{ + glPushMatrix(); + if(block->panel) { + glTranslatef((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0); + i_translate((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0, UIwinmat); + } +} + +static void ui_panel_pop(uiBlock *block) +{ + glPopMatrix(); + Mat4CpyMat4(UIwinmat, block->winmat); +} + +/* 'icon' for panel header */ +static void ui_draw_tria(float x, float y, float aspect, char dir) +{ + + /* hilite */ + glColor3ub(240, 240, 240); + if(dir=='h') fdrawline(x, y+15.0-aspect, x+13.0, y+7.5-aspect); + else fdrawline(x, y+13.0-aspect, x+15.0, y+13.0-aspect); + + /* outline */ + glColor3ub(70, 70, 70); + glBegin(GL_LINE_LOOP); + if(dir=='h') { + glVertex2f( x, y); + glVertex2f( x, y+15.0); + glVertex2f( x+13, y+7.5); + } + else { + glVertex2f( x, y+13.0); + glVertex2f( x+15, y+13.0); + glVertex2f( x+7.5, y); + } + glEnd(); + +} + +static void ui_set_panel_pattern(char dir) +{ + static int firsttime= 1; + static GLubyte path[4*32], patv[4*32]; + int a,b,i=0; + + if(firsttime) { + firsttime= 0; + for(a=0; a<128; a++) patv[a]= 0x33; + for(a=0; a<8; a++) { + for(b=0; b<4; b++) path[i++]= 0xff; /* 1 scanlines */ + for(b=0; b<12; b++) path[i++]= 0x0; /* 3 lines */ + } + } + glEnable(GL_POLYGON_STIPPLE); + if(dir=='h') glPolygonStipple(path); + else glPolygonStipple(patv); +} + +static void ui_draw_panel(uiBlock *block) +{ + if(block->panel->flag & PNL_CLOSED) { + uiSetRoundBox(15); + glColor3ub(160, 160, 167); + uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 10); + + glColor3ub(255,255,255); + glRasterPos2f(block->minx+10, block->maxy+5); + BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & TR_BUTTONS), 0); + + // selected border + if(block->panel->flag & PNL_SELECT) { + glColor3ub(64, 64, 64); + uiRoundRect(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 10); + } + + } + else { + + uiSetRoundBox(3); + glColor3ub(160, 160, 167); + uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 10); + + glColor3ub(192, 192, 192); + glRectf(block->minx, block->miny, block->maxx, block->maxy); + + if(G.buts->align) { + glColor3ub(200, 200, 200); + if(G.buts->align==BUT_HORIZONTAL) ui_set_panel_pattern('h'); + else ui_set_panel_pattern('v'); + glRectf(block->minx, block->miny, block->maxx, block->maxy); + glDisable(GL_POLYGON_STIPPLE); + } + + glColor3ub(255,255,255); + glRasterPos2f(block->minx+10, block->maxy+5); + BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & TR_BUTTONS), 0); + + // selected border + if(block->panel->flag & PNL_SELECT) { + glColor3ub(64, 64, 64); + uiRoundRect(block->minx, block->miny, block->maxx, block->maxy+PNL_HEADER, 10); + } + + /* and a soft shadow-line for now */ + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + glColor4ub(0, 0, 0, 50); + fdrawline(block->maxx, block->miny, block->maxx, block->maxy); + fdrawline(block->minx, block->miny, block->maxx, block->miny); + glDisable(GL_BLEND); + + } + /* icon */ + if(block->panel->flag & PNL_CLOSED) + ui_draw_tria(block->maxx-30, block->maxy+2, block->aspect, 'h'); + else + ui_draw_tria(block->maxx-30, block->maxy+2, block->aspect, 'v'); + + //if(block->aspect>1.1) glPixelZoom(1.0/block->aspect, 1.0/block->aspect); + + //glRasterPos2f(block->maxx-30, block->maxy+2); + //if(block->panel->flag & PNL_CLOSED) BIF_draw_icon(ICON_DISCLOSURE_TRI_RIGHT); + //else BIF_draw_icon(ICON_DISCLOSURE_TRI_DOWN); + + //glPixelZoom(1.0, 1.0); + +} + +/* ------------ panel alignment ---------------- */ + +/* this function is needed because uiBlock and Panel itself dont +change sizey or location when closed */ +static int get_panel_real_ofsy(Panel *pa) +{ + if(pa->flag & PNL_CLOSED) return pa->ofsy+pa->sizey; + else return pa->ofsy; +} + + +static Panel *find_highest_panel(ListBase *lb) +{ + Panel *pa, *patop=NULL; + int top= -100000; + + pa= lb->first; + while(pa) { + if( pa->ofsy + pa->sizey > top) { + top= pa->ofsy + pa->sizey; + patop= pa; + } + pa= pa->next; + } + return patop; +} + +static Panel *find_leftmost_panel(ListBase *lb) +{ + Panel *pa, *paleft=NULL; + int left= 100000; + + pa= lb->first; + while(pa) { + if( pa->ofsx < left) { + left= pa->ofsx; + paleft= pa; + } + pa= pa->next; + } + return paleft; +} + + +/* this also animates */ +static void ui_align_panel_step(ScrArea *sa, float fac) +{ + SpaceButs *sbuts= sa->spacedata.first; + ListBase lb1= {NULL, NULL}; + Panel *pa, *panel; + + /* find the desired positions of current panels first */ + /* sorting */ + while(sa->panels.first) { + if(sbuts->align==BUT_VERTICAL) + pa= find_highest_panel(&sa->panels); + else + pa= find_leftmost_panel(&sa->panels); + + if(pa==NULL) printf("panel sort error (crash!)\n"); + BLI_remlink(&sa->panels, pa); + BLI_addtail(&lb1, pa); + } + /* put back sorted */ + sa->panels = lb1; + + /* make copy */ + duplicatelist(&lb1, &sa->panels); + + /* now we fill in lb1 panels the desired location */ + pa= lb1.first; + + /* default startloc current view2d topleft corner */ + pa->ofsx= sbuts->v2d.tot.xmin+PNL_DIST; + pa->ofsy= sbuts->v2d.tot.ymax-PNL_DIST- pa->sizey-PNL_HEADER; + + if(sbuts->align==BUT_VERTICAL) { + while(pa->next) { + pa->next->ofsx = pa->ofsx; + pa->next->ofsy = get_panel_real_ofsy(pa) - pa->sizey-PNL_HEADER-PNL_DIST; + pa= pa->next; + } + } + else { + while(pa->next) { + pa->next->ofsx = pa->ofsx + pa->sizex+PNL_DIST; + pa->next->ofsy = pa->ofsy; + pa= pa->next; + } + } + + /* we interpolate */ + panel= sa->panels.first; + pa= lb1.first; + while(panel && pa) { + + if( (panel->flag & PNL_SELECT)==0) { + panel->ofsx= floor(0.5 + fac*pa->ofsx + (1.0-fac)*panel->ofsx); + panel->ofsy= floor(0.5 + fac*pa->ofsy + (1.0-fac)*panel->ofsy); + } + panel= panel->next; + pa= pa->next; + } + + BLI_freelistN(&lb1); + + /* warn: this re-allocs blocks! */ + scrarea_do_windraw(curarea); + screen_swapbuffers(); +} + + +void uiAnimatePanels(ScrArea *sa) +{ + double time=0, ltime; + float result= 0.0, fac= 0.2; + + ltime = PIL_check_seconds_timer(); + + /* for max 1 second, interpolate positions */ + while(TRUE) { + + ui_align_panel_step(sa, fac); + if(result >= 1.0) break; + + if(result==0.0) { // firsttime + time = PIL_check_seconds_timer()-ltime; + if(time > 0.5) fac= 0.7; + else if(time > 0.2) fac= 0.5; + else if(time > 0.1) fac= 0.4; + else if(time > 0.05) fac= 0.3; // 11 steps + } + + result= fac + (1.0-fac)*result; + + if(result > 0.98) { + result= 1.0; + fac= 1.0; + } + } +} + +static void ui_drag_panel(uiBlock *block) +{ + SpaceButs *sbuts= curarea->spacedata.first; + Panel *panel= block->panel; + short first=1, ofsx, ofsy, dx, dy, dxo=0, dyo=0, mval[2], mvalo[2]; + + uiGetMouse(block->win, mvalo); + ofsx= block->panel->ofsx; + ofsy= block->panel->ofsy; + + panel->flag |= PNL_SELECT; + + while(TRUE) { + + if( !(get_mbut() & L_MOUSE) ) break; + + uiGetMouse(mywinget(), mval); + dx= (mval[0]-mvalo[0]) & ~(PNL_GRID-1); + dy= (mval[1]-mvalo[1]) & ~(PNL_GRID-1); + + if(dx!=dxo || dy!=dyo || first) { + dxo= dx; dyo= dy; + first= 0; + + panel->ofsx = ofsx+dx; + panel->ofsy = ofsy+dy; + + /* warn: this re-allocs blocks! */ + if(sbuts->align==0) { + scrarea_do_windraw(curarea); + screen_swapbuffers(); + } + else ui_align_panel_step(curarea, 0.2); + + /* so, we find the new block */ + block= curarea->uiblocks.first; + while(block) { + if(block->panel == panel) break; + block= block->next; + } + // temporal debug + if(block==NULL) { + printf("block null while panel drag, should not happen\n"); + } + + /* restore */ + Mat4CpyMat4(UIwinmat, block->winmat); + } + /* idle for this poor code */ + else PIL_sleep_ms(30); + } + + panel->flag &= ~PNL_SELECT; + if(sbuts->align==0) addqueue(block->win, REDRAW, 1); + else uiAnimatePanels(curarea); +} + +/* ------------ panel events ---------------- */ + +/* this function is supposed to call general window drawing too */ +/* also it supposes a block has panel, and isnt a menu */ +static void ui_do_panel(uiBlock *block, uiEvent *uevent) +{ + SpaceButs *sbuts= curarea->spacedata.first; + + if(uevent->event==LEFTMOUSE) { + + /* check open/closed button */ + + if(uevent->mval[0] >= block->maxx-30 && uevent->mval[0] <= block->maxx-10) { + block->panel->flag ^= PNL_CLOSED; + + if(sbuts->align==0) addqueue(block->win, REDRAW, 1); + else uiAnimatePanels(curarea); + } + else { + ui_drag_panel(block); + } + } +} + + diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index 22ff4108204..966abee3814 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -154,9 +154,11 @@ static void def_col(BIFColorID colorid, unsigned char r, unsigned char g, unsign rgbaCCol_addNT(get_color(colorid, COLORSHADE_WHITE), col, 60); rgbaCCol_addNT(get_color(colorid, COLORSHADE_LIGHT), col, 35); rgbaCCol_addNT(get_color(colorid, COLORSHADE_HILITE), col, 20); + rgbaCCol_addNT(get_color(colorid, COLORSHADE_LMEDIUM), col, 10); rgbaCCol_addNT(get_color(colorid, COLORSHADE_MEDIUM), col, 0); - rgbaCCol_addNT(get_color(colorid, COLORSHADE_GREY), col, -45); - rgbaCCol_addNT(get_color(colorid, COLORSHADE_DARK), col, -60); + rgbaCCol_addNT(get_color(colorid, COLORSHADE_LGREY), col, -20); + rgbaCCol_addNT(get_color(colorid, COLORSHADE_GREY), col, -45); + rgbaCCol_addNT(get_color(colorid, COLORSHADE_DARK), col, -80); } else { printf("def_col: Internal error, bad color ID: %d\n", colorid); } @@ -265,11 +267,11 @@ void BIF_resources_init(void) IMB_freeImBuf(bbuf); - def_col(BUTGREY, 0xB0,0xB0,0xB0); + def_col(BUTGREY, 0x90,0x90,0x90); def_col(BUTGREEN, 0x88,0xA0,0xA4); def_col(BUTBLUE, 0xA0,0xA0,0xB0); def_col(BUTSALMON, 0xB0,0xA0,0x90); - def_col(MIDGREY, 0x90,0x90,0x90); + def_col(MIDGREY, 0xB0,0xB0,0xB0); def_col(BUTPURPLE, 0xA2,0x98,0xA9); def_col(BUTYELLOW, 0xB2,0xB2,0x99); def_col(BUTRUST, 0x80,0x70,0x70); @@ -278,7 +280,16 @@ void BIF_resources_init(void) def_col(BUTDBLUE, 0x80,0x80,0xA0); def_col(BUTDPINK, 0xAA,0x88,0x55); def_col(BUTPINK, 0xE8,0xBD,0xA7); - def_col(BUTMACTIVE, 0x70,0x70,0xC0); + def_col(BUTMACTIVE, 0x30,0x30,0x30); + + def_col(ACTIONBUTCOL, 0x88,0x88,0x88); + def_col(NUMBUTCOL, 0x88,0x88,0x88); + def_col(TEXBUTCOL, 0x88,0x88,0x88); + def_col(TOGBUTCOL, 0x88,0x88,0x88); + def_col(SLIDERCOL, 0x88,0x88,0x88); + def_col(TABCOL, 0x88,0x88,0x88); + def_col(MENUCOL, 0xCF,0xCF,0xCF); + def_col(MENUACTIVECOL, 0x80,0x80,0x80); def_col(BUTIPO, 0xB0,0xB0,0x99); def_col(BUTAUDIO, 0xB0,0xA0,0x90); @@ -290,13 +301,17 @@ void BIF_resources_init(void) def_col(BUTMOTION, 0x98,0xA7,0xA9); def_col(BUTMESSAGE, 0x88,0xA0,0x94); def_col(BUTACTION, 0xB2,0xA9,0x99); - def_col(BUTVISIBILITY, 0xB2,0xA9,0x99); + def_col(BUTVISIBILITY, 0xB2,0xA9,0x99); def_col(BUTCD, 0xB0,0x95,0x90); def_col(BUTGAME, 0x99,0xB2,0x9C); def_col(BUTYUCK, 0xB0,0x99,0xB0); def_col(BUTSEASICK, 0x99,0xB0,0xB0); def_col(BUTCHOKE, 0x88,0x94,0xA0); def_col(BUTIMPERIAL, 0x94,0x88,0xA0); + + def_col(HEADERCOL, 165, 165, 165); + def_col(HEADERCOLSEL, 185, 185, 185); + } void BIF_resources_free(void) diff --git a/source/blender/src/space.c b/source/blender/src/space.c index c289f8275ae..2ae77c262b6 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -437,7 +437,7 @@ void select_children(Object *ob, int recursive) void select_parent(void) /* Makes parent active and de-selected OBACT */ { - Base *base, *startbase, *basact, *oldbasact; + Base *base, *startbase, *basact=NULL, *oldbasact; if (!(OBACT->parent)) return; BASACT->flag &= (~SELECT); @@ -1962,6 +1962,12 @@ void drawinfospace(ScrArea *sa, void *spacedata) } uiDrawBlock(block); + + myortho2(-0.5, (float)(sa->winx)-.05, -0.5, (float)(sa->winy)-0.5); + draw_area_emboss(sa); + myortho2(0.0, 1280.0, 0.0, curarea->winy/fac); + sa->win_swap= WIN_BACK_OK; + } @@ -2010,7 +2016,7 @@ void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt) short val= evt->val; SpaceButs *sbuts= curarea->spacedata.first; ScrArea *sa2, *sa3d; - int doredraw= 0; + int nr, doredraw= 0; if(val) { @@ -2026,7 +2032,14 @@ void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case WHEELDOWNMOUSE: view2dmove(event); /* in drawipo.c */ break; + case RIGHTMOUSE: + nr= pupmenu("Align buttons%t|Free %x0|Horizontal%x1|Vertical%x2"); + if (nr>=0) { + sbuts->align= nr; + if(nr) uiAnimatePanels(sa); + } + break; case PADPLUSKEY: view2d_zoom(&sbuts->v2d, 0.06, curarea->winx, curarea->winy); scrarea_queue_winredraw(curarea); @@ -2087,11 +2100,11 @@ void set_rects_butspace(SpaceButs *buts) buts->v2d.min[0]= 256.0; buts->v2d.min[1]= 42.0; - buts->v2d.max[0]= 1600.0; + buts->v2d.max[0]= 2048.0; buts->v2d.max[1]= 450.0; buts->v2d.minzoom= 0.5; - buts->v2d.maxzoom= 1.41; + buts->v2d.maxzoom= 1.21; buts->v2d.scroll= 0; buts->v2d.keepaspect= 1; |