Qt 4.8
Public Functions | Public Variables | List of all members
QLinuxFbIntegrationPrivate Class Reference

Public Functions

void closeTty ()
 
void openTty ()
 
 QLinuxFbIntegrationPrivate ()
 
 ~QLinuxFbIntegrationPrivate ()
 

Public Variables

bool blank
 
QString displaySpec
 
bool doGraphicsMode
 
int fd
 
long oldKdMode
 
int startupd
 
int startuph
 
int startupw
 
QString ttyDevice
 
int ttyfd
 

Detailed Description

Definition at line 73 of file qlinuxfbintegration.cpp.

Constructors and Destructors

◆ QLinuxFbIntegrationPrivate()

QLinuxFbIntegrationPrivate::QLinuxFbIntegrationPrivate ( )

Definition at line 98 of file qlinuxfbintegration.cpp.

99  : fd(-1), blank(true), doGraphicsMode(true),
100 #ifdef QT_QWS_DEPTH_GENERIC
101  doGenericColors(false),
102 #endif
103  ttyfd(-1), oldKdMode(KD_TEXT)
104 {
105 }

◆ ~QLinuxFbIntegrationPrivate()

QLinuxFbIntegrationPrivate::~QLinuxFbIntegrationPrivate ( )

Definition at line 107 of file qlinuxfbintegration.cpp.

108 {
109  closeTty();
110 }

Functions

◆ closeTty()

void QLinuxFbIntegrationPrivate::closeTty ( )

Definition at line 143 of file qlinuxfbintegration.cpp.

Referenced by ~QLinuxFbIntegrationPrivate().

144 {
145  if (ttyfd == -1)
146  return;
147 
148  if (doGraphicsMode)
149  ioctl(ttyfd, KDSETMODE, oldKdMode);
150 
151  // Blankin' screen, blinkin' cursor!
152  const char termctl[] = "\033[9;15]\033[?33h\033[?25h\033[?0c";
153  QT_WRITE(ttyfd, termctl, sizeof(termctl));
154 
155  QT_CLOSE(ttyfd);
156  ttyfd = -1;
157 }
#define QT_WRITE
Definition: qcore_unix_p.h:289
#define QT_CLOSE
Definition: qcore_unix_p.h:304

◆ openTty()

void QLinuxFbIntegrationPrivate::openTty ( )

Definition at line 112 of file qlinuxfbintegration.cpp.

Referenced by QLinuxFbIntegration::initDevice().

113 {
114  const char *const devs[] = {"/dev/tty0", "/dev/tty", "/dev/console", 0};
115 
116  if (ttyDevice.isEmpty()) {
117  for (const char * const *dev = devs; *dev; ++dev) {
118  ttyfd = QT_OPEN(*dev, O_RDWR);
119  if (ttyfd != -1)
120  break;
121  }
122  } else {
124  }
125 
126  if (ttyfd == -1)
127  return;
128 
129  if (doGraphicsMode) {
130  ioctl(ttyfd, KDGETMODE, &oldKdMode);
131  if (oldKdMode != KD_GRAPHICS) {
132  int ret = ioctl(ttyfd, KDSETMODE, KD_GRAPHICS);
133  if (ret == -1)
134  doGraphicsMode = false;
135  }
136  }
137 
138  // No blankin' screen, no blinkin' cursor!, no cursor!
139  const char termctl[] = "\033[9;0]\033[?33l\033[?25l\033[?1c";
140  QT_WRITE(ttyfd, termctl, sizeof(termctl));
141 }
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
#define QT_OPEN
Definition: qcore_unix_p.h:186
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4014
#define QT_WRITE
Definition: qcore_unix_p.h:289
#define O_RDWR

Properties

◆ blank

bool QLinuxFbIntegrationPrivate::blank

Definition at line 86 of file qlinuxfbintegration.cpp.

Referenced by QLinuxFbIntegration::blank().

◆ displaySpec

QString QLinuxFbIntegrationPrivate::displaySpec

Definition at line 95 of file qlinuxfbintegration.cpp.

◆ doGraphicsMode

bool QLinuxFbIntegrationPrivate::doGraphicsMode

Definition at line 88 of file qlinuxfbintegration.cpp.

Referenced by closeTty(), QLinuxFbIntegration::connect(), and openTty().

◆ fd

int QLinuxFbIntegrationPrivate::fd

◆ oldKdMode

long QLinuxFbIntegrationPrivate::oldKdMode

Definition at line 93 of file qlinuxfbintegration.cpp.

Referenced by closeTty(), and openTty().

◆ startupd

int QLinuxFbIntegrationPrivate::startupd

Definition at line 85 of file qlinuxfbintegration.cpp.

Referenced by QLinuxFbIntegration::initDevice().

◆ startuph

int QLinuxFbIntegrationPrivate::startuph

Definition at line 84 of file qlinuxfbintegration.cpp.

Referenced by QLinuxFbIntegration::initDevice().

◆ startupw

int QLinuxFbIntegrationPrivate::startupw

Definition at line 83 of file qlinuxfbintegration.cpp.

Referenced by QLinuxFbIntegration::initDevice().

◆ ttyDevice

QString QLinuxFbIntegrationPrivate::ttyDevice

Definition at line 94 of file qlinuxfbintegration.cpp.

Referenced by QLinuxFbIntegration::connect(), and openTty().

◆ ttyfd

int QLinuxFbIntegrationPrivate::ttyfd

Definition at line 92 of file qlinuxfbintegration.cpp.

Referenced by closeTty(), and openTty().


The documentation for this class was generated from the following file: