~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/base/tile-private.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
19
19
#ifndef __TILE_PRIVATE_H__
20
20
#define __TILE_PRIVATE_H__
21
21
 
22
 
#include "config.h"
23
 
 
24
 
#ifdef USE_PTHREADS
25
 
#include <pthread.h>
26
 
#endif
27
 
 
28
22
#include <sys/types.h>
29
23
 
30
 
#include <glib.h>
31
 
 
 
24
#ifdef G_OS_WIN32
 
25
 
 
26
int gimp_win32_large_truncate (int    fd,
 
27
                               gint64 size);
 
28
 
 
29
#define LARGE_SEEK(f, o, w) _lseeki64 (f, o, w)
 
30
#define LARGE_TRUNCATE(f, s) gimp_win32_large_truncate (f, s)
 
31
 
 
32
#else
 
33
 
 
34
#define LARGE_SEEK(f, o, t) lseek (f, o, t)
 
35
#define LARGE_TRUNCATE(f, s) ftruncate (f, s)
 
36
 
 
37
#endif
32
38
 
33
39
typedef struct _TileLink TileLink;
34
40
 
37
43
  TileLink    *next;
38
44
  gint         tile_num; /* the number of this tile within the drawable */
39
45
  TileManager *tm;       /* A pointer to the tile manager for this tile.
40
 
                          *  We need this in order to call the tile managers
41
 
                          *  validate proc whenever the tile is referenced
42
 
                          *  yet invalid.
43
 
                          */
 
46
                          *  We need this in order to call the tile managers
 
47
                          *  validate proc whenever the tile is referenced
 
48
                          *  yet invalid.
 
49
                          */
44
50
};
45
51
 
46
52
struct _Tile
47
53
{
48
54
  gshort  ref_count;    /* reference count. when the reference count is
49
 
                         *  non-zero then the "data" for this tile must
50
 
                         *  be valid. when the reference count for a tile
51
 
                         *  is 0 then the "data" for this tile must be
52
 
                         *  NULL.
53
 
                         */
 
55
                          *  non-zero then the "data" for this tile must
 
56
                         *  be valid. when the reference count for a tile
 
57
                         *  is 0 then the "data" for this tile must be
 
58
                         *  NULL.
 
59
                         */
54
60
  gshort  write_count;  /* write count: number of references that are
55
61
                           for write access */
56
62
  gshort  share_count;  /* share count: number of tile managers that
61
67
  guchar  bpp;          /* the bytes per pixel (1, 2, 3 or 4) */
62
68
  gushort ewidth;       /* the effective width of the tile */
63
69
  gushort eheight;      /* the effective height of the tile
64
 
                         *  a tile's effective width and height may be smaller
65
 
                         *  (but not larger) than TILE_WIDTH and TILE_HEIGHT.
66
 
                         *  this is to handle edge tiles of a drawable.
67
 
                         */
 
70
                         *  a tile's effective width and height may be smaller
 
71
                         *  (but not larger) than TILE_WIDTH and TILE_HEIGHT.
 
72
                         *  this is to handle edge tiles of a drawable.
 
73
                         */
 
74
  gint    size;         /* size of the tile data (ewidth * eheight * bpp) */
68
75
 
69
76
  TileRowHint *rowhint; /* An array of hints for rendering purposes */
70
77
 
76
83
                         * for swapping. swap_num 1 is always the global
77
84
                         * swap file.
78
85
                         */
79
 
  off_t   swap_offset;  /* the offset within the swap file of the tile data.
80
 
                         * if the tile data is in memory this will be set
 
86
  gint64  swap_offset;  /* the offset within the swap file of the tile data.
 
87
                         * if the tile data is in memory this will be set
81
88
                         * to -1.
82
89
                         */
83
90
 
86
93
  Tile     *next;
87
94
  Tile     *prev;       /* List pointers for the tile cache lists */
88
95
  gpointer  listhead;   /* Pointer to the head of the list this tile is on */
89
 
 
90
 
#ifdef USE_PTHREADS
91
 
  pthread_mutex_t mutex;
92
 
#endif
93
96
};
94
97
 
95
98
 
96
 
#ifdef USE_PTHREADS
97
 
#define TILE_MUTEX_LOCK(tile)   pthread_mutex_lock(&((tile)->mutex))
98
 
#define TILE_MUTEX_UNLOCK(tile) pthread_mutex_unlock(&((tile)->mutex))
99
 
#else
100
 
#define TILE_MUTEX_LOCK(tile)   /* nothing */
101
 
#define TILE_MUTEX_UNLOCK(tile) /* nothing */
102
 
#endif
103
 
 
104
 
 
105
 
/*  an inlined version of tile_size()  */
106
 
static inline gint
107
 
tile_size_inline (Tile *tile)
108
 
{
109
 
  return tile->ewidth * tile->eheight * tile->bpp;
110
 
}
111
 
 
112
 
 
113
 
 
114
99
#endif /* __TILE_PRIVATE_H__ */