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

#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <pango/pango.h>
#include <float.h>
#include <math.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

VALA_EXTERN GtkWindow* files_get_active_window (void);
VALA_EXTERN gboolean files_is_admin (void);
VALA_EXTERN GtkLabel* files_make_key_label (const gchar* label);
VALA_EXTERN GtkLabel* files_make_value_label (const gchar* label);

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

GtkWindow*
files_get_active_window (void)
{
	GtkApplication* gtk_app = NULL;
	GApplication* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* _tmp2_;
	GtkWindow* result;
	_tmp0_ = g_application_get_default ();
	gtk_app = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication);
	_tmp1_ = gtk_application_get_active_window (gtk_app);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

gboolean
files_is_admin (void)
{
	gboolean result;
	result = getuid () == ((uid_t) 0);
	return result;
}

GtkLabel*
files_make_key_label (const gchar* label)
{
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* result;
	g_return_val_if_fail (label != NULL, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (label);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_END);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 12);
	g_object_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

GtkLabel*
files_make_value_label (const gchar* label)
{
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* result;
	g_return_val_if_fail (label != NULL, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (label);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_label_set_selectable (_tmp0_, TRUE);
	gtk_label_set_use_markup (_tmp0_, TRUE);
	g_object_set (_tmp0_, "wrap", TRUE, NULL);
	gtk_label_set_ellipsize (_tmp0_, PANGO_ELLIPSIZE_END);
	gtk_label_set_lines (_tmp0_, 2);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

