~ubuntu-branches/ubuntu/wily/mupen64plus/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/correct_security_printf.patch/opengl/osd.h

  • Committer: Bazaar Package Importer
  • Author(s): Sven Eckelmann
  • Date: 2011-02-06 11:57:54 UTC
  • mfrom: (10.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110206115754-t3abbdfr1q3brszp
Tags: 1.5+dfsg1-15
* Upload to unstable
* Updated my maintainer e-mail address
* debian/patches:
  - Add inline_header.patch, Move inline list_empty to header to make it
    inlineable
* Keep dependencies on separate lines in debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
 *   Mupen64plus - osd.h                                                   *
 
3
 *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
 
4
 *   Copyright (C) 2008 Nmn, Ebenblues                                     *
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 *   This program 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         *
 
14
 *   GNU General Public License for more details.                          *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU General Public License     *
 
17
 *   along with this program; if not, write to the                         *
 
18
 *   Free Software Foundation, Inc.,                                       *
 
19
 *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
 
20
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
21
 
 
22
#ifndef __OSD_H__
 
23
#define __OSD_H__
 
24
 
 
25
/******************************************************************
 
26
   osd_corner
 
27
   0    1    2 |
 
28
    \ __|__/   | Offset always effects the same:
 
29
     |     |   |  +X = Leftward   +Y = Upward
 
30
   3-|  4  |-5 |  With no offset, the text will touch the border.
 
31
     |_____|   |
 
32
    /   |   \  |
 
33
   6    7    8 |
 
34
*******************************************************************/
 
35
enum osd_corner {
 
36
    OSD_TOP_LEFT,       // 0 in the picture above
 
37
    OSD_TOP_CENTER,     // 1 in the picture above
 
38
    OSD_TOP_RIGHT,      // 2 in the picture above
 
39
 
 
40
    OSD_MIDDLE_LEFT,    // 3 in the picture above
 
41
    OSD_MIDDLE_CENTER,  // 4 in the picture above
 
42
    OSD_MIDDLE_RIGHT,   // 5 in the picture above
 
43
 
 
44
    OSD_BOTTOM_LEFT,    // 6 in the picture above
 
45
    OSD_BOTTOM_CENTER,  // 7 in the picture above
 
46
    OSD_BOTTOM_RIGHT,   // 8 in the picture above
 
47
 
 
48
    OSD_NUM_CORNERS
 
49
};
 
50
 
 
51
enum osd_message_state {
 
52
    OSD_APPEAR,     // OSD message is appearing on the screen
 
53
    OSD_DISPLAY,    // OSD message is being displayed on the screen
 
54
    OSD_DISAPPEAR,  // OSD message is disappearing from the screen
 
55
 
 
56
    OSD_NUM_STATES
 
57
};
 
58
 
 
59
enum osd_animation_type {
 
60
    OSD_NONE,
 
61
    OSD_FADE,
 
62
 
 
63
    OSD_NUM_ANIM_TYPES
 
64
};
 
65
 
 
66
typedef struct {
 
67
    char *text;        // Text that this object will have when displayed
 
68
    enum osd_corner corner; // One of the 9 corners
 
69
    float xoffset;     // Relative X position
 
70
    float yoffset;     // Relative Y position
 
71
    float color[3];    // Red, Green, Blue values
 
72
    float sizebox[4];  // bounding box (xmin, ymin, xmax, ymax)
 
73
    int state;         // display state of current message
 
74
    enum osd_animation_type animation[OSD_NUM_STATES]; // animations for each display state
 
75
    unsigned int timeout[OSD_NUM_STATES]; // timeouts for each display state
 
76
#define OSD_INFINITE_TIMEOUT 0xffffffff
 
77
    unsigned int frames; // number of frames in this state
 
78
} osd_message_t;
 
79
 
 
80
enum { R, G, B }; // for referencing color array
 
81
 
 
82
#ifdef __cplusplus
 
83
extern "C" {
 
84
#endif
 
85
 
 
86
void osd_init(int width, int height);
 
87
void osd_exit(void);
 
88
void osd_render();
 
89
osd_message_t * osd_new_message(enum osd_corner, const char *, ...);
 
90
void osd_update_message(osd_message_t *, const char *, ...);
 
91
void osd_delete_message(osd_message_t *);
 
92
void osd_message_set_corner(osd_message_t *, enum osd_corner);
 
93
void osd_message_set_static(osd_message_t *);
 
94
osd_message_t * osd_message_valid(osd_message_t *);
 
95
 
 
96
#ifdef __cplusplus
 
97
}
 
98
#endif
 
99
 
 
100
#endif // __OSD_H__
 
101