You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
1.6 KiB
102 lines
1.6 KiB
15 years ago
|
//-----------------------------------------------------------------------------
|
||
|
//
|
||
|
// kvm screensaver
|
||
|
//
|
||
|
|
||
|
#ifndef __KVM_H__
|
||
|
#define __KVM_H__
|
||
|
|
||
15 years ago
|
#include <tqtimer.h>
|
||
|
#include <tqptrlist.h>
|
||
15 years ago
|
|
||
|
#include <kdialogbase.h>
|
||
12 years ago
|
#include <tdescreensaver.h>
|
||
15 years ago
|
|
||
|
extern "C" {
|
||
|
#include "vm.h"
|
||
|
#include "vm_random.h"
|
||
|
}
|
||
|
|
||
|
#define THREAD_MAX_STACK_SIZE 10
|
||
|
#define MAX_THREADS_NUM 20
|
||
|
|
||
|
#define MAX_REFRESH_TIMEOUT 40
|
||
|
|
||
|
typedef struct {
|
||
15 years ago
|
TQWidget *w;
|
||
15 years ago
|
int grid_width, grid_height;
|
||
|
int grid_margin_x;
|
||
|
int grid_margin_y;
|
||
|
int char_width, char_height;
|
||
|
bool insert_top_p, insert_bottom_p;
|
||
|
int density;
|
||
|
struct tvm_pool* pool;
|
||
|
char* modified;
|
||
|
int show_threads;
|
||
|
|
||
15 years ago
|
TQPixmap images;
|
||
15 years ago
|
int image_width, image_height;
|
||
|
int nglyphs;
|
||
|
|
||
|
} m_state;
|
||
|
|
||
|
|
||
|
class kVmSaver : public KScreenSaver
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
kVmSaver( WId id );
|
||
|
virtual ~kVmSaver();
|
||
|
|
||
|
void setSpeed( int spd );
|
||
|
void setRefreshTimeout( const int refreshTimeout );
|
||
|
|
||
|
protected:
|
||
|
void blank();
|
||
|
void readSettings();
|
||
|
int getRandom( const int max_value );
|
||
|
void modifyArea( const int op );
|
||
|
|
||
|
protected slots:
|
||
|
void slotTimeout();
|
||
|
|
||
|
protected:
|
||
15 years ago
|
TQTimer timer;
|
||
15 years ago
|
int colorContext;
|
||
|
|
||
|
int speed;
|
||
|
m_state* pool_state;
|
||
|
int refreshStep;
|
||
|
int refreshTimeout;
|
||
|
};
|
||
|
|
||
|
|
||
|
class kVmSetup : public KDialogBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
15 years ago
|
kVmSetup( TQWidget *parent = NULL, const char *name = NULL );
|
||
15 years ago
|
~kVmSetup();
|
||
|
protected:
|
||
|
void readSettings();
|
||
|
|
||
|
private slots:
|
||
|
void slotSpeed( int );
|
||
|
void slotRefreshTimeout( int num );
|
||
|
void slotOk();
|
||
|
void slotHelp();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQWidget *preview;
|
||
15 years ago
|
kVmSaver *saver;
|
||
|
|
||
|
int speed;
|
||
|
int refreshTimeout;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|