diff options
Diffstat (limited to 'src/adwaita/disfluid-application.c')
-rw-r--r-- | src/adwaita/disfluid-application.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/adwaita/disfluid-application.c b/src/adwaita/disfluid-application.c new file mode 100644 index 0000000..6bf3956 --- /dev/null +++ b/src/adwaita/disfluid-application.c @@ -0,0 +1,76 @@ +#include <config.h> + +#include "attribute.h" +#include <disfluid/adwaita.h> + +#define STREQ(a, b) (strcmp ((a), (b)) == 0) +#define STRNEQ(a, b) (! (STREQ (a, b))) + +#include <locale.h> +#include <stdio.h> +#include <unistd.h> +#include "gettext.h" +#include "relocatable.h" + +#define _(String) dgettext (PACKAGE, (String)) +#define N_(String) (String) + +#include <glib-object.h> +#include <adwaita.h> +#include <gtk/gtk.h> + +#define DISFLUID_TYPE_APPLICATION \ + disfluid_application_get_type () + +struct DisfluidApplication +{ + AdwApplication parent_instance; +}; + +struct DisfluidApplicationClass +{ + AdwApplicationClass parent_instance; +}; + +typedef struct DisfluidApplication DisfluidApplication; +typedef struct DisfluidApplicationClass DisfluidApplicationClass; + +/* *INDENT-OFF* */ +G_DEFINE_TYPE (DisfluidApplication, disfluid_application, ADW_TYPE_APPLICATION) +/* *INDENT-ON* */ + +static void +disfluid_application_class_init (DisfluidApplicationClass * klass) +{ + (void) klass; +} + +static void +disfluid_application_init (DisfluidApplication * self) +{ + (void) self; + /* Perform default initialization of self. */ +} + +static void +activated (GtkApplication * app) +{ + GtkWidget *window = gtk_application_window_new (app); + GtkWidget *label = gtk_label_new (_("Hello, world!")); + gtk_window_set_title (GTK_WINDOW (window), _("Hello")); + gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); + gtk_window_set_child (GTK_WINDOW (window), label); + gtk_window_present (GTK_WINDOW (window)); +} + +DisfluidApplication * +disfluid_application_new (void) +{ + DisfluidApplication *self = NULL; + self = (DisfluidApplication *) g_object_new (DISFLUID_TYPE_APPLICATION, + "application-id", + "eu.planete-kraus.Disfluid", + NULL); + g_signal_connect (self, "activate", G_CALLBACK (activated), NULL); + return self; +} |