discourse.h (2778B)
1 /* 2 This file is part of GNUnet. 3 Copyright (C) 2024 GNUnet e.V. 4 5 GNUnet is free software: you can redistribute it and/or modify it 6 under the terms of the GNU Affero General Public License as published 7 by the Free Software Foundation, either version 3 of the License, 8 or (at your option) any later version. 9 10 GNUnet is distributed in the hope that it will be useful, but 11 WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Affero General Public License for more details. 14 15 You should have received a copy of the GNU Affero General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 SPDX-License-Identifier: AGPL3.0-or-later 19 */ 20 /* 21 * @author Tobias Frisch 22 * @file ui/discourse.h 23 */ 24 25 #ifndef UI_DISCOURSE_H_ 26 #define UI_DISCOURSE_H_ 27 28 #include "messenger.h" 29 30 #include <gnunet/gnunet_chat_lib.h> 31 32 #include <glib-2.0/glib.h> 33 #include <gstreamer-1.0/gst/gst.h> 34 #include <pthread.h> 35 36 typedef struct UI_DISCOURSE_Handle 37 { 38 MESSENGER_Application *app; 39 struct GNUNET_CHAT_Context *context; 40 41 struct GNUNET_CHAT_Discourse *voice_discourse; 42 struct GNUNET_CHAT_Discourse *video_discourse; 43 44 gboolean muted; 45 gboolean streaming; 46 47 GtkWindow *parent; 48 49 GtkBuilder *builder; 50 HdyWindow *window; 51 52 HdyHeaderBar *title_bar; 53 GtkButton *back_button; 54 GtkButton *details_button; 55 56 HdyFlap *details_flap; 57 58 GtkStack *discourse_stack; 59 GtkWidget *offline_page; 60 GtkWidget *members_page; 61 62 GtkFlowBox *members_flowbox; 63 64 GtkButton *microphone_button; 65 GtkButton *camera_button; 66 GtkButton *screen_button; 67 GtkVolumeButton *speakers_button; 68 69 GtkStack *microphone_stack; 70 GtkWidget *microphone_on_icon; 71 GtkWidget *microphone_off_icon; 72 73 GtkStack *call_stack; 74 GtkWidget *call_start_button; 75 GtkWidget *call_stop_button; 76 77 GtkButton *close_details_button; 78 GtkListBox *contacts_listbox; 79 } UI_DISCOURSE_Handle; 80 81 /** 82 * Initializes a handle for the discourse window 83 * of a given messenger application. 84 * 85 * @param app Messenger application 86 * @param handle Discourse window handle 87 */ 88 void 89 ui_discourse_window_init(MESSENGER_Application *app, 90 UI_DISCOURSE_Handle *handle); 91 92 /** 93 * Updates a handle for the discourse window with 94 * a given chat context. 95 * 96 * @param handle Discourse window handle 97 * @param context Chat context 98 */ 99 void 100 ui_discourse_window_update(UI_DISCOURSE_Handle *handle, 101 struct GNUNET_CHAT_Context *context); 102 103 /** 104 * Cleans up the allocated resources and resets the 105 * state of a given discourse window handle. 106 * 107 * @param handle Discourse window handle 108 */ 109 void 110 ui_discourse_window_cleanup(UI_DISCOURSE_Handle *handle); 111 112 #endif /* UI_DISCOURSE_H_ */