prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / messages.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #ifndef MESSAGES_H
23 #define MESSAGES_H
24
25 #include <sys/types.h>
26 #include <sys/ipc.h>
27 #include <sys/msg.h>
28
29 #define MESSAGE_TO_PLUGIN 1
30 #define MESSAGE_FROM_PLUGIN 2
31 #include "messages.inc"
32
33 class Messages
34 {
35 public:
36         Messages(int input_flag, int output_flag, int id = -1);
37         ~Messages();
38
39         char* get_message_buffer();
40
41         int read_message(char *text);
42         char* read_message_raw();        // return the raw text in the buffer
43         int read_message(int *command, char *text);
44         long read_message();    // return the number contained in the message
45         int read_message(long *value1, long *value2);
46         int read_message(long *command, long *value1, long *value2);
47         int read_message(long *command, long *value1, long *value2, long *value3);
48         float read_message_f();
49         int read_message_f(float *value1, float *value2);
50         int read_message_f(float *value1, float *value2, float *value3);
51         int read_message_f(float *value1, float *value2, float *value3, float *value4);
52
53         int write_message(char *text);
54         int write_message_raw();                 // send the text currently in the buffer
55         int write_message(int command, char *text);
56         int write_message_flagged(int output_flag, int command);
57         int write_message(int number);
58         int write_message(long command, long value);
59         int write_message(long command, long value1, long value2);
60         int write_message(long command, long value1, long value2, long value3);
61         int write_message_f(float number);
62         int write_message_f(float value1, float value2);
63         int write_message_f(float value1, float value2, float value3);
64         int write_message_f(float value1, float value2, float value3, float value4);
65         int get_id();
66
67         int msgid;
68         int client;
69         int input_flag;
70         int output_flag;
71         struct buffer_ {
72                 long mtype;
73                 char text[MESSAGESIZE];
74         } buffer;
75 };
76
77 #endif