2014-02-25 08:28:24 +01:00
|
|
|
/* groupchat.h
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Toxic All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This file is part of Toxic.
|
|
|
|
*
|
|
|
|
* Toxic is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Toxic is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Toxic. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2013-09-15 22:38:38 +02:00
|
|
|
*/
|
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
#ifndef GROUPCHAT_H
|
|
|
|
#define GROUPCHAT_H
|
2014-06-12 00:06:55 +02:00
|
|
|
|
|
|
|
#include "toxic.h"
|
|
|
|
#include "windows.h"
|
2014-11-26 18:24:52 +01:00
|
|
|
|
|
|
|
#ifdef AUDIO
|
2014-11-15 02:13:08 +01:00
|
|
|
#include "audio_call.h"
|
2014-11-26 18:24:52 +01:00
|
|
|
#endif
|
2014-06-12 00:06:55 +02:00
|
|
|
|
2014-11-29 15:36:31 +01:00
|
|
|
#ifdef AUDIO
|
|
|
|
#ifdef __APPLE__
|
|
|
|
#include <OpenAL/al.h>
|
|
|
|
#include <OpenAL/alc.h>
|
|
|
|
#else
|
|
|
|
#include <AL/al.h>
|
|
|
|
#include <AL/alc.h>
|
|
|
|
/* compatibility with older versions of OpenAL */
|
|
|
|
#ifndef ALC_ALL_DEVICES_SPECIFIER
|
|
|
|
#include <AL/alext.h>
|
|
|
|
#endif /* ALC_ALL_DEVICES_SPECIFIER */
|
|
|
|
#endif /* __APPLE__ */
|
|
|
|
#endif /* AUDIO */
|
|
|
|
|
2013-11-24 03:19:59 +01:00
|
|
|
#define SIDEBAR_WIDTH 16
|
2013-12-03 09:44:02 +01:00
|
|
|
#define SDBAR_OFST 2 /* Offset for the peer number box at the top of the statusbar */
|
2014-06-19 19:50:41 +02:00
|
|
|
#define MAX_GROUPCHAT_NUM MAX_WINDOWS_NUM - 2
|
2014-11-29 15:36:31 +01:00
|
|
|
#define GROUP_EVENT_WAIT 3
|
2013-11-24 03:19:59 +01:00
|
|
|
|
2014-11-15 02:13:08 +01:00
|
|
|
#ifdef AUDIO
|
2014-11-29 15:36:31 +01:00
|
|
|
struct GAudio {
|
|
|
|
ALCdevice *dvhandle; /* Handle of device selected/opened */
|
|
|
|
ALCcontext *dvctx;
|
2014-12-10 00:29:07 +01:00
|
|
|
ALuint source;
|
|
|
|
ALuint buffers[OPENAL_BUFS];
|
2014-11-29 15:36:31 +01:00
|
|
|
};
|
|
|
|
#endif /* AUDIO */
|
2014-11-15 02:13:08 +01:00
|
|
|
|
2013-11-24 03:19:59 +01:00
|
|
|
typedef struct {
|
|
|
|
int chatwin;
|
|
|
|
bool active;
|
2014-11-12 02:49:05 +01:00
|
|
|
uint8_t type;
|
2013-11-24 03:19:59 +01:00
|
|
|
int num_peers;
|
2013-12-03 09:44:02 +01:00
|
|
|
int side_pos; /* current position of the sidebar - used for scrolling up and down */
|
2016-09-23 00:31:52 +02:00
|
|
|
time_t start_time;
|
2014-04-01 04:00:17 +02:00
|
|
|
uint8_t *peer_names;
|
|
|
|
uint8_t *oldpeer_names;
|
|
|
|
uint16_t *peer_name_lengths;
|
|
|
|
uint16_t *oldpeer_name_lengths;
|
2014-11-26 21:22:34 +01:00
|
|
|
|
|
|
|
#ifdef AUDIO
|
2014-11-29 15:36:31 +01:00
|
|
|
struct GAudio audio;
|
2014-11-26 21:22:34 +01:00
|
|
|
#endif
|
2013-11-24 03:19:59 +01:00
|
|
|
} GroupChat;
|
|
|
|
|
2014-12-07 19:51:12 +01:00
|
|
|
void close_groupchat(ToxWindow *self, Tox *m, int groupnum);
|
2014-11-12 02:49:05 +01:00
|
|
|
int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum, uint8_t type);
|
2014-10-08 08:45:08 +02:00
|
|
|
|
|
|
|
/* destroys and re-creates groupchat window with or without the peerlist */
|
|
|
|
void redraw_groupchat_win(ToxWindow *self);
|
|
|
|
|
2013-11-30 00:52:21 +01:00
|
|
|
ToxWindow new_group_chat(Tox *m, int groupnum);
|
2014-06-12 00:06:55 +02:00
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
#endif /* #define GROUPCHAT_H */
|