~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/util/render/x11/imageDGAFull.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  xfree 4.0 dga fullscreen mode
 
3
  Copyright (C) 2000  Martin Vogt, Christian Gerlach
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#ifndef __IMAGEDGAFULL_H
 
15
#define __IMAGEDGAFULL_H
 
16
#include "xinit.h"
 
17
 
 
18
#include "../imageBase.h"
 
19
 
 
20
 
 
21
 
 
22
 
 
23
#include <iostream.h>
 
24
#include <stdio.h>
 
25
#include <unistd.h>
 
26
#include <limits.h>
 
27
#include <sys/types.h>
 
28
 
 
29
 
 
30
 
 
31
 
 
32
#define DGA_MINMAJOR 2
 
33
#define DGA_MINMINOR 0
 
34
 
 
35
 
 
36
 
 
37
 
 
38
/**
 
39
   
 
40
   Displays and renders X11 images in software with the help
 
41
   of the ditherWrapper class. It switches to xfree 4.0 dga 2.0
 
42
   and needs root priviliges for that
 
43
   
 
44
*/
 
45
 
 
46
 
 
47
class ImageDGAFull : public ImageBase {
 
48
 
 
49
 
 
50
  XWindow* m_pxWindow;
 
51
 
 
52
  // DGA status
 
53
  int m_iMajorVersion;
 
54
  int m_iMinorVersion;
 
55
  int m_iEventBase;
 
56
  int m_iErrorBase;
 
57
  
 
58
  int m_iScreen;
 
59
  
 
60
  Display    *m_pDisplay;
 
61
  
 
62
  int         m_iNumberModes;
 
63
 
 
64
#ifdef X11_DGA2
 
65
  XDGAMode   *m_pDGAModes;
 
66
  XDGADevice *m_pDevice;
 
67
#endif
 
68
  
 
69
  int         m_iScreenWidth;
 
70
  int         m_iScreenHeight;
 
71
  
 
72
  char       *m_pAddr;            // Base address of the screen
 
73
  
 
74
  // DGA parameter
 
75
  int  m_iVideoWidth;
 
76
  int  m_iVideoHeight;
 
77
  
 
78
  int   m_iBytesPerLine;
 
79
  int   m_iBytesPerRow;           // Size of one image line
 
80
  int   m_iBytesPerPixel;
 
81
  int   m_iOffsetScreen;
 
82
  int   m_iOffsetLine;
 
83
  char *m_pStartAddr;             // Start address for a centered image
 
84
  
 
85
  int  m_iImageMode;
 
86
  int  m_iMode;
 
87
  bool m_bZoom;
 
88
  bool m_bAllowZoom;
 
89
 
 
90
  bool m_bIsActive;
 
91
 
 
92
  int lSupport;
 
93
  DitherWrapper* ditherWrapper;
 
94
 
 
95
 
 
96
 public:
 
97
  ImageDGAFull();
 
98
  ~ImageDGAFull();
 
99
 
 
100
  void init(XWindow *xWindow, YUVPicture* pic = NULL);
 
101
 
 
102
  int support();
 
103
 
 
104
  int openImage(int mode);
 
105
  int closeImage();
 
106
 
 
107
  void ditherImage(YUVPicture* pic);
 
108
  void putImage();
 
109
 
 
110
  int active() { return m_bIsActive; }
 
111
 
 
112
 private:
 
113
  
 
114
  // Tries to find a fullscreen-mode which matches the resolution best
 
115
  int findMode(int width, int height, int bpp);
 
116
 
 
117
  // Returns TRUE if an event is waiting
 
118
  int event();
 
119
 
 
120
  // Returns the start address of the upper left corner of the video frame
 
121
  unsigned char *address();
 
122
  
 
123
  // Number of bytes from the end of a row to the beginning of next one
 
124
  int  offset();
 
125
 
 
126
  // Disables DGA-View (performs a mode-switch if neccesary)
 
127
  void stop();
 
128
 
 
129
 
 
130
 
 
131
};
 
132
 
 
133
#endif