Blender  V2.59
ED_numinput.h
Go to the documentation of this file.
00001 /*
00002  * $Id: ED_numinput.h 35016 2011-02-21 07:25:24Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * Contributor(s): none yet.
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00029 #ifndef ED_NUMINPUT_H
00030 #define ED_NUMINPUT_H
00031 
00032 
00033 typedef struct NumInput {
00034         short  idx;
00035         short  idx_max;
00036         short  flag;        /* Different flags to indicate different behaviors                                */
00037         char   inv[3];      /* If the value is inverted or not                                                */
00038         float  val[3];      /* Direct value of the input                                                      */
00039         int    ctrl[3];     /* Control to indicate what to do with the numbers that are typed                 */
00040         float  increment;
00041 } NumInput ;
00042 
00043 /* NUMINPUT FLAGS */
00044 #define NUM_NULL_ONE            2
00045 #define NUM_NO_NEGATIVE         4
00046 #define NUM_NO_ZERO                     8
00047 #define NUM_NO_FRACTION         16
00048 #define NUM_AFFECT_ALL          32
00049 
00050 /*********************** NumInput ********************************/
00051 
00052 void initNumInput(NumInput *n);
00053 void outputNumInput(NumInput *n, char *str);
00054 short hasNumInput(NumInput *n);
00055 void applyNumInput(NumInput *n, float *vec);
00056 char handleNumInput(NumInput *n, struct wmEvent *event);
00057 
00058 #define NUM_MODAL_INCREMENT_UP   18
00059 #define NUM_MODAL_INCREMENT_DOWN 19
00060 
00061 #endif