Blender V2.61 - r43446

UI_interface.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00032 #ifndef UI_INTERFACE_H
00033 #define UI_INTERFACE_H
00034 
00035 #include "BLO_sys_types.h" /* size_t */
00036 #include "RNA_types.h"
00037 #include "DNA_userdef_types.h"
00038 
00039 /* Struct Declarations */
00040 
00041 struct ID;
00042 struct Main;
00043 struct ListBase;
00044 struct ARegion;
00045 struct ScrArea;
00046 struct wmWindow;
00047 struct wmWindowManager;
00048 struct wmOperator;
00049 struct AutoComplete;
00050 struct bContext;
00051 struct Panel;
00052 struct PanelType;
00053 struct PointerRNA;
00054 struct PropertyRNA;
00055 struct ReportList;
00056 struct rcti;
00057 struct rctf;
00058 struct uiStyle;
00059 struct uiFontStyle;
00060 struct uiWidgetColors;
00061 struct ColorBand;
00062 struct CurveMapping;
00063 struct Image;
00064 struct ImageUser;
00065 struct uiWidgetColors;
00066 struct Tex;
00067 struct MTex;
00068 struct ImBuf;
00069 struct bNodeTree;
00070 struct bNode;
00071 struct bNodeSocket;
00072 
00073 typedef struct uiBut uiBut;
00074 typedef struct uiBlock uiBlock;
00075 typedef struct uiPopupBlockHandle uiPopupBlockHandle;
00076 typedef struct uiLayout uiLayout;
00077 
00078 /* Defines */
00079 
00080 /* names */
00081 #define UI_MAX_DRAW_STR 400
00082 #define UI_MAX_NAME_STR 128
00083 
00084 /* uiBlock->dt */
00085 #define UI_EMBOSS       0   /* use widget style for drawing */
00086 #define UI_EMBOSSN      1   /* Nothing, only icon and/or text */
00087 #define UI_EMBOSSP      2   /* Pulldown menu style */
00088 #define UI_EMBOSST      3   /* Table */
00089 
00090 /* uiBlock->direction */
00091 #define UI_DIRECTION    (UI_TOP|UI_DOWN|UI_LEFT|UI_RIGHT)
00092 #define UI_TOP      1
00093 #define UI_DOWN     2
00094 #define UI_LEFT     4
00095 #define UI_RIGHT    8
00096 
00097 #define UI_CENTER       16
00098 #define UI_SHIFT_FLIPPED    32
00099 
00100 /* uiBlock->autofill (not yet used) */
00101 // #define UI_BLOCK_COLLUMNS    1
00102 // #define UI_BLOCK_ROWS        2
00103 
00104 /* uiBlock->flag (controls) */
00105 #define UI_BLOCK_LOOP           1
00106 #define UI_BLOCK_REDRAW         2
00107 #define UI_BLOCK_RET_1          4       /* XXX 2.5 not implemented */
00108 #define UI_BLOCK_NUMSELECT      8
00109 /*#define UI_BLOCK_ENTER_OK     16*/ /*UNUSED*/
00110 #define UI_BLOCK_CLIPBOTTOM     32
00111 #define UI_BLOCK_CLIPTOP        64
00112 #define UI_BLOCK_MOVEMOUSE_QUIT 128
00113 #define UI_BLOCK_KEEP_OPEN      256
00114 #define UI_BLOCK_POPUP          512
00115 #define UI_BLOCK_OUT_1          1024
00116 #define UI_BLOCK_NO_FLIP        2048
00117 #define UI_BLOCK_POPUP_MEMORY   4096
00118 #define UI_BLOCK_CLIP_EVENTS    8192    /* stop handling mouse events */
00119 
00120 /* uiPopupBlockHandle->menuretval */
00121 #define UI_RETURN_CANCEL    1       /* cancel all menus cascading */
00122 #define UI_RETURN_OK        2       /* choice made */
00123 #define UI_RETURN_OUT       4       /* left the menu */
00124 #define UI_RETURN_UPDATE    8       /* update the button that opened */
00125 #define UI_RETURN_POPUP_OK  16      /* popup is ok to be handled */
00126 
00127     /* block->flag bits 12-15 are identical to but->flag bits */
00128 
00129 /* panel controls */
00130 #define UI_PNL_SOLID    2
00131 #define UI_PNL_CLOSE    32
00132 #define UI_PNL_SCALE    512
00133 
00134 /* warning the first 6 flags are internal */
00135 /* but->flag */
00136 #define UI_TEXT_LEFT    64
00137 #define UI_ICON_LEFT    128
00138 #define UI_ICON_SUBMENU 256
00139 #define UI_ICON_PREVIEW 512
00140 
00141 #define UI_TEXT_RIGHT       1024
00142 #define UI_BUT_NODE_LINK    2048
00143 #define UI_BUT_NODE_ACTIVE  4096
00144 #define UI_FLAG_UNUSED      8192
00145 
00146     /* button align flag, for drawing groups together */
00147 #define UI_BUT_ALIGN        (UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT|UI_BUT_ALIGN_RIGHT|UI_BUT_ALIGN_DOWN)
00148 #define UI_BUT_ALIGN_TOP    (1<<14)
00149 #define UI_BUT_ALIGN_LEFT   (1<<15)
00150 #define UI_BUT_ALIGN_RIGHT  (1<<16)
00151 #define UI_BUT_ALIGN_DOWN   (1<<17)
00152 
00153 #define UI_BUT_DISABLED     (1<<18)
00154 #define UI_BUT_COLOR_LOCK   (1<<19)
00155 #define UI_BUT_ANIMATED     (1<<20)
00156 #define UI_BUT_ANIMATED_KEY (1<<21)
00157 #define UI_BUT_DRIVEN       (1<<22)
00158 #define UI_BUT_REDALERT     (1<<23)
00159 #define UI_BUT_INACTIVE     (1<<24)
00160 #define UI_BUT_LAST_ACTIVE  (1<<25)
00161 #define UI_BUT_UNDO         (1<<26)
00162 #define UI_BUT_IMMEDIATE    (1<<27)
00163 #define UI_BUT_NO_TOOLTIP   (1<<28)
00164 #define UI_BUT_NO_UTF8      (1<<29)
00165 
00166 #define UI_BUT_VEC_SIZE_LOCK (1<<30) /* used to flag if color hsv-circle should keep luminance */
00167 #define UI_BUT_COLOR_CUBIC  (1<<31) /* cubic saturation for the color wheel */
00168 
00169 #define UI_PANEL_WIDTH          340
00170 #define UI_COMPACT_PANEL_WIDTH  160
00171 
00172 /* scale fixed button widths by this to account for DPI
00173  * 8.4852 == sqrtf(72.0f)) */
00174 #define UI_DPI_FAC (sqrtf((float)U.dpi) / 8.48528137423857f)
00175 #define UI_DPI_ICON_FAC (((float)U.dpi) / 72.0f)
00176 /* 16 to copy ICON_DEFAULT_HEIGHT */
00177 #define UI_DPI_ICON_SIZE ((float)16 * UI_DPI_ICON_FAC)
00178 
00179 /* Button types, bits stored in 1 value... and a short even!
00180 - bits 0-4:  bitnr (0-31)
00181 - bits 5-7:  pointer type
00182 - bit  8:    for 'bit'
00183 - bit  9-15: button type (now 6 bits, 64 types)
00184 */
00185 
00186 #define CHA 32
00187 #define SHO 64
00188 #define INT 96
00189 #define FLO 128
00190 /*#define FUN   192*/ /*UNUSED*/
00191 #define BIT 256
00192 
00193 #define BUTPOIN (128+64+32)
00194 
00195 #define BUT (1<<9)
00196 #define ROW (2<<9)
00197 #define TOG (3<<9)
00198 #define SLI (4<<9)
00199 #define NUM (5<<9)
00200 #define TEX (6<<9)
00201 #define TOG3    (7<<9)
00202 #define TOGR    (8<<9)
00203 #define TOGN    (9<<9)
00204 #define LABEL   (10<<9)
00205 #define MENU    (11<<9)
00206 #define ICONROW (12<<9)
00207 #define ICONTOG (13<<9)
00208 #define NUMSLI  (14<<9)
00209 #define COL     (15<<9)
00210 #define IDPOIN  (16<<9)
00211 #define HSVSLI  (17<<9)
00212 #define SCROLL  (18<<9)
00213 #define BLOCK   (19<<9)
00214 #define BUTM    (20<<9)
00215 #define SEPR    (21<<9)
00216 #define LINK    (22<<9)
00217 #define INLINK  (23<<9)
00218 #define KEYEVT  (24<<9)
00219 #define ICONTEXTROW (25<<9)
00220 #define HSVCUBE     (26<<9)
00221 #define PULLDOWN    (27<<9)
00222 #define ROUNDBOX    (28<<9)
00223 #define CHARTAB     (29<<9)
00224 #define BUT_COLORBAND (30<<9)
00225 #define BUT_NORMAL  (31<<9)
00226 #define BUT_CURVE   (32<<9)
00227 #define BUT_TOGDUAL (33<<9)
00228 #define ICONTOGN    (34<<9)
00229 #define FTPREVIEW   (35<<9)
00230 #define NUMABS      (36<<9)
00231 #define TOGBUT      (37<<9)
00232 #define OPTION      (38<<9)
00233 #define OPTIONN     (39<<9)
00234 #define TRACKPREVIEW    (40<<9)
00235         /* buttons with value >= SEARCH_MENU don't get undo pushes */
00236 #define SEARCH_MENU (41<<9)
00237 #define BUT_EXTRA   (42<<9)
00238 #define HSVCIRCLE   (43<<9)
00239 #define LISTBOX     (44<<9)
00240 #define LISTROW     (45<<9)
00241 #define HOTKEYEVT   (46<<9)
00242 #define BUT_IMAGE   (47<<9)
00243 #define HISTOGRAM   (48<<9)
00244 #define WAVEFORM    (49<<9)
00245 #define VECTORSCOPE (50<<9)
00246 #define PROGRESSBAR (51<<9)
00247 
00248 #define BUTTYPE     (63<<9)
00249 
00250 /* gradient types, for color picker HSVCUBE etc */
00251 #define UI_GRAD_SV      0
00252 #define UI_GRAD_HV      1
00253 #define UI_GRAD_HS      2
00254 #define UI_GRAD_H       3
00255 #define UI_GRAD_S       4
00256 #define UI_GRAD_V       5
00257 
00258 #define UI_GRAD_V_ALT   9
00259 
00260 /* Drawing
00261  *
00262  * Functions to draw various shapes, taking theme settings into account.
00263  * Used for code that draws its own UI style elements. */
00264 
00265 void uiEmboss(float x1, float y1, float x2, float y2, int sel);
00266 void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad);
00267 void uiSetRoundBox(int type);
00268 int uiGetRoundBox(void);
00269 void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad);
00270 void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, short direction);
00271 void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
00272 void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad);
00273 void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
00274 void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
00275 
00276 /* state for scrolldrawing */
00277 #define UI_SCROLL_PRESSED       1
00278 #define UI_SCROLL_ARROWS        2
00279 #define UI_SCROLL_NO_OUTLINE    4
00280 void uiWidgetScrollDraw(struct uiWidgetColors *wcol, struct rcti *rect, struct rcti *slider, int state);
00281 
00282 /* Callbacks
00283  *
00284  * uiBlockSetHandleFunc/ButmFunc are for handling events through a callback.
00285  * HandleFunc gets the retval passed on, and ButmFunc gets a2. The latter is
00286  * mostly for compatibility with older code.
00287  *
00288  * uiButSetCompleteFunc is for tab completion.
00289  *
00290  * uiButSearchFunc is for name buttons, showing a popup with matches
00291  *
00292  * uiBlockSetFunc and uiButSetFunc are callbacks run when a button is used,
00293  * in case events, operators or RNA are not sufficient to handle the button.
00294  *
00295  * uiButSetNFunc will free the argument with MEM_freeN. */
00296 
00297 typedef struct uiSearchItems uiSearchItems;
00298 
00299 typedef void (*uiButHandleFunc)(struct bContext *C, void *arg1, void *arg2);
00300 typedef void (*uiButHandleRenameFunc)(struct bContext *C, void *arg, char *origstr);
00301 typedef void (*uiButHandleNFunc)(struct bContext *C, void *argN, void *arg2);
00302 typedef void (*uiButCompleteFunc)(struct bContext *C, char *str, void *arg);
00303 typedef void (*uiButSearchFunc)(const struct bContext *C, void *arg, const char *str, uiSearchItems *items);
00304 typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event);
00305 
00306 /* Menu Callbacks */
00307 
00308 typedef void (*uiMenuCreateFunc)(struct bContext *C, struct uiLayout *layout, void *arg1);
00309 typedef void (*uiMenuHandleFunc)(struct bContext *C, void *arg, int event);
00310 
00311 /* Popup Menus
00312  *
00313  * Functions used to create popup menus. For more extended menus the
00314  * uiPupMenuBegin/End functions can be used to define own items with
00315  * the uiItem functions in between. If it is a simple confirmation menu
00316  * or similar, popups can be created with a single function call. */
00317 
00318 typedef struct uiPopupMenu uiPopupMenu;
00319 
00320 uiPopupMenu *uiPupMenuBegin(struct bContext *C, const char *title, int icon);
00321 void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head);
00322 struct uiLayout *uiPupMenuLayout(uiPopupMenu *head);
00323 
00324 void uiPupMenuOkee(struct bContext *C, const char *opname, const char *str, ...);
00325 void uiPupMenuSaveOver(struct bContext *C, struct wmOperator *op, const char *filename);
00326 void uiPupMenuNotice(struct bContext *C, const char *str, ...);
00327 void uiPupMenuError(struct bContext *C, const char *str, ...);
00328 void uiPupMenuReports(struct bContext *C, struct ReportList *reports);
00329 void uiPupMenuInvoke(struct bContext *C, const char *idname); /* popup registered menu */
00330 
00331 /* Popup Blocks
00332  *
00333  * Functions used to create popup blocks. These are like popup menus
00334  * but allow using all button types and creating an own layout. */
00335 
00336 typedef uiBlock* (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1);
00337 typedef void (*uiBlockCancelFunc)(void *arg1);
00338 
00339 void uiPupBlock(struct bContext *C, uiBlockCreateFunc func, void *arg);
00340 void uiPupBlockO(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext);
00341 void uiPupBlockEx(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg);
00342 /* void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); */ /* UNUSED */
00343 
00344 void uiPupBlockClose(struct bContext *C, uiBlock *block);
00345 
00346 /* Blocks
00347  *
00348  * Functions for creating, drawing and freeing blocks. A Block is a
00349  * container of buttons and used for various purposes.
00350  * 
00351  * Begin/Define Buttons/End/Draw is the typical order in which these
00352  * function should be called, though for popup blocks Draw is left out.
00353  * Freeing blocks is done by the screen/ module automatically.
00354  *
00355  * */
00356 
00357 uiBlock *uiBeginBlock(const struct bContext *C, struct ARegion *region, const char *name, short dt);
00358 void uiEndBlock(const struct bContext *C, uiBlock *block);
00359 void uiDrawBlock(const struct bContext *C, struct uiBlock *block);
00360 
00361 uiBlock *uiGetBlock(const char *name, struct ARegion *ar);
00362 
00363 void uiBlockSetEmboss(uiBlock *block, char dt);
00364 
00365 void uiFreeBlock(const struct bContext *C, uiBlock *block);
00366 void uiFreeBlocks(const struct bContext *C, struct ListBase *lb);
00367 void uiFreeInactiveBlocks(const struct bContext *C, struct ListBase *lb);
00368 void uiFreeActiveButtons(const struct bContext *C, struct bScreen *screen);
00369 
00370 void uiBlockSetRegion(uiBlock *block, struct ARegion *region);
00371 
00372 void uiBlockSetButLock(uiBlock *block, int val, const char *lockstr);
00373 void uiBlockClearButLock(uiBlock *block);
00374 
00375 /* automatic aligning, horiz or verical */
00376 void uiBlockBeginAlign(uiBlock *block);
00377 void uiBlockEndAlign(uiBlock *block);
00378 
00379 /* block bounds/position calculation */
00380 enum {
00381     UI_BLOCK_BOUNDS=1,
00382     UI_BLOCK_BOUNDS_TEXT,
00383     UI_BLOCK_BOUNDS_POPUP_MOUSE,
00384     UI_BLOCK_BOUNDS_POPUP_MENU,
00385     UI_BLOCK_BOUNDS_POPUP_CENTER
00386 } eBlockBoundsCalc;
00387 
00388 void uiBoundsBlock(struct uiBlock *block, int addval);
00389 void uiTextBoundsBlock(uiBlock *block, int addval);
00390 void uiPopupBoundsBlock(uiBlock *block, int addval, int mx, int my);
00391 void uiMenuPopupBoundsBlock(uiBlock *block, int addvall, int mx, int my);
00392 void uiCenteredBoundsBlock(uiBlock *block, int addval);
00393 void uiExplicitBoundsBlock(uiBlock *block, int minx, int miny, int maxx, int maxy);
00394 
00395 int     uiBlocksGetYMin     (struct ListBase *lb);
00396 
00397 void    uiBlockSetDirection (uiBlock *block, int direction);
00398 void    uiBlockFlipOrder    (uiBlock *block);
00399 void    uiBlockSetFlag      (uiBlock *block, int flag);
00400 void    uiBlockClearFlag    (uiBlock *block, int flag);
00401 void    uiBlockSetXOfs      (uiBlock *block, int xofs);
00402 
00403 int     uiButGetRetVal      (uiBut *but);
00404 
00405 void    uiButSetDragID(uiBut *but, struct ID *id);
00406 void    uiButSetDragRNA(uiBut *but, struct PointerRNA *ptr);
00407 void    uiButSetDragPath(uiBut *but, const char *path);
00408 void    uiButSetDragName(uiBut *but, const char *name);
00409 void    uiButSetDragValue(uiBut *but);
00410 void    uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale);
00411 
00412 int     UI_but_active_drop_name(struct bContext *C);
00413 
00414 void    uiButSetFlag        (uiBut *but, int flag);
00415 void    uiButClearFlag      (uiBut *but, int flag);
00416 
00417 /* special button case, only draw it when used actively, for outliner etc */
00418 int     uiButActiveOnly     (const struct bContext *C, uiBlock *block, uiBut *but);
00419 
00420 
00421 /* Buttons
00422  *
00423  * Functions to define various types of buttons in a block. Postfixes:
00424  * - F: float
00425  * - I: int
00426  * - S: short
00427  * - C: char
00428  * - R: RNA
00429  * - O: operator */
00430 
00431 uiBut *uiDefBut(uiBlock *block, 
00432                        int type, int retval, const char *str, 
00433                        int x1, int y1, 
00434                        short x2, short y2, 
00435                        void *poin, 
00436                        float min, float max, 
00437                        float a1, float a2, const char *tip);
00438 uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip);
00439 uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip);
00440 uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip);
00441 uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip);
00442 uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip);
00443 uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip);
00444 uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip);
00445 uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip);
00446 uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip);
00447 uiBut *uiDefButR_prop(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip);
00448 uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00449 uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip);
00450 
00451 uiBut *uiDefIconBut(uiBlock *block, 
00452                        int type, int retval, int icon, 
00453                        int x1, int y1, 
00454                        short x2, short y2, 
00455                        void *poin, 
00456                        float min, float max, 
00457                        float a1, float a2,  const char *tip);
00458 uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip);
00459 uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip);
00460 uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip);
00461 uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip);
00462 uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip);
00463 uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip);
00464 uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip);
00465 uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip);
00466 uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip);
00467 uiBut *uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, struct PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip);
00468 uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, int x1, int y1, short x2, short y2, const char *tip);
00469 
00470 uiBut *uiDefIconTextBut(uiBlock *block,
00471                         int type, int retval, int icon, const char *str, 
00472                         int x1, int y1,
00473                         short x2, short y2,
00474                         void *poin,
00475                         float min, float max,
00476                         float a1, float a2, const char *tip);
00477 uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip);
00478 uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip);
00479 uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip);
00480 uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip);
00481 uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip);
00482 uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip);
00483 uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip);
00484 uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip);
00485 uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip);
00486 uiBut *uiDefIconTextButR_prop(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, float min, float max, float a1, float a2, const char *tip);
00487 uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00488 
00489 /* for passing inputs to ButO buttons */
00490 struct PointerRNA *uiButGetOperatorPtrRNA(uiBut *but);
00491 
00492 void uiButSetUnitType(uiBut *but, const int unit_type);
00493 int uiButGetUnitType(uiBut *but);
00494 
00495 /* Special Buttons
00496  *
00497  * Butons with a more specific purpose:
00498  * - IDPoinBut: for creating buttons that work on a pointer to an ID block.
00499  * - MenuBut: buttons that popup a menu (in headers usually).
00500  * - PulldownBut: like MenuBut, but creating a uiBlock (for compatibility).
00501  * - BlockBut: buttons that popup a block with more buttons.
00502  * - KeyevtBut: buttons that can be used to turn key events into values.
00503  * - PickerButtons: buttons like the color picker (for code sharing).
00504  * - AutoButR: RNA property button with type automatically defined. */
00505 
00506 #define UI_ID_RENAME        1
00507 #define UI_ID_BROWSE        2
00508 #define UI_ID_ADD_NEW       4
00509 #define UI_ID_OPEN          8
00510 #define UI_ID_ALONE         16
00511 #define UI_ID_DELETE        32
00512 #define UI_ID_LOCAL         64
00513 #define UI_ID_AUTO_NAME     128
00514 #define UI_ID_FAKE_USER     256
00515 #define UI_ID_PIN           512
00516 #define UI_ID_BROWSE_RENDER 1024
00517 #define UI_ID_PREVIEWS      2048
00518 #define UI_ID_FULL          (UI_ID_RENAME|UI_ID_BROWSE|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_ALONE|UI_ID_DELETE|UI_ID_LOCAL)
00519 
00520 typedef void (*uiIDPoinFuncFP)(struct bContext *C, const char *str, struct ID **idpp);
00521 typedef void (*uiIDPoinFunc)(struct bContext *C, struct ID *id, int event);
00522 
00523 uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str,
00524                         int x1, int y1, short x2, short y2, void *idpp, const char *tip);
00525 
00526 int uiIconFromID(struct ID *id);
00527 
00528 uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00529 uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00530 uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00531 uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x1, int y1, short x2, short y2, const char *tip);
00532 
00533 uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *func_arg1, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00534 uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00535 
00536 uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x1, int y1, short x2, short y2, const char *tip);
00537 uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, const char *str, int x1, int y1, short x2, short y2, const char *tip);
00538 
00539 uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x1, int y1, short x2, short y2, short *spoin, const char *tip);
00540 uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x1, int y1, short x2, short y2, short *keypoin, short *modkeypoin, const char *tip);
00541 
00542 uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x1, int y1, short x2, short y2, float a1, float a2, const char *tip);
00543 
00544 uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2);
00545 int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align);
00546 
00547 /* Links
00548  *
00549  * Game engine logic brick links. Non-functional currently in 2.5,
00550  * code to handle and draw these is disabled internally. */
00551 
00552 void uiSetButLink(struct uiBut *but,  void **poin,  void ***ppoin,  short *tot,  int from, int to);
00553 
00554 void uiComposeLinks(uiBlock *block);
00555 uiBut *uiFindInlink(uiBlock *block, void *poin);
00556 
00557         /* use inside searchfunc to add items */
00558 int     uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid);
00559         /* bfunc gets search item *poin as arg2, or if NULL the old string */
00560 void    uiButSetSearchFunc  (uiBut *but,        uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active);
00561         /* height in pixels, it's using hardcoded values still */
00562 int     uiSearchBoxhHeight(void);
00563 
00564 void    uiBlockSetHandleFunc(uiBlock *block,    uiBlockHandleFunc func, void *arg);
00565 void    uiBlockSetButmFunc  (uiBlock *block,    uiMenuHandleFunc func, void *arg);
00566 void    uiBlockSetFunc      (uiBlock *block,    uiButHandleFunc func, void *arg1, void *arg2);
00567 void    uiBlockSetNFunc     (uiBlock *block,    uiButHandleFunc func, void *argN, void *arg2);
00568 
00569 void    uiButSetRenameFunc  (uiBut *but,        uiButHandleRenameFunc func, void *arg1);
00570 void    uiButSetFunc        (uiBut *but,        uiButHandleFunc func, void *arg1, void *arg2);
00571 void    uiButSetNFunc       (uiBut *but,        uiButHandleNFunc func, void *argN, void *arg2);
00572 
00573 void    uiButSetCompleteFunc(uiBut *but,        uiButCompleteFunc func, void *arg);
00574 
00575 void    uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2);
00576 
00577 void uiButSetFocusOnEnter   (struct wmWindow *win, uiBut *but);
00578 
00579 /* Autocomplete
00580  *
00581  * Tab complete helper functions, for use in uiButCompleteFunc callbacks.
00582  * Call begin once, then multiple times do_name with all possibilities,
00583  * and finally end to finish and get the completed name. */
00584 
00585 typedef struct AutoComplete AutoComplete;
00586 
00587 AutoComplete *autocomplete_begin(const char *startname, size_t maxlen);
00588 void autocomplete_do_name(AutoComplete *autocpl, const char *name);
00589 void autocomplete_end(AutoComplete *autocpl, char *autoname);
00590 
00591 /* Panels
00592  *
00593  * Functions for creating, freeing and drawing panels. The API here
00594  * could use a good cleanup, though how they will function in 2.5 is
00595  * not clear yet so we postpone that. */
00596 
00597 void uiBeginPanels(const struct bContext *C, struct ARegion *ar);
00598 void uiEndPanels(const struct bContext *C, struct ARegion *ar, int *x, int *y);
00599 void uiDrawPanels(const struct bContext *C, struct ARegion *ar);
00600 
00601 struct Panel *uiBeginPanel(struct ScrArea *sa, struct ARegion *ar, uiBlock *block, struct PanelType *pt, int *open);
00602 void uiEndPanel(uiBlock *block, int width, int height);
00603 
00604 /* Handlers
00605  *
00606  * Handlers that can be registered in regions, areas and windows for
00607  * handling WM events. Mostly this is done automatic by modules such
00608  * as screen/ if ED_KEYMAP_UI is set, or internally in popup functions. */
00609 
00610 void UI_add_region_handlers(struct ListBase *handlers);
00611 void UI_add_area_handlers(struct ListBase *handlers);
00612 void UI_add_popup_handlers(struct bContext *C, struct ListBase *handlers, uiPopupBlockHandle *popup);
00613 void UI_remove_popup_handlers(struct ListBase *handlers, uiPopupBlockHandle *popup);
00614 
00615 /* Module
00616  *
00617  * init and exit should be called before using this module. init_userdef must
00618  * be used to reinitialize some internal state if user preferences change. */
00619 
00620 void UI_init(void);
00621 void UI_init_userdef(void);
00622 void UI_reinit_font(void);
00623 void UI_exit(void);
00624 
00625 /* Layout
00626  *
00627  * More automated layout of buttons. Has three levels:
00628  * - Layout: contains a number templates, within a bounded width or height.
00629  * - Template: predefined layouts for buttons with a number of slots, each
00630  *   slot can contain multiple items.
00631  * - Item: item to put in a template slot, being either an RNA property,
00632  *   operator, label or menu. Also regular buttons can be used when setting
00633  *   uiBlockCurLayout. */
00634 
00635 /* layout */
00636 #define UI_LAYOUT_HORIZONTAL    0
00637 #define UI_LAYOUT_VERTICAL      1
00638 
00639 #define UI_LAYOUT_PANEL         0
00640 #define UI_LAYOUT_HEADER        1
00641 #define UI_LAYOUT_MENU          2
00642 #define UI_LAYOUT_TOOLBAR       3
00643  
00644 #define UI_UNIT_X               U.widget_unit
00645 #define UI_UNIT_Y               U.widget_unit
00646 
00647 #define UI_LAYOUT_ALIGN_EXPAND  0
00648 #define UI_LAYOUT_ALIGN_LEFT    1
00649 #define UI_LAYOUT_ALIGN_CENTER  2
00650 #define UI_LAYOUT_ALIGN_RIGHT   3
00651 
00652 #define UI_ITEM_O_RETURN_PROPS  1
00653 #define UI_ITEM_R_EXPAND        2
00654 #define UI_ITEM_R_SLIDER        4
00655 #define UI_ITEM_R_TOGGLE        8
00656 #define UI_ITEM_R_ICON_ONLY     16
00657 #define UI_ITEM_R_EVENT         32
00658 #define UI_ITEM_R_FULL_EVENT    64
00659 #define UI_ITEM_R_NO_BG         128
00660 #define UI_ITEM_R_IMMEDIATE     256
00661 
00662 /* uiLayoutOperatorButs flags */
00663 #define UI_LAYOUT_OP_SHOW_TITLE 1
00664 #define UI_LAYOUT_OP_SHOW_EMPTY 2
00665 
00666 /* flags to set which corners will become rounded:
00667  *
00668  * 1------2
00669  * |      |
00670  * 8------4 */
00671 
00672 enum {
00673     UI_CNR_TOP_LEFT= 1,
00674     UI_CNR_TOP_RIGHT= 2,
00675     UI_CNR_BOTTOM_RIGHT= 4,
00676     UI_CNR_BOTTOM_LEFT= 8,
00677     /* just for convenience */
00678     UI_CNR_NONE= 0,
00679     UI_CNR_ALL= (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)
00680 };
00681 
00682 /* not apart of the corner flags but mixed in some functions  */
00683 #define UI_RB_ALPHA (UI_CNR_ALL + 1)
00684 
00685 uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, struct uiStyle *style);
00686 void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout);
00687 void uiBlockLayoutResolve(uiBlock *block, int *x, int *y);
00688 
00689 uiBlock *uiLayoutGetBlock(uiLayout *layout);
00690 
00691 void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv);
00692 void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct PointerRNA *ptr);
00693 const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
00694 void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, struct wmOperator *op, int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag);
00695 struct MenuType *uiButGetMenuType(uiBut *but);
00696 
00697 void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext);
00698 void uiLayoutSetActive(uiLayout *layout, int active);
00699 void uiLayoutSetEnabled(uiLayout *layout, int enabled);
00700 void uiLayoutSetRedAlert(uiLayout *layout, int redalert);
00701 void uiLayoutSetAlignment(uiLayout *layout, int alignment);
00702 void uiLayoutSetKeepAspect(uiLayout *layout, int keepaspect);
00703 void uiLayoutSetScaleX(uiLayout *layout, float scale);
00704 void uiLayoutSetScaleY(uiLayout *layout, float scale);
00705 
00706 int uiLayoutGetOperatorContext(uiLayout *layout);
00707 int uiLayoutGetActive(uiLayout *layout);
00708 int uiLayoutGetEnabled(uiLayout *layout);
00709 int uiLayoutGetRedAlert(uiLayout *layout);
00710 int uiLayoutGetAlignment(uiLayout *layout);
00711 int uiLayoutGetKeepAspect(uiLayout *layout);
00712 int uiLayoutGetWidth(uiLayout *layout);
00713 float uiLayoutGetScaleX(uiLayout *layout);
00714 float uiLayoutGetScaleY(uiLayout *layout);
00715 
00716 /* layout specifiers */
00717 uiLayout *uiLayoutRow(uiLayout *layout, int align);
00718 uiLayout *uiLayoutColumn(uiLayout *layout, int align);
00719 uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align);
00720 uiLayout *uiLayoutBox(uiLayout *layout);
00721 uiLayout *uiLayoutListBox(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop,
00722     struct PointerRNA *actptr, struct PropertyRNA *actprop);
00723 uiLayout *uiLayoutAbsolute(uiLayout *layout, int align);
00724 uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align);
00725 uiLayout *uiLayoutOverlap(uiLayout *layout);
00726 
00727 uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
00728 
00729 /* templates */
00730 void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus);
00731 void uiTemplateDopeSheetFilter(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr);
00732 void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
00733     const char *newop, const char *openop, const char *unlinkop);
00734 void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
00735                         const char *newop, const char *openop, const char *unlinkop);
00736 void uiTemplateIDPreview(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
00737     const char *newop, const char *openop, const char *unlinkop, int rows, int cols);
00738 void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, const char *propname, 
00739     const char *proptypename, const char *text);
00740 void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname, 
00741     struct PointerRNA *root_ptr, const char *text);
00742 uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr);
00743 uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr);
00744 void uiTemplatePreview(uiLayout *layout, struct ID *id, int show_buttons, struct ID *parent, struct MTex *slot);
00745 void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int expand);
00746 void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
00747 void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
00748 void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
00749 void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, int levels, int brush);
00750 void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int value_slider, int lock, int lock_luminosity, int cubic);
00751 void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
00752                       PointerRNA *used_ptr, const char *used_propname, int active_layer);
00753 void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *userptr, int compact);
00754 void uiTemplateImageSettings(uiLayout *layout, struct PointerRNA *imfptr);
00755 void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser);
00756 void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
00757 void uiTemplateOperatorSearch(uiLayout *layout);
00758 void uiTemplateHeader3D(uiLayout *layout, struct bContext *C);
00759 void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C);
00760 void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
00761 void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
00762 void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
00763 
00764 void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, const char *prop_list, int rows, int maxrows, int type);
00765 void uiTemplateNodeLink(uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input);
00766 void uiTemplateNodeView(uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input);
00767 void uiTemplateTextureUser(uiLayout *layout, struct bContext *C);
00768 void uiTemplateTextureShow(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop);
00769 
00770 void uiTemplateMovieClip(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, int compact);
00771 void uiTemplateTrack(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname);
00772 void uiTemplateMarker(struct uiLayout *layout, struct PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int cmpact);
00773 
00774 /* items */
00775 void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname);
00776 void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value);
00777 void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value);
00778 void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value);
00779 void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname);
00780 void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value);
00781 void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value);
00782 void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value);
00783 void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value);
00784 PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, int icon, struct IDProperty *properties, int context, int flag);
00785 
00786 void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon);
00787 void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon);
00788 void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, const char *propname, int value);
00789 void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, const char *name, int icon);
00790 void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
00791 void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *searchptr, const char *searchpropname, const char *name, int icon);
00792 void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, struct IDProperty *properties, int context, int flag);
00793 
00794 void uiItemL(uiLayout *layout, const char *name, int icon); /* label */
00795 void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon); /* label icon for dragging */
00796 void uiItemM(uiLayout *layout, struct bContext *C, const char *menuname, const char *name, int icon); /* menu */
00797 void uiItemV(uiLayout *layout, const char *name, int icon, int argval); /* value */
00798 void uiItemS(uiLayout *layout); /* separator */
00799 
00800 void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg);
00801 void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name, int icon);
00802 void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon);
00803 
00804 /* UI Operators */
00805 void UI_buttons_operatortypes(void);
00806 
00807 /* Helpers for Operators */
00808 uiBut *uiContextActiveButton(const struct bContext *C);
00809 void uiContextActiveProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index);
00810 void uiContextActivePropertyHandle(struct bContext *C);
00811 struct wmOperator *uiContextActiveOperator(const struct bContext *C);
00812 void uiContextAnimUpdate(const struct bContext *C);
00813 void uiFileBrowseContextProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop);
00814 void uiIDContextProperty(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop);
00815 
00816 /* Styled text draw */
00817 void uiStyleFontSet(struct uiFontStyle *fs);
00818 void uiStyleFontDrawExt(struct uiFontStyle *fs, struct rcti *rect, const char *str,
00819     float *r_xofs, float *r_yofs);
00820 void uiStyleFontDraw(struct uiFontStyle *fs, struct rcti *rect, const char *str);
00821 void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, const char *str);
00822 
00823 int UI_GetStringWidth(const char *str); // XXX temp
00824 void UI_DrawString(float x, float y, const char *str); // XXX temp
00825 void UI_DrawTriIcon(float x, float y, char dir);
00826 uiStyle* UI_GetStyle(void);
00827 /* linker workaround ack! */
00828 void UI_template_fix_linking(void);
00829 
00830 /* UI_OT_editsource helpers */
00831 int  UI_editsource_enable_check(void);
00832 void UI_editsource_active_but_test(uiBut *but);
00833 
00834 #endif /*  UI_INTERFACE_H */
00835