home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / common / ps-pi-adapter.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-29  |  2.7 KB  |  103 lines

  1. /* Plug-in to interface to Adobe Photoshop (tm) compatible plug-ins.
  2.  *
  3.  * Copyright (C) 1999 Tor Lillqvist
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * This plug-in works only on Windows, but work is being done
  22.  * to make it work on Linux with the help of Winelib.
  23.  *
  24.  * To build this plug-in you will need the headers from the
  25.  * Photoshop SDK. The SDK is available from http://www.adobe.com.
  26.  */
  27.  
  28. /* Set to the level of debugging output you want, 0 for release */
  29. #define DEBUGLEVEL 3
  30.  
  31. #define IFDBG(level) if (DEBUGLEVEL >= level)
  32.  
  33. #include "config.h"
  34.  
  35. #include <stdio.h>
  36. #include <stdio.h>
  37. #include <string.h>
  38. #include <stdlib.h>
  39.  
  40. #include <PIGeneral.h>
  41. #include <PIAbout.h>
  42. #include <PIFilter.h>
  43. #include <PIUtilities.h>
  44. #include <WinUtilities.h>
  45.  
  46. #include <gtk/gtk.h>
  47. #include <libgimp/gimp.h>
  48.  
  49. #define RECT_EMPTY(r) ((r)->top == (r)->bottom || (r)->left == (r)->right)
  50.  
  51. static char *piplname = NULL;
  52. static char *pipltype = NULL;
  53.  
  54. static void
  55. query ()
  56. {
  57.   GParamDef *args;
  58.   GParam *return_vals;
  59.   gint nreturn_vals;
  60.  
  61.   /* Scan ps-plugin-path for plug-ins, check that they are valid, and
  62.    * install a corresponding PDB procedure.
  63.    */
  64.   return_vals = gimp_run_procedure ("gimp_gimprc_query", &nreturn_vals,
  65.                     PARAM_STRING, "ps-pi-path",
  66.                                     PARAM_END);
  67.   if(return_vals[0].data.d_status != STATUS_SUCCESS
  68.      || return_vals[1].data.d_string == NULL)
  69.     {
  70.       
  71. }
  72.  
  73. static void
  74. run (char    *name,
  75.      int      nparams,
  76.      GParam  *param,
  77.      int     *nreturn_vals,
  78.      GParam **return_vals)
  79. {
  80.   static GParam values[1];
  81.   GRunModeType run_mode;
  82.   GStatusType status = STATUS_SUCCESS;
  83.  
  84.   run_mode = param[0].data.d_int32;
  85.  
  86.   *return_vals = values;
  87.   *nreturn_vals = 1;
  88.   values[0].type = PARAM_STATUS;
  89.  
  90.   values[0].data.d_status = status;
  91. }
  92.  
  93. GPlugInInfo PLUG_IN_INFO =
  94. {
  95.   NULL,    /* init_proc */
  96.   NULL,    /* quit_proc */
  97.   query,   /* query_proc */
  98.   run,     /* run_proc */
  99. };
  100.  
  101. MAIN ()
  102.  
  103.