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_lib.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-10  |  5.4 KB  |  149 lines

  1. /* gap_lib.h
  2.  * 1997.11.01 hof (Wolfgang Hofer)
  3.  *
  4.  * GAP ... Gimp Animation Plugins
  5.  *
  6.  * basic anim functions
  7.  *
  8.  */
  9. /* The GIMP -- an image manipulation program
  10.  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version.
  16.  *
  17.  * This program is distributed in the hope that it will be useful,
  18.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  * GNU General Public License for more details.
  21.  *
  22.  * You should have received a copy of the GNU General Public License
  23.  * along with this program; if not, write to the Free Software
  24.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  25.  */
  26.  
  27. /* revision history:
  28.  * 1.1.29a; 2000/11/23   hof: gap locking (changed to procedures and placed here)
  29.  * 1.1.20a; 2000/04/25   hof: new: p_get_video_paste_name p_clear_video_paste
  30.  * 1.1.14a; 2000/01/02   hof: new: p_get_frame_nr
  31.  * 1.1.8a;  1999/08/31   hof: new: p_strdup_del_underscore and p_strdup_add_underscore
  32.  * 0.99.00; 1999/03/15   hof: prepared for win/dos filename conventions
  33.  * 0.96.02; 1998/08/05   hof: extended gap_dup (duplicate range instead of singele frame)
  34.  *                            added gap_shift (framesequence shift)
  35.  * 0.96.00; 1998/06/27   hof: added gap animation sizechange plugins
  36.  *                            (moved range_ops to seperate .h file)
  37.  * 0.94.01; 1998/04/27   hof: added flatten_mode to plugin: gap_range_to_multilayer
  38.  * 0.90.00;              hof: 1.st (pre) release
  39.  */
  40.  
  41. #ifndef _GAP_LIB_H
  42. #define _GAP_LIB_H
  43.  
  44. #include "libgimp/gimp.h"
  45.  
  46. /* G_DIR_SEPARATOR (is defined in glib.h if you have glib-1.2.0 or later) */
  47. #ifdef G_OS_WIN32
  48.  
  49. /* Filenames in WIN/DOS Style */
  50. #ifndef G_DIR_SEPARATOR
  51. #define G_DIR_SEPARATOR '\\'
  52. #endif
  53. #define DIR_ROOT ':'
  54.  
  55. #else  /* !G_OS_WIN32 */
  56.  
  57. /* Filenames in UNIX Style */
  58. #ifndef G_DIR_SEPARATOR
  59. #define G_DIR_SEPARATOR '/'
  60. #endif
  61. #define DIR_ROOT '/'
  62.  
  63. #endif /* !G_OS_WIN32 */
  64.  
  65. typedef struct
  66. {
  67.     char   key[50];
  68.     long   lock;        /* 0 ... NOT Locked, 1 ... locked */
  69.     gint32 image_id;
  70.     gint32 pid;
  71. } t_gap_lockdata;
  72.  
  73. typedef struct t_anim_info {
  74.    gint32      image_id;
  75.    char        *basename;    /* may include path */
  76.    long         frame_nr; 
  77.    char        *extension;
  78.    char        *new_filename;
  79.    char        *old_filename;
  80.    GimpRunModeType run_mode;
  81.    long         width;       
  82.    long         height;      
  83.    long         type;    
  84.    long         frame_cnt;   
  85.    long         curr_frame_nr; 
  86.    long         first_frame_nr; 
  87.    long         last_frame_nr;
  88. } t_anim_info;
  89.  
  90. /* procedures used in other gap*.c files */
  91. int          p_file_exists(char *fname);
  92. int          p_file_copy(char *fname, char *fname_copy);
  93. void         p_free_ainfo(t_anim_info **ainfo);
  94. char*        p_alloc_basename(char *imagename, long *number);
  95. char*        p_alloc_extension(char *imagename);
  96. t_anim_info* p_alloc_ainfo(gint32 image_id, GimpRunModeType run_mode);
  97. int          p_dir_ainfo(t_anim_info *ainfo_ptr);
  98. int          p_chk_framerange(t_anim_info *ainfo_ptr);
  99. int          p_chk_framechange(t_anim_info *ainfo_ptr);
  100.  
  101. int    p_save_named_frame (gint32 image_id, char *sav_name);
  102. int    p_load_named_frame (gint32 image_id, char *lod_name);
  103. gint32 p_load_image (char *lod_name);
  104. gint32 p_save_named_image(gint32 image_id, char *sav_name, GimpRunModeType run_mode);
  105. char*  p_alloc_fname(char *basename, long nr, char *extension);
  106. char*  p_gzip (char *orig_name, char *new_name, char *zip);
  107. char*  p_strdup_add_underscore(char *name);
  108. char*  p_strdup_del_underscore(char *name);
  109.  
  110. long  p_get_frame_nr(gint32 image_id);
  111. long  p_get_frame_nr_from_name(char *fname);
  112. char *p_alloc_fname_thumbnail(char *name);
  113. int   p_image_file_copy(char *fname, char *fname_copy);
  114.  
  115. /* animation menu fuctions provided by gap_lib.c */
  116.  
  117. int gap_next(GimpRunModeType run_mode, gint32 image_id);
  118. int gap_prev(GimpRunModeType run_mode, gint32 image_id);
  119. int gap_first(GimpRunModeType run_mode, gint32 image_id);
  120. int gap_last(GimpRunModeType run_mode, gint32 image_id);
  121. int gap_goto(GimpRunModeType run_mode, gint32 image_id, int nr);
  122.  
  123. int gap_dup(GimpRunModeType run_mode, gint32 image_id, int nr, long range_from, long range_to);
  124. int gap_del(GimpRunModeType run_mode, gint32 image_id, int nr);
  125. int gap_exchg(GimpRunModeType run_mode, gint32 image_id, int nr);
  126. int gap_shift(GimpRunModeType run_mode, gint32 image_id, int nr, long range_from, long range_to);
  127.  
  128. void p_msg_win(GimpRunModeType run_mode, char *msg);
  129. gchar *p_get_video_paste_name(void);
  130. gint32 p_vid_edit_clear(void);
  131. gint32 p_vid_edit_framecount(void);
  132. gint   gap_vid_edit_copy(GimpRunModeType run_mode, gint32 image_id, long range_from, long range_to);
  133. gint   gap_vid_edit_paste(GimpRunModeType run_mode, gint32 image_id, long paste_mode);
  134. gint32 p_getpid(void);
  135. gint   p_pid_is_alive(gint32 pid);
  136.  
  137. gint   p_gap_lock_is_locked(gint32 image_id, GimpRunModeType run_mode);
  138. void   p_gap_lock_set(gint32 image_id);
  139. void   p_gap_lock_remove(gint32 image_id);
  140.  
  141.  
  142. #define  VID_PASTE_REPLACE         0
  143. #define  VID_PASTE_INSERT_BEFORE   1
  144. #define  VID_PASTE_INSERT_AFTER    2
  145.  
  146. #endif
  147.  
  148.  
  149.