File: display.h

package info (click to toggle)
oleo 1.6-16
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,640 kB
  • ctags: 3,139
  • sloc: ansic: 39,221; yacc: 1,737; sh: 362; makefile: 88
file content (111 lines) | stat: -rw-r--r-- 3,461 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef DISPLAYH
#define DISPLAYH

/*	Copyright (C) 1992, 1993 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software; see the file COPYING.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
/*  t. lord	Sat Oct  3 16:08:21 1992	*/

#include "global.h"
#include "font.h"
#include "cell.h"
#include "ir.h"

union cell_numeric
{
  int integer;
  double dbl;
};

struct cell_display
{
  CELLREF r, c;
  int cell_type;
  int justification;
  struct font_memo *font;

  char *unclipped;
  struct xx_sIntRectangle goal;

  char *clipped;		/* Box of clipped string, if known. */
  struct xx_sIntRectangle clip;
  union cell_numeric numeric;	/* Value from which to compute clipped str. */


  struct xx_sIntRectangle layout;	/* Space available under current layout. */

  struct cell_display *used_by;
  struct cell_display *was_used_by;
  struct cell_display *next_damaged;
};

struct display;
/* This should set the w_goal and h_goal fields of the cell_display. */
typedef void (*cell_display_metric) (struct cell_display *,
				     struct display *);

struct display
{
  struct rng range;
  int *widths;
  int *heights;
  int *rowy;
  int *colx;
  void *vdata;
  cell_display_metric metric;
  struct cell_display *cells;
  struct cell_display *damaged;	/* This is a list, terminated by a pointer */
			        /* to this structure rather than 0, */
			        /* following the next_damage chain. */
};

#if PROTOTYPES
extern void free_display (struct display *);
extern void build_display (struct display *, struct rng *,
			   cell_display_metric, void *);
extern void build_unscaled_display (struct display *, struct rng *,
				    cell_display_metric, void *);
extern void display_test_cmd (struct rng *);
extern struct cell_display *cell_display_of (struct display *dpy,
					     CELLREF r, CELLREF c);
extern void display_range (struct rng *, struct display *dpy,
			   int x, int y, int w, int h);
extern void record_display_damage (struct display *,
				   int x, int y, int w, int h);
extern void layout (struct display *);
extern int pr_display_cell (struct display *, CELLREF, CELLREF, CELL *);
#else
extern void free_display ();
extern void build_display ();
extern void build_unscaled_display ();
extern void display_test_cmd ();
extern struct cell_display *cell_display_of ();
extern void display_range ();
extern void record_display_damage ();
extern void layout ();
extern int pr_display_cell ();
#endif

#define display_width(DPY) \
     ((DPY)->colx[(DPY)->range.hc - (DPY)->range.lc] \
      + (DPY)->widths[(DPY)->range.hc - (DPY)->range.lc])
#define display_height(DPY) \
     ((DPY)->rowy[(DPY)->range.hr - (DPY)->range.lr] \
      + (DPY)->heights[(DPY)->range.hr - (DPY)->range.lr])
#define dpy_cols(DPY) ((DPY)->range.hc - (DPY)->range.lc)
#define dpy_aref(DPY,R,C) \
   ((DPY)->cells + (((R) - (DPY)->range.lr) * dpy_cols(DPY)) \
    + ((C) - (DPY)->range.lc))
#endif