signals.h

Go to the documentation of this file.
00001 
00015 #ifndef SIGNALS_H
00016 #define SIGNALS_H
00017 
00018 
00022 /*
00023 struct SMPSignal{
00024     enum type{
00025         default_signal,
00026         other_signal
00027         // to be added
00028     }; 
00029 
00030     uint32_t data; // 4 bytes of data
00031     
00032     uint8_t ref_count;
00033     uint8_t dest_port; // 1 bytes 
00034 // / *    
00035     pthread_mutex_t mutex;
00036 
00037     SMPSignal(){
00038         pthread_mutex_init(&mutex, NULL);
00039     }
00040     ~SMPSignal(){
00041         pthread_mutex_destroy(&mutex);
00042     }
00043     void dec_count(){
00044         pthread_mutex_lock(&mutex);
00045         ref_count--;
00046         pthread_mutex_unlock(&mutex);
00047     }
00048     int get_ref_count(){
00049         int count;
00050         pthread_mutex_lock(&mutex);
00051         count = ref_count;
00052         pthread_mutex_unlock(&mutex);
00053         return count;
00054     }   
00055 // * /
00056 };
00057 
00058 */
00059 
00060 enum SLIM_DEFAULT_SIGNAL_ID{
00061     //media control events
00062     SLIM_MEDIA_PLAY_EVENT = 128,
00063     SLIM_MEDIA_STOP_EVENT,
00064     SLIM_MEDIA_PAUSE_EVENT,
00065     SLIM_MEDIA_NEXT_EVENT,
00066     SLIM_MEDIA_PREVIOUS_EVENT,
00067 
00068     //repeat events
00069     SLIM_MEDIA_REPEAT_EVENT,
00070     SLIM_MEDIA_REPEATALL_EVENT,
00071 
00072     //forward, backward events
00073     SLIM_MEDIA_CURRENT_POS_UPDATE_EVENT,
00074     SLIM_MEDIA_REQUEST_POS_UPDATE_EVENT,
00075 
00076     //misc events...
00077      
00078 };
00079 
00080 
00082 enum SMP_SIGNAL_TYPE {
00083     SMP_KEYDOWN,
00084     SMP_KEYUP,
00085     SMP_MOUSEMOTION,
00086     SMP_MOUSEBUTTONDOWN,
00087     SMP_MOUSEBUTTONUP,
00088 //  SMP_QUIT,
00089     SMP_USEREVENT
00090 };
00091 
00092 
00093 
00094 
00096 struct SMPKeyboardEvent{
00097     SMP_SIGNAL_TYPE type; //SMP_KEYDOWN, SMP_KEYUP
00098     uint8_t state;
00099 };
00100 
00102 struct SMPMouseMotionEvent{
00103     SMP_SIGNAL_TYPE type; //SMP_MOUSEMOTION
00104     uint8_t state;
00105     uint16_t x, y;
00106     int16_t xrel, yrel;
00107 };
00108 
00110 struct SMPMouseButtonEvent{
00111     SMP_SIGNAL_TYPE type;   //SMP_MOUSEBUTTONDOWN, SMP_MOUSEBUTTONUP
00112     uint8_t button;
00113     uint8_t state;
00114     uint16_t x, y;
00115 };
00116 
00118 struct SMPUserEvent{
00120     SMP_SIGNAL_TYPE type; //SMP_USEREVENT
00122     int code;
00124     void *data;
00125 };
00126 
00131 class SMPSignal{
00132 public:
00134     SMP_SIGNAL_TYPE type;
00137     uint8_t dest_port; 
00140     uint8_t ref_count;
00142     union{
00144         SMPKeyboardEvent key;
00146         SMPMouseMotionEvent motion;
00148         SMPMouseButtonEvent button;
00149 //      SMPQuitEvent quit;
00151         SMPUserEvent user;
00152     };
00153 };
00154 
00155 
00156 #endif
00157 

Generated on Fri Aug 31 15:41:42 2007 for SCREAMLinuxMiddleware(SLIM) by  doxygen 1.5.1