/* Screencast.c generated by valac 0.56.19, the Vala compiler
 * generated from Screencast.vala, do not modify */

/*
* Budgie Screencast
* Author: Sam Lane
* Copyright © 2026 Ubuntu Budgie Developers
* Website=https://ubuntubudgie.org
* This program 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 any later version.
* This program 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 this program.  If not, see
* <https://www.gnu.org/licenses/>.
*/

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include "budgie-screencast.h"
#include <gio/gio.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <pango/pango.h>
#include <plugin.h>
#include <libxfce4windowing/libxfce4windowing.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <locale.h>
#include <config.h>
#include <libpeas.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	SCREENCAST_APPLET_SCREENCAST_SETTINGS_0_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_SETTINGS_NUM_PROPERTIES
};
static GParamSpec* screencast_applet_screencast_settings_properties[SCREENCAST_APPLET_SCREENCAST_SETTINGS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SCREENCAST_APPLET_PLUGIN_0_PROPERTY,
	SCREENCAST_APPLET_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* screencast_applet_plugin_properties[SCREENCAST_APPLET_PLUGIN_NUM_PROPERTIES];
enum  {
	SCREENCAST_APPLET_SCREENCAST_POPOVER_0_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_ACTIVE_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_CAPTURE_MODE_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_DELAY_SECONDS_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_DURATION_SECONDS_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_ENABLED_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_DEVICE_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_POPOVER_NUM_PROPERTIES
};
static GParamSpec* screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_NUM_PROPERTIES];
typedef struct _Block2Data Block2Data;
typedef void (*ScreencastAppletScreencastPopoverPresetSelected) (gint value, gpointer user_data);
typedef struct _Block3Data Block3Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block4Data Block4Data;
typedef struct _Block5Data Block5Data;
typedef struct _Block6Data Block6Data;
enum  {
	SCREENCAST_APPLET_SCREENCAST_APPLET_0_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_APPLET_UUID_PROPERTY,
	SCREENCAST_APPLET_SCREENCAST_APPLET_NUM_PROPERTIES
};
static GParamSpec* screencast_applet_screencast_applet_properties[SCREENCAST_APPLET_SCREENCAST_APPLET_NUM_PROPERTIES];

struct _ScreencastAppletScreencastSettingsPrivate {
	GSettings* settings;
};

struct _Block1Data {
	int _ref_count_;
	ScreencastAppletScreencastSettings* self;
	gchar* save_path;
	GtkLabel* path_label;
	GSettings* settings;
};

struct _ScreencastAppletScreencastPopoverPrivate {
	GtkToggleButton* screen_button;
	GtkToggleButton* area_button;
	GtkRevealer* output_revealer;
	GtkBox* output_box;
	GtkToggleButton** delay_buttons;
	gint delay_buttons_length1;
	gint _delay_buttons_size_;
	GtkToggleButton** duration_buttons;
	gint duration_buttons_length1;
	gint _duration_buttons_size_;
	GtkToggleButton* audio_button;
	GtkComboBoxText* device_combo;
	GtkRevealer* audio_device_revealer;
	gchar* _active;
	RecorderControlCaptureMode _capture_mode;
	gint _delay_seconds;
	gint _duration_seconds;
	gboolean _audio_enabled;
	gchar* _audio_device;
	XfwScreen* screen;
	GSettings* settings;
};

struct _Block2Data {
	int _ref_count_;
	ScreencastAppletScreencastPopover* self;
	GSettings* settings;
};

struct _Block3Data {
	int _ref_count_;
	ScreencastAppletScreencastPopover* self;
	GtkPopover* tip_pop;
	guint ticks_inside;
	guint ticks_threshold;
	gboolean tip_visible;
	GtkWidget* widget;
};

struct _Block4Data {
	int _ref_count_;
	ScreencastAppletScreencastPopover* self;
	GtkToggleButton** btns;
	gint btns_length1;
	gint _btns_size_;
	gboolean in_handler;
	ScreencastAppletScreencastPopoverPresetSelected on_select;
	gpointer on_select_target;
};

struct _Block5Data {
	int _ref_count_;
	Block4Data * _data4_;
	gint val;
	GtkToggleButton* btn;
	gint idx;
};

struct _Block6Data {
	int _ref_count_;
	ScreencastAppletScreencastPopover* self;
	GtkRadioButton* radio;
};

struct _ScreencastAppletScreencastAppletPrivate {
	ScreencastIcon* panel_widget;
	ScreencastAppletScreencastPopover* popover;
	GSettings* settings;
	BudgiePopoverManager* manager;
	gchar* _uuid;
	RecorderControlRecorder* recorder_app;
};

VALA_EXTERN gchar* screencast_applet_default_path;
gchar* screencast_applet_default_path = NULL;
static gint ScreencastAppletScreencastSettings_private_offset;
static gpointer screencast_applet_screencast_settings_parent_class = NULL;
static GType screencast_applet_screencast_settings_type_id = 0;
static gpointer screencast_applet_plugin_parent_class = NULL;
static BudgiePluginIface * screencast_applet_plugin_budgie_plugin_parent_iface = NULL;
static GType screencast_applet_plugin_type_id = 0;
static gint ScreencastAppletScreencastPopover_private_offset;
static gpointer screencast_applet_screencast_popover_parent_class = NULL;
static GType screencast_applet_screencast_popover_type_id = 0;
static gint ScreencastAppletScreencastApplet_private_offset;
static gpointer screencast_applet_screencast_applet_parent_class = NULL;
static GType screencast_applet_screencast_applet_type_id = 0;

VALA_EXTERN gchar** screencast_applet_get_duration_tips (gint* result_length1);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
VALA_EXTERN gboolean screencast_applet_is_valid_folder (const gchar* path);
static void __lambda4_ (Block1Data* _data1_);
static void ___lambda4__gtk_button_clicked (GtkButton* _sender,
                                     gpointer self);
static void screencast_applet_screencast_settings_finalize (GObject * obj);
static BudgieApplet* screencast_applet_plugin_real_get_panel_widget (BudgiePlugin* base,
                                                              const gchar* uuid);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda6_ (ScreencastAppletScreencastPopover* self,
                 XfwMonitor* m);
static void ___lambda6__libxfce4windowing_screen_monitor_added (XfwScreen* _sender,
                                                         XfwMonitor* monitor,
                                                         gpointer self);
static void __lambda8_ (ScreencastAppletScreencastPopover* self,
                 XfwMonitor* m);
static void screencast_applet_screencast_popover_set_active (ScreencastAppletScreencastPopover* self,
                                                      const gchar* value);
static void ___lambda8__libxfce4windowing_screen_monitor_removed (XfwScreen* _sender,
                                                           XfwMonitor* monitor,
                                                           gpointer self);
static void screencast_applet_screencast_popover_attach_hover_popover (ScreencastAppletScreencastPopover* self,
                                                                GtkWidget* widget,
                                                                const gchar* text,
                                                                guint delay_ms);
static void screencast_applet_screencast_popover_set_capture_mode (ScreencastAppletScreencastPopover* self,
                                                            RecorderControlCaptureMode value);
static void __lambda11_ (Block2Data* _data2_);
static void ___lambda11__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                             gpointer self);
static void __lambda12_ (Block2Data* _data2_);
static void ___lambda12__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                             gpointer self);
static void screencast_applet_screencast_popover_set_audio_enabled (ScreencastAppletScreencastPopover* self,
                                                             gboolean value);
static void screencast_applet_screencast_popover_set_audio_device (ScreencastAppletScreencastPopover* self,
                                                            const gchar* value);
static void screencast_applet_screencast_popover_populate_device_combo (ScreencastAppletScreencastPopover* self);
static void __lambda13_ (Block2Data* _data2_);
static void ___lambda13__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                             gpointer self);
static void __lambda14_ (Block2Data* _data2_);
static void ___lambda14__gtk_combo_box_changed (GtkComboBox* _sender,
                                         gpointer self);
static gint screencast_applet_screencast_popover_find_nearest_preset (ScreencastAppletScreencastPopover* self,
                                                               gint* presets,
                                                               gint presets_length1,
                                                               gint target);
static void screencast_applet_screencast_popover_set_delay_seconds (ScreencastAppletScreencastPopover* self,
                                                             gint value);
static GtkBox* screencast_applet_screencast_popover_make_preset_buttons (ScreencastAppletScreencastPopover* self,
                                                                  gint* presets,
                                                                  gint presets_length1,
                                                                  gchar** labels,
                                                                  gint labels_length1,
                                                                  gchar** tips,
                                                                  gint tips_length1,
                                                                  gint active_value,
                                                                  GtkToggleButton*** buttons,
                                                                  gint* buttons_length1,
                                                                  ScreencastAppletScreencastPopoverPresetSelected on_select,
                                                                  gpointer on_select_target);
static void __lambda16_ (Block2Data* _data2_,
                  gint val);
static void ___lambda16__screencast_applet_screencast_popover_preset_selected (gint value,
                                                                        gpointer self);
static void screencast_applet_screencast_popover_set_duration_seconds (ScreencastAppletScreencastPopover* self,
                                                                gint value);
static void __lambda17_ (Block2Data* _data2_,
                  gint val);
static void ___lambda17__screencast_applet_screencast_popover_preset_selected (gint value,
                                                                        gpointer self);
static gboolean screencast_applet_screencast_popover_widget_pointer_over (ScreencastAppletScreencastPopover* self,
                                                                   GtkWidget* widget);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean __lambda9_ (Block3Data* _data3_);
static gboolean ___lambda9__gsource_func (gpointer self);
static gboolean __lambda10_ (Block3Data* _data3_,
                      GdkEventButton* e);
static gboolean ___lambda10__gtk_widget_button_press_event (GtkWidget* _sender,
                                                     GdkEventButton* event,
                                                     gpointer self);
static gchar** screencast_applet_screencast_popover_get_audio_sources (ScreencastAppletScreencastPopover* self,
                                                                gint* result_length1);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void _____lambda15_ (Block5Data* _data5_);
static void ______lambda15__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                gpointer self);
static gchar** screencast_applet_screencast_popover_get_output_list (ScreencastAppletScreencastPopover* self,
                                                              gint* result_length1);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void ____lambda7_ (Block6Data* _data6_);
static void _____lambda7__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                              gpointer self);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void screencast_applet_screencast_popover_finalize (GObject * obj);
static void _vala_screencast_applet_screencast_popover_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_screencast_applet_screencast_popover_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
static void __lambda25_ (ScreencastAppletScreencastApplet* self);
static void ___lambda25__g_settings_changed (GSettings* _sender,
                                      const gchar* key,
                                      gpointer self);
static void __lambda26_ (ScreencastAppletScreencastApplet* self,
                  gboolean rec);
static void ___lambda26__recorder_control_recorder_recording_changed (RecorderControlRecorder* _sender,
                                                               gboolean recording,
                                                               gpointer self);
static void __lambda27_ (ScreencastAppletScreencastApplet* self,
                  gboolean pend,
                  gint countdown);
static void ___lambda27__recorder_control_recorder_pending_changed (RecorderControlRecorder* _sender,
                                                             gboolean pending,
                                                             gint countdown,
                                                             gpointer self);
static gboolean __lambda28_ (ScreencastAppletScreencastApplet* self,
                      GdkEventButton* e);
static gboolean ___lambda28__gtk_widget_button_press_event (GtkWidget* _sender,
                                                     GdkEventButton* event,
                                                     gpointer self);
static gboolean screencast_applet_screencast_applet_real_supports_settings (BudgieApplet* base);
static GtkWidget* screencast_applet_screencast_applet_real_get_settings_ui (BudgieApplet* base);
static void screencast_applet_screencast_applet_real_update_popovers (BudgieApplet* base,
                                                               BudgiePopoverManager* manager);
static void screencast_applet_screencast_applet_finalize (GObject * obj);
static void _vala_screencast_applet_screencast_applet_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec);
static void _vala_screencast_applet_screencast_applet_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec);
GType recorder_control_recorder_register_type (GTypeModule * module);
GType screencast_icon_register_type (GTypeModule * module);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

const gint SCREENCAST_APPLET_DELAY_PRESETS[5] = {0, 5, 10, 20, 30};
const gchar* SCREENCAST_APPLET_DELAY_LABELS[5] = {"Off", "5s", "10s", "20s", "30s"};
const gint SCREENCAST_APPLET_DURATION_PRESETS[7] = {0, 15, 30, 60, 90, 180, 600};
const gchar* SCREENCAST_APPLET_DURATION_LABELS[7] = {"∞", "15s", "30s", "1m", "90s", "3m", "10m"};

gchar**
screencast_applet_get_duration_tips (gint* result_length1)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar** result;
	_tmp0_ = g_strdup (_ ("No limit"));
	_tmp1_ = g_strdup (_ ("TikTok / Reels short"));
	_tmp2_ = g_strdup (_ ("Reels / Shorts standard"));
	_tmp3_ = g_strdup (_ ("TikTok / YouTube Shorts / Reels"));
	_tmp4_ = g_strdup (_ ("Instagram max"));
	_tmp5_ = g_strdup (_ ("LinkedIn / Facebook"));
	_tmp6_ = g_strdup (_ ("TikTok max"));
	_tmp7_ = g_new0 (gchar*, 7 + 1);
	_tmp7_[0] = _tmp0_;
	_tmp7_[1] = _tmp1_;
	_tmp7_[2] = _tmp2_;
	_tmp7_[3] = _tmp3_;
	_tmp7_[4] = _tmp4_;
	_tmp7_[5] = _tmp5_;
	_tmp7_[6] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 7;
	if (result_length1) {
		*result_length1 = _tmp8__length1;
	}
	result = _tmp8_;
	return result;
}

static inline gpointer
screencast_applet_screencast_settings_get_instance_private (ScreencastAppletScreencastSettings* self)
{
	return G_STRUCT_MEMBER_P (self, ScreencastAppletScreencastSettings_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		ScreencastAppletScreencastSettings* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->path_label);
		_g_free0 (_data1_->save_path);
		_g_object_unref0 (_data1_->settings);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
__lambda4_ (Block1Data* _data1_)
{
	ScreencastAppletScreencastSettings* self;
	GtkFileChooserDialog* folder_chooser = NULL;
	GtkFileChooserDialog* _tmp0_;
	GtkFileChooserDialog* _tmp1_;
	GtkFileChooserDialog* _tmp2_;
	GtkFileChooserDialog* _tmp3_;
	GtkFileChooserDialog* _tmp4_;
	const gchar* _tmp5_;
	GtkFileChooserDialog* _tmp6_;
	GtkFileChooserDialog* _tmp16_;
	self = _data1_->self;
	_tmp0_ = (GtkFileChooserDialog*) gtk_file_chooser_dialog_new (_ ("Select Recording Folder"), NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, NULL);
	g_object_ref_sink (_tmp0_);
	folder_chooser = _tmp0_;
	_tmp1_ = folder_chooser;
	gtk_dialog_add_button ((GtkDialog*) _tmp1_, _ ("_Cancel"), (gint) GTK_RESPONSE_CANCEL);
	_tmp2_ = folder_chooser;
	gtk_dialog_add_button ((GtkDialog*) _tmp2_, _ ("_Select"), (gint) GTK_RESPONSE_ACCEPT);
	_tmp3_ = folder_chooser;
	gtk_window_set_modal ((GtkWindow*) _tmp3_, TRUE);
	_tmp4_ = folder_chooser;
	_tmp5_ = _data1_->save_path;
	gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp4_, _tmp5_);
	_tmp6_ = folder_chooser;
	if (gtk_dialog_run ((GtkDialog*) _tmp6_) == ((gint) GTK_RESPONSE_ACCEPT)) {
		gchar* chosen = NULL;
		GtkFileChooserDialog* _tmp7_;
		gchar* _tmp8_;
		gboolean _tmp9_ = FALSE;
		const gchar* _tmp10_;
		_tmp7_ = folder_chooser;
		_tmp8_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp7_);
		chosen = _tmp8_;
		_tmp10_ = chosen;
		if (_tmp10_ != NULL) {
			const gchar* _tmp11_;
			_tmp11_ = chosen;
			_tmp9_ = screencast_applet_is_valid_folder (_tmp11_);
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			const gchar* _tmp15_;
			_tmp12_ = chosen;
			g_settings_set_string (_data1_->settings, "save-path", _tmp12_);
			_tmp13_ = chosen;
			_tmp14_ = g_strdup (_tmp13_);
			_g_free0 (_data1_->save_path);
			_data1_->save_path = _tmp14_;
			_tmp15_ = _data1_->save_path;
			gtk_label_set_text (_data1_->path_label, _tmp15_);
		}
		_g_free0 (chosen);
	}
	_tmp16_ = folder_chooser;
	gtk_widget_destroy ((GtkWidget*) _tmp16_);
	_g_object_unref0 (folder_chooser);
}

static void
___lambda4__gtk_button_clicked (GtkButton* _sender,
                                gpointer self)
{
	__lambda4_ (self);
}

ScreencastAppletScreencastSettings*
screencast_applet_screencast_settings_construct (GType object_type,
                                                 GSettings* settings)
{
	ScreencastAppletScreencastSettings * self = NULL;
	Block1Data* _data1_;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	GtkLabel* select_label = NULL;
	GtkLabel* _tmp6_;
	GtkButton* folderbutton = NULL;
	GtkButton* _tmp7_;
	const gchar* _tmp8_;
	GtkLabel* _tmp9_;
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (_data1_->settings);
	_data1_->settings = _tmp0_;
	self = (ScreencastAppletScreencastSettings*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (_data1_->settings);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = g_settings_get_string (_data1_->settings, "save-path");
	_data1_->save_path = _tmp2_;
	_tmp3_ = _data1_->save_path;
	if (!screencast_applet_is_valid_folder (_tmp3_)) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = screencast_applet_default_path;
		_tmp5_ = g_strdup (_tmp4_);
		_g_free0 (_data1_->save_path);
		_data1_->save_path = _tmp5_;
	}
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 10);
	_tmp6_ = (GtkLabel*) gtk_label_new (_ ("Output folder:"));
	g_object_ref_sink (_tmp6_);
	select_label = _tmp6_;
	gtk_widget_set_halign ((GtkWidget*) select_label, GTK_ALIGN_START);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) select_label, 0, 0, 2, 1);
	_tmp7_ = (GtkButton*) gtk_button_new_from_icon_name ("folder", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp7_);
	folderbutton = _tmp7_;
	gtk_widget_set_hexpand ((GtkWidget*) folderbutton, FALSE);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) folderbutton, 0, 1, 1, 1);
	_tmp8_ = _data1_->save_path;
	_tmp9_ = (GtkLabel*) gtk_label_new (_tmp8_);
	g_object_ref_sink (_tmp9_);
	_data1_->path_label = _tmp9_;
	gtk_label_set_width_chars (_data1_->path_label, 30);
	gtk_label_set_ellipsize (_data1_->path_label, PANGO_ELLIPSIZE_MIDDLE);
	gtk_label_set_xalign (_data1_->path_label, 0.0f);
	gtk_widget_set_hexpand ((GtkWidget*) _data1_->path_label, TRUE);
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _data1_->path_label, 1, 1, 1, 1);
	g_signal_connect_data (folderbutton, "clicked", (GCallback) ___lambda4__gtk_button_clicked, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (folderbutton);
	_g_object_unref0 (select_label);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}

ScreencastAppletScreencastSettings*
screencast_applet_screencast_settings_new (GSettings* settings)
{
	return screencast_applet_screencast_settings_construct (SCREENCAST_APPLET_TYPE_SCREENCAST_SETTINGS, settings);
}

static void
screencast_applet_screencast_settings_class_init (ScreencastAppletScreencastSettingsClass * klass,
                                                  gpointer klass_data)
{
	screencast_applet_screencast_settings_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScreencastAppletScreencastSettings_private_offset);
	G_OBJECT_CLASS (klass)->finalize = screencast_applet_screencast_settings_finalize;
}

static void
screencast_applet_screencast_settings_instance_init (ScreencastAppletScreencastSettings * self,
                                                     gpointer klass)
{
	self->priv = screencast_applet_screencast_settings_get_instance_private (self);
	self->priv->settings = NULL;
}

static void
screencast_applet_screencast_settings_finalize (GObject * obj)
{
	ScreencastAppletScreencastSettings * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCREENCAST_APPLET_TYPE_SCREENCAST_SETTINGS, ScreencastAppletScreencastSettings);
	_g_object_unref0 (self->priv->settings);
	G_OBJECT_CLASS (screencast_applet_screencast_settings_parent_class)->finalize (obj);
}

GType
screencast_applet_screencast_settings_get_type (void)
{
	return screencast_applet_screencast_settings_type_id;
}

GType
screencast_applet_screencast_settings_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScreencastAppletScreencastSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) screencast_applet_screencast_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScreencastAppletScreencastSettings), 0, (GInstanceInitFunc) screencast_applet_screencast_settings_instance_init, NULL };
	screencast_applet_screencast_settings_type_id = g_type_module_register_type (module, gtk_grid_get_type (), "ScreencastAppletScreencastSettings", &g_define_type_info, 0);
	ScreencastAppletScreencastSettings_private_offset = sizeof (ScreencastAppletScreencastSettingsPrivate);
	return screencast_applet_screencast_settings_type_id;
}

static BudgieApplet*
screencast_applet_plugin_real_get_panel_widget (BudgiePlugin* base,
                                                const gchar* uuid)
{
	ScreencastAppletPlugin * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	ScreencastAppletScreencastApplet* _tmp5_;
	BudgieApplet* result;
	self = (ScreencastAppletPlugin*) base;
	g_return_val_if_fail (uuid != NULL, NULL);
	_tmp0_ = g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS);
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (screencast_applet_default_path);
	screencast_applet_default_path = _tmp1_;
	_tmp2_ = screencast_applet_default_path;
	if (_tmp2_ == NULL) {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = g_get_home_dir ();
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (screencast_applet_default_path);
		screencast_applet_default_path = _tmp4_;
	}
	_tmp5_ = screencast_applet_screencast_applet_new (uuid);
	g_object_ref_sink (_tmp5_);
	result = (BudgieApplet*) _tmp5_;
	return result;
}

ScreencastAppletPlugin*
screencast_applet_plugin_construct (GType object_type)
{
	ScreencastAppletPlugin * self = NULL;
	self = (ScreencastAppletPlugin*) g_object_new (object_type, NULL);
	return self;
}

ScreencastAppletPlugin*
screencast_applet_plugin_new (void)
{
	return screencast_applet_plugin_construct (SCREENCAST_APPLET_TYPE_PLUGIN);
}

static void
screencast_applet_plugin_class_init (ScreencastAppletPluginClass * klass,
                                     gpointer klass_data)
{
	screencast_applet_plugin_parent_class = g_type_class_peek_parent (klass);
}

static void
screencast_applet_plugin_budgie_plugin_interface_init (BudgiePluginIface * iface,
                                                       gpointer iface_data)
{
	screencast_applet_plugin_budgie_plugin_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_panel_widget = (BudgieApplet* (*) (BudgiePlugin*, const gchar*)) screencast_applet_plugin_real_get_panel_widget;
}

static void
screencast_applet_plugin_instance_init (ScreencastAppletPlugin * self,
                                        gpointer klass)
{
}

GType
screencast_applet_plugin_get_type (void)
{
	return screencast_applet_plugin_type_id;
}

GType
screencast_applet_plugin_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScreencastAppletPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) screencast_applet_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScreencastAppletPlugin), 0, (GInstanceInitFunc) screencast_applet_plugin_instance_init, NULL };
	static const GInterfaceInfo budgie_plugin_info = { (GInterfaceInitFunc) screencast_applet_plugin_budgie_plugin_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	screencast_applet_plugin_type_id = g_type_module_register_type (module, peas_extension_base_get_type (), "ScreencastAppletPlugin", &g_define_type_info, 0);
	g_type_module_add_interface (module, screencast_applet_plugin_type_id, budgie_plugin_get_type (), &budgie_plugin_info);
	return screencast_applet_plugin_type_id;
}

static inline gpointer
screencast_applet_screencast_popover_get_instance_private (ScreencastAppletScreencastPopover* self)
{
	return G_STRUCT_MEMBER_P (self, ScreencastAppletScreencastPopover_private_offset);
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		ScreencastAppletScreencastPopover* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->settings);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda6_ (ScreencastAppletScreencastPopover* self,
            XfwMonitor* m)
{
	g_return_if_fail (m != NULL);
	screencast_applet_screencast_popover_generate_outputs (self);
}

static void
___lambda6__libxfce4windowing_screen_monitor_added (XfwScreen* _sender,
                                                    XfwMonitor* monitor,
                                                    gpointer self)
{
	__lambda6_ ((ScreencastAppletScreencastPopover*) self, monitor);
}

static void
__lambda8_ (ScreencastAppletScreencastPopover* self,
            XfwMonitor* m)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (m != NULL);
	_tmp0_ = xfw_monitor_get_connector (m);
	_tmp1_ = self->priv->_active;
	if (g_strcmp0 (_tmp0_, _tmp1_) == 0) {
		screencast_applet_screencast_popover_set_active (self, "");
	}
	screencast_applet_screencast_popover_generate_outputs (self);
}

static void
___lambda8__libxfce4windowing_screen_monitor_removed (XfwScreen* _sender,
                                                      XfwMonitor* monitor,
                                                      gpointer self)
{
	__lambda8_ ((ScreencastAppletScreencastPopover*) self, monitor);
}

static void
__lambda11_ (Block2Data* _data2_)
{
	ScreencastAppletScreencastPopover* self;
	GtkToggleButton* _tmp0_;
	self = _data2_->self;
	_tmp0_ = self->priv->screen_button;
	if (gtk_toggle_button_get_active (_tmp0_)) {
		GtkToggleButton* _tmp1_;
		GtkRevealer* _tmp2_;
		_tmp1_ = self->priv->area_button;
		gtk_toggle_button_set_active (_tmp1_, FALSE);
		screencast_applet_screencast_popover_set_capture_mode (self, RECORDER_CONTROL_CAPTURE_MODE_SCREEN);
		g_settings_set_enum (_data2_->settings, "capture-mode", 0);
		_tmp2_ = self->priv->output_revealer;
		gtk_revealer_set_reveal_child (_tmp2_, TRUE);
	} else {
		GtkToggleButton* _tmp3_;
		_tmp3_ = self->priv->area_button;
		if (!gtk_toggle_button_get_active (_tmp3_)) {
			GtkToggleButton* _tmp4_;
			_tmp4_ = self->priv->screen_button;
			gtk_toggle_button_set_active (_tmp4_, TRUE);
		}
	}
}

static void
___lambda11__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                        gpointer self)
{
	__lambda11_ (self);
}

static void
__lambda12_ (Block2Data* _data2_)
{
	ScreencastAppletScreencastPopover* self;
	GtkToggleButton* _tmp0_;
	self = _data2_->self;
	_tmp0_ = self->priv->area_button;
	if (gtk_toggle_button_get_active (_tmp0_)) {
		GtkToggleButton* _tmp1_;
		GtkRevealer* _tmp2_;
		_tmp1_ = self->priv->screen_button;
		gtk_toggle_button_set_active (_tmp1_, FALSE);
		screencast_applet_screencast_popover_set_capture_mode (self, RECORDER_CONTROL_CAPTURE_MODE_AREA);
		g_settings_set_enum (_data2_->settings, "capture-mode", 1);
		_tmp2_ = self->priv->output_revealer;
		gtk_revealer_set_reveal_child (_tmp2_, FALSE);
	} else {
		GtkToggleButton* _tmp3_;
		_tmp3_ = self->priv->screen_button;
		if (!gtk_toggle_button_get_active (_tmp3_)) {
			GtkToggleButton* _tmp4_;
			_tmp4_ = self->priv->area_button;
			gtk_toggle_button_set_active (_tmp4_, TRUE);
		}
	}
}

static void
___lambda12__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                        gpointer self)
{
	__lambda12_ (self);
}

static void
__lambda13_ (Block2Data* _data2_)
{
	ScreencastAppletScreencastPopover* self;
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	GtkRevealer* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = _data2_->self;
	_tmp0_ = self->priv->audio_button;
	screencast_applet_screencast_popover_set_audio_enabled (self, gtk_toggle_button_get_active (_tmp0_));
	_tmp1_ = self->priv->_audio_enabled;
	g_settings_set_boolean (_data2_->settings, "audio-enabled", _tmp1_);
	_tmp2_ = self->priv->audio_device_revealer;
	_tmp3_ = self->priv->_audio_enabled;
	gtk_revealer_set_reveal_child (_tmp2_, _tmp3_);
	_tmp4_ = self->priv->_audio_enabled;
	if (_tmp4_) {
		screencast_applet_screencast_popover_populate_device_combo (self);
	}
}

static void
___lambda13__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                        gpointer self)
{
	__lambda13_ (self);
}

static void
__lambda14_ (Block2Data* _data2_)
{
	ScreencastAppletScreencastPopover* self;
	gchar* chosen = NULL;
	GtkComboBoxText* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp6_;
	self = _data2_->self;
	_tmp0_ = self->priv->device_combo;
	_tmp1_ = gtk_combo_box_get_active_id ((GtkComboBox*) _tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	chosen = _tmp2_;
	_tmp4_ = chosen;
	if (_tmp4_ != NULL) {
		const gchar* _tmp5_;
		_tmp5_ = chosen;
		_tmp3_ = _tmp5_;
	} else {
		_tmp3_ = "";
	}
	screencast_applet_screencast_popover_set_audio_device (self, _tmp3_);
	_tmp6_ = self->priv->_audio_device;
	g_settings_set_string (_data2_->settings, "audio-device", _tmp6_);
	_g_free0 (chosen);
}

static void
___lambda14__gtk_combo_box_changed (GtkComboBox* _sender,
                                    gpointer self)
{
	__lambda14_ (self);
}

static void
__lambda16_ (Block2Data* _data2_,
             gint val)
{
	ScreencastAppletScreencastPopover* self;
	self = _data2_->self;
	screencast_applet_screencast_popover_set_delay_seconds (self, val);
	g_settings_set_int (_data2_->settings, "delay-seconds", val);
}

static void
___lambda16__screencast_applet_screencast_popover_preset_selected (gint value,
                                                                   gpointer self)
{
	__lambda16_ (self, value);
}

static void
__lambda17_ (Block2Data* _data2_,
             gint val)
{
	ScreencastAppletScreencastPopover* self;
	self = _data2_->self;
	screencast_applet_screencast_popover_set_duration_seconds (self, val);
	g_settings_set_int (_data2_->settings, "duration-seconds", val);
}

static void
___lambda17__screencast_applet_screencast_popover_preset_selected (gint value,
                                                                   gpointer self)
{
	__lambda17_ (self, value);
}

ScreencastAppletScreencastPopover*
screencast_applet_screencast_popover_construct (GType object_type,
                                                GtkEventBox* panel_widget,
                                                GSettings* settings)
{
	ScreencastAppletScreencastPopover * self = NULL;
	Block2Data* _data2_;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	XfwScreen* _tmp2_;
	XfwScreen* _tmp3_;
	XfwScreen* _tmp4_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp5_;
	GtkGrid* _tmp6_;
	GtkGrid* _tmp7_;
	GtkGrid* _tmp8_;
	GtkGrid* _tmp9_;
	GtkGrid* _tmp10_;
	GtkGrid* _tmp11_;
	gint row = 0;
	GtkLabel* mode_label = NULL;
	GtkLabel* _tmp12_;
	GtkLabel* _tmp13_;
	GtkGrid* _tmp14_;
	GtkLabel* _tmp15_;
	gint _tmp16_;
	GtkBox* mode_box = NULL;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	GtkStyleContext* _tmp19_;
	GtkBox* _tmp20_;
	GtkToggleButton* _tmp21_;
	GtkToggleButton* _tmp22_;
	GtkToggleButton* _tmp23_;
	GtkImage* _tmp24_;
	GtkImage* _tmp25_;
	GtkToggleButton* _tmp26_;
	GtkToggleButton* _tmp27_;
	GtkToggleButton* _tmp28_;
	GtkToggleButton* _tmp29_;
	GtkImage* _tmp30_;
	GtkImage* _tmp31_;
	GtkToggleButton* _tmp32_;
	gint saved_mode = 0;
	RecorderControlCaptureMode _tmp33_ = 0;
	GtkToggleButton* _tmp34_;
	RecorderControlCaptureMode _tmp35_;
	GtkToggleButton* _tmp36_;
	RecorderControlCaptureMode _tmp37_;
	GtkBox* _tmp38_;
	GtkToggleButton* _tmp39_;
	GtkBox* _tmp40_;
	GtkToggleButton* _tmp41_;
	GtkGrid* _tmp42_;
	GtkBox* _tmp43_;
	gint _tmp44_;
	GtkToggleButton* _tmp45_;
	GtkToggleButton* _tmp46_;
	GtkLabel* display_label = NULL;
	GtkLabel* _tmp47_;
	GtkLabel* _tmp48_;
	GtkBox* _tmp49_;
	GtkBox* _tmp50_;
	GtkBox* output_inner = NULL;
	GtkBox* _tmp51_;
	GtkBox* _tmp52_;
	GtkLabel* _tmp53_;
	GtkBox* _tmp54_;
	GtkBox* _tmp55_;
	GtkRevealer* _tmp56_;
	GtkRevealer* _tmp57_;
	GtkRevealer* _tmp58_;
	GtkRevealer* _tmp59_;
	RecorderControlCaptureMode _tmp60_;
	GtkRevealer* _tmp61_;
	GtkBox* _tmp62_;
	GtkGrid* _tmp63_;
	GtkRevealer* _tmp64_;
	gint _tmp65_;
	GtkBox* audio_row = NULL;
	GtkBox* _tmp66_;
	GtkToggleButton* _tmp67_;
	GtkToggleButton* _tmp68_;
	GtkImage* _tmp69_;
	GtkImage* _tmp70_;
	GtkToggleButton* _tmp71_;
	GtkLabel* audio_label = NULL;
	GtkLabel* _tmp72_;
	GtkLabel* _tmp73_;
	GtkBox* _tmp74_;
	GtkToggleButton* _tmp75_;
	GtkBox* _tmp76_;
	GtkLabel* _tmp77_;
	GtkGrid* _tmp78_;
	GtkBox* _tmp79_;
	gint _tmp80_;
	GtkComboBoxText* _tmp81_;
	GtkComboBoxText* _tmp82_;
	GtkRevealer* _tmp83_;
	GtkRevealer* _tmp84_;
	GtkRevealer* _tmp85_;
	GtkRevealer* _tmp86_;
	GtkComboBoxText* _tmp87_;
	GtkGrid* _tmp88_;
	GtkRevealer* _tmp89_;
	gint _tmp90_;
	gchar* _tmp91_;
	gchar* _tmp92_;
	GtkToggleButton* _tmp93_;
	gboolean _tmp94_;
	GtkRevealer* _tmp95_;
	gboolean _tmp96_;
	gboolean _tmp97_;
	GtkToggleButton* _tmp98_;
	GtkComboBoxText* _tmp99_;
	GtkLabel* delay_label = NULL;
	GtkLabel* _tmp100_;
	GtkGrid* _tmp101_;
	GtkLabel* _tmp102_;
	gint _tmp103_;
	gint saved_delay = 0;
	GtkBox* delay_box = NULL;
	gint _tmp104_;
	GtkToggleButton** _tmp105_ = NULL;
	gint _tmp106_ = 0;
	GtkBox* _tmp107_;
	GtkGrid* _tmp108_;
	GtkBox* _tmp109_;
	gint _tmp110_;
	GtkLabel* dur_label = NULL;
	GtkLabel* _tmp111_;
	GtkGrid* _tmp112_;
	GtkLabel* _tmp113_;
	gint _tmp114_;
	gint saved_dur = 0;
	GtkBox* dur_box = NULL;
	gint _tmp115_ = 0;
	gchar** _tmp116_;
	gchar** _tmp117_;
	gint _tmp117__length1;
	gint _tmp118_;
	GtkToggleButton** _tmp119_ = NULL;
	gint _tmp120_ = 0;
	GtkBox* _tmp121_;
	GtkBox* _tmp122_;
	GtkGrid* _tmp123_;
	GtkBox* _tmp124_;
	gint _tmp125_;
	GtkGrid* _tmp126_;
	g_return_val_if_fail (panel_widget != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (_data2_->settings);
	_data2_->settings = _tmp0_;
	self = (ScreencastAppletScreencastPopover*) g_object_new (object_type, "relative-to", panel_widget, NULL);
	_data2_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (_data2_->settings);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = xfw_screen_get_default ();
	_g_object_unref0 (self->priv->screen);
	self->priv->screen = _tmp2_;
	_tmp3_ = self->priv->screen;
	g_signal_connect_object (_tmp3_, "monitor-added", (GCallback) ___lambda6__libxfce4windowing_screen_monitor_added, self, 0);
	_tmp4_ = self->priv->screen;
	g_signal_connect_object (_tmp4_, "monitor-removed", (GCallback) ___lambda8__libxfce4windowing_screen_monitor_removed, self, 0);
	_tmp5_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp5_);
	grid = _tmp5_;
	_tmp6_ = grid;
	gtk_grid_set_row_spacing (_tmp6_, (guint) 6);
	_tmp7_ = grid;
	gtk_grid_set_column_spacing (_tmp7_, (guint) 6);
	_tmp8_ = grid;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp8_, 8);
	_tmp9_ = grid;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp9_, 8);
	_tmp10_ = grid;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp10_, 8);
	_tmp11_ = grid;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp11_, 8);
	row = 0;
	_tmp12_ = (GtkLabel*) gtk_label_new (_ ("Capture Mode:"));
	g_object_ref_sink (_tmp12_);
	mode_label = _tmp12_;
	_tmp13_ = mode_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp13_, GTK_ALIGN_START);
	_tmp14_ = grid;
	_tmp15_ = mode_label;
	_tmp16_ = row;
	row = _tmp16_ + 1;
	gtk_grid_attach (_tmp14_, (GtkWidget*) _tmp15_, 0, _tmp16_, 1, 1);
	_tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp17_);
	mode_box = _tmp17_;
	_tmp18_ = mode_box;
	_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _tmp18_);
	gtk_style_context_add_class (_tmp19_, "linked");
	_tmp20_ = mode_box;
	gtk_widget_set_halign ((GtkWidget*) _tmp20_, GTK_ALIGN_CENTER);
	_tmp21_ = (GtkToggleButton*) gtk_toggle_button_new ();
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->screen_button);
	self->priv->screen_button = _tmp21_;
	_tmp22_ = self->priv->screen_button;
	gtk_widget_set_size_request ((GtkWidget*) _tmp22_, 32, 32);
	_tmp23_ = self->priv->screen_button;
	_tmp24_ = (GtkImage*) gtk_image_new_from_icon_name ("video-display-symbolic", (GtkIconSize) GTK_ICON_SIZE_DND);
	g_object_ref_sink (_tmp24_);
	_tmp25_ = _tmp24_;
	gtk_container_add ((GtkContainer*) _tmp23_, (GtkWidget*) _tmp25_);
	_g_object_unref0 (_tmp25_);
	_tmp26_ = self->priv->screen_button;
	screencast_applet_screencast_popover_attach_hover_popover (self, (GtkWidget*) _tmp26_, _ ("Record entire display"), (guint) 600);
	_tmp27_ = (GtkToggleButton*) gtk_toggle_button_new ();
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->area_button);
	self->priv->area_button = _tmp27_;
	_tmp28_ = self->priv->area_button;
	gtk_widget_set_size_request ((GtkWidget*) _tmp28_, 32, 32);
	_tmp29_ = self->priv->area_button;
	_tmp30_ = (GtkImage*) gtk_image_new_from_icon_name ("object-select-symbolic", (GtkIconSize) GTK_ICON_SIZE_DND);
	g_object_ref_sink (_tmp30_);
	_tmp31_ = _tmp30_;
	gtk_container_add ((GtkContainer*) _tmp29_, (GtkWidget*) _tmp31_);
	_g_object_unref0 (_tmp31_);
	_tmp32_ = self->priv->area_button;
	screencast_applet_screencast_popover_attach_hover_popover (self, (GtkWidget*) _tmp32_, _ ("Record selected area"), (guint) 600);
	saved_mode = g_settings_get_enum (_data2_->settings, "capture-mode");
	if (saved_mode == 1) {
		_tmp33_ = RECORDER_CONTROL_CAPTURE_MODE_AREA;
	} else {
		_tmp33_ = RECORDER_CONTROL_CAPTURE_MODE_SCREEN;
	}
	screencast_applet_screencast_popover_set_capture_mode (self, _tmp33_);
	_tmp34_ = self->priv->screen_button;
	_tmp35_ = self->priv->_capture_mode;
	gtk_toggle_button_set_active (_tmp34_, _tmp35_ == RECORDER_CONTROL_CAPTURE_MODE_SCREEN);
	_tmp36_ = self->priv->area_button;
	_tmp37_ = self->priv->_capture_mode;
	gtk_toggle_button_set_active (_tmp36_, _tmp37_ == RECORDER_CONTROL_CAPTURE_MODE_AREA);
	_tmp38_ = mode_box;
	_tmp39_ = self->priv->screen_button;
	gtk_box_pack_start (_tmp38_, (GtkWidget*) _tmp39_, FALSE, FALSE, (guint) 0);
	_tmp40_ = mode_box;
	_tmp41_ = self->priv->area_button;
	gtk_box_pack_start (_tmp40_, (GtkWidget*) _tmp41_, FALSE, FALSE, (guint) 0);
	_tmp42_ = grid;
	_tmp43_ = mode_box;
	_tmp44_ = row;
	row = _tmp44_ + 1;
	gtk_grid_attach (_tmp42_, (GtkWidget*) _tmp43_, 0, _tmp44_, 1, 1);
	_tmp45_ = self->priv->screen_button;
	g_signal_connect_data (_tmp45_, "toggled", (GCallback) ___lambda11__gtk_toggle_button_toggled, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp46_ = self->priv->area_button;
	g_signal_connect_data (_tmp46_, "toggled", (GCallback) ___lambda12__gtk_toggle_button_toggled, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp47_ = (GtkLabel*) gtk_label_new (_ ("Record Display:"));
	g_object_ref_sink (_tmp47_);
	display_label = _tmp47_;
	_tmp48_ = display_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp48_, GTK_ALIGN_START);
	_tmp49_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
	g_object_ref_sink (_tmp49_);
	_g_object_unref0 (self->priv->output_box);
	self->priv->output_box = _tmp49_;
	_tmp50_ = self->priv->output_box;
	gtk_widget_set_size_request ((GtkWidget*) _tmp50_, 180, -1);
	_tmp51_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
	g_object_ref_sink (_tmp51_);
	output_inner = _tmp51_;
	_tmp52_ = output_inner;
	_tmp53_ = display_label;
	gtk_box_pack_start (_tmp52_, (GtkWidget*) _tmp53_, FALSE, FALSE, (guint) 0);
	_tmp54_ = output_inner;
	_tmp55_ = self->priv->output_box;
	gtk_box_pack_start (_tmp54_, (GtkWidget*) _tmp55_, FALSE, FALSE, (guint) 0);
	_tmp56_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp56_);
	_g_object_unref0 (self->priv->output_revealer);
	self->priv->output_revealer = _tmp56_;
	_tmp57_ = self->priv->output_revealer;
	gtk_revealer_set_transition_type (_tmp57_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	_tmp58_ = self->priv->output_revealer;
	gtk_revealer_set_transition_duration (_tmp58_, (guint) 200);
	_tmp59_ = self->priv->output_revealer;
	_tmp60_ = self->priv->_capture_mode;
	gtk_revealer_set_reveal_child (_tmp59_, _tmp60_ == RECORDER_CONTROL_CAPTURE_MODE_SCREEN);
	_tmp61_ = self->priv->output_revealer;
	_tmp62_ = output_inner;
	gtk_container_add ((GtkContainer*) _tmp61_, (GtkWidget*) _tmp62_);
	_tmp63_ = grid;
	_tmp64_ = self->priv->output_revealer;
	_tmp65_ = row;
	row = _tmp65_ + 1;
	gtk_grid_attach (_tmp63_, (GtkWidget*) _tmp64_, 0, _tmp65_, 1, 1);
	_tmp66_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp66_);
	audio_row = _tmp66_;
	_tmp67_ = (GtkToggleButton*) gtk_toggle_button_new ();
	g_object_ref_sink (_tmp67_);
	_g_object_unref0 (self->priv->audio_button);
	self->priv->audio_button = _tmp67_;
	_tmp68_ = self->priv->audio_button;
	_tmp69_ = (GtkImage*) gtk_image_new_from_icon_name ("audio-input-microphone-symbolic", (GtkIconSize) GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp69_);
	_tmp70_ = _tmp69_;
	gtk_container_add ((GtkContainer*) _tmp68_, (GtkWidget*) _tmp70_);
	_g_object_unref0 (_tmp70_);
	_tmp71_ = self->priv->audio_button;
	screencast_applet_screencast_popover_attach_hover_popover (self, (GtkWidget*) _tmp71_, _ ("Toggle audio capture"), (guint) 600);
	_tmp72_ = (GtkLabel*) gtk_label_new (_ ("Record Audio:"));
	g_object_ref_sink (_tmp72_);
	audio_label = _tmp72_;
	_tmp73_ = audio_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp73_, GTK_ALIGN_START);
	_tmp74_ = audio_row;
	_tmp75_ = self->priv->audio_button;
	gtk_box_pack_start (_tmp74_, (GtkWidget*) _tmp75_, FALSE, FALSE, (guint) 0);
	_tmp76_ = audio_row;
	_tmp77_ = audio_label;
	gtk_box_pack_start (_tmp76_, (GtkWidget*) _tmp77_, FALSE, FALSE, (guint) 0);
	_tmp78_ = grid;
	_tmp79_ = audio_row;
	_tmp80_ = row;
	row = _tmp80_ + 1;
	gtk_grid_attach (_tmp78_, (GtkWidget*) _tmp79_, 0, _tmp80_, 1, 1);
	_tmp81_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	g_object_ref_sink (_tmp81_);
	_g_object_unref0 (self->priv->device_combo);
	self->priv->device_combo = _tmp81_;
	_tmp82_ = self->priv->device_combo;
	screencast_applet_screencast_popover_attach_hover_popover (self, (GtkWidget*) _tmp82_, _ ("Audio source device"), (guint) 600);
	_tmp83_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp83_);
	_g_object_unref0 (self->priv->audio_device_revealer);
	self->priv->audio_device_revealer = _tmp83_;
	_tmp84_ = self->priv->audio_device_revealer;
	gtk_revealer_set_transition_type (_tmp84_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	_tmp85_ = self->priv->audio_device_revealer;
	gtk_revealer_set_transition_duration (_tmp85_, (guint) 200);
	_tmp86_ = self->priv->audio_device_revealer;
	_tmp87_ = self->priv->device_combo;
	gtk_container_add ((GtkContainer*) _tmp86_, (GtkWidget*) _tmp87_);
	_tmp88_ = grid;
	_tmp89_ = self->priv->audio_device_revealer;
	_tmp90_ = row;
	row = _tmp90_ + 1;
	gtk_grid_attach (_tmp88_, (GtkWidget*) _tmp89_, 0, _tmp90_, 1, 1);
	screencast_applet_screencast_popover_set_audio_enabled (self, g_settings_get_boolean (_data2_->settings, "audio-enabled"));
	_tmp91_ = g_settings_get_string (_data2_->settings, "audio-device");
	_tmp92_ = _tmp91_;
	screencast_applet_screencast_popover_set_audio_device (self, _tmp92_);
	_g_free0 (_tmp92_);
	_tmp93_ = self->priv->audio_button;
	_tmp94_ = self->priv->_audio_enabled;
	gtk_toggle_button_set_active (_tmp93_, _tmp94_);
	_tmp95_ = self->priv->audio_device_revealer;
	_tmp96_ = self->priv->_audio_enabled;
	gtk_revealer_set_reveal_child (_tmp95_, _tmp96_);
	_tmp97_ = self->priv->_audio_enabled;
	if (_tmp97_) {
		screencast_applet_screencast_popover_populate_device_combo (self);
	}
	_tmp98_ = self->priv->audio_button;
	g_signal_connect_data (_tmp98_, "toggled", (GCallback) ___lambda13__gtk_toggle_button_toggled, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp99_ = self->priv->device_combo;
	g_signal_connect_data ((GtkComboBox*) _tmp99_, "changed", (GCallback) ___lambda14__gtk_combo_box_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp100_ = (GtkLabel*) gtk_label_new (_ ("Start Delay:"));
	g_object_ref_sink (_tmp100_);
	delay_label = _tmp100_;
	gtk_widget_set_halign ((GtkWidget*) delay_label, GTK_ALIGN_START);
	_tmp101_ = grid;
	_tmp102_ = delay_label;
	_tmp103_ = row;
	row = _tmp103_ + 1;
	gtk_grid_attach (_tmp101_, (GtkWidget*) _tmp102_, 0, _tmp103_, 1, 1);
	saved_delay = g_settings_get_int (_data2_->settings, "delay-seconds");
	screencast_applet_screencast_popover_set_delay_seconds (self, screencast_applet_screencast_popover_find_nearest_preset (self, SCREENCAST_APPLET_DELAY_PRESETS, (gint) G_N_ELEMENTS (SCREENCAST_APPLET_DELAY_PRESETS), saved_delay));
	_tmp104_ = self->priv->_delay_seconds;
	_tmp107_ = screencast_applet_screencast_popover_make_preset_buttons (self, SCREENCAST_APPLET_DELAY_PRESETS, (gint) G_N_ELEMENTS (SCREENCAST_APPLET_DELAY_PRESETS), SCREENCAST_APPLET_DELAY_LABELS, (gint) G_N_ELEMENTS (SCREENCAST_APPLET_DELAY_LABELS), NULL, (gint) 0, _tmp104_, &_tmp105_, &_tmp106_, ___lambda16__screencast_applet_screencast_popover_preset_selected, _data2_);
	self->priv->delay_buttons = (_vala_array_free (self->priv->delay_buttons, self->priv->delay_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->delay_buttons = _tmp105_;
	self->priv->delay_buttons_length1 = _tmp106_;
	self->priv->_delay_buttons_size_ = self->priv->delay_buttons_length1;
	delay_box = _tmp107_;
	_tmp108_ = grid;
	_tmp109_ = delay_box;
	_tmp110_ = row;
	row = _tmp110_ + 1;
	gtk_grid_attach (_tmp108_, (GtkWidget*) _tmp109_, 0, _tmp110_, 1, 1);
	_tmp111_ = (GtkLabel*) gtk_label_new (_ ("Record For:"));
	g_object_ref_sink (_tmp111_);
	dur_label = _tmp111_;
	gtk_widget_set_halign ((GtkWidget*) dur_label, GTK_ALIGN_START);
	_tmp112_ = grid;
	_tmp113_ = dur_label;
	_tmp114_ = row;
	row = _tmp114_ + 1;
	gtk_grid_attach (_tmp112_, (GtkWidget*) _tmp113_, 0, _tmp114_, 1, 1);
	saved_dur = g_settings_get_int (_data2_->settings, "duration-seconds");
	screencast_applet_screencast_popover_set_duration_seconds (self, screencast_applet_screencast_popover_find_nearest_preset (self, SCREENCAST_APPLET_DURATION_PRESETS, (gint) G_N_ELEMENTS (SCREENCAST_APPLET_DURATION_PRESETS), saved_dur));
	_tmp116_ = screencast_applet_get_duration_tips (&_tmp115_);
	_tmp117_ = _tmp116_;
	_tmp117__length1 = _tmp115_;
	_tmp118_ = self->priv->_duration_seconds;
	_tmp121_ = screencast_applet_screencast_popover_make_preset_buttons (self, SCREENCAST_APPLET_DURATION_PRESETS, (gint) G_N_ELEMENTS (SCREENCAST_APPLET_DURATION_PRESETS), SCREENCAST_APPLET_DURATION_LABELS, (gint) G_N_ELEMENTS (SCREENCAST_APPLET_DURATION_LABELS), _tmp117_, (gint) _tmp115_, _tmp118_, &_tmp119_, &_tmp120_, ___lambda17__screencast_applet_screencast_popover_preset_selected, _data2_);
	self->priv->duration_buttons = (_vala_array_free (self->priv->duration_buttons, self->priv->duration_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->duration_buttons = _tmp119_;
	self->priv->duration_buttons_length1 = _tmp120_;
	self->priv->_duration_buttons_size_ = self->priv->duration_buttons_length1;
	_tmp122_ = _tmp121_;
	_tmp117_ = (_vala_array_free (_tmp117_, _tmp117__length1, (GDestroyNotify) g_free), NULL);
	dur_box = _tmp122_;
	_tmp123_ = grid;
	_tmp124_ = dur_box;
	_tmp125_ = row;
	row = _tmp125_ + 1;
	gtk_grid_attach (_tmp123_, (GtkWidget*) _tmp124_, 0, _tmp125_, 1, 1);
	_tmp126_ = grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp126_);
	screencast_applet_screencast_popover_generate_outputs (self);
	_g_object_unref0 (dur_box);
	_g_object_unref0 (dur_label);
	_g_object_unref0 (delay_box);
	_g_object_unref0 (delay_label);
	_g_object_unref0 (audio_label);
	_g_object_unref0 (audio_row);
	_g_object_unref0 (output_inner);
	_g_object_unref0 (display_label);
	_g_object_unref0 (mode_box);
	_g_object_unref0 (mode_label);
	_g_object_unref0 (grid);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}

ScreencastAppletScreencastPopover*
screencast_applet_screencast_popover_new (GtkEventBox* panel_widget,
                                          GSettings* settings)
{
	return screencast_applet_screencast_popover_construct (SCREENCAST_APPLET_TYPE_SCREENCAST_POPOVER, panel_widget, settings);
}

static gboolean
screencast_applet_screencast_popover_widget_pointer_over (ScreencastAppletScreencastPopover* self,
                                                          GtkWidget* widget)
{
	GdkWindow* win = NULL;
	GdkWindow* _tmp0_;
	GdkWindow* _tmp1_;
	GdkWindow* _tmp2_;
	gint wx = 0;
	gint wy = 0;
	GdkWindow* _tmp3_;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	GtkAllocation alloc = {0};
	GtkAllocation _tmp6_ = {0};
	GtkAllocation _tmp7_;
	GtkAllocation _tmp8_;
	GdkSeat* seat = NULL;
	GdkDisplay* _tmp9_;
	GdkSeat* _tmp10_;
	GdkSeat* _tmp11_;
	gint px = 0;
	gint py = 0;
	GdkSeat* _tmp12_;
	GdkDevice* _tmp13_;
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (widget != NULL, FALSE);
	_tmp0_ = gtk_widget_get_window (widget);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	win = _tmp1_;
	_tmp2_ = win;
	if (_tmp2_ == NULL) {
		result = FALSE;
		_g_object_unref0 (win);
		return result;
	}
	_tmp3_ = win;
	gdk_window_get_origin (_tmp3_, &_tmp4_, &_tmp5_);
	wx = _tmp4_;
	wy = _tmp5_;
	gtk_widget_get_allocation (widget, &_tmp6_);
	alloc = _tmp6_;
	_tmp7_ = alloc;
	wx += _tmp7_.x;
	_tmp8_ = alloc;
	wy += _tmp8_.y;
	_tmp9_ = gdk_display_get_default ();
	_tmp10_ = gdk_display_get_default_seat (_tmp9_);
	_tmp11_ = _g_object_ref0 (_tmp10_);
	seat = _tmp11_;
	_tmp12_ = seat;
	_tmp13_ = gdk_seat_get_pointer (_tmp12_);
	gdk_device_get_position (_tmp13_, NULL, &_tmp14_, &_tmp15_);
	px = _tmp14_;
	py = _tmp15_;
	if (px >= wx) {
		GtkAllocation _tmp19_;
		_tmp19_ = alloc;
		_tmp18_ = px < (wx + _tmp19_.width);
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		_tmp17_ = py >= wy;
	} else {
		_tmp17_ = FALSE;
	}
	if (_tmp17_) {
		GtkAllocation _tmp20_;
		_tmp20_ = alloc;
		_tmp16_ = py < (wy + _tmp20_.height);
	} else {
		_tmp16_ = FALSE;
	}
	result = _tmp16_;
	_g_object_unref0 (seat);
	_g_object_unref0 (win);
	return result;
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		ScreencastAppletScreencastPopover* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->tip_pop);
		_g_object_unref0 (_data3_->widget);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gboolean
__lambda9_ (Block3Data* _data3_)
{
	ScreencastAppletScreencastPopover* self;
	gboolean result;
	self = _data3_->self;
	if (!gtk_widget_get_mapped (_data3_->widget)) {
		_data3_->ticks_inside = (guint) 0;
		result = TRUE;
		return result;
	}
	if (screencast_applet_screencast_popover_widget_pointer_over (self, _data3_->widget)) {
		guint _tmp0_;
		gboolean _tmp1_ = FALSE;
		_tmp0_ = _data3_->ticks_inside;
		_data3_->ticks_inside = _tmp0_ + 1;
		if (!_data3_->tip_visible) {
			_tmp1_ = _data3_->ticks_inside >= _data3_->ticks_threshold;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			gtk_popover_popup (_data3_->tip_pop);
			_data3_->tip_visible = TRUE;
		}
	} else {
		_data3_->ticks_inside = (guint) 0;
		if (_data3_->tip_visible) {
			gtk_popover_popdown (_data3_->tip_pop);
			_data3_->tip_visible = FALSE;
		}
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda9__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda9_ (self);
	return result;
}

static gboolean
__lambda10_ (Block3Data* _data3_,
             GdkEventButton* e)
{
	ScreencastAppletScreencastPopover* self;
	gboolean result;
	self = _data3_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_data3_->ticks_inside = (guint) 0;
	if (_data3_->tip_visible) {
		gtk_popover_popdown (_data3_->tip_pop);
		_data3_->tip_visible = FALSE;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda10__gtk_widget_button_press_event (GtkWidget* _sender,
                                            GdkEventButton* event,
                                            gpointer self)
{
	gboolean result;
	result = __lambda10_ (self, event);
	return result;
}

static void
screencast_applet_screencast_popover_attach_hover_popover (ScreencastAppletScreencastPopover* self,
                                                           GtkWidget* widget,
                                                           const gchar* text,
                                                           guint delay_ms)
{
	Block3Data* _data3_;
	GtkWidget* _tmp0_;
	GtkLabel* tip_label = NULL;
	GtkLabel* _tmp1_;
	GtkPopover* _tmp2_;
	static const guint TICK_MS = (guint) 100;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (text != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (widget);
	_g_object_unref0 (_data3_->widget);
	_data3_->widget = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (text);
	g_object_ref_sink (_tmp1_);
	tip_label = _tmp1_;
	gtk_widget_set_margin_top ((GtkWidget*) tip_label, 4);
	gtk_widget_set_margin_bottom ((GtkWidget*) tip_label, 4);
	gtk_widget_set_margin_start ((GtkWidget*) tip_label, 6);
	gtk_widget_set_margin_end ((GtkWidget*) tip_label, 6);
	gtk_widget_show ((GtkWidget*) tip_label);
	_tmp2_ = (GtkPopover*) gtk_popover_new (_data3_->widget);
	g_object_ref_sink (_tmp2_);
	_data3_->tip_pop = _tmp2_;
	gtk_container_add ((GtkContainer*) _data3_->tip_pop, (GtkWidget*) tip_label);
	gtk_popover_set_position (_data3_->tip_pop, GTK_POS_BOTTOM);
	gtk_popover_set_modal (_data3_->tip_pop, FALSE);
	_data3_->ticks_inside = (guint) 0;
	_data3_->ticks_threshold = delay_ms / TICK_MS;
	_data3_->tip_visible = FALSE;
	g_timeout_add_full (G_PRIORITY_DEFAULT, TICK_MS, ___lambda9__gsource_func, block3_data_ref (_data3_), block3_data_unref);
	g_signal_connect_data (_data3_->widget, "button-press-event", (GCallback) ___lambda10__gtk_widget_button_press_event, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_g_object_unref0 (tip_label);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static void
screencast_applet_screencast_popover_populate_device_combo (ScreencastAppletScreencastPopover* self)
{
	gchar* saved = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GtkComboBoxText* _tmp2_;
	GtkComboBoxText* _tmp3_;
	GtkComboBoxText* _tmp4_;
	gint _tmp5_ = 0;
	gchar** _tmp6_;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_;
	GtkComboBoxText* _tmp16_;
	GtkComboBoxText* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_audio_device;
	_tmp1_ = g_strdup (_tmp0_);
	saved = _tmp1_;
	_tmp2_ = self->priv->device_combo;
	g_signal_handlers_block_matched (_tmp2_, G_SIGNAL_MATCH_DATA, (guint) 0, (GQuark) 0, NULL, NULL, NULL);
	_tmp3_ = self->priv->device_combo;
	gtk_combo_box_text_remove_all (_tmp3_);
	_tmp4_ = self->priv->device_combo;
	gtk_combo_box_text_append (_tmp4_, "", _ ("System default"));
	_tmp6_ = screencast_applet_screencast_popover_get_audio_sources (self, &_tmp5_);
	{
		gchar** src_collection = NULL;
		gint src_collection_length1 = 0;
		gint _src_collection_size_ = 0;
		gint src_it = 0;
		src_collection = _tmp6_;
		src_collection_length1 = _tmp5_;
		for (src_it = 0; src_it < src_collection_length1; src_it = src_it + 1) {
			gchar* _tmp7_;
			gchar* src = NULL;
			_tmp7_ = g_strdup (src_collection[src_it]);
			src = _tmp7_;
			{
				GtkComboBoxText* _tmp8_;
				const gchar* _tmp9_;
				const gchar* _tmp10_;
				_tmp8_ = self->priv->device_combo;
				_tmp9_ = src;
				_tmp10_ = src;
				gtk_combo_box_text_append (_tmp8_, _tmp9_, _tmp10_);
				_g_free0 (src);
			}
		}
		src_collection = (_vala_array_free (src_collection, src_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp12_ = saved;
	if (g_strcmp0 (_tmp12_, "") != 0) {
		GtkComboBoxText* _tmp13_;
		const gchar* _tmp14_;
		_tmp13_ = self->priv->device_combo;
		_tmp14_ = saved;
		_tmp11_ = gtk_combo_box_set_active_id ((GtkComboBox*) _tmp13_, _tmp14_);
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
	} else {
		GtkComboBoxText* _tmp15_;
		_tmp15_ = self->priv->device_combo;
		gtk_combo_box_set_active_id ((GtkComboBox*) _tmp15_, "");
		screencast_applet_screencast_popover_set_audio_device (self, "");
	}
	_tmp16_ = self->priv->device_combo;
	g_signal_handlers_unblock_matched (_tmp16_, G_SIGNAL_MATCH_DATA, (guint) 0, (GQuark) 0, NULL, NULL, NULL);
	_tmp17_ = self->priv->device_combo;
	gtk_widget_show_all ((GtkWidget*) _tmp17_);
	_g_free0 (saved);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar**
screencast_applet_screencast_popover_get_audio_sources (ScreencastAppletScreencastPopover* self,
                                                        gint* result_length1)
{
	gchar** sources = NULL;
	gchar** _tmp0_;
	gint sources_length1;
	gint _sources_size_;
	gchar* pactl = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* stdout_buf = NULL;
	gchar* _tmp4_;
	gchar* stderr_buf = NULL;
	gchar* _tmp5_;
	gint status = 0;
	const gchar* _tmp16_;
	gchar** _tmp17_;
	gchar** _tmp18_;
	gchar** _tmp33_;
	gint _tmp33__length1;
	GError* _inner_error0_ = NULL;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	sources = _tmp0_;
	sources_length1 = 0;
	_sources_size_ = sources_length1;
	_tmp1_ = g_find_program_in_path ("pactl");
	pactl = _tmp1_;
	_tmp2_ = pactl;
	if (_tmp2_ == NULL) {
		gchar** _tmp3_;
		gint _tmp3__length1;
		_tmp3_ = sources;
		_tmp3__length1 = sources_length1;
		if (result_length1) {
			*result_length1 = _tmp3__length1;
		}
		result = _tmp3_;
		_g_free0 (pactl);
		return result;
	}
	_tmp4_ = g_strdup ("");
	stdout_buf = _tmp4_;
	_tmp5_ = g_strdup ("");
	stderr_buf = _tmp5_;
	status = 0;
	{
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		gint _tmp11_ = 0;
		_tmp6_ = pactl;
		_tmp7_ = g_strconcat (_tmp6_, " list short sources", NULL);
		_tmp8_ = _tmp7_;
		g_spawn_command_line_sync (_tmp8_, &_tmp9_, &_tmp10_, &_tmp11_, &_inner_error0_);
		_g_free0 (stdout_buf);
		stdout_buf = _tmp9_;
		_g_free0 (stderr_buf);
		stderr_buf = _tmp10_;
		status = _tmp11_;
		_g_free0 (_tmp8_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			_g_free0 (stderr_buf);
			_g_free0 (stdout_buf);
			_g_free0 (pactl);
			sources = (_vala_array_free (sources, sources_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		gchar** _tmp14_;
		gint _tmp14__length1;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		g_warning ("Screencast.vala:555: Failed to enumerate audio sources: %s", _tmp13_);
		_tmp14_ = sources;
		_tmp14__length1 = sources_length1;
		if (result_length1) {
			*result_length1 = _tmp14__length1;
		}
		result = _tmp14_;
		_g_error_free0 (e);
		_g_free0 (stderr_buf);
		_g_free0 (stdout_buf);
		_g_free0 (pactl);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (stderr_buf);
		_g_free0 (stdout_buf);
		_g_free0 (pactl);
		sources = (_vala_array_free (sources, sources_length1, (GDestroyNotify) g_free), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	if (status != 0) {
		gchar** _tmp15_;
		gint _tmp15__length1;
		_tmp15_ = sources;
		_tmp15__length1 = sources_length1;
		if (result_length1) {
			*result_length1 = _tmp15__length1;
		}
		result = _tmp15_;
		_g_free0 (stderr_buf);
		_g_free0 (stdout_buf);
		_g_free0 (pactl);
		return result;
	}
	_tmp16_ = stdout_buf;
	_tmp18_ = _tmp17_ = g_strsplit (_tmp16_, "\n", 0);
	{
		gchar** line_collection = NULL;
		gint line_collection_length1 = 0;
		gint _line_collection_size_ = 0;
		gint line_it = 0;
		line_collection = _tmp18_;
		line_collection_length1 = _vala_array_length (_tmp17_);
		for (line_it = 0; line_it < line_collection_length1; line_it = line_it + 1) {
			gchar* _tmp19_;
			gchar* line = NULL;
			_tmp19_ = g_strdup (line_collection[line_it]);
			line = _tmp19_;
			{
				gchar** parts = NULL;
				const gchar* _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				gchar** _tmp23_;
				gchar** _tmp24_;
				gchar** _tmp25_;
				gint _tmp25__length1;
				gint parts_length1;
				gint _parts_size_;
				gchar** _tmp26_;
				gint _tmp26__length1;
				_tmp20_ = line;
				_tmp21_ = string_strip (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp24_ = _tmp23_ = g_strsplit (_tmp22_, "\t", 0);
				_tmp25_ = _tmp24_;
				_tmp25__length1 = _vala_array_length (_tmp23_);
				_g_free0 (_tmp22_);
				parts = _tmp25_;
				parts_length1 = _tmp25__length1;
				_parts_size_ = parts_length1;
				_tmp26_ = parts;
				_tmp26__length1 = parts_length1;
				if (_tmp26__length1 >= 2) {
					gchar* name = NULL;
					gchar** _tmp27_;
					gint _tmp27__length1;
					const gchar* _tmp28_;
					gchar* _tmp29_;
					const gchar* _tmp30_;
					_tmp27_ = parts;
					_tmp27__length1 = parts_length1;
					_tmp28_ = _tmp27_[1];
					_tmp29_ = string_strip (_tmp28_);
					name = _tmp29_;
					_tmp30_ = name;
					if (g_strcmp0 (_tmp30_, "") != 0) {
						const gchar* _tmp31_;
						gchar* _tmp32_;
						_tmp31_ = name;
						_tmp32_ = g_strdup (_tmp31_);
						_vala_array_add1 (&sources, &sources_length1, &_sources_size_, _tmp32_);
					}
					_g_free0 (name);
				}
				parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (line);
			}
		}
		line_collection = (_vala_array_free (line_collection, line_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp33_ = sources;
	_tmp33__length1 = sources_length1;
	if (result_length1) {
		*result_length1 = _tmp33__length1;
	}
	result = _tmp33_;
	_g_free0 (stderr_buf);
	_g_free0 (stdout_buf);
	_g_free0 (pactl);
	return result;
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		ScreencastAppletScreencastPopover* self;
		self = _data4_->self;
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		ScreencastAppletScreencastPopover* self;
		self = _data5_->_data4_->self;
		_g_object_unref0 (_data5_->btn);
		block4_data_unref (_data5_->_data4_);
		_data5_->_data4_ = NULL;
		g_slice_free (Block5Data, _data5_);
	}
}

static void
_____lambda15_ (Block5Data* _data5_)
{
	Block4Data* _data4_;
	ScreencastAppletScreencastPopover* self;
	GtkToggleButton* _tmp0_;
	_data4_ = _data5_->_data4_;
	self = _data4_->self;
	if (_data4_->in_handler) {
		return;
	}
	_tmp0_ = _data5_->btn;
	if (!gtk_toggle_button_get_active (_tmp0_)) {
		GtkToggleButton* _tmp1_;
		_data4_->in_handler = TRUE;
		_tmp1_ = _data5_->btn;
		gtk_toggle_button_set_active (_tmp1_, TRUE);
		_data4_->in_handler = FALSE;
		return;
	}
	_data4_->in_handler = TRUE;
	{
		gint j = 0;
		j = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkToggleButton** _tmp4_;
				gint _tmp4__length1;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = j;
					j = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = _data4_->btns;
				_tmp4__length1 = _data4_->btns_length1;
				if (!(j < _tmp4__length1)) {
					break;
				}
				if (j != _data5_->idx) {
					GtkToggleButton** _tmp5_;
					gint _tmp5__length1;
					GtkToggleButton* _tmp6_;
					_tmp5_ = _data4_->btns;
					_tmp5__length1 = _data4_->btns_length1;
					_tmp6_ = _tmp5_[j];
					gtk_toggle_button_set_active (_tmp6_, FALSE);
				}
			}
		}
	}
	_data4_->in_handler = FALSE;
	_data4_->on_select (_data5_->val, _data4_->on_select_target);
}

static void
______lambda15__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                           gpointer self)
{
	_____lambda15_ (self);
}

static GtkBox*
screencast_applet_screencast_popover_make_preset_buttons (ScreencastAppletScreencastPopover* self,
                                                          gint* presets,
                                                          gint presets_length1,
                                                          gchar** labels,
                                                          gint labels_length1,
                                                          gchar** tips,
                                                          gint tips_length1,
                                                          gint active_value,
                                                          GtkToggleButton*** buttons,
                                                          gint* buttons_length1,
                                                          ScreencastAppletScreencastPopoverPresetSelected on_select,
                                                          gpointer on_select_target)
{
	GtkToggleButton** _vala_buttons = NULL;
	gint _vala_buttons_length1 = 0;
	Block4Data* _data4_;
	GtkBox* box = NULL;
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkStyleContext* _tmp2_;
	GtkToggleButton** _tmp3_;
	GtkToggleButton** _tmp4_;
	gint _tmp4__length1;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_data4_->on_select = on_select;
	_data4_->on_select_target = on_select_target;
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	_tmp1_ = box;
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _tmp1_);
	gtk_style_context_add_class (_tmp2_, "linked");
	_tmp3_ = g_new0 (GtkToggleButton*, presets_length1 + 1);
	_vala_buttons = (_vala_array_free (_vala_buttons, _vala_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	_vala_buttons = _tmp3_;
	_vala_buttons_length1 = presets_length1;
	_tmp4_ = _vala_buttons;
	_tmp4__length1 = _vala_buttons_length1;
	_data4_->btns = _tmp4_;
	_data4_->btns_length1 = _tmp4__length1;
	_data4_->_btns_size_ = _data4_->btns_length1;
	_data4_->in_handler = FALSE;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				Block5Data* _data5_;
				gint _tmp7_;
				const gchar* _tmp8_;
				GtkToggleButton* _tmp9_;
				gboolean _tmp10_ = FALSE;
				GtkToggleButton* _tmp13_;
				GtkToggleButton** _tmp14_;
				gint _tmp14__length1;
				GtkToggleButton* _tmp15_;
				GtkToggleButton* _tmp16_;
				GtkBox* _tmp17_;
				GtkToggleButton* _tmp18_;
				GtkToggleButton* _tmp19_;
				_data5_ = g_slice_new0 (Block5Data);
				_data5_->_ref_count_ = 1;
				_data5_->_data4_ = block4_data_ref (_data4_);
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				if (!(i < presets_length1)) {
					block5_data_unref (_data5_);
					_data5_ = NULL;
					break;
				}
				_tmp7_ = presets[i];
				_data5_->val = _tmp7_;
				_tmp8_ = labels[i];
				_tmp9_ = (GtkToggleButton*) gtk_toggle_button_new_with_label (_tmp8_);
				g_object_ref_sink (_tmp9_);
				_data5_->btn = _tmp9_;
				if (tips != NULL) {
					_tmp10_ = i < tips_length1;
				} else {
					_tmp10_ = FALSE;
				}
				if (_tmp10_) {
					GtkToggleButton* _tmp11_;
					const gchar* _tmp12_;
					_tmp11_ = _data5_->btn;
					_tmp12_ = tips[i];
					screencast_applet_screencast_popover_attach_hover_popover (self, (GtkWidget*) _tmp11_, _tmp12_, (guint) 600);
				}
				_tmp13_ = _data5_->btn;
				gtk_toggle_button_set_active (_tmp13_, _data5_->val == active_value);
				_tmp14_ = _vala_buttons;
				_tmp14__length1 = _vala_buttons_length1;
				_tmp15_ = _data5_->btn;
				_tmp16_ = _g_object_ref0 (_tmp15_);
				_g_object_unref0 (_tmp14_[i]);
				_tmp14_[i] = _tmp16_;
				_tmp17_ = box;
				_tmp18_ = _data5_->btn;
				gtk_box_pack_start (_tmp17_, (GtkWidget*) _tmp18_, FALSE, FALSE, (guint) 0);
				_data5_->idx = i;
				_tmp19_ = _data5_->btn;
				g_signal_connect_data (_tmp19_, "toggled", (GCallback) ______lambda15__gtk_toggle_button_toggled, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
				block5_data_unref (_data5_);
				_data5_ = NULL;
			}
		}
	}
	result = box;
	block4_data_unref (_data4_);
	_data4_ = NULL;
	if (buttons) {
		*buttons = _vala_buttons;
	} else {
		_vala_buttons = (_vala_array_free (_vala_buttons, _vala_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	if (buttons_length1) {
		*buttons_length1 = _vala_buttons_length1;
	}
	return result;
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		ScreencastAppletScreencastPopover* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->radio);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static void
____lambda7_ (Block6Data* _data6_)
{
	ScreencastAppletScreencastPopover* self;
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data6_->self;
	_tmp0_ = _data6_->radio;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkRadioButton* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp3_ = _data6_->radio;
		_tmp4_ = gtk_button_get_label ((GtkButton*) _tmp3_);
		_tmp5_ = _tmp4_;
		screencast_applet_screencast_popover_set_active (self, _tmp5_);
	}
}

static void
_____lambda7__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                         gpointer self)
{
	____lambda7_ (self);
}

void
screencast_applet_screencast_popover_generate_outputs (ScreencastAppletScreencastPopover* self)
{
	GtkBox* _tmp0_;
	GList* _tmp1_;
	gchar** current_outputs = NULL;
	gint _tmp6_ = 0;
	gchar** _tmp7_;
	gint current_outputs_length1;
	gint _current_outputs_size_;
	GtkRadioButton* first = NULL;
	gchar** _tmp8_;
	gint _tmp8__length1;
	GtkBox* _tmp24_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->output_box;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp1_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* _tmp2_;
			GtkWidget* child = NULL;
			_tmp2_ = _g_object_ref0 ((GtkWidget*) child_it->data);
			child = _tmp2_;
			{
				GtkBox* _tmp3_;
				GtkWidget* _tmp4_;
				GtkWidget* _tmp5_;
				_tmp3_ = self->priv->output_box;
				_tmp4_ = child;
				gtk_container_remove ((GtkContainer*) _tmp3_, _tmp4_);
				_tmp5_ = child;
				gtk_widget_destroy (_tmp5_);
				_g_object_unref0 (child);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
	_tmp7_ = screencast_applet_screencast_popover_get_output_list (self, &_tmp6_);
	current_outputs = _tmp7_;
	current_outputs_length1 = _tmp6_;
	_current_outputs_size_ = current_outputs_length1;
	first = NULL;
	_tmp8_ = current_outputs;
	_tmp8__length1 = current_outputs_length1;
	{
		gchar** output_collection = NULL;
		gint output_collection_length1 = 0;
		gint _output_collection_size_ = 0;
		gint output_it = 0;
		output_collection = _tmp8_;
		output_collection_length1 = _tmp8__length1;
		for (output_it = 0; output_it < output_collection_length1; output_it = output_it + 1) {
			gchar* _tmp9_;
			gchar* output = NULL;
			_tmp9_ = g_strdup (output_collection[output_it]);
			output = _tmp9_;
			{
				Block6Data* _data6_;
				const gchar* _tmp10_;
				GtkRadioButton* _tmp12_;
				const gchar* _tmp13_;
				GtkRadioButton* _tmp14_;
				GtkRadioButton* _tmp15_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				GtkRadioButton* _tmp21_;
				GtkBox* _tmp22_;
				GtkRadioButton* _tmp23_;
				_data6_ = g_slice_new0 (Block6Data);
				_data6_->_ref_count_ = 1;
				_data6_->self = g_object_ref (self);
				_tmp10_ = self->priv->_active;
				if (g_strcmp0 (_tmp10_, "") == 0) {
					const gchar* _tmp11_;
					_tmp11_ = output;
					screencast_applet_screencast_popover_set_active (self, _tmp11_);
				}
				_tmp12_ = first;
				_tmp13_ = output;
				_tmp14_ = (GtkRadioButton*) gtk_radio_button_new_with_label_from_widget (_tmp12_, _tmp13_);
				g_object_ref_sink (_tmp14_);
				_data6_->radio = _tmp14_;
				_tmp15_ = first;
				if (_tmp15_ == NULL) {
					GtkRadioButton* _tmp16_;
					GtkRadioButton* _tmp17_;
					_tmp16_ = _data6_->radio;
					_tmp17_ = _g_object_ref0 (_tmp16_);
					_g_object_unref0 (first);
					first = _tmp17_;
				}
				_tmp18_ = output;
				_tmp19_ = self->priv->_active;
				if (g_strcmp0 (_tmp18_, _tmp19_) == 0) {
					GtkRadioButton* _tmp20_;
					_tmp20_ = _data6_->radio;
					gtk_toggle_button_set_active ((GtkToggleButton*) _tmp20_, TRUE);
				}
				_tmp21_ = _data6_->radio;
				g_signal_connect_data ((GtkToggleButton*) _tmp21_, "toggled", (GCallback) _____lambda7__gtk_toggle_button_toggled, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
				_tmp22_ = self->priv->output_box;
				_tmp23_ = _data6_->radio;
				gtk_box_pack_start (_tmp22_, (GtkWidget*) _tmp23_, FALSE, FALSE, (guint) 0);
				_g_free0 (output);
				block6_data_unref (_data6_);
				_data6_ = NULL;
			}
		}
	}
	_tmp24_ = self->priv->output_box;
	gtk_widget_show_all ((GtkWidget*) _tmp24_);
	_g_object_unref0 (first);
	current_outputs = (_vala_array_free (current_outputs, current_outputs_length1, (GDestroyNotify) g_free), NULL);
}

gchar*
screencast_applet_screencast_popover_get_selected_output (ScreencastAppletScreencastPopover* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar**
screencast_applet_screencast_popover_get_output_list (ScreencastAppletScreencastPopover* self,
                                                      gint* result_length1)
{
	gchar** current_outputs = NULL;
	gchar** _tmp0_;
	gint current_outputs_length1;
	gint _current_outputs_size_;
	XfwScreen* _tmp1_;
	GList* monitors = NULL;
	XfwScreen* _tmp3_;
	GList* _tmp4_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	current_outputs = _tmp0_;
	current_outputs_length1 = 0;
	_current_outputs_size_ = current_outputs_length1;
	_tmp1_ = self->priv->screen;
	if (_tmp1_ == NULL) {
		gchar** _tmp2_;
		gint _tmp2__length1;
		g_warning ("Screencast.vala:668: No displays found\n");
		_tmp2_ = current_outputs;
		_tmp2__length1 = current_outputs_length1;
		if (result_length1) {
			*result_length1 = _tmp2__length1;
		}
		result = _tmp2_;
		return result;
	}
	_tmp3_ = self->priv->screen;
	_tmp4_ = xfw_screen_get_monitors (_tmp3_);
	monitors = _tmp4_;
	{
		GList* m = NULL;
		GList* _tmp5_;
		_tmp5_ = monitors;
		m = _tmp5_;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				GList* _tmp9_;
				GList* _tmp10_;
				gconstpointer _tmp11_;
				GList* _tmp12_;
				gconstpointer _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				if (!_tmp6_) {
					GList* _tmp7_;
					GList* _tmp8_;
					_tmp7_ = m;
					_tmp8_ = _tmp7_->next;
					m = _tmp8_;
				}
				_tmp6_ = FALSE;
				_tmp9_ = m;
				if (!(_tmp9_ != NULL)) {
					break;
				}
				_tmp10_ = m;
				_tmp11_ = _tmp10_->data;
				if (((XfwMonitor*) _tmp11_) == NULL) {
					continue;
				}
				_tmp12_ = m;
				_tmp13_ = _tmp12_->data;
				_tmp14_ = xfw_monitor_get_connector ((XfwMonitor*) _tmp13_);
				_tmp15_ = g_strdup (_tmp14_);
				_vala_array_add2 (&current_outputs, &current_outputs_length1, &_current_outputs_size_, _tmp15_);
			}
		}
	}
	_tmp16_ = current_outputs;
	_tmp16__length1 = current_outputs_length1;
	if (result_length1) {
		*result_length1 = _tmp16__length1;
	}
	result = _tmp16_;
	return result;
}

static gint
screencast_applet_screencast_popover_find_nearest_preset (ScreencastAppletScreencastPopover* self,
                                                          gint* presets,
                                                          gint presets_length1,
                                                          gint target)
{
	gint _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	{
		gint* p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
		p_collection = presets;
		p_collection_length1 = presets_length1;
		for (p_it = 0; p_it < p_collection_length1; p_it = p_it + 1) {
			gint p = 0;
			p = p_collection[p_it];
			{
				if (p == target) {
					result = p;
					return result;
				}
			}
		}
	}
	_tmp0_ = presets[0];
	result = _tmp0_;
	return result;
}

const gchar*
screencast_applet_screencast_popover_get_active (ScreencastAppletScreencastPopover* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active;
	result = _tmp0_;
	return result;
}

static void
screencast_applet_screencast_popover_set_active (ScreencastAppletScreencastPopover* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_popover_get_active (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_active);
		self->priv->_active = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_ACTIVE_PROPERTY]);
	}
}

RecorderControlCaptureMode
screencast_applet_screencast_popover_get_capture_mode (ScreencastAppletScreencastPopover* self)
{
	RecorderControlCaptureMode result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_capture_mode;
	return result;
}

static void
screencast_applet_screencast_popover_set_capture_mode (ScreencastAppletScreencastPopover* self,
                                                       RecorderControlCaptureMode value)
{
	RecorderControlCaptureMode old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_popover_get_capture_mode (self);
	if (old_value != value) {
		self->priv->_capture_mode = value;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_CAPTURE_MODE_PROPERTY]);
	}
}

gint
screencast_applet_screencast_popover_get_delay_seconds (ScreencastAppletScreencastPopover* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_delay_seconds;
	return result;
}

static void
screencast_applet_screencast_popover_set_delay_seconds (ScreencastAppletScreencastPopover* self,
                                                        gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_popover_get_delay_seconds (self);
	if (old_value != value) {
		self->priv->_delay_seconds = value;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_DELAY_SECONDS_PROPERTY]);
	}
}

gint
screencast_applet_screencast_popover_get_duration_seconds (ScreencastAppletScreencastPopover* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_duration_seconds;
	return result;
}

static void
screencast_applet_screencast_popover_set_duration_seconds (ScreencastAppletScreencastPopover* self,
                                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_popover_get_duration_seconds (self);
	if (old_value != value) {
		self->priv->_duration_seconds = value;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_DURATION_SECONDS_PROPERTY]);
	}
}

gboolean
screencast_applet_screencast_popover_get_audio_enabled (ScreencastAppletScreencastPopover* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_audio_enabled;
	return result;
}

static void
screencast_applet_screencast_popover_set_audio_enabled (ScreencastAppletScreencastPopover* self,
                                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_popover_get_audio_enabled (self);
	if (old_value != value) {
		self->priv->_audio_enabled = value;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_ENABLED_PROPERTY]);
	}
}

const gchar*
screencast_applet_screencast_popover_get_audio_device (ScreencastAppletScreencastPopover* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_audio_device;
	result = _tmp0_;
	return result;
}

static void
screencast_applet_screencast_popover_set_audio_device (ScreencastAppletScreencastPopover* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_popover_get_audio_device (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_audio_device);
		self->priv->_audio_device = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_DEVICE_PROPERTY]);
	}
}

static void
screencast_applet_screencast_popover_class_init (ScreencastAppletScreencastPopoverClass * klass,
                                                 gpointer klass_data)
{
	screencast_applet_screencast_popover_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScreencastAppletScreencastPopover_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_screencast_applet_screencast_popover_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_screencast_applet_screencast_popover_set_property;
	G_OBJECT_CLASS (klass)->finalize = screencast_applet_screencast_popover_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_POPOVER_ACTIVE_PROPERTY, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_ACTIVE_PROPERTY] = g_param_spec_string ("active", "active", "active", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_POPOVER_CAPTURE_MODE_PROPERTY, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_CAPTURE_MODE_PROPERTY] = g_param_spec_enum ("capture-mode", "capture-mode", "capture-mode", RECORDER_CONTROL_TYPE_CAPTURE_MODE, RECORDER_CONTROL_CAPTURE_MODE_SCREEN, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_POPOVER_DELAY_SECONDS_PROPERTY, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_DELAY_SECONDS_PROPERTY] = g_param_spec_int ("delay-seconds", "delay-seconds", "delay-seconds", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_POPOVER_DURATION_SECONDS_PROPERTY, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_DURATION_SECONDS_PROPERTY] = g_param_spec_int ("duration-seconds", "duration-seconds", "duration-seconds", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_ENABLED_PROPERTY, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_ENABLED_PROPERTY] = g_param_spec_boolean ("audio-enabled", "audio-enabled", "audio-enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_DEVICE_PROPERTY, screencast_applet_screencast_popover_properties[SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_DEVICE_PROPERTY] = g_param_spec_string ("audio-device", "audio-device", "audio-device", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
screencast_applet_screencast_popover_instance_init (ScreencastAppletScreencastPopover * self,
                                                    gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = screencast_applet_screencast_popover_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_active = _tmp0_;
	self->priv->_capture_mode = RECORDER_CONTROL_CAPTURE_MODE_SCREEN;
	self->priv->_delay_seconds = 0;
	self->priv->_duration_seconds = 0;
	self->priv->_audio_enabled = FALSE;
	_tmp1_ = g_strdup ("");
	self->priv->_audio_device = _tmp1_;
}

static void
screencast_applet_screencast_popover_finalize (GObject * obj)
{
	ScreencastAppletScreencastPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCREENCAST_APPLET_TYPE_SCREENCAST_POPOVER, ScreencastAppletScreencastPopover);
	_g_object_unref0 (self->priv->screen_button);
	_g_object_unref0 (self->priv->area_button);
	_g_object_unref0 (self->priv->output_revealer);
	_g_object_unref0 (self->priv->output_box);
	self->priv->delay_buttons = (_vala_array_free (self->priv->delay_buttons, self->priv->delay_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->duration_buttons = (_vala_array_free (self->priv->duration_buttons, self->priv->duration_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->audio_button);
	_g_object_unref0 (self->priv->device_combo);
	_g_object_unref0 (self->priv->audio_device_revealer);
	_g_free0 (self->priv->_active);
	_g_free0 (self->priv->_audio_device);
	_g_object_unref0 (self->priv->screen);
	_g_object_unref0 (self->priv->settings);
	G_OBJECT_CLASS (screencast_applet_screencast_popover_parent_class)->finalize (obj);
}

GType
screencast_applet_screencast_popover_get_type (void)
{
	return screencast_applet_screencast_popover_type_id;
}

GType
screencast_applet_screencast_popover_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScreencastAppletScreencastPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) screencast_applet_screencast_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScreencastAppletScreencastPopover), 0, (GInstanceInitFunc) screencast_applet_screencast_popover_instance_init, NULL };
	screencast_applet_screencast_popover_type_id = g_type_module_register_type (module, budgie_popover_get_type (), "ScreencastAppletScreencastPopover", &g_define_type_info, 0);
	ScreencastAppletScreencastPopover_private_offset = sizeof (ScreencastAppletScreencastPopoverPrivate);
	return screencast_applet_screencast_popover_type_id;
}

static void
_vala_screencast_applet_screencast_popover_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	ScreencastAppletScreencastPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCREENCAST_APPLET_TYPE_SCREENCAST_POPOVER, ScreencastAppletScreencastPopover);
	switch (property_id) {
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_ACTIVE_PROPERTY:
		g_value_set_string (value, screencast_applet_screencast_popover_get_active (self));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_CAPTURE_MODE_PROPERTY:
		g_value_set_enum (value, screencast_applet_screencast_popover_get_capture_mode (self));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_DELAY_SECONDS_PROPERTY:
		g_value_set_int (value, screencast_applet_screencast_popover_get_delay_seconds (self));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_DURATION_SECONDS_PROPERTY:
		g_value_set_int (value, screencast_applet_screencast_popover_get_duration_seconds (self));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_ENABLED_PROPERTY:
		g_value_set_boolean (value, screencast_applet_screencast_popover_get_audio_enabled (self));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_DEVICE_PROPERTY:
		g_value_set_string (value, screencast_applet_screencast_popover_get_audio_device (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_screencast_applet_screencast_popover_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	ScreencastAppletScreencastPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCREENCAST_APPLET_TYPE_SCREENCAST_POPOVER, ScreencastAppletScreencastPopover);
	switch (property_id) {
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_ACTIVE_PROPERTY:
		screencast_applet_screencast_popover_set_active (self, g_value_get_string (value));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_CAPTURE_MODE_PROPERTY:
		screencast_applet_screencast_popover_set_capture_mode (self, g_value_get_enum (value));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_DELAY_SECONDS_PROPERTY:
		screencast_applet_screencast_popover_set_delay_seconds (self, g_value_get_int (value));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_DURATION_SECONDS_PROPERTY:
		screencast_applet_screencast_popover_set_duration_seconds (self, g_value_get_int (value));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_ENABLED_PROPERTY:
		screencast_applet_screencast_popover_set_audio_enabled (self, g_value_get_boolean (value));
		break;
		case SCREENCAST_APPLET_SCREENCAST_POPOVER_AUDIO_DEVICE_PROPERTY:
		screencast_applet_screencast_popover_set_audio_device (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
screencast_applet_screencast_applet_get_instance_private (ScreencastAppletScreencastApplet* self)
{
	return G_STRUCT_MEMBER_P (self, ScreencastAppletScreencastApplet_private_offset);
}

static void
__lambda25_ (ScreencastAppletScreencastApplet* self)
{
	gchar* save_path = NULL;
	GSettings* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	_tmp0_ = self->priv->settings;
	_tmp1_ = g_settings_get_string (_tmp0_, "save-path");
	save_path = _tmp1_;
	_tmp2_ = save_path;
	if (screencast_applet_is_valid_folder (_tmp2_)) {
		RecorderControlRecorder* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->recorder_app;
		_tmp4_ = save_path;
		recorder_control_recorder_set_save_path (_tmp3_, _tmp4_);
	}
	_g_free0 (save_path);
}

static void
___lambda25__g_settings_changed (GSettings* _sender,
                                 const gchar* key,
                                 gpointer self)
{
	__lambda25_ ((ScreencastAppletScreencastApplet*) self);
}

static void
__lambda26_ (ScreencastAppletScreencastApplet* self,
             gboolean rec)
{
	ScreencastIcon* _tmp0_;
	_tmp0_ = self->priv->panel_widget;
	screencast_icon_set_recording (_tmp0_, rec);
}

static void
___lambda26__recorder_control_recorder_recording_changed (RecorderControlRecorder* _sender,
                                                          gboolean recording,
                                                          gpointer self)
{
	__lambda26_ ((ScreencastAppletScreencastApplet*) self, recording);
}

static void
__lambda27_ (ScreencastAppletScreencastApplet* self,
             gboolean pend,
             gint countdown)
{
	ScreencastIcon* _tmp0_;
	_tmp0_ = self->priv->panel_widget;
	screencast_icon_set_pending (_tmp0_, pend, countdown);
	if (pend) {
		ScreencastIcon* _tmp1_;
		_tmp1_ = self->priv->panel_widget;
		screencast_icon_update_countdown (_tmp1_, countdown);
	}
}

static void
___lambda27__recorder_control_recorder_pending_changed (RecorderControlRecorder* _sender,
                                                        gboolean pending,
                                                        gint countdown,
                                                        gpointer self)
{
	__lambda27_ ((ScreencastAppletScreencastApplet*) self, pending, countdown);
}

static gboolean
__lambda28_ (ScreencastAppletScreencastApplet* self,
             GdkEventButton* e)
{
	ScreencastAppletScreencastPopover* _tmp24_;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	if (e->button == ((guint) 1)) {
		RecorderControlCaptureMode mode = 0;
		ScreencastAppletScreencastPopover* _tmp0_;
		RecorderControlCaptureMode _tmp1_;
		RecorderControlCaptureMode _tmp2_;
		gchar* _tmp3_ = NULL;
		gchar* output = NULL;
		gchar* _tmp7_;
		gboolean _tmp8_ = FALSE;
		RecorderControlRecorder* _tmp10_;
		const gchar* _tmp11_;
		ScreencastAppletScreencastPopover* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		ScreencastAppletScreencastPopover* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		ScreencastAppletScreencastPopover* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		ScreencastAppletScreencastPopover* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		_tmp0_ = self->priv->popover;
		_tmp1_ = screencast_applet_screencast_popover_get_capture_mode (_tmp0_);
		_tmp2_ = _tmp1_;
		mode = _tmp2_;
		if (mode == RECORDER_CONTROL_CAPTURE_MODE_SCREEN) {
			ScreencastAppletScreencastPopover* _tmp4_;
			gchar* _tmp5_;
			_tmp4_ = self->priv->popover;
			_tmp5_ = screencast_applet_screencast_popover_get_selected_output (_tmp4_);
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp5_;
		} else {
			gchar* _tmp6_;
			_tmp6_ = g_strdup ("");
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp6_;
		}
		_tmp7_ = _tmp3_;
		_tmp3_ = NULL;
		output = _tmp7_;
		if (mode == RECORDER_CONTROL_CAPTURE_MODE_SCREEN) {
			const gchar* _tmp9_;
			_tmp9_ = output;
			_tmp8_ = g_strcmp0 (_tmp9_, "") == 0;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			result = GDK_EVENT_STOP;
			_g_free0 (output);
			_g_free0 (_tmp3_);
			return result;
		}
		_tmp10_ = self->priv->recorder_app;
		_tmp11_ = output;
		_tmp12_ = self->priv->popover;
		_tmp13_ = screencast_applet_screencast_popover_get_delay_seconds (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = self->priv->popover;
		_tmp16_ = screencast_applet_screencast_popover_get_duration_seconds (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = self->priv->popover;
		_tmp19_ = screencast_applet_screencast_popover_get_audio_enabled (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->popover;
		_tmp22_ = screencast_applet_screencast_popover_get_audio_device (_tmp21_);
		_tmp23_ = _tmp22_;
		recorder_control_recorder_toggle (_tmp10_, _tmp11_, mode, _tmp14_, _tmp17_, _tmp20_, _tmp23_);
		result = GDK_EVENT_STOP;
		_g_free0 (output);
		_g_free0 (_tmp3_);
		return result;
	}
	_tmp24_ = self->priv->popover;
	if (gtk_widget_get_visible ((GtkWidget*) _tmp24_)) {
		ScreencastAppletScreencastPopover* _tmp25_;
		_tmp25_ = self->priv->popover;
		gtk_widget_hide ((GtkWidget*) _tmp25_);
	} else {
		BudgiePopoverManager* _tmp26_;
		ScreencastIcon* _tmp27_;
		_tmp26_ = self->priv->manager;
		_tmp27_ = self->priv->panel_widget;
		budgie_popover_manager_show_popover (_tmp26_, (GtkWidget*) _tmp27_);
	}
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
___lambda28__gtk_widget_button_press_event (GtkWidget* _sender,
                                            GdkEventButton* event,
                                            gpointer self)
{
	gboolean result;
	result = __lambda28_ ((ScreencastAppletScreencastApplet*) self, event);
	return result;
}

ScreencastAppletScreencastApplet*
screencast_applet_screencast_applet_construct (GType object_type,
                                               const gchar* uuid)
{
	ScreencastAppletScreencastApplet * self = NULL;
	RecorderControlRecorder* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	gchar* save_path = NULL;
	GSettings* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	RecorderControlRecorder* _tmp8_;
	const gchar* _tmp9_;
	ScreencastIcon* _tmp10_;
	ScreencastIcon* _tmp11_;
	RecorderControlRecorder* _tmp12_;
	RecorderControlRecorder* _tmp13_;
	ScreencastIcon* _tmp14_;
	GSettings* _tmp15_;
	ScreencastAppletScreencastPopover* _tmp16_;
	ScreencastIcon* _tmp17_;
	ScreencastAppletScreencastPopover* _tmp18_;
	GtkWidget* _tmp19_;
	g_return_val_if_fail (uuid != NULL, NULL);
	self = (ScreencastAppletScreencastApplet*) g_object_new (object_type, "uuid", uuid, NULL);
	screencast_applet_screencast_applet_initialiseLocaleLanguageSupport (self);
	_tmp0_ = recorder_control_recorder_new ();
	_g_object_unref0 (self->priv->recorder_app);
	self->priv->recorder_app = _tmp0_;
	budgie_applet_set_settings_schema ((BudgieApplet*) self, "org.ubuntubudgie.budgie-screencast");
	budgie_applet_set_settings_prefix ((BudgieApplet*) self, "/com/solus-project/budgie-panel/instance/budgie-screencast");
	_tmp1_ = budgie_applet_get_applet_settings ((BudgieApplet*) self, uuid);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = self->priv->settings;
	g_signal_connect_object (_tmp2_, "changed::save-path", (GCallback) ___lambda25__g_settings_changed, self, 0);
	_tmp3_ = self->priv->settings;
	_tmp4_ = g_settings_get_string (_tmp3_, "save-path");
	save_path = _tmp4_;
	_tmp5_ = save_path;
	if (!screencast_applet_is_valid_folder (_tmp5_)) {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = screencast_applet_default_path;
		_tmp7_ = g_strdup (_tmp6_);
		_g_free0 (save_path);
		save_path = _tmp7_;
	}
	_tmp8_ = self->priv->recorder_app;
	_tmp9_ = save_path;
	recorder_control_recorder_set_save_path (_tmp8_, _tmp9_);
	_tmp10_ = screencast_icon_new ("budgie-screencast-symbolic");
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->panel_widget);
	self->priv->panel_widget = _tmp10_;
	_tmp11_ = self->priv->panel_widget;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp11_);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp12_ = self->priv->recorder_app;
	g_signal_connect_object (_tmp12_, "recording-changed", (GCallback) ___lambda26__recorder_control_recorder_recording_changed, self, 0);
	_tmp13_ = self->priv->recorder_app;
	g_signal_connect_object (_tmp13_, "pending-changed", (GCallback) ___lambda27__recorder_control_recorder_pending_changed, self, 0);
	_tmp14_ = self->priv->panel_widget;
	_tmp15_ = self->priv->settings;
	_tmp16_ = screencast_applet_screencast_popover_new ((GtkEventBox*) _tmp14_, _tmp15_);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->popover);
	self->priv->popover = _tmp16_;
	_tmp17_ = self->priv->panel_widget;
	g_signal_connect_object ((GtkWidget*) _tmp17_, "button-press-event", (GCallback) ___lambda28__gtk_widget_button_press_event, self, 0);
	_tmp18_ = self->priv->popover;
	_tmp19_ = gtk_bin_get_child ((GtkBin*) _tmp18_);
	gtk_widget_show_all (_tmp19_);
	_g_free0 (save_path);
	return self;
}

ScreencastAppletScreencastApplet*
screencast_applet_screencast_applet_new (const gchar* uuid)
{
	return screencast_applet_screencast_applet_construct (SCREENCAST_APPLET_TYPE_SCREENCAST_APPLET, uuid);
}

static gboolean
screencast_applet_screencast_applet_real_supports_settings (BudgieApplet* base)
{
	ScreencastAppletScreencastApplet * self;
	gboolean result;
	self = (ScreencastAppletScreencastApplet*) base;
	result = TRUE;
	return result;
}

static GtkWidget*
screencast_applet_screencast_applet_real_get_settings_ui (BudgieApplet* base)
{
	ScreencastAppletScreencastApplet * self;
	const gchar* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	ScreencastAppletScreencastSettings* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* result;
	self = (ScreencastAppletScreencastApplet*) base;
	_tmp0_ = self->priv->_uuid;
	_tmp1_ = budgie_applet_get_applet_settings ((BudgieApplet*) self, _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = screencast_applet_screencast_settings_new (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = (GtkWidget*) _tmp3_;
	_g_object_unref0 (_tmp2_);
	result = _tmp4_;
	return result;
}

static void
screencast_applet_screencast_applet_real_update_popovers (BudgieApplet* base,
                                                          BudgiePopoverManager* manager)
{
	ScreencastAppletScreencastApplet * self;
	ScreencastIcon* _tmp0_;
	ScreencastAppletScreencastPopover* _tmp1_;
	self = (ScreencastAppletScreencastApplet*) base;
	self->priv->manager = manager;
	_tmp0_ = self->priv->panel_widget;
	_tmp1_ = self->priv->popover;
	budgie_popover_manager_register_popover (manager, (GtkWidget*) _tmp0_, (GtkPopover*) _tmp1_);
}

void
screencast_applet_screencast_applet_initialiseLocaleLanguageSupport (ScreencastAppletScreencastApplet* self)
{
	g_return_if_fail (self != NULL);
	setlocale (LC_ALL, "");
	bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);
}

const gchar*
screencast_applet_screencast_applet_get_uuid (ScreencastAppletScreencastApplet* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uuid;
	result = _tmp0_;
	return result;
}

void
screencast_applet_screencast_applet_set_uuid (ScreencastAppletScreencastApplet* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = screencast_applet_screencast_applet_get_uuid (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_uuid);
		self->priv->_uuid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, screencast_applet_screencast_applet_properties[SCREENCAST_APPLET_SCREENCAST_APPLET_UUID_PROPERTY]);
	}
}

static void
screencast_applet_screencast_applet_class_init (ScreencastAppletScreencastAppletClass * klass,
                                                gpointer klass_data)
{
	screencast_applet_screencast_applet_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScreencastAppletScreencastApplet_private_offset);
	((BudgieAppletClass *) klass)->supports_settings = (gboolean (*) (BudgieApplet*)) screencast_applet_screencast_applet_real_supports_settings;
	((BudgieAppletClass *) klass)->get_settings_ui = (GtkWidget* (*) (BudgieApplet*)) screencast_applet_screencast_applet_real_get_settings_ui;
	((BudgieAppletClass *) klass)->update_popovers = (void (*) (BudgieApplet*, BudgiePopoverManager*)) screencast_applet_screencast_applet_real_update_popovers;
	G_OBJECT_CLASS (klass)->get_property = _vala_screencast_applet_screencast_applet_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_screencast_applet_screencast_applet_set_property;
	G_OBJECT_CLASS (klass)->finalize = screencast_applet_screencast_applet_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SCREENCAST_APPLET_SCREENCAST_APPLET_UUID_PROPERTY, screencast_applet_screencast_applet_properties[SCREENCAST_APPLET_SCREENCAST_APPLET_UUID_PROPERTY] = g_param_spec_string ("uuid", "uuid", "uuid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
screencast_applet_screencast_applet_instance_init (ScreencastAppletScreencastApplet * self,
                                                   gpointer klass)
{
	self->priv = screencast_applet_screencast_applet_get_instance_private (self);
	self->priv->popover = NULL;
	self->priv->manager = NULL;
}

static void
screencast_applet_screencast_applet_finalize (GObject * obj)
{
	ScreencastAppletScreencastApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCREENCAST_APPLET_TYPE_SCREENCAST_APPLET, ScreencastAppletScreencastApplet);
	_g_object_unref0 (self->priv->panel_widget);
	_g_object_unref0 (self->priv->popover);
	_g_object_unref0 (self->priv->settings);
	_g_free0 (self->priv->_uuid);
	_g_object_unref0 (self->priv->recorder_app);
	G_OBJECT_CLASS (screencast_applet_screencast_applet_parent_class)->finalize (obj);
}

GType
screencast_applet_screencast_applet_get_type (void)
{
	return screencast_applet_screencast_applet_type_id;
}

GType
screencast_applet_screencast_applet_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScreencastAppletScreencastAppletClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) screencast_applet_screencast_applet_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScreencastAppletScreencastApplet), 0, (GInstanceInitFunc) screencast_applet_screencast_applet_instance_init, NULL };
	screencast_applet_screencast_applet_type_id = g_type_module_register_type (module, budgie_applet_get_type (), "ScreencastAppletScreencastApplet", &g_define_type_info, 0);
	ScreencastAppletScreencastApplet_private_offset = sizeof (ScreencastAppletScreencastAppletPrivate);
	return screencast_applet_screencast_applet_type_id;
}

static void
_vala_screencast_applet_screencast_applet_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec)
{
	ScreencastAppletScreencastApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCREENCAST_APPLET_TYPE_SCREENCAST_APPLET, ScreencastAppletScreencastApplet);
	switch (property_id) {
		case SCREENCAST_APPLET_SCREENCAST_APPLET_UUID_PROPERTY:
		g_value_set_string (value, screencast_applet_screencast_applet_get_uuid (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_screencast_applet_screencast_applet_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec)
{
	ScreencastAppletScreencastApplet * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SCREENCAST_APPLET_TYPE_SCREENCAST_APPLET, ScreencastAppletScreencastApplet);
	switch (property_id) {
		case SCREENCAST_APPLET_SCREENCAST_APPLET_UUID_PROPERTY:
		screencast_applet_screencast_applet_set_uuid (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gboolean
screencast_applet_is_valid_folder (const gchar* path)
{
	gboolean _tmp0_ = FALSE;
	GFile* file = NULL;
	GFile* _tmp3_;
	GFile* _tmp4_;
	GFile* _tmp5_;
	gboolean result;
	g_return_val_if_fail (path != NULL, FALSE);
	if (path == NULL) {
		_tmp0_ = TRUE;
	} else {
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = string_strip (path);
		_tmp2_ = _tmp1_;
		_tmp0_ = g_strcmp0 (_tmp2_, "") == 0;
		_g_free0 (_tmp2_);
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = g_file_new_for_path (path);
	file = _tmp3_;
	_tmp4_ = file;
	if (!g_file_query_exists (_tmp4_, NULL)) {
		result = FALSE;
		_g_object_unref0 (file);
		return result;
	}
	_tmp5_ = file;
	result = g_file_query_file_type (_tmp5_, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY;
	_g_object_unref0 (file);
	return result;
}

void
peas_register_types (GTypeModule* module)
{
	PeasObjectModule* objmodule = NULL;
	PeasObjectModule* _tmp0_;
	g_return_if_fail (module != NULL);
	screencast_applet_screencast_settings_register_type (module);
	screencast_applet_plugin_register_type (module);
	screencast_applet_screencast_popover_register_type (module);
	screencast_applet_screencast_applet_register_type (module);
	recorder_control_recorder_register_type (module);
	screencast_icon_register_type (module);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (module, peas_object_module_get_type ()) ? ((PeasObjectModule*) module) : NULL);
	objmodule = _tmp0_;
	peas_object_module_register_extension_type (objmodule, budgie_plugin_get_type (), SCREENCAST_APPLET_TYPE_PLUGIN);
	_g_object_unref0 (objmodule);
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

