messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

new_contact.h (2139B)


      1 /*
      2    This file is part of GNUnet.
      3    Copyright (C) 2021--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/new_contact.h
     23  */
     24 
     25 #ifndef UI_NEW_CONTACT_H_
     26 #define UI_NEW_CONTACT_H_
     27 
     28 #include "messenger.h"
     29 
     30 #include <cairo/cairo.h>
     31 #include <gdk/gdkpixbuf.h>
     32 #include <gstreamer-1.0/gst/gst.h>
     33 #include <pthread.h>
     34 
     35 typedef struct UI_NEW_CONTACT_Handle
     36 {
     37   guint camera_count;
     38 
     39   GstElement *pipeline;
     40   GstElement *source;
     41   GstElement *scanner;
     42   GstElement *sink;
     43 
     44   GtkBuilder *builder;
     45   GtkDialog *dialog;
     46 
     47   GtkRevealer *camera_combo_box_revealer;
     48   GtkComboBox *camera_combo_box;
     49   GtkListStore *camera_list_store;
     50 
     51   GtkStack *preview_stack;
     52   GtkWidget *loading_box;
     53   GtkWidget *fail_box;
     54   GtkWidget *no_camera_box;
     55 
     56   GtkWidget *video_box;
     57   GtkEntry *id_entry;
     58 
     59   GtkButton *cancel_button;
     60   GtkButton *confirm_button;
     61 
     62   pthread_t video_tid;
     63 } UI_NEW_CONTACT_Handle;
     64 
     65 /**
     66  * Initializes a handle for the new contact dialog
     67  * of a given messenger application.
     68  *
     69  * @param app Messenger application
     70  * @param handle New contact dialog handle
     71  */
     72 void
     73 ui_new_contact_dialog_init(MESSENGER_Application *app,
     74                            UI_NEW_CONTACT_Handle *handle);
     75 
     76 /**
     77  * Cleans up the allocated resources and resets the
     78  * state of a given new contact dialog handle.
     79  *
     80  * @param handle New contact dialog handle
     81  */
     82 void
     83 ui_new_contact_dialog_cleanup(UI_NEW_CONTACT_Handle *handle);
     84 
     85 #endif /* UI_NEW_CONTACT_H_ */