Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MyPty Class Reference

#include </home/clem/local/src/opie/core/apps/embeddedkonsole/MyPty.h>

Inheritance diagram for MyPty:

Inheritance graph
[legend]
Collaboration diagram for MyPty:

Collaboration graph
[legend]
List of all members.

Public Slots

void send_bytes (const char *s, int len)
void setSize (int lines, int columns)
void error ()
void start ()
int run (const char *pgm, QStrList &args, const char *term, int addutmp)
bool open ()
void close ()
void reload (const Profile &)
void setSize (int lines, int columns)
void error ()
bool isConnected ()
void send (const QByteArray &)

Signals

void done (int status)
void block_in (const char *s, int len)
void done (int status)
void received (const QByteArray &)

Public Member Functions

 MyPty ()
 ~MyPty ()
int run (const char *pgm, QStrList &args, const char *term, int addutmp)
void send_byte (char s)
const char * deviceName ()
 MyPty (const Profile &)
 ~MyPty ()
QString identifier () const
QString name () const
QBitArray supports () const

Protected Slots

void readPty ()
void donePty ()
void readPty ()
void donePty ()

Private Member Functions

int openPty ()
const char * deviceName ()
int openPty ()

Private Attributes

char ptynam [16]
char ttynam [16]
int fd
int cpid
char m_ptynam [16]
char m_ttynam [16]
int m_fd
int m_cpid
QSocketNotifier * m_sn_e
QSocketNotifier * m_sn_r
char * m_term
QString m_cmd
EnvironmentMap m_env

Constructor & Destructor Documentation

MyPty::MyPty  ) 
 

Create an instance.

Definition at line 235 of file MyPty.cpp.

References fd, and openPty().

MyPty::~MyPty  ) 
 

Destructor. Note that the related client program is not killed (yet) when a instance is deleted.

Definition at line 245 of file MyPty.cpp.

References donePty().

MyPty::MyPty const Profile prof  ) 
 

Create an instance.

Definition at line 239 of file MyPty.cpp.

References l, Profile::Linux, m_fd, m_sn_e, m_sn_r, m_term, openPty(), Profile::readNumEntry(), reload(), ProcCtl::self(), Profile::VT100, Profile::VT102, and Profile::XTerm.

MyPty::~MyPty  ) 
 


Member Function Documentation

void MyPty::block_in const char *  s,
int  len
[signal]
 

emitted when a new block of data comes in.

Parameters:
s - the data
len - the length of the block

Referenced by readPty().

void MyPty::close  )  [virtual, slot]
 

close the io

Implements IOLayer.

Definition at line 286 of file MyPty.cpp.

References donePty(), m_fd, and openPty().

Referenced by donePty(), openPty(), and run().

const char* MyPty::deviceName  )  [private]
 

const char * MyPty::deviceName  ) 
 

Definition at line 124 of file MyPty.cpp.

References ttynam.

void MyPty::done int  status  )  [signal]
 

emitted when the client program terminates.

Parameters:
status the wait(2) status code of the terminated client program.

void MyPty::done int  status  )  [signal]
 

emitted when the client program terminates.

Parameters:
status the wait(2) status code of the terminated client program.

Referenced by donePty().

void MyPty::donePty  )  [protected, slot]
 

void MyPty::donePty  )  [protected, slot]
 

Definition at line 108 of file MyPty.cpp.

References close(), cpid, done(), and fd.

Referenced by close(), error(), readPty(), run(), and ~MyPty().

void MyPty::error  )  [slot]
 

void MyPty::error  )  [slot]
 

Definition at line 130 of file MyPty.cpp.

References donePty().

Referenced by run().

QString MyPty::identifier  )  const [virtual]
 

a small internal identifier

Implements IOLayer.

Definition at line 273 of file MyPty.cpp.

References QString::fromLatin1().

Referenced by name().

bool MyPty::isConnected  )  [inline, virtual, slot]
 

Implements IOLayer.

Definition at line 62 of file MyPty.h.

QString MyPty::name  )  const [virtual]
 

a short name

Implements IOLayer.

Definition at line 276 of file MyPty.cpp.

References identifier().

Referenced by reload().

bool MyPty::open  )  [virtual, slot]
 

bool open

Implements IOLayer.

Definition at line 279 of file MyPty.cpp.

References m_fd, openPty(), and start().

Referenced by openPty(), and run().

int MyPty::openPty  )  [private]
 

int MyPty::openPty  )  [private]
 

Definition at line 198 of file MyPty.cpp.

References close(), open(), ptynam, qApp, and ttynam.

Referenced by close(), MyPty(), and open().

void MyPty::readPty  )  [protected, slot]
 

void MyPty::readPty  )  [protected, slot]
 

indicates that a block of data is received

Definition at line 267 of file MyPty.cpp.

References block_in(), buf, donePty(), fd, i, len, and printf.

Referenced by run().

void MyPty::received const QByteArray  )  [virtual, signal]
 

emitted when a new block of data comes in.

Parameters:
s - the data
len - the length of the block

Reimplemented from IOLayer.

void MyPty::reload const Profile  )  [virtual, slot]
 

closes and reloads the settings

Implements IOLayer.

Definition at line 290 of file MyPty.cpp.

References QMap< Key, T >::clear(), QFile::encodeName(), QFile::exists(), i, QMap< Key, T >::insert(), QString::isEmpty(), m_cmd, m_env, name(), QString::number(), Profile::readEntry(), Profile::readNumEntry(), and QString::stripWhiteSpace().

Referenced by MyPty().

int MyPty::run const char *  pgm,
QStrList args,
const char *  term,
int  addutmp
[slot]
 

int MyPty::run const char *  pgm,
QStrList args,
const char *  term,
int  addutmp
 

having a `run' separate from the constructor allows to make the necessary connections to the signals and slots of the instance before starting the execution of the client.

Definition at line 140 of file MyPty.cpp.

References close(), cpid, donePty(), error(), fd, QString::latin1(), open(), Opie::Core::perror(), readPty(), ttynam, and write().

Referenced by TESession::run(), and start().

void MyPty::send const QByteArray ar  )  [virtual, slot]
 

sends len bytes through the line

Implements IOLayer.

Definition at line 316 of file MyPty.cpp.

References i, m_fd, printf, and write().

void MyPty::send_byte char  s  ) 
 

void MyPty::send_bytes const char *  s,
int  len
[slot]
 

sends len bytes through the line

Definition at line 252 of file MyPty.cpp.

References fd, i, printf, and write().

void MyPty::setSize int  lines,
int  columns
[virtual, slot]
 

set the size needed for pty

Reimplemented from IOLayer.

void MyPty::setSize int  lines,
int  columns
[virtual, slot]
 

Informs the client program about the actual size of the window.

Reimplemented from IOLayer.

Definition at line 98 of file MyPty.cpp.

References fd.

Referenced by TESession::TESession().

void MyPty::start  )  [slot]
 

having a `run' separate from the constructor allows to make the necessary connections to the signals and slots of the instance before starting the execution of the client.

Definition at line 142 of file MyPty.cpp.

References QString::latin1(), m_cmd, and run().

Referenced by open().

QBitArray MyPty::supports  )  const [virtual]
 

What does the IOLayer support? Bits are related to features

Implements IOLayer.

Definition at line 357 of file MyPty.cpp.


Member Data Documentation

int MyPty::cpid [private]
 

Definition at line 85 of file MyPty.h.

Referenced by donePty(), and run().

int MyPty::fd [private]
 

Definition at line 84 of file MyPty.h.

Referenced by donePty(), MyPty(), readPty(), run(), send_bytes(), and setSize().

QString MyPty::m_cmd [private]
 

Definition at line 102 of file MyPty.h.

Referenced by reload(), and start().

int MyPty::m_cpid [private]
 

Definition at line 97 of file MyPty.h.

EnvironmentMap MyPty::m_env [private]
 

Definition at line 103 of file MyPty.h.

Referenced by reload().

int MyPty::m_fd [private]
 

Definition at line 96 of file MyPty.h.

Referenced by close(), MyPty(), open(), and send().

char MyPty::m_ptynam[16] [private]
 

Definition at line 94 of file MyPty.h.

QSocketNotifier* MyPty::m_sn_e [private]
 

Definition at line 98 of file MyPty.h.

Referenced by MyPty().

QSocketNotifier* MyPty::m_sn_r [private]
 

Definition at line 99 of file MyPty.h.

Referenced by MyPty().

char* MyPty::m_term [private]
 

Definition at line 100 of file MyPty.h.

Referenced by MyPty().

char MyPty::m_ttynam[16] [private]
 

Definition at line 95 of file MyPty.h.

char MyPty::ptynam[16] [private]
 

Definition at line 82 of file MyPty.h.

Referenced by openPty().

char MyPty::ttynam[16] [private]
 

Definition at line 83 of file MyPty.h.

Referenced by deviceName(), openPty(), and run().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:41:02 2005 for OPIE by  doxygen 1.4.2