/* PointingStick.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from PointingStick.vala, do not modify */

/*
 * SPDX-License-Identifier: GPL-2.0-or-later
 * SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io)
 */

#include "mouse-touchpad.h"
#include <glib-object.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <switchboard.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <granite-7.h>
#include <stdlib.h>
#include <string.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  {
	MOUSE_TOUCHPAD_POINTING_STICK_VIEW_0_PROPERTY,
	MOUSE_TOUCHPAD_POINTING_STICK_VIEW_NUM_PROPERTIES
};
static GParamSpec* mouse_touchpad_pointing_stick_view_properties[MOUSE_TOUCHPAD_POINTING_STICK_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

static gpointer mouse_touchpad_pointing_stick_view_parent_class = NULL;

static GObject * mouse_touchpad_pointing_stick_view_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static GType mouse_touchpad_pointing_stick_view_get_type_once (void);

MouseTouchpadPointingStickView*
mouse_touchpad_pointing_stick_view_construct (GType object_type)
{
	MouseTouchpadPointingStickView * self = NULL;
	GThemedIcon* _tmp0_;
	GThemedIcon* _tmp1_;
	_tmp0_ = (GThemedIcon*) g_themed_icon_new ("mouse-touchpad-pointingstick");
	_tmp1_ = _tmp0_;
	self = (MouseTouchpadPointingStickView*) g_object_new (object_type, "header", _ ("Devices"), "icon", _tmp1_, "title", _ ("Pointing Stick"), NULL);
	_g_object_unref0 (_tmp1_);
	return self;
}

MouseTouchpadPointingStickView*
mouse_touchpad_pointing_stick_view_new (void)
{
	return mouse_touchpad_pointing_stick_view_construct (MOUSE_TOUCHPAD_TYPE_POINTING_STICK_VIEW);
}

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

static GObject *
mouse_touchpad_pointing_stick_view_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	MouseTouchpadPointingStickView * self;
	GtkAdjustment* speed_adjustment = NULL;
	GtkAdjustment* _tmp0_;
	GtkScale* speed_scale = NULL;
	GtkAdjustment* _tmp1_;
	GtkScale* _tmp2_ = NULL;
	GtkScale* _tmp3_;
	GtkScale* _tmp4_;
	GtkScale* _tmp5_;
	GraniteHeaderLabel* speed_header = NULL;
	GtkScale* _tmp6_;
	GtkWidget* _tmp7_;
	GraniteHeaderLabel* _tmp8_ = NULL;
	GtkCheckButton* accel_profile_default = NULL;
	gchar* _tmp9_;
	GVariant* _tmp10_;
	GtkCheckButton* _tmp11_ = NULL;
	GtkCheckButton* accel_profile_flat = NULL;
	gchar* _tmp12_;
	GVariant* _tmp13_;
	GtkCheckButton* _tmp14_ = NULL;
	GtkCheckButton* accel_profile_adaptive = NULL;
	gchar* _tmp15_;
	GVariant* _tmp16_;
	GtkCheckButton* _tmp17_ = NULL;
	GraniteBox* accel_profile_box = NULL;
	GraniteBox* _tmp18_ = NULL;
	GraniteBox* _tmp19_;
	GtkCheckButton* _tmp20_;
	GraniteBox* _tmp21_;
	GtkCheckButton* _tmp22_;
	GraniteBox* _tmp23_;
	GtkCheckButton* _tmp24_;
	GraniteHeaderLabel* accel_profile_header = NULL;
	GraniteBox* _tmp25_;
	GtkWidget* _tmp26_;
	GraniteHeaderLabel* _tmp27_ = NULL;
	GtkCheckButton* scroll_method_default = NULL;
	gchar* _tmp28_;
	GVariant* _tmp29_;
	GtkCheckButton* _tmp30_ = NULL;
	GtkCheckButton* scroll_method_none = NULL;
	gchar* _tmp31_;
	GVariant* _tmp32_;
	GtkCheckButton* _tmp33_ = NULL;
	GtkCheckButton* scroll_method_buttondown = NULL;
	gchar* _tmp34_;
	GVariant* _tmp35_;
	GtkCheckButton* _tmp36_ = NULL;
	GraniteBox* scroll_method_box = NULL;
	GraniteBox* _tmp37_ = NULL;
	GraniteBox* _tmp38_;
	GtkCheckButton* _tmp39_;
	GraniteBox* _tmp40_;
	GtkCheckButton* _tmp41_;
	GraniteBox* _tmp42_;
	GtkCheckButton* _tmp43_;
	GraniteHeaderLabel* scrolling_header = NULL;
	GraniteBox* _tmp44_;
	GtkWidget* _tmp45_;
	GraniteHeaderLabel* _tmp46_ = NULL;
	GraniteBox* content_box = NULL;
	GraniteBox* _tmp47_;
	GraniteBox* _tmp48_;
	GraniteHeaderLabel* _tmp49_;
	GraniteBox* _tmp50_;
	GtkScale* _tmp51_;
	GraniteBox* _tmp52_;
	GraniteHeaderLabel* _tmp53_;
	GraniteBox* _tmp54_;
	GraniteBox* _tmp55_;
	GraniteBox* _tmp56_;
	GraniteHeaderLabel* _tmp57_;
	GraniteBox* _tmp58_;
	GraniteBox* _tmp59_;
	GraniteBox* _tmp60_;
	GSettings* settings = NULL;
	GSettings* _tmp61_;
	GSettings* _tmp62_;
	GtkAdjustment* _tmp63_;
	GSimpleActionGroup* action_group = NULL;
	GSimpleActionGroup* _tmp64_;
	GSimpleActionGroup* _tmp65_;
	GSettings* _tmp66_;
	GAction* _tmp67_;
	GAction* _tmp68_;
	GSimpleActionGroup* _tmp69_;
	GSettings* _tmp70_;
	GAction* _tmp71_;
	GAction* _tmp72_;
	GSimpleActionGroup* _tmp73_;
	parent_class = G_OBJECT_CLASS (mouse_touchpad_pointing_stick_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MOUSE_TOUCHPAD_TYPE_POINTING_STICK_VIEW, MouseTouchpadPointingStickView);
	switchboard_settings_page_set_show_end_title_buttons ((SwitchboardSettingsPage*) self, TRUE);
	_tmp0_ = gtk_adjustment_new ((gdouble) 0, (gdouble) -1, (gdouble) 1, 0.1, (gdouble) 0, (gdouble) 0);
	g_object_ref_sink (_tmp0_);
	speed_adjustment = _tmp0_;
	_tmp1_ = speed_adjustment;
	_tmp2_ = (GtkScale*) gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, _tmp1_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	g_object_ref_sink (_tmp2_);
	speed_scale = _tmp2_;
	_tmp3_ = speed_scale;
	gtk_scale_add_mark (_tmp3_, (gdouble) -1, GTK_POS_BOTTOM, _ ("Slower"));
	_tmp4_ = speed_scale;
	gtk_scale_add_mark (_tmp4_, (gdouble) 0, GTK_POS_BOTTOM, NULL);
	_tmp5_ = speed_scale;
	gtk_scale_add_mark (_tmp5_, (gdouble) 1, GTK_POS_BOTTOM, _ ("Faster"));
	_tmp6_ = speed_scale;
	_tmp7_ = _g_object_ref0 ((GtkWidget*) _tmp6_);
	_tmp8_ = granite_header_label_new (_ ("Pointer Speed"));
	granite_header_label_set_mnemonic_widget (_tmp8_, _tmp7_);
	_g_object_unref0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	speed_header = _tmp8_;
	_tmp9_ = g_strdup ("pointingstick.accel-profile");
	_tmp10_ = g_variant_new_string ("default");
	g_variant_ref_sink (_tmp10_);
	_tmp11_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Hardware default"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp11_, _tmp9_);
	_g_free0 (_tmp9_);
	g_object_set ((GtkActionable*) _tmp11_, "action-target", _tmp10_, NULL);
	_g_variant_unref0 (_tmp10_);
	g_object_ref_sink (_tmp11_);
	accel_profile_default = _tmp11_;
	_tmp12_ = g_strdup ("pointingstick.accel-profile");
	_tmp13_ = g_variant_new_string ("flat");
	g_variant_ref_sink (_tmp13_);
	_tmp14_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("None"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp14_, _tmp12_);
	_g_free0 (_tmp12_);
	g_object_set ((GtkActionable*) _tmp14_, "action-target", _tmp13_, NULL);
	_g_variant_unref0 (_tmp13_);
	g_object_ref_sink (_tmp14_);
	accel_profile_flat = _tmp14_;
	_tmp15_ = g_strdup ("pointingstick.accel-profile");
	_tmp16_ = g_variant_new_string ("adaptive");
	g_variant_ref_sink (_tmp16_);
	_tmp17_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Adaptive"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp17_, _tmp15_);
	_g_free0 (_tmp15_);
	g_object_set ((GtkActionable*) _tmp17_, "action-target", _tmp16_, NULL);
	_g_variant_unref0 (_tmp16_);
	g_object_ref_sink (_tmp17_);
	accel_profile_adaptive = _tmp17_;
	_tmp18_ = granite_box_new (GTK_ORIENTATION_VERTICAL, GRANITE_BOX_SPACING_HALF);
	g_object_set ((GtkAccessible*) _tmp18_, "accessible-role", GTK_ACCESSIBLE_ROLE_LIST, NULL);
	g_object_ref_sink (_tmp18_);
	accel_profile_box = _tmp18_;
	_tmp19_ = accel_profile_box;
	_tmp20_ = accel_profile_default;
	gtk_box_append ((GtkBox*) _tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = accel_profile_box;
	_tmp22_ = accel_profile_flat;
	gtk_box_append ((GtkBox*) _tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = accel_profile_box;
	_tmp24_ = accel_profile_adaptive;
	gtk_box_append ((GtkBox*) _tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = accel_profile_box;
	_tmp26_ = _g_object_ref0 ((GtkWidget*) _tmp25_);
	_tmp27_ = granite_header_label_new (_ ("Pointer Acceleration"));
	granite_header_label_set_mnemonic_widget (_tmp27_, _tmp26_);
	_g_object_unref0 (_tmp26_);
	g_object_ref_sink (_tmp27_);
	accel_profile_header = _tmp27_;
	_tmp28_ = g_strdup ("pointingstick.scroll-method");
	_tmp29_ = g_variant_new_string ("default");
	g_variant_ref_sink (_tmp29_);
	_tmp30_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Hardware default"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp30_, _tmp28_);
	_g_free0 (_tmp28_);
	g_object_set ((GtkActionable*) _tmp30_, "action-target", _tmp29_, NULL);
	_g_variant_unref0 (_tmp29_);
	g_object_ref_sink (_tmp30_);
	scroll_method_default = _tmp30_;
	_tmp31_ = g_strdup ("pointingstick.scroll-method");
	_tmp32_ = g_variant_new_string ("none");
	g_variant_ref_sink (_tmp32_);
	_tmp33_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("None"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp33_, _tmp31_);
	_g_free0 (_tmp31_);
	g_object_set ((GtkActionable*) _tmp33_, "action-target", _tmp32_, NULL);
	_g_variant_unref0 (_tmp32_);
	g_object_ref_sink (_tmp33_);
	scroll_method_none = _tmp33_;
	_tmp34_ = g_strdup ("pointingstick.scroll-method");
	_tmp35_ = g_variant_new_string ("on-button-down");
	g_variant_ref_sink (_tmp35_);
	_tmp36_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("While the middle button is held down"));
	gtk_actionable_set_action_name ((GtkActionable*) _tmp36_, _tmp34_);
	_g_free0 (_tmp34_);
	g_object_set ((GtkActionable*) _tmp36_, "action-target", _tmp35_, NULL);
	_g_variant_unref0 (_tmp35_);
	g_object_ref_sink (_tmp36_);
	scroll_method_buttondown = _tmp36_;
	_tmp37_ = granite_box_new (GTK_ORIENTATION_VERTICAL, GRANITE_BOX_SPACING_HALF);
	g_object_set ((GtkAccessible*) _tmp37_, "accessible-role", GTK_ACCESSIBLE_ROLE_LIST, NULL);
	g_object_ref_sink (_tmp37_);
	scroll_method_box = _tmp37_;
	_tmp38_ = scroll_method_box;
	_tmp39_ = scroll_method_default;
	gtk_box_append ((GtkBox*) _tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = scroll_method_box;
	_tmp41_ = scroll_method_none;
	gtk_box_append ((GtkBox*) _tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = scroll_method_box;
	_tmp43_ = scroll_method_buttondown;
	gtk_box_append ((GtkBox*) _tmp42_, (GtkWidget*) _tmp43_);
	_tmp44_ = scroll_method_box;
	_tmp45_ = _g_object_ref0 ((GtkWidget*) _tmp44_);
	_tmp46_ = granite_header_label_new (_ ("Scroll Method"));
	granite_header_label_set_mnemonic_widget (_tmp46_, _tmp45_);
	_g_object_unref0 (_tmp45_);
	g_object_ref_sink (_tmp46_);
	scrolling_header = _tmp46_;
	_tmp47_ = granite_box_new (GTK_ORIENTATION_VERTICAL, GRANITE_BOX_SPACING_HALF);
	g_object_ref_sink (_tmp47_);
	content_box = _tmp47_;
	_tmp48_ = content_box;
	_tmp49_ = speed_header;
	gtk_box_append ((GtkBox*) _tmp48_, (GtkWidget*) _tmp49_);
	_tmp50_ = content_box;
	_tmp51_ = speed_scale;
	gtk_box_append ((GtkBox*) _tmp50_, (GtkWidget*) _tmp51_);
	_tmp52_ = content_box;
	_tmp53_ = accel_profile_header;
	gtk_box_append ((GtkBox*) _tmp52_, (GtkWidget*) _tmp53_);
	_tmp54_ = content_box;
	_tmp55_ = accel_profile_box;
	gtk_box_append ((GtkBox*) _tmp54_, (GtkWidget*) _tmp55_);
	_tmp56_ = content_box;
	_tmp57_ = scrolling_header;
	gtk_box_append ((GtkBox*) _tmp56_, (GtkWidget*) _tmp57_);
	_tmp58_ = content_box;
	_tmp59_ = scroll_method_box;
	gtk_box_append ((GtkBox*) _tmp58_, (GtkWidget*) _tmp59_);
	_tmp60_ = content_box;
	switchboard_settings_page_set_child ((SwitchboardSettingsPage*) self, (GtkWidget*) _tmp60_);
	_tmp61_ = g_settings_new ("org.gnome.desktop.peripherals.pointingstick");
	settings = _tmp61_;
	_tmp62_ = settings;
	_tmp63_ = speed_adjustment;
	g_settings_bind (_tmp62_, "speed", (GObject*) _tmp63_, "value", G_SETTINGS_BIND_DEFAULT);
	_tmp64_ = g_simple_action_group_new ();
	action_group = _tmp64_;
	_tmp65_ = action_group;
	_tmp66_ = settings;
	_tmp67_ = g_settings_create_action (_tmp66_, "accel-profile");
	_tmp68_ = _tmp67_;
	g_action_map_add_action ((GActionMap*) _tmp65_, _tmp68_);
	_g_object_unref0 (_tmp68_);
	_tmp69_ = action_group;
	_tmp70_ = settings;
	_tmp71_ = g_settings_create_action (_tmp70_, "scroll-method");
	_tmp72_ = _tmp71_;
	g_action_map_add_action ((GActionMap*) _tmp69_, _tmp72_);
	_g_object_unref0 (_tmp72_);
	_tmp73_ = action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "pointingstick", (GActionGroup*) _tmp73_);
	_g_object_unref0 (action_group);
	_g_object_unref0 (settings);
	_g_object_unref0 (content_box);
	_g_object_unref0 (scrolling_header);
	_g_object_unref0 (scroll_method_box);
	_g_object_unref0 (scroll_method_buttondown);
	_g_object_unref0 (scroll_method_none);
	_g_object_unref0 (scroll_method_default);
	_g_object_unref0 (accel_profile_header);
	_g_object_unref0 (accel_profile_box);
	_g_object_unref0 (accel_profile_adaptive);
	_g_object_unref0 (accel_profile_flat);
	_g_object_unref0 (accel_profile_default);
	_g_object_unref0 (speed_header);
	_g_object_unref0 (speed_scale);
	_g_object_unref0 (speed_adjustment);
	return obj;
}

static void
mouse_touchpad_pointing_stick_view_class_init (MouseTouchpadPointingStickViewClass * klass,
                                               gpointer klass_data)
{
	mouse_touchpad_pointing_stick_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = mouse_touchpad_pointing_stick_view_constructor;
}

static void
mouse_touchpad_pointing_stick_view_instance_init (MouseTouchpadPointingStickView * self,
                                                  gpointer klass)
{
}

static GType
mouse_touchpad_pointing_stick_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MouseTouchpadPointingStickViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mouse_touchpad_pointing_stick_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MouseTouchpadPointingStickView), 0, (GInstanceInitFunc) mouse_touchpad_pointing_stick_view_instance_init, NULL };
	GType mouse_touchpad_pointing_stick_view_type_id;
	mouse_touchpad_pointing_stick_view_type_id = g_type_register_static (SWITCHBOARD_TYPE_SETTINGS_PAGE, "MouseTouchpadPointingStickView", &g_define_type_info, 0);
	return mouse_touchpad_pointing_stick_view_type_id;
}

GType
mouse_touchpad_pointing_stick_view_get_type (void)
{
	static volatile gsize mouse_touchpad_pointing_stick_view_type_id__once = 0;
	if (g_once_init_enter (&mouse_touchpad_pointing_stick_view_type_id__once)) {
		GType mouse_touchpad_pointing_stick_view_type_id;
		mouse_touchpad_pointing_stick_view_type_id = mouse_touchpad_pointing_stick_view_get_type_once ();
		g_once_init_leave (&mouse_touchpad_pointing_stick_view_type_id__once, mouse_touchpad_pointing_stick_view_type_id);
	}
	return mouse_touchpad_pointing_stick_view_type_id__once;
}

