home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / libgimp / gimpdisplay_pdb.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-25  |  3.3 KB  |  120 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpdisplay_pdb.c
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. /* NOTE: This file is autogenerated by pdbgen.pl */
  23.  
  24. #include "gimp.h"
  25.  
  26. /**
  27.  * gimp_display_new:
  28.  * @image_ID: The image.
  29.  *
  30.  * Create a new display for the specified image.
  31.  *
  32.  * Creates a new display for the specified image. If the image already
  33.  * has a display, another is added. Multiple displays are handled
  34.  * transparently by the GIMP. The newly created display is returned and
  35.  * can be subsequently destroyed with a call to 'gimp-display-delete'.
  36.  * This procedure only makes sense for use with the GIMP UI.
  37.  *
  38.  * Returns: The new display.
  39.  */
  40. gint32
  41. gimp_display_new (gint32 image_ID)
  42. {
  43.   GimpParam *return_vals;
  44.   gint nreturn_vals;
  45.   gint32 display_ID = -1;
  46.  
  47.   return_vals = gimp_run_procedure ("gimp_display_new",
  48.                     &nreturn_vals,
  49.                     GIMP_PDB_IMAGE, image_ID,
  50.                     GIMP_PDB_END);
  51.  
  52.   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  53.     display_ID = return_vals[1].data.d_display;
  54.  
  55.   gimp_destroy_params (return_vals, nreturn_vals);
  56.  
  57.   return display_ID;
  58. }
  59.  
  60. /**
  61.  * gimp_display_delete:
  62.  * @display_ID: The display to delete.
  63.  *
  64.  * Delete the specified display.
  65.  *
  66.  * This procedure removes the specified display. If this is the last
  67.  * remaining display for the underlying image, then the image is
  68.  * deleted also.
  69.  *
  70.  * Returns: TRUE on success.
  71.  */
  72. gboolean
  73. gimp_display_delete (gint32 display_ID)
  74. {
  75.   GimpParam *return_vals;
  76.   gint nreturn_vals;
  77.   gboolean success = TRUE;
  78.  
  79.   return_vals = gimp_run_procedure ("gimp_display_delete",
  80.                     &nreturn_vals,
  81.                     GIMP_PDB_DISPLAY, display_ID,
  82.                     GIMP_PDB_END);
  83.  
  84.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  85.  
  86.   gimp_destroy_params (return_vals, nreturn_vals);
  87.  
  88.   return success;
  89. }
  90.  
  91. /**
  92.  * gimp_displays_flush:
  93.  *
  94.  * Flush all internal changes to the user interface
  95.  *
  96.  * This procedure takes no arguments and returns nothing except a
  97.  * success status. Its purpose is to flush all pending updates of image
  98.  * manipulations to the user interface. It should be called whenever
  99.  * appropriate.
  100.  *
  101.  * Returns: TRUE on success.
  102.  */
  103. gboolean
  104. gimp_displays_flush (void)
  105. {
  106.   GimpParam *return_vals;
  107.   gint nreturn_vals;
  108.   gboolean success = TRUE;
  109.  
  110.   return_vals = gimp_run_procedure ("gimp_displays_flush",
  111.                     &nreturn_vals,
  112.                     GIMP_PDB_END);
  113.  
  114.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  115.  
  116.   gimp_destroy_params (return_vals, nreturn_vals);
  117.  
  118.   return success;
  119. }
  120.