home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / gap / gap_arr_dialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-03-03  |  5.5 KB  |  176 lines

  1. /* gap_arr_dialog.h
  2.  * 1998.May.23 hof (Wolfgang Hofer)
  3.  *
  4.  * GAP ... Gimp Animation Plugins (Standard array dialog)
  5.  *
  6.  * - p_array_dialog   Dialog Window with one or more rows
  7.  *                    each row can contain one of the following GAP widgets:
  8.  *                       - float pair widget
  9.  *                         (horizontal slidebar combined with a float input field)
  10.  *                       - int pair widget
  11.  *                         (horizontal slidebar combined with a int input field)
  12.  *                       - Toggle Button widget
  13.  *                       - Textentry widget
  14.  *                       - Float entry widget
  15.  *                       - Int entry widget
  16.  * - p_slider_dialog
  17.  *                         simplified call of p_pair_array_dialog,
  18.  *                         using an array with one WGT_INT_PAIR.
  19.  * - p_buttons_dialog
  20.  *
  21.  *
  22.  *
  23.  */
  24. /* The GIMP -- an image manipulation program
  25.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  26.  *
  27.  * This program is free software; you can redistribute it and/or modify
  28.  * it under the terms of the GNU General Public License as published by
  29.  * the Free Software Foundation; either version 2 of the License, or
  30.  * (at your option) any later version.
  31.  *
  32.  * This program is distributed in the hope that it will be useful,
  33.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  34.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  35.  * GNU General Public License for more details.
  36.  *
  37.  * You should have received a copy of the GNU General Public License
  38.  * along with this program; if not, write to the Free Software
  39.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  40.  */
  41.  
  42. /* revision history:
  43.  * gimp    1.1.17b; 2000/01/26  hof: 
  44.  * version 0.96.03; 1998/08/15  hof: p_arr_gtk_init 
  45.  * version 0.96.00; 1998/07/09  hof: 1.st release 
  46.  *                                   (re-implementation of gap_sld_dialog.c)
  47.  */
  48.  
  49. #ifndef _ARR_DIALOG_H
  50. #define _ARR_DIALOG_H
  51.  
  52. /* GIMP includes */
  53. #include "gtk/gtk.h"
  54. #include "libgimp/gimp.h"
  55.  
  56. typedef enum
  57. {
  58.    WGT_LABEL        
  59.   ,WGT_TEXT       
  60.   ,WGT_INT        
  61.   ,WGT_FLT        
  62.   ,WGT_TOGGLE     
  63.   ,WGT_RADIO      
  64.   ,WGT_OPTIONMENU      
  65.   ,WGT_FLT_PAIR   
  66.   ,WGT_INT_PAIR   
  67.   ,WGT_ACT_BUTTON 
  68.   ,WGT_FILESEL
  69.   ,WGT_LABEL_LEFT
  70.   ,WGT_LABEL_RIGHT
  71. } t_gap_widget;
  72.  
  73. typedef int (*t_action_func) ( gpointer action_data);
  74. /*
  75.  * - If one of the Args has set 'has_default' to TRUE
  76.  *   the action Area will contain an additional Button 'Default'
  77.  *
  78.  */
  79.  
  80. typedef struct {
  81.   t_gap_widget widget_type;
  82.  
  83.   /* common fields for all widget types */
  84.   char    *label_txt;
  85.   char    *help_txt;
  86.   gint     entry_width;  /* for all Widgets with  an entry */
  87.   gint     scale_width;  /* for the Widgets with a scale */
  88.   gint     constraint;   /* TRUE: check for min/max values */
  89.   gint     has_default;  /* TRUE: default value available */
  90.   
  91.   /* flt_ fileds are used for WGT_FLT and WGT_FLT_PAIR */
  92.   gint     flt_digits;    /* digits behind comma */
  93.   gdouble  flt_min;
  94.   gdouble  flt_max;
  95.   gdouble  flt_step;
  96.   gdouble  flt_default;
  97.   gdouble  flt_ret;
  98.   
  99.   /* int_ fileds are used for WGT_INT and WGT_INT_PAIR WGT_TOGGLE */
  100.   gint     int_min;
  101.   gint     int_max;
  102.   gint     int_step;
  103.   gint     int_default;
  104.   gint     int_ret;
  105.   gint     int_ret_lim;  /* for private (arr_dialog.c) use only */
  106.  
  107.   /* uncontraint lower /upper limit for WGT_FLT_PAIR and WGT_INT_PAIR */
  108.   gfloat   umin;
  109.   gfloat   umax;
  110.   gfloat   pagestep;
  111.  
  112.  
  113.   /* togg_ field are used for WGT_TOGGLE */
  114.   char    *togg_label;    /* extra label attached right to toggle button */
  115.    
  116.   /* radio_ fileds are used for WGT_RADIO and WGT_OPTIONMENU */
  117.   gint     radio_argc;
  118.   gint     radio_default;
  119.   gint     radio_ret;
  120.   char   **radio_argv;
  121.   char   **radio_help_argv;
  122.   
  123.   /* text_ fileds are used for WGT_TEXT */
  124.   gint     text_buf_len;         /* common length for init, default and ret text_buffers */
  125.   char    *text_buf_default;
  126.   char    *text_buf_ret;
  127.   GtkWidget  *text_filesel; /* for private (arr_dialog.c) use only */
  128.   GtkWidget  *text_entry;   /* for private (arr_dialog.c) use only */
  129.  
  130.   /* action_ fileds are used for WGT_ACT_BUTTON */
  131.   t_action_func action_functon;  
  132.   gpointer      action_data;  
  133.  
  134. } t_arr_arg;
  135.  
  136.  
  137. typedef struct {
  138.   char      *but_txt;
  139.   gint       but_val;
  140. } t_but_arg;
  141.  
  142. void     p_init_arr_arg  (t_arr_arg *arr_ptr,
  143.                           gint       widget_type);
  144.  
  145. gint     p_array_dialog  (char     *title_txt,
  146.                           char     *frame_txt,
  147.                           int       argc,
  148.                           t_arr_arg argv[]);
  149.  
  150. long     p_slider_dialog(char *title_txt,
  151.                          char *frame_txt,
  152.                          char *label_txt,
  153.                          char *tooltip_txt,
  154.                          long min, long max, long curr, long constraint);
  155.  
  156.  
  157.  
  158. gint     p_buttons_dialog (char *title_txt,
  159.                          char *frame_txt,
  160.                          int        b_argc,
  161.                          t_but_arg  b_argv[],
  162.                          gint       b_def_val);
  163.  
  164.  
  165. gint     p_array_std_dialog  (char     *title_txt,
  166.                           char     *frame_txt,
  167.                           int       argc,
  168.                           t_arr_arg argv[],
  169.                           int       b_argc,
  170.                           t_but_arg b_argv[],
  171.                           gint      b_def_val);
  172.                                
  173. gint     p_arr_gtk_init(gint flag);
  174.  
  175. #endif
  176.