home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / unofficial-plug-ins / mathmap / userval.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-21  |  1.9 KB  |  93 lines

  1. /*
  2.  * userval.h
  3.  *
  4.  * MathMap
  5.  *
  6.  * Copyright (C) 1997-2000 Mark Probst
  7.  *
  8.  * This program is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU General Public License
  10.  * as published by the Free Software Foundation; either version 2
  11.  * of the License, or (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #ifndef __USERVAL_H__
  24. #define __USERVAL_H__
  25.  
  26. #include <gtk/gtk.h>
  27.  
  28. #include "tuples.h"
  29. #include "exprtree.h"
  30.  
  31. #define USER_CURVE_POINTS       1024
  32.  
  33. #define USERVAL_SLIDER      1
  34. #define USERVAL_BOOL        2
  35. #define USERVAL_COLOR       3
  36. #define USERVAL_CURVE       4
  37. #define USERVAL_IMAGE       5
  38.  
  39. typedef struct _userval_t
  40. {
  41.     ident name;
  42.     int type;
  43.     GtkWidget *widget;
  44.     int tag;
  45.     union
  46.     {
  47.     struct
  48.     {
  49.         float min;
  50.         float max;
  51.         float value;
  52.     } slider;
  53.  
  54.     struct
  55.     {
  56.         float value;
  57.     } bool;
  58.  
  59.     struct
  60.     {
  61.         tuple_t value;
  62.     } color;
  63.  
  64.     struct
  65.     {
  66.         float values[USER_CURVE_POINTS];
  67.     } curve;
  68.  
  69.     struct
  70.     {
  71.         int index;
  72.     } image;
  73.     } v;
  74.     struct _userval_t *next;
  75. } userval_t;
  76.  
  77. void untag_uservals (void);
  78. void clear_untagged_uservals (void);
  79.  
  80. userval_t* lookup_userval (const char *name, int type);
  81.  
  82. userval_t* register_slider (const char *name, float min, float max);
  83. userval_t* register_bool (const char *name);
  84. userval_t* register_color (const char *name);
  85. userval_t* register_curve (const char *name);
  86. userval_t* register_image (const char *name);
  87.  
  88. GtkWidget* make_userval_table (void);
  89.  
  90. void update_uservals (void);
  91.  
  92. #endif
  93.