summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/util/render/x11/x11Surface.h
blob: 54a6582d123402c5f6cadb0df4e345cbc89c8dc4 (plain)
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
/*
  surface wrapper for X11 Window
  Copyright (C) 2000  Martin Vogt

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Library General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */


#ifndef __X11SURFACE_H
#define __X11SURFACE_H

#include <limits.h>
#include "xinit.h"
#include "../surface.h"
#include "initDisplay.h"
#include "../dither/ditherWrapper.h"
#include "imageDeskX11.h"
#include "imageDGAFull.h"
#include "imageXVDesk.h"



class X11Surface : public Surface {

  int lOpen;
  int imageMode;
  
  XWindow* xWindow;

  ImageBase** imageList;
  int         images;
  
  ImageBase* imageCurrent;

  Atom WM_DELETE_WINDOW;
  Atom WM_RESIZE_WINDOW;
  int lXVAllow;

 public:
  X11Surface();
  ~X11Surface();

  int isOpen();
  int open(int width, int height,const char *title, bool border = false);
  int close();
  int getHeight();
  int getWidth();
  int getDepth();
  int getImageMode();
  int x11WindowId();
  
  ImageBase *findImage(int mode);
	  
  // these functions grant access to the supported images. be careful when changing
  // entries, because these are no copies. they are the original values!
  ImageBase **getModes();
  void setModes(ImageBase **modes);

  int openImage(int mode, YUVPicture* pic = NULL);
  int closeImage();
  int dither(YUVPicture* pic);
  int putImage(YUVPicture* pic);

  int checkEvent(int* mode);
  
  void config(const char* key, 
	      const char* value,void* user_data);


 private:
  int initX11();
  bool m_windowIdAvailable;
};
#endif