home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.sepub/pictures / 2014.11.ftp.sunet.se-pictures.tar / ftp.sunet.se / pub / pictures / ACiD-artpacks / programs / unix / editors / gimp-plugins-unstable-0_99_23_tar.gz / gimp-plugins-unstable-0_99_23_tar / gimp-plugins-unstable-0.99.23 / gimple / gimple.c < prev    next >
C/C++ Source or Header  |  1998-02-26  |  2KB  |  85 lines

  1. /* Gimple - Gimp in Guile
  2.  * Copyright (C) 1998 Lauri Alanko <la@iki.fi>
  3.  *
  4.  * This program is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU General Public License
  6.  * as published by the Free Software Foundation; either version 2
  7.  * of the License, or (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  17.  */
  18.  
  19. #include "gimple.h"
  20.  
  21. static void query (void);
  22. static void run    (char    *name, 
  23.          int      nparams, 
  24.          GParam  *param, 
  25.          int     *nreturn_vals, 
  26.          GParam **return_vals);
  27. static void gimple_main (void* closure, int argc, char** argv);
  28.  
  29. GPlugInInfo PLUG_IN_INFO = 
  30. {
  31.     NULL,                    /* init_proc */
  32.     NULL,                    /* quit_proc */
  33.     query,                /* query_proc */
  34.     run,                    /* init_proc */
  35. };
  36.  
  37. MAIN ();
  38.  
  39. static void
  40. query (){
  41.     gimp_install_procedure ("extension_gimple",
  42.                 "A Guile (Scheme) interpreter for scripting "
  43.                 "GIMP operations",
  44.                 "",
  45.                 "Lauri Alanko & Scott Goehring",
  46.                 "Lauri Alanko & Scott Goehring",
  47.                 "1997-1998",
  48.                 NULL,
  49.                 NULL,
  50.                 PROC_EXTENSION,
  51.                 0,0,
  52.                 NULL,NULL);
  53. }
  54.  
  55. static void
  56. run (char    *name,
  57.      int      nparams,
  58.      GParam  *param,
  59.      int     *nreturn_vals,
  60.      GParam **return_vals){
  61.     /*  Init the interpreter  */
  62.     gh_enter(0, NULL, gimple_main);
  63. }
  64.  
  65. static void
  66. gimple_main (void* closure, 
  67.          int argc, 
  68.          char** argv){
  69.     int n;
  70.     char *name="gimple";
  71.     
  72.     GParam* vals=gimp_run_procedure ("gimp_gimprc_query",
  73.                      &n,
  74.                      PARAM_STRING, "gimple-startup-command",
  75.                      PARAM_END);
  76.     if(vals[0].data.d_status!=STATUS_SUCCESS)
  77.         return;
  78.     gimple_gparam_init();
  79.     gimple_pdb_init();
  80.     scm_compile_shell_switches(1, &name);
  81.     scm_eval_0str(vals[1].data.d_string);
  82. }
  83.  
  84.  
  85.