mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-01-26 11:39:44 +00:00
Cleaning: Fixes #126, C code has no documentation
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc-msgina.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/msgina.h>
|
||||
|
||||
#include "ui.h"
|
||||
#include "../window.h"
|
||||
#include "ui.h"
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCClassicUIPrivate
|
||||
{
|
||||
GtkWidget* wnd_gina;
|
||||
};
|
||||
|
||||
struct _WinTCClassicUIClass
|
||||
{
|
||||
GtkWidgetClass __parent__;
|
||||
@@ -24,7 +19,7 @@ struct _WinTCClassicUI
|
||||
{
|
||||
GtkWidget __parent__;
|
||||
|
||||
WinTCClassicUIPrivate* priv;
|
||||
GtkWidget* wnd_gina;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -43,11 +38,10 @@ static void on_self_realized(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
G_DEFINE_TYPE(
|
||||
WinTCClassicUI,
|
||||
wintc_classic_ui,
|
||||
GTK_TYPE_WIDGET,
|
||||
G_ADD_PRIVATE(WinTCClassicUI)
|
||||
GTK_TYPE_WIDGET
|
||||
)
|
||||
|
||||
static void wintc_classic_ui_class_init(
|
||||
@@ -63,13 +57,11 @@ static void wintc_classic_ui_init(
|
||||
WinTCClassicUI* self
|
||||
)
|
||||
{
|
||||
self->priv = wintc_classic_ui_get_instance_private(self);
|
||||
|
||||
gtk_widget_set_has_window(GTK_WIDGET(self), FALSE);
|
||||
|
||||
// Set up widgets
|
||||
//
|
||||
self->priv->wnd_gina = wintc_gina_auth_window_new();
|
||||
self->wnd_gina = wintc_gina_auth_window_new();
|
||||
|
||||
// Connect to realize signal to begin when we're ready
|
||||
//
|
||||
@@ -106,7 +98,7 @@ GtkWidget* wintc_classic_ui_new(void)
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_CLASSIC_UI,
|
||||
WINTC_TYPE_CLASSIC_UI,
|
||||
"hexpand", TRUE,
|
||||
"vexpand", TRUE,
|
||||
NULL
|
||||
@@ -124,6 +116,6 @@ static void on_self_realized(
|
||||
{
|
||||
WinTCClassicUI* classic_ui = WINTC_CLASSIC_UI(self);
|
||||
|
||||
gtk_widget_show_all(classic_ui->priv->wnd_gina);
|
||||
gtk_widget_show_all(classic_ui->wnd_gina);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,16 +7,15 @@
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCClassicUIPrivate WinTCClassicUIPrivate;
|
||||
typedef struct _WinTCClassicUIClass WinTCClassicUIClass;
|
||||
typedef struct _WinTCClassicUI WinTCClassicUI;
|
||||
typedef struct _WinTCClassicUIClass WinTCClassicUIClass;
|
||||
typedef struct _WinTCClassicUI WinTCClassicUI;
|
||||
|
||||
#define TYPE_WINTC_CLASSIC_UI (wintc_classic_ui_get_type())
|
||||
#define WINTC_CLASSIC_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_CLASSIC_UI, WinTCClassicUI))
|
||||
#define WINTC_CLASSIC_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), TYPE_WINTC_CLASSIC_UI, WinTCClassicUI))
|
||||
#define IS_WINTC_CLASSIC_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_CLASSIC_UI))
|
||||
#define IS_WINTC_CLASSIC_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_CLASSIC_UI))
|
||||
#define WINTC_CLASSIC_UI_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), TYPE_WINTC_CLASSIC_UI))
|
||||
#define WINTC_TYPE_CLASSIC_UI (wintc_classic_ui_get_type())
|
||||
#define WINTC_CLASSIC_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_CLASSIC_UI, WinTCClassicUI))
|
||||
#define WINTC_CLASSIC_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), WINTC_TYPE_CLASSIC_UI, WinTCClassicUI))
|
||||
#define IS_WINTC_CLASSIC_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_CLASSIC_UI))
|
||||
#define IS_WINTC_CLASSIC_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_CLASSIC_UI))
|
||||
#define WINTC_CLASSIC_UI_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), WINTC_TYPE_CLASSIC_UI))
|
||||
|
||||
GType wintc_classic_ui_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "window.h"
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comctl.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc-msgina.h>
|
||||
#include <wintc/comctl.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/msgina.h>
|
||||
|
||||
#include "../window.h"
|
||||
#include "ui.h"
|
||||
#include "userlist.h"
|
||||
#include "../window.h"
|
||||
|
||||
#define DELAY_SECONDS_AT_LEAST 2
|
||||
#define DELAY_SECONDS_POLL 1
|
||||
@@ -32,8 +32,17 @@
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCWelcomeUIPrivate
|
||||
struct _WinTCWelcomeUIClass
|
||||
{
|
||||
GtkContainerClass __parent__;
|
||||
|
||||
GtkCssProvider* css_provider;
|
||||
};
|
||||
|
||||
struct _WinTCWelcomeUI
|
||||
{
|
||||
GtkContainer __parent__;
|
||||
|
||||
GSList* child_widgets;
|
||||
|
||||
// Graphic resources
|
||||
@@ -75,20 +84,6 @@ struct _WinTCWelcomeUIPrivate
|
||||
WinTCGinaLogonSession* logon_session;
|
||||
};
|
||||
|
||||
struct _WinTCWelcomeUIClass
|
||||
{
|
||||
GtkContainerClass __parent__;
|
||||
|
||||
GtkCssProvider* css_provider;
|
||||
};
|
||||
|
||||
struct _WinTCWelcomeUI
|
||||
{
|
||||
GtkContainer __parent__;
|
||||
|
||||
WinTCWelcomeUIPrivate* priv;
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
@@ -150,11 +145,10 @@ static gboolean on_timeout_poll_ready(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
G_DEFINE_TYPE(
|
||||
WinTCWelcomeUI,
|
||||
wintc_welcome_ui,
|
||||
GTK_TYPE_CONTAINER,
|
||||
G_ADD_PRIVATE(WinTCWelcomeUI)
|
||||
GTK_TYPE_CONTAINER
|
||||
)
|
||||
|
||||
static void wintc_welcome_ui_class_init(
|
||||
@@ -192,17 +186,15 @@ static void wintc_welcome_ui_init(
|
||||
WinTCWelcomeUI* self
|
||||
)
|
||||
{
|
||||
self->priv = wintc_welcome_ui_get_instance_private(self);
|
||||
|
||||
gtk_widget_set_has_window(GTK_WIDGET(self), FALSE);
|
||||
|
||||
// Set initial state
|
||||
//
|
||||
self->priv->current_state = WINTC_GINA_STATE_NONE;
|
||||
self->priv->logon_session = wintc_gina_logon_session_new();
|
||||
self->current_state = WINTC_GINA_STATE_NONE;
|
||||
self->logon_session = wintc_gina_logon_session_new();
|
||||
|
||||
g_signal_connect(
|
||||
self->priv->logon_session,
|
||||
self->logon_session,
|
||||
"attempt-complete",
|
||||
G_CALLBACK(on_logon_session_attempt_complete),
|
||||
self
|
||||
@@ -210,47 +202,47 @@ static void wintc_welcome_ui_init(
|
||||
|
||||
// Set up image resources
|
||||
//
|
||||
self->priv->pixbuf_bglight =
|
||||
self->pixbuf_bglight =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/bglight.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
self->priv->pixbuf_hsepa =
|
||||
self->pixbuf_hsepa =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/hsepa.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
self->priv->pixbuf_hsepb =
|
||||
self->pixbuf_hsepb =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/hsepb.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
|
||||
self->priv->surface_bglight =
|
||||
self->surface_bglight =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_bglight,
|
||||
self->pixbuf_bglight,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
self->priv->surface_hsepa =
|
||||
self->surface_hsepa =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_hsepa,
|
||||
self->pixbuf_hsepa,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
self->priv->surface_hsepb =
|
||||
self->surface_hsepb =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_hsepb,
|
||||
self->pixbuf_hsepb,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
|
||||
self->priv->pixbuf_logo =
|
||||
self->pixbuf_logo =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/logo.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
self->priv->pixbuf_logoani =
|
||||
self->pixbuf_logoani =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/logoani.png",
|
||||
NULL // FIXME: Error reporting
|
||||
@@ -258,44 +250,44 @@ static void wintc_welcome_ui_init(
|
||||
|
||||
// Set up 'Please wait...' box
|
||||
//
|
||||
self->priv->box_wait = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
self->box_wait = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
|
||||
self->priv->animation_logo_wait = wintc_animation_new();
|
||||
self->priv->label_wait = gtk_label_new("Please wait...");
|
||||
self->animation_logo_wait = wintc_ctl_animation_new();
|
||||
self->label_wait = gtk_label_new("Please wait...");
|
||||
|
||||
self->priv->ani_id_logo_wait =
|
||||
wintc_animation_add_static(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_wait),
|
||||
self->priv->pixbuf_logo
|
||||
self->ani_id_logo_wait =
|
||||
wintc_ctl_animation_add_static(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_wait),
|
||||
self->pixbuf_logo
|
||||
);
|
||||
wintc_animation_set_halign(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_wait),
|
||||
wintc_ctl_animation_set_halign(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_wait),
|
||||
GTK_ALIGN_END
|
||||
);
|
||||
wintc_animation_set_valign(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_wait),
|
||||
wintc_ctl_animation_set_valign(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_wait),
|
||||
GTK_ALIGN_END
|
||||
);
|
||||
wintc_animation_play(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_wait),
|
||||
self->priv->ani_id_logo_wait,
|
||||
wintc_ctl_animation_play(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_wait),
|
||||
self->ani_id_logo_wait,
|
||||
0,
|
||||
WINTC_ANIMATION_INFINITE
|
||||
WINTC_CTL_ANIMATION_INFINITE
|
||||
);
|
||||
|
||||
gtk_label_set_xalign(GTK_LABEL(self->priv->label_wait), 1.0f);
|
||||
gtk_label_set_yalign(GTK_LABEL(self->priv->label_wait), 0.0f);
|
||||
gtk_label_set_xalign(GTK_LABEL(self->label_wait), 1.0f);
|
||||
gtk_label_set_yalign(GTK_LABEL(self->label_wait), 0.0f);
|
||||
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_wait),
|
||||
self->priv->animation_logo_wait,
|
||||
GTK_BOX(self->box_wait),
|
||||
self->animation_logo_wait,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
);
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_wait),
|
||||
self->priv->label_wait,
|
||||
GTK_BOX(self->box_wait),
|
||||
self->label_wait,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
@@ -303,46 +295,46 @@ static void wintc_welcome_ui_init(
|
||||
|
||||
// Set up instruction box
|
||||
//
|
||||
self->priv->box_instruction = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
self->box_instruction = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
|
||||
self->priv->animation_logo_ins = wintc_animation_new();
|
||||
self->priv->label_instruction =
|
||||
self->animation_logo_ins = wintc_ctl_animation_new();
|
||||
self->label_instruction =
|
||||
gtk_label_new("To begin, click your user name");
|
||||
|
||||
gtk_label_set_xalign(GTK_LABEL(self->priv->label_instruction), 1.0f);
|
||||
gtk_label_set_yalign(GTK_LABEL(self->priv->label_instruction), 0.0f);
|
||||
gtk_label_set_xalign(GTK_LABEL(self->label_instruction), 1.0f);
|
||||
gtk_label_set_yalign(GTK_LABEL(self->label_instruction), 0.0f);
|
||||
|
||||
self->priv->ani_id_logo_ins =
|
||||
wintc_animation_add_framesheet(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_ins),
|
||||
self->priv->pixbuf_logoani,
|
||||
self->ani_id_logo_ins =
|
||||
wintc_ctl_animation_add_framesheet(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_ins),
|
||||
self->pixbuf_logoani,
|
||||
LOGOANI_FRAME_COUNT
|
||||
);
|
||||
wintc_animation_set_halign(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_ins),
|
||||
wintc_ctl_animation_set_halign(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_ins),
|
||||
GTK_ALIGN_END
|
||||
);
|
||||
wintc_animation_set_valign(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_ins),
|
||||
wintc_ctl_animation_set_valign(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_ins),
|
||||
GTK_ALIGN_END
|
||||
);
|
||||
wintc_animation_play(
|
||||
WINTC_ANIMATION(self->priv->animation_logo_ins),
|
||||
self->priv->ani_id_logo_ins,
|
||||
wintc_ctl_animation_play(
|
||||
WINTC_CTL_ANIMATION(self->animation_logo_ins),
|
||||
self->ani_id_logo_ins,
|
||||
LOGOANI_FRAME_RATE,
|
||||
WINTC_ANIMATION_INFINITE
|
||||
WINTC_CTL_ANIMATION_INFINITE
|
||||
);
|
||||
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_instruction),
|
||||
self->priv->animation_logo_ins,
|
||||
GTK_BOX(self->box_instruction),
|
||||
self->animation_logo_ins,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
);
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_instruction),
|
||||
self->priv->label_instruction,
|
||||
GTK_BOX(self->box_instruction),
|
||||
self->label_instruction,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
@@ -350,39 +342,39 @@ static void wintc_welcome_ui_init(
|
||||
|
||||
// Set up login box
|
||||
//
|
||||
self->priv->box_login = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
self->priv->scrollwnd = gtk_scrolled_window_new(NULL, NULL);
|
||||
self->priv->user_list =
|
||||
wintc_welcome_user_list_new(self->priv->logon_session);
|
||||
self->box_login = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
self->scrollwnd = gtk_scrolled_window_new(NULL, NULL);
|
||||
self->user_list =
|
||||
wintc_welcome_user_list_new(self->logon_session);
|
||||
|
||||
gtk_container_add(
|
||||
GTK_CONTAINER(self->priv->scrollwnd),
|
||||
self->priv->user_list
|
||||
GTK_CONTAINER(self->scrollwnd),
|
||||
self->user_list
|
||||
);
|
||||
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_login),
|
||||
self->priv->scrollwnd,
|
||||
GTK_BOX(self->box_login),
|
||||
self->scrollwnd,
|
||||
FALSE,
|
||||
FALSE,
|
||||
0
|
||||
);
|
||||
gtk_box_set_center_widget(
|
||||
GTK_BOX(self->priv->box_login),
|
||||
self->priv->scrollwnd
|
||||
GTK_BOX(self->box_login),
|
||||
self->scrollwnd
|
||||
);
|
||||
|
||||
// Set up 'welcome' box
|
||||
//
|
||||
self->priv->box_welcome = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
self->priv->label_welcome = gtk_label_new("welcome");
|
||||
self->box_welcome = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
self->label_welcome = gtk_label_new("welcome");
|
||||
|
||||
gtk_label_set_xalign(GTK_LABEL(self->priv->label_welcome), 0.8f);
|
||||
gtk_label_set_yalign(GTK_LABEL(self->priv->label_welcome), 0.5f);
|
||||
gtk_label_set_xalign(GTK_LABEL(self->label_welcome), 0.8f);
|
||||
gtk_label_set_yalign(GTK_LABEL(self->label_welcome), 0.5f);
|
||||
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_welcome),
|
||||
self->priv->label_welcome,
|
||||
GTK_BOX(self->box_welcome),
|
||||
self->label_welcome,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
@@ -390,29 +382,29 @@ static void wintc_welcome_ui_init(
|
||||
|
||||
// Set up container
|
||||
//
|
||||
self->priv->box_container = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
self->box_container = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
gtk_box_set_homogeneous(
|
||||
GTK_BOX(self->priv->box_container),
|
||||
GTK_BOX(self->box_container),
|
||||
TRUE
|
||||
);
|
||||
|
||||
wintc_welcome_ui_internal_add(self, self->priv->box_container);
|
||||
wintc_welcome_ui_internal_add(self, self->box_container);
|
||||
|
||||
// Add style classes
|
||||
//
|
||||
wintc_widget_add_style_class(self->priv->box_instruction, "box-instruction");
|
||||
wintc_widget_add_style_class(self->priv->box_login, "box-login");
|
||||
wintc_widget_add_style_class(self->priv->box_wait, "box-wait");
|
||||
wintc_widget_add_style_class(self->priv->box_welcome, "box-welcome");
|
||||
wintc_widget_add_style_class(self->box_instruction, "box-instruction");
|
||||
wintc_widget_add_style_class(self->box_login, "box-login");
|
||||
wintc_widget_add_style_class(self->box_wait, "box-wait");
|
||||
wintc_widget_add_style_class(self->box_welcome, "box-welcome");
|
||||
|
||||
// Hold an additional reference to the boxes, so we can add/remove
|
||||
// them ourselves without them getting binned
|
||||
//
|
||||
g_object_ref(self->priv->box_instruction);
|
||||
g_object_ref(self->priv->box_login);
|
||||
g_object_ref(self->priv->box_wait);
|
||||
g_object_ref(self->priv->box_welcome);
|
||||
g_object_ref(self->box_instruction);
|
||||
g_object_ref(self->box_login);
|
||||
g_object_ref(self->box_wait);
|
||||
g_object_ref(self->box_welcome);
|
||||
|
||||
// Connect to realize signal to kick off everything when we're
|
||||
// actually live
|
||||
@@ -436,20 +428,20 @@ static void wintc_welcome_ui_finalize(
|
||||
|
||||
// Bin graphical resources
|
||||
//
|
||||
cairo_surface_destroy(welcome_ui->priv->surface_bglight);
|
||||
cairo_surface_destroy(welcome_ui->priv->surface_hsepa);
|
||||
cairo_surface_destroy(welcome_ui->priv->surface_hsepb);
|
||||
g_clear_object(&(welcome_ui->priv->pixbuf_bglight));
|
||||
g_clear_object(&(welcome_ui->priv->pixbuf_hsepa));
|
||||
g_clear_object(&(welcome_ui->priv->pixbuf_hsepb));
|
||||
g_clear_object(&(welcome_ui->priv->pixbuf_logoani));
|
||||
cairo_surface_destroy(welcome_ui->surface_bglight);
|
||||
cairo_surface_destroy(welcome_ui->surface_hsepa);
|
||||
cairo_surface_destroy(welcome_ui->surface_hsepb);
|
||||
g_clear_object(&(welcome_ui->pixbuf_bglight));
|
||||
g_clear_object(&(welcome_ui->pixbuf_hsepa));
|
||||
g_clear_object(&(welcome_ui->pixbuf_hsepb));
|
||||
g_clear_object(&(welcome_ui->pixbuf_logoani));
|
||||
|
||||
// Bin additional references held for the boxes
|
||||
//
|
||||
g_clear_object(&(welcome_ui->priv->box_instruction));
|
||||
g_clear_object(&(welcome_ui->priv->box_login));
|
||||
g_clear_object(&(welcome_ui->priv->box_wait));
|
||||
g_clear_object(&(welcome_ui->priv->box_welcome));
|
||||
g_clear_object(&(welcome_ui->box_instruction));
|
||||
g_clear_object(&(welcome_ui->box_login));
|
||||
g_clear_object(&(welcome_ui->box_wait));
|
||||
g_clear_object(&(welcome_ui->box_welcome));
|
||||
|
||||
(G_OBJECT_CLASS(wintc_welcome_ui_parent_class))->finalize(gobject);
|
||||
}
|
||||
@@ -471,14 +463,14 @@ static gboolean wintc_welcome_ui_draw(
|
||||
|
||||
// Draw top banner edge
|
||||
//
|
||||
gint hsepa_width = gdk_pixbuf_get_width(welcome_ui->priv->pixbuf_hsepa);
|
||||
gint hsepa_width = gdk_pixbuf_get_width(welcome_ui->pixbuf_hsepa);
|
||||
|
||||
cairo_save(cr);
|
||||
|
||||
cairo_scale(cr, (double) width / (double) hsepa_width, 1.0f);
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
welcome_ui->priv->surface_hsepa,
|
||||
welcome_ui->surface_hsepa,
|
||||
0.0f,
|
||||
(double) TOP_RIBBON_THICKNESS
|
||||
);
|
||||
@@ -507,7 +499,7 @@ static gboolean wintc_welcome_ui_draw(
|
||||
//
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
welcome_ui->priv->surface_bglight,
|
||||
welcome_ui->surface_bglight,
|
||||
0.0f,
|
||||
(double) (TOP_RIBBON_THICKNESS + STRIP_THICKNESS)
|
||||
);
|
||||
@@ -515,14 +507,14 @@ static gboolean wintc_welcome_ui_draw(
|
||||
|
||||
// Draw bottom banner edge
|
||||
//
|
||||
gint hsepb_width = gdk_pixbuf_get_width(welcome_ui->priv->pixbuf_hsepb);
|
||||
gint hsepb_width = gdk_pixbuf_get_width(welcome_ui->pixbuf_hsepb);
|
||||
|
||||
cairo_save(cr);
|
||||
|
||||
cairo_scale(cr, (double) width / (double) hsepb_width, 1.0f);
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
welcome_ui->priv->surface_hsepb,
|
||||
welcome_ui->surface_hsepb,
|
||||
0.0f,
|
||||
(double) (height - BOTTOM_RIBBON_THICKNESS - STRIP_THICKNESS)
|
||||
);
|
||||
@@ -595,7 +587,7 @@ static void wintc_welcome_ui_size_allocate(
|
||||
- (INNER_BOX_VMARGIN * 2);
|
||||
|
||||
gtk_widget_size_allocate(
|
||||
welcome_ui->priv->box_container,
|
||||
welcome_ui->box_container,
|
||||
&box_alloc
|
||||
);
|
||||
}
|
||||
@@ -618,7 +610,7 @@ static void wintc_welcome_ui_forall(
|
||||
WinTCWelcomeUI* welcome_ui = WINTC_WELCOME_UI(container);
|
||||
|
||||
g_slist_foreach(
|
||||
welcome_ui->priv->child_widgets,
|
||||
welcome_ui->child_widgets,
|
||||
(GFunc) callback,
|
||||
callback_data
|
||||
);
|
||||
@@ -639,7 +631,7 @@ GtkWidget* wintc_welcome_ui_new(void)
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_WELCOME_UI,
|
||||
WINTC_TYPE_WELCOME_UI,
|
||||
"hexpand", TRUE,
|
||||
"vexpand", TRUE,
|
||||
NULL
|
||||
@@ -657,30 +649,30 @@ static void wintc_welcome_ui_change_state(
|
||||
{
|
||||
// Disable current state, if any
|
||||
//
|
||||
switch (welcome_ui->priv->current_state)
|
||||
switch (welcome_ui->current_state)
|
||||
{
|
||||
case WINTC_GINA_STATE_STARTING:
|
||||
gtk_container_remove(
|
||||
GTK_CONTAINER(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_wait
|
||||
GTK_CONTAINER(welcome_ui->box_container),
|
||||
welcome_ui->box_wait
|
||||
);
|
||||
break;
|
||||
|
||||
case WINTC_GINA_STATE_PROMPT:
|
||||
gtk_container_remove(
|
||||
GTK_CONTAINER(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_instruction
|
||||
GTK_CONTAINER(welcome_ui->box_container),
|
||||
welcome_ui->box_instruction
|
||||
);
|
||||
gtk_container_remove(
|
||||
GTK_CONTAINER(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_login
|
||||
GTK_CONTAINER(welcome_ui->box_container),
|
||||
welcome_ui->box_login
|
||||
);
|
||||
break;
|
||||
|
||||
case WINTC_GINA_STATE_LAUNCHING:
|
||||
gtk_container_remove(
|
||||
GTK_CONTAINER(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_welcome
|
||||
GTK_CONTAINER(welcome_ui->box_container),
|
||||
welcome_ui->box_welcome
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -693,14 +685,14 @@ static void wintc_welcome_ui_change_state(
|
||||
{
|
||||
case WINTC_GINA_STATE_STARTING:
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_wait,
|
||||
GTK_BOX(welcome_ui->box_container),
|
||||
welcome_ui->box_wait,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
);
|
||||
wintc_gina_logon_session_establish(
|
||||
welcome_ui->priv->logon_session
|
||||
welcome_ui->logon_session
|
||||
);
|
||||
g_timeout_add_seconds(
|
||||
DELAY_SECONDS_AT_LEAST,
|
||||
@@ -711,15 +703,15 @@ static void wintc_welcome_ui_change_state(
|
||||
|
||||
case WINTC_GINA_STATE_PROMPT:
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_instruction,
|
||||
GTK_BOX(welcome_ui->box_container),
|
||||
welcome_ui->box_instruction,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
);
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_login,
|
||||
GTK_BOX(welcome_ui->box_container),
|
||||
welcome_ui->box_login,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
@@ -728,8 +720,8 @@ static void wintc_welcome_ui_change_state(
|
||||
|
||||
case WINTC_GINA_STATE_LAUNCHING:
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(welcome_ui->priv->box_container),
|
||||
welcome_ui->priv->box_welcome,
|
||||
GTK_BOX(welcome_ui->box_container),
|
||||
welcome_ui->box_welcome,
|
||||
TRUE,
|
||||
TRUE,
|
||||
0
|
||||
@@ -745,10 +737,10 @@ static void wintc_welcome_ui_change_state(
|
||||
}
|
||||
|
||||
gtk_widget_show_all(
|
||||
welcome_ui->priv->box_container
|
||||
welcome_ui->box_container
|
||||
);
|
||||
|
||||
welcome_ui->priv->current_state = next_state;
|
||||
welcome_ui->current_state = next_state;
|
||||
}
|
||||
|
||||
static void wintc_welcome_ui_internal_add(
|
||||
@@ -758,8 +750,8 @@ static void wintc_welcome_ui_internal_add(
|
||||
{
|
||||
gtk_widget_set_parent(widget, GTK_WIDGET(welcome_ui));
|
||||
|
||||
welcome_ui->priv->child_widgets =
|
||||
g_slist_append(welcome_ui->priv->child_widgets, widget);
|
||||
welcome_ui->child_widgets =
|
||||
g_slist_append(welcome_ui->child_widgets, widget);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -799,7 +791,7 @@ static gboolean on_timeout_delay_done(
|
||||
{
|
||||
WinTCWelcomeUI* welcome_ui = WINTC_WELCOME_UI(user_data);
|
||||
|
||||
switch (welcome_ui->priv->current_state)
|
||||
switch (welcome_ui->current_state)
|
||||
{
|
||||
case WINTC_GINA_STATE_STARTING:
|
||||
g_timeout_add_seconds(
|
||||
@@ -811,7 +803,7 @@ static gboolean on_timeout_delay_done(
|
||||
|
||||
case WINTC_GINA_STATE_LAUNCHING:
|
||||
wintc_gina_logon_session_finish(
|
||||
welcome_ui->priv->logon_session
|
||||
welcome_ui->logon_session
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -831,7 +823,7 @@ static gboolean on_timeout_poll_ready(
|
||||
|
||||
if (
|
||||
wintc_gina_logon_session_is_available(
|
||||
welcome_ui->priv->logon_session
|
||||
welcome_ui->logon_session
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
@@ -7,16 +7,15 @@
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCWelcomeUIPrivate WinTCWelcomeUIPrivate;
|
||||
typedef struct _WinTCWelcomeUIClass WinTCWelcomeUIClass;
|
||||
typedef struct _WinTCWelcomeUI WinTCWelcomeUI;
|
||||
typedef struct _WinTCWelcomeUIClass WinTCWelcomeUIClass;
|
||||
typedef struct _WinTCWelcomeUI WinTCWelcomeUI;
|
||||
|
||||
#define TYPE_WINTC_WELCOME_UI (wintc_welcome_ui_get_type())
|
||||
#define WINTC_WELCOME_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_WELCOME_UI, WinTCWelcomeUI))
|
||||
#define WINTC_WELCOME_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_WELCOME_UI, WinTCWelcomeUI))
|
||||
#define IS_WINTC_WELCOME_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_WELCOME_UI))
|
||||
#define IS_WINTC_WELCOME_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_WELCOME_UI))
|
||||
#define WINTC_WELCOME_UI_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), TYPE_WINTC_WELCOME_UI))
|
||||
#define WINTC_TYPE_WELCOME_UI (wintc_welcome_ui_get_type())
|
||||
#define WINTC_WELCOME_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_WELCOME_UI, WinTCWelcomeUI))
|
||||
#define WINTC_WELCOME_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_WELCOME_UI, WinTCWelcomeUI))
|
||||
#define IS_WINTC_WELCOME_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_WELCOME_UI))
|
||||
#define IS_WINTC_WELCOME_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_WELCOME_UI))
|
||||
#define WINTC_WELCOME_UI_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), WINTC_TYPE_WELCOME_UI))
|
||||
|
||||
GType wintc_welcome_ui_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <lightdm.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc-msgina.h>
|
||||
#include <wintc/comgtk.h>
|
||||
#include <wintc/msgina.h>
|
||||
|
||||
#include "userlist.h"
|
||||
|
||||
@@ -40,8 +40,17 @@ enum
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCWelcomeUserListPrivate
|
||||
struct _WinTCWelcomeUserListClass
|
||||
{
|
||||
GtkContainerClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCWelcomeUserList
|
||||
{
|
||||
GtkContainer __parent__;
|
||||
|
||||
// UI
|
||||
//
|
||||
GdkWindow* hwnd;
|
||||
|
||||
GSList* child_widgets;
|
||||
@@ -69,6 +78,7 @@ struct _WinTCWelcomeUserListPrivate
|
||||
cairo_surface_t* surface_usersel;
|
||||
|
||||
// Geometry
|
||||
//
|
||||
gint item_height;
|
||||
|
||||
GtkAdjustment* hadjustment;
|
||||
@@ -81,18 +91,6 @@ struct _WinTCWelcomeUserListPrivate
|
||||
gint scroll_y;
|
||||
};
|
||||
|
||||
struct _WinTCWelcomeUserListClass
|
||||
{
|
||||
GtkContainerClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCWelcomeUserList
|
||||
{
|
||||
GtkContainer __parent__;
|
||||
|
||||
WinTCWelcomeUserListPrivate* priv;
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
@@ -211,7 +209,6 @@ G_DEFINE_TYPE_WITH_CODE(
|
||||
WinTCWelcomeUserList,
|
||||
wintc_welcome_user_list,
|
||||
GTK_TYPE_CONTAINER,
|
||||
G_ADD_PRIVATE(WinTCWelcomeUserList)
|
||||
G_IMPLEMENT_INTERFACE(
|
||||
GTK_TYPE_SCROLLABLE,
|
||||
NULL
|
||||
@@ -255,7 +252,7 @@ static void wintc_welcome_user_list_class_init(
|
||||
"logon-session",
|
||||
"LogonSession",
|
||||
"The GINA logon session instance.",
|
||||
TYPE_WINTC_GINA_LOGON_SESSION,
|
||||
WINTC_TYPE_GINA_LOGON_SESSION,
|
||||
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY
|
||||
)
|
||||
);
|
||||
@@ -288,79 +285,77 @@ static void wintc_welcome_user_list_init(
|
||||
WinTCWelcomeUserList* self
|
||||
)
|
||||
{
|
||||
self->priv = wintc_welcome_user_list_get_instance_private(self);
|
||||
|
||||
gtk_widget_set_has_window(GTK_WIDGET(self), TRUE);
|
||||
|
||||
// Set up image resources
|
||||
//
|
||||
self->priv->pixbuf_tile =
|
||||
self->pixbuf_tile =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/tile.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
self->priv->pixbuf_tilehot =
|
||||
self->pixbuf_tilehot =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/tilehot.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
self->priv->pixbuf_userpic =
|
||||
self->pixbuf_userpic =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/userpic.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
self->priv->pixbuf_usersel =
|
||||
self->pixbuf_usersel =
|
||||
gdk_pixbuf_new_from_resource(
|
||||
"/uk/oddmatics/wintc/logonui/usersel.png",
|
||||
NULL // FIXME: Error reporting
|
||||
);
|
||||
|
||||
self->priv->surface_tile =
|
||||
self->surface_tile =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_tile,
|
||||
self->pixbuf_tile,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
self->priv->surface_tilehot =
|
||||
self->surface_tilehot =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_tilehot,
|
||||
self->pixbuf_tilehot,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
self->priv->surface_userpic =
|
||||
self->surface_userpic =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_userpic,
|
||||
self->pixbuf_userpic,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
self->priv->surface_usersel =
|
||||
self->surface_usersel =
|
||||
gdk_cairo_surface_create_from_pixbuf(
|
||||
self->priv->pixbuf_usersel,
|
||||
self->pixbuf_usersel,
|
||||
1,
|
||||
NULL
|
||||
);
|
||||
|
||||
// Set up widgets
|
||||
//
|
||||
self->priv->box_auth = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
self->priv->button_go = gtk_button_new_with_label("Go");
|
||||
self->priv->entry_password = gtk_entry_new();
|
||||
self->box_auth = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
self->button_go = gtk_button_new_with_label("Go");
|
||||
self->entry_password = gtk_entry_new();
|
||||
|
||||
gtk_entry_set_visibility(
|
||||
GTK_ENTRY(self->priv->entry_password),
|
||||
GTK_ENTRY(self->entry_password),
|
||||
FALSE
|
||||
);
|
||||
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_auth),
|
||||
self->priv->entry_password,
|
||||
GTK_BOX(self->box_auth),
|
||||
self->entry_password,
|
||||
FALSE,
|
||||
FALSE,
|
||||
0
|
||||
);
|
||||
gtk_box_pack_start(
|
||||
GTK_BOX(self->priv->box_auth),
|
||||
self->priv->button_go,
|
||||
GTK_BOX(self->box_auth),
|
||||
self->button_go,
|
||||
FALSE,
|
||||
FALSE,
|
||||
0
|
||||
@@ -368,16 +363,16 @@ static void wintc_welcome_user_list_init(
|
||||
|
||||
wintc_welcome_user_list_internal_add(
|
||||
self,
|
||||
self->priv->box_auth
|
||||
self->box_auth
|
||||
);
|
||||
|
||||
gtk_widget_set_sensitive(
|
||||
self->priv->entry_password,
|
||||
self->entry_password,
|
||||
FALSE
|
||||
);
|
||||
|
||||
g_signal_connect(
|
||||
self->priv->button_go,
|
||||
self->button_go,
|
||||
"clicked",
|
||||
G_CALLBACK(on_button_go_clicked),
|
||||
self
|
||||
@@ -385,28 +380,28 @@ static void wintc_welcome_user_list_init(
|
||||
|
||||
// Add style classes
|
||||
//
|
||||
wintc_widget_add_style_class(self->priv->button_go, "go");
|
||||
wintc_widget_add_style_class(self->priv->entry_password, "password");
|
||||
wintc_widget_add_style_class(self->button_go, "go");
|
||||
wintc_widget_add_style_class(self->entry_password, "password");
|
||||
|
||||
// Store item height
|
||||
//
|
||||
gint usersel_height = gdk_pixbuf_get_height(self->priv->pixbuf_usersel);
|
||||
gint usersel_height = gdk_pixbuf_get_height(self->pixbuf_usersel);
|
||||
|
||||
self->priv->item_height = usersel_height + (2 * USER_LISTING_GAP_Y_HALF);
|
||||
self->item_height = usersel_height + (2 * USER_LISTING_GAP_Y_HALF);
|
||||
|
||||
// Set up default scroll policy
|
||||
//
|
||||
self->priv->hscroll_policy = GTK_SCROLL_MINIMUM;
|
||||
self->priv->vscroll_policy = GTK_SCROLL_NATURAL;
|
||||
self->hscroll_policy = GTK_SCROLL_MINIMUM;
|
||||
self->vscroll_policy = GTK_SCROLL_NATURAL;
|
||||
|
||||
// Retrieve users
|
||||
//
|
||||
self->priv->users =
|
||||
self->users =
|
||||
lightdm_user_list_get_users(
|
||||
lightdm_user_list_get_instance()
|
||||
);
|
||||
|
||||
self->priv->selected_index = -1;
|
||||
self->selected_index = -1;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -418,14 +413,14 @@ static void wintc_welcome_user_list_finalize(
|
||||
{
|
||||
WinTCWelcomeUserList* user_list = WINTC_WELCOME_USER_LIST(gobject);
|
||||
|
||||
cairo_surface_destroy(user_list->priv->surface_tile);
|
||||
cairo_surface_destroy(user_list->priv->surface_tilehot);
|
||||
cairo_surface_destroy(user_list->priv->surface_userpic);
|
||||
cairo_surface_destroy(user_list->priv->surface_usersel);
|
||||
g_clear_object(&user_list->priv->pixbuf_tile);
|
||||
g_clear_object(&user_list->priv->pixbuf_tilehot);
|
||||
g_clear_object(&user_list->priv->pixbuf_userpic);
|
||||
g_clear_object(&user_list->priv->pixbuf_usersel);
|
||||
cairo_surface_destroy(user_list->surface_tile);
|
||||
cairo_surface_destroy(user_list->surface_tilehot);
|
||||
cairo_surface_destroy(user_list->surface_userpic);
|
||||
cairo_surface_destroy(user_list->surface_usersel);
|
||||
g_clear_object(&user_list->pixbuf_tile);
|
||||
g_clear_object(&user_list->pixbuf_tilehot);
|
||||
g_clear_object(&user_list->pixbuf_userpic);
|
||||
g_clear_object(&user_list->pixbuf_usersel);
|
||||
|
||||
(G_OBJECT_CLASS(wintc_welcome_user_list_parent_class))->finalize(gobject);
|
||||
}
|
||||
@@ -442,19 +437,19 @@ static void wintc_welcome_user_list_get_property(
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_HADJUSTMENT:
|
||||
g_value_set_object(value, user_list->priv->hadjustment);
|
||||
g_value_set_object(value, user_list->hadjustment);
|
||||
break;
|
||||
|
||||
case PROP_VADJUSTMENT:
|
||||
g_value_set_object(value, user_list->priv->vadjustment);
|
||||
g_value_set_object(value, user_list->vadjustment);
|
||||
break;
|
||||
|
||||
case PROP_HSCROLL_POLICY:
|
||||
g_value_set_enum(value, user_list->priv->hscroll_policy);
|
||||
g_value_set_enum(value, user_list->hscroll_policy);
|
||||
break;
|
||||
|
||||
case PROP_VSCROLL_POLICY:
|
||||
g_value_set_enum(value, user_list->priv->vscroll_policy);
|
||||
g_value_set_enum(value, user_list->vscroll_policy);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -475,11 +470,11 @@ static void wintc_welcome_user_list_set_property(
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LOGON_SESSION:
|
||||
user_list->priv->logon_session =
|
||||
user_list->logon_session =
|
||||
WINTC_GINA_LOGON_SESSION(g_value_get_object(value));
|
||||
|
||||
g_signal_connect(
|
||||
user_list->priv->logon_session,
|
||||
user_list->logon_session,
|
||||
"attempt-complete",
|
||||
G_CALLBACK(on_logon_session_attempt_complete),
|
||||
user_list
|
||||
@@ -499,18 +494,18 @@ static void wintc_welcome_user_list_set_property(
|
||||
break;
|
||||
|
||||
case PROP_HSCROLL_POLICY:
|
||||
if (user_list->priv->hscroll_policy != g_value_get_enum(value))
|
||||
if (user_list->hscroll_policy != g_value_get_enum(value))
|
||||
{
|
||||
user_list->priv->hscroll_policy = g_value_get_enum(value);
|
||||
user_list->hscroll_policy = g_value_get_enum(value);
|
||||
gtk_widget_queue_resize(GTK_WIDGET(user_list));
|
||||
g_object_notify_by_pspec(gobject, pspec);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_VSCROLL_POLICY:
|
||||
if (user_list->priv->vscroll_policy != g_value_get_enum(value))
|
||||
if (user_list->vscroll_policy != g_value_get_enum(value))
|
||||
{
|
||||
user_list->priv->vscroll_policy = g_value_get_enum(value);
|
||||
user_list->vscroll_policy = g_value_get_enum(value);
|
||||
gtk_widget_queue_resize(GTK_WIDGET(user_list));
|
||||
g_object_notify_by_pspec(gobject, pspec);
|
||||
}
|
||||
@@ -531,10 +526,10 @@ static gboolean wintc_welcome_user_list_button_press_event(
|
||||
gdouble scroll_y;
|
||||
WinTCWelcomeUserList* user_list = WINTC_WELCOME_USER_LIST(widget);
|
||||
|
||||
scroll_y = gtk_adjustment_get_value(user_list->priv->vadjustment);
|
||||
hit_item = (gint) (scroll_y + event->y) / user_list->priv->item_height;
|
||||
scroll_y = gtk_adjustment_get_value(user_list->vadjustment);
|
||||
hit_item = (gint) (scroll_y + event->y) / user_list->item_height;
|
||||
|
||||
if (hit_item >= (gint) g_list_length(user_list->priv->users))
|
||||
if (hit_item >= (gint) g_list_length(user_list->users))
|
||||
{
|
||||
hit_item = -1;
|
||||
}
|
||||
@@ -553,7 +548,7 @@ static gboolean wintc_welcome_user_list_draw(
|
||||
|
||||
// Acquire adjustment
|
||||
//
|
||||
gdouble scroll_y = gtk_adjustment_get_value(user_list->priv->vadjustment);
|
||||
gdouble scroll_y = gtk_adjustment_get_value(user_list->vadjustment);
|
||||
|
||||
// Acquire clip region
|
||||
//
|
||||
@@ -569,16 +564,16 @@ static gboolean wintc_welcome_user_list_draw(
|
||||
gdouble region_bottom = clip_bottom + scroll_y;
|
||||
gdouble region_top = clip_top + scroll_y;
|
||||
|
||||
gint item_first = (gint) region_top / user_list->priv->item_height;
|
||||
gint item_last = (gint) region_bottom / user_list->priv->item_height;
|
||||
gint items = g_list_length(user_list->priv->users);
|
||||
gint item_first = (gint) region_top / user_list->item_height;
|
||||
gint item_last = (gint) region_bottom / user_list->item_height;
|
||||
gint items = g_list_length(user_list->users);
|
||||
gdouble width = clip_right - clip_left;
|
||||
|
||||
item_first = item_first < 0 ? 0 : item_first;
|
||||
|
||||
for (int i = item_first; i < items && i <= item_last; i++)
|
||||
{
|
||||
gdouble item_y = (double) (i * user_list->priv->item_height) - scroll_y;
|
||||
gdouble item_y = (double) (i * user_list->item_height) - scroll_y;
|
||||
|
||||
cairo_save(cr);
|
||||
|
||||
@@ -587,7 +582,7 @@ static gboolean wintc_welcome_user_list_draw(
|
||||
0.0f,
|
||||
item_y,
|
||||
width,
|
||||
(double) user_list->priv->item_height
|
||||
(double) user_list->item_height
|
||||
);
|
||||
cairo_clip(cr);
|
||||
|
||||
@@ -596,8 +591,8 @@ static gboolean wintc_welcome_user_list_draw(
|
||||
|
||||
draw_user(
|
||||
cr,
|
||||
(g_list_nth(user_list->priv->users, i))->data,
|
||||
user_list->priv->selected_index == i,
|
||||
(g_list_nth(user_list->users, i))->data,
|
||||
user_list->selected_index == i,
|
||||
user_list
|
||||
);
|
||||
|
||||
@@ -620,9 +615,9 @@ static void wintc_welcome_user_list_get_preferred_height(
|
||||
{
|
||||
WinTCWelcomeUserList* user_list = WINTC_WELCOME_USER_LIST(widget);
|
||||
|
||||
*minimum_height = user_list->priv->item_height;
|
||||
*natural_height = user_list->priv->item_height *
|
||||
g_list_length(user_list->priv->users);
|
||||
*minimum_height = user_list->item_height;
|
||||
*natural_height = user_list->item_height *
|
||||
g_list_length(user_list->users);
|
||||
}
|
||||
|
||||
static void wintc_welcome_user_list_get_preferred_height_for_width(
|
||||
@@ -690,7 +685,7 @@ static void wintc_welcome_user_list_realize(
|
||||
attribs.visual = gtk_widget_get_visual(widget);
|
||||
attribs.window_type = GDK_WINDOW_CHILD;
|
||||
|
||||
user_list->priv->hwnd =
|
||||
user_list->hwnd =
|
||||
gdk_window_new(
|
||||
gtk_widget_get_parent_window(widget),
|
||||
&attribs,
|
||||
@@ -699,11 +694,11 @@ static void wintc_welcome_user_list_realize(
|
||||
|
||||
gtk_widget_set_window(
|
||||
widget,
|
||||
user_list->priv->hwnd
|
||||
user_list->hwnd
|
||||
);
|
||||
gtk_widget_register_window(
|
||||
widget,
|
||||
user_list->priv->hwnd
|
||||
user_list->hwnd
|
||||
);
|
||||
}
|
||||
|
||||
@@ -721,7 +716,7 @@ static void wintc_welcome_user_list_size_allocate(
|
||||
if (gtk_widget_get_realized(widget))
|
||||
{
|
||||
gdk_window_move_resize(
|
||||
user_list->priv->hwnd,
|
||||
user_list->hwnd,
|
||||
allocation->x,
|
||||
allocation->y,
|
||||
allocation->width,
|
||||
@@ -733,21 +728,21 @@ static void wintc_welcome_user_list_size_allocate(
|
||||
//
|
||||
GtkAllocation box_alloc;
|
||||
|
||||
if (user_list->priv->selected_index > -1)
|
||||
if (user_list->selected_index > -1)
|
||||
{
|
||||
gint scroll_y =
|
||||
gtk_adjustment_get_value(
|
||||
user_list->priv->vadjustment
|
||||
user_list->vadjustment
|
||||
);
|
||||
|
||||
box_alloc.x = 70;
|
||||
box_alloc.y = user_list->priv->selected_index *
|
||||
user_list->priv->item_height +
|
||||
box_alloc.y = user_list->selected_index *
|
||||
user_list->item_height +
|
||||
50 - scroll_y;
|
||||
box_alloc.width = 248;
|
||||
box_alloc.height = 30;
|
||||
|
||||
gtk_widget_show_all(user_list->priv->box_auth);
|
||||
gtk_widget_show_all(user_list->box_auth);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -756,11 +751,11 @@ static void wintc_welcome_user_list_size_allocate(
|
||||
box_alloc.width = 0;
|
||||
box_alloc.height = 0;
|
||||
|
||||
gtk_widget_hide(user_list->priv->box_auth);
|
||||
gtk_widget_hide(user_list->box_auth);
|
||||
}
|
||||
|
||||
gtk_widget_size_allocate(
|
||||
user_list->priv->box_auth,
|
||||
user_list->box_auth,
|
||||
&box_alloc
|
||||
);
|
||||
|
||||
@@ -787,7 +782,7 @@ static void wintc_welcome_user_list_forall(
|
||||
WinTCWelcomeUserList* user_list = WINTC_WELCOME_USER_LIST(container);
|
||||
|
||||
g_slist_foreach(
|
||||
user_list->priv->child_widgets,
|
||||
user_list->child_widgets,
|
||||
(GFunc) callback,
|
||||
callback_data
|
||||
);
|
||||
@@ -810,7 +805,7 @@ GtkWidget* wintc_welcome_user_list_new(
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_WELCOME_USER_LIST,
|
||||
WINTC_TYPE_WELCOME_USER_LIST,
|
||||
"logon-session", logon_session,
|
||||
"hexpand", TRUE,
|
||||
"vexpand", TRUE,
|
||||
@@ -829,8 +824,8 @@ static void wintc_welcome_user_list_internal_add(
|
||||
{
|
||||
gtk_widget_set_parent(widget, GTK_WIDGET(user_list));
|
||||
|
||||
user_list->priv->child_widgets =
|
||||
g_slist_append(user_list->priv->child_widgets, widget);
|
||||
user_list->child_widgets =
|
||||
g_slist_append(user_list->child_widgets, widget);
|
||||
}
|
||||
|
||||
static void wintc_welcome_user_list_select_user(
|
||||
@@ -838,22 +833,22 @@ static void wintc_welcome_user_list_select_user(
|
||||
gint index
|
||||
)
|
||||
{
|
||||
user_list->priv->selected_index = index;
|
||||
user_list->selected_index = index;
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
gtk_widget_set_sensitive(
|
||||
user_list->priv->entry_password,
|
||||
user_list->entry_password,
|
||||
TRUE
|
||||
);
|
||||
gtk_widget_grab_focus(
|
||||
user_list->priv->entry_password
|
||||
user_list->entry_password
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_sensitive(
|
||||
user_list->priv->entry_password,
|
||||
user_list->entry_password,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
@@ -866,20 +861,20 @@ static void wintc_welcome_user_list_set_vadjustment(
|
||||
GtkAdjustment* adjustment
|
||||
)
|
||||
{
|
||||
if (user_list->priv->vadjustment == adjustment)
|
||||
if (user_list->vadjustment == adjustment)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (user_list->priv->vadjustment)
|
||||
if (user_list->vadjustment)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func(
|
||||
user_list->priv->vadjustment,
|
||||
user_list->vadjustment,
|
||||
on_self_adjustment_changed,
|
||||
user_list
|
||||
);
|
||||
|
||||
g_object_unref(user_list->priv->vadjustment);
|
||||
g_object_unref(user_list->vadjustment);
|
||||
}
|
||||
|
||||
if (adjustment == NULL)
|
||||
@@ -902,7 +897,7 @@ static void wintc_welcome_user_list_set_vadjustment(
|
||||
user_list
|
||||
);
|
||||
|
||||
user_list->priv->vadjustment = g_object_ref_sink(adjustment);
|
||||
user_list->vadjustment = g_object_ref_sink(adjustment);
|
||||
|
||||
wintc_welcome_user_list_set_vadjustment_values(user_list);
|
||||
|
||||
@@ -922,15 +917,15 @@ static void wintc_welcome_user_list_set_vadjustment_values(
|
||||
gtk_widget_get_allocation(GTK_WIDGET(user_list), &alloc);
|
||||
|
||||
old_value =
|
||||
gtk_adjustment_get_value(user_list->priv->vadjustment);
|
||||
gtk_adjustment_get_value(user_list->vadjustment);
|
||||
user_count =
|
||||
g_list_length(user_list->priv->users);
|
||||
g_list_length(user_list->users);
|
||||
|
||||
new_upper =
|
||||
MAX(alloc.height, user_list->priv->item_height * user_count);
|
||||
MAX(alloc.height, user_list->item_height * user_count);
|
||||
|
||||
g_object_set(
|
||||
user_list->priv->vadjustment,
|
||||
user_list->vadjustment,
|
||||
"lower", 0.0,
|
||||
"upper", new_upper,
|
||||
"page-size", (gdouble) alloc.height,
|
||||
@@ -944,7 +939,7 @@ static void wintc_welcome_user_list_set_vadjustment_values(
|
||||
if (new_value != old_value)
|
||||
{
|
||||
gtk_adjustment_set_value(
|
||||
user_list->priv->vadjustment,
|
||||
user_list->vadjustment,
|
||||
new_value
|
||||
);
|
||||
}
|
||||
@@ -969,7 +964,7 @@ static void draw_user(
|
||||
{
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
user_list->priv->surface_usersel,
|
||||
user_list->surface_usersel,
|
||||
0.0f,
|
||||
origin_y
|
||||
);
|
||||
@@ -985,8 +980,8 @@ static void draw_user(
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
selected ?
|
||||
user_list->priv->surface_tilehot :
|
||||
user_list->priv->surface_tile,
|
||||
user_list->surface_tilehot :
|
||||
user_list->surface_tile,
|
||||
USER_TILE_OFFSET_X,
|
||||
USER_TILE_OFFSET_Y + origin_y
|
||||
);
|
||||
@@ -994,7 +989,7 @@ static void draw_user(
|
||||
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
user_list->priv->surface_userpic,
|
||||
user_list->surface_userpic,
|
||||
USER_TILE_OFFSET_X + USER_PIC_OFFSET,
|
||||
USER_TILE_OFFSET_Y + USER_PIC_OFFSET + origin_y
|
||||
);
|
||||
@@ -1040,16 +1035,16 @@ static void on_logon_session_attempt_complete(
|
||||
if (response == WINTC_GINA_RESPONSE_FAIL)
|
||||
{
|
||||
gtk_entry_set_text(
|
||||
GTK_ENTRY(user_list->priv->entry_password),
|
||||
GTK_ENTRY(user_list->entry_password),
|
||||
""
|
||||
);
|
||||
|
||||
gtk_widget_set_sensitive(
|
||||
user_list->priv->button_go,
|
||||
user_list->button_go,
|
||||
TRUE
|
||||
);
|
||||
gtk_widget_set_sensitive(
|
||||
user_list->priv->entry_password,
|
||||
user_list->entry_password,
|
||||
TRUE
|
||||
);
|
||||
}
|
||||
@@ -1063,23 +1058,23 @@ static void on_button_go_clicked(
|
||||
WinTCWelcomeUserList* user_list = WINTC_WELCOME_USER_LIST(user_data);
|
||||
|
||||
gtk_widget_set_sensitive(
|
||||
user_list->priv->button_go,
|
||||
user_list->button_go,
|
||||
FALSE
|
||||
);
|
||||
gtk_widget_set_sensitive(
|
||||
user_list->priv->entry_password,
|
||||
user_list->entry_password,
|
||||
FALSE
|
||||
);
|
||||
|
||||
wintc_gina_logon_session_try_logon(
|
||||
user_list->priv->logon_session,
|
||||
user_list->logon_session,
|
||||
lightdm_user_get_name(
|
||||
g_list_nth(
|
||||
user_list->priv->users,
|
||||
user_list->priv->selected_index
|
||||
user_list->users,
|
||||
user_list->selected_index
|
||||
)->data
|
||||
),
|
||||
gtk_entry_get_text(GTK_ENTRY(user_list->priv->entry_password))
|
||||
gtk_entry_get_text(GTK_ENTRY(user_list->entry_password))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,21 +3,20 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-msgina.h>
|
||||
#include <wintc/msgina.h>
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCWelcomeUserListPrivate WinTCWelcomeUserListPrivate;
|
||||
typedef struct _WinTCWelcomeUserListClass WinTCWelcomeUserListClass;
|
||||
typedef struct _WinTCWelcomeUserList WinTCWelcomeUserList;
|
||||
typedef struct _WinTCWelcomeUserListClass WinTCWelcomeUserListClass;
|
||||
typedef struct _WinTCWelcomeUserList WinTCWelcomeUserList;
|
||||
|
||||
#define TYPE_WINTC_WELCOME_USER_LIST (wintc_welcome_user_list_get_type())
|
||||
#define WINTC_WELCOME_USER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_WELCOME_USER_LIST, WinTCWelcomeUserList))
|
||||
#define WINTC_WELCOME_USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_WELCOME_USER_LIST, WinTCWelcomeUserList))
|
||||
#define IS_WINTC_WELCOME_USER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_WELCOME_USER_LIST))
|
||||
#define IS_WINTC_WELCOME_USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_WELCOME_USER_LIST))
|
||||
#define WINTC_WELCOME_USER_LIST_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), TYPE_WINTC_WELCOME_USER_LIST))
|
||||
#define WINTC_TYPE_WELCOME_USER_LIST (wintc_welcome_user_list_get_type())
|
||||
#define WINTC_WELCOME_USER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_WELCOME_USER_LIST, WinTCWelcomeUserList))
|
||||
#define WINTC_WELCOME_USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_WELCOME_USER_LIST, WinTCWelcomeUserList))
|
||||
#define IS_WINTC_WELCOME_USER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_WELCOME_USER_LIST))
|
||||
#define IS_WINTC_WELCOME_USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_WELCOME_USER_LIST))
|
||||
#define WINTC_WELCOME_USER_LIST_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), WINTC_TYPE_WELCOME_USER_LIST))
|
||||
|
||||
GType wintc_welcome_user_list_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "window.h"
|
||||
#include "classic/ui.h"
|
||||
@@ -19,11 +19,6 @@ enum
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCLogonUIWindowPrivate
|
||||
{
|
||||
GtkWidget* login_ui;
|
||||
};
|
||||
|
||||
struct _WinTCLogonUIWindowClass
|
||||
{
|
||||
GtkWindowClass __parent__;
|
||||
@@ -33,7 +28,7 @@ struct _WinTCLogonUIWindow
|
||||
{
|
||||
GtkWindow __parent__;
|
||||
|
||||
WinTCLogonUIWindowPrivate* priv;
|
||||
GtkWidget* login_ui;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -59,11 +54,10 @@ static void on_window_realize(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
G_DEFINE_TYPE(
|
||||
WinTCLogonUIWindow,
|
||||
wintc_logonui_window,
|
||||
GTK_TYPE_WINDOW,
|
||||
G_ADD_PRIVATE(WinTCLogonUIWindow)
|
||||
GTK_TYPE_WINDOW
|
||||
)
|
||||
|
||||
static void wintc_logonui_window_class_init(
|
||||
@@ -91,8 +85,6 @@ static void wintc_logonui_window_init(
|
||||
WinTCLogonUIWindow* self
|
||||
)
|
||||
{
|
||||
self->priv = wintc_logonui_window_get_instance_private(self);
|
||||
|
||||
// Set up window
|
||||
//
|
||||
GdkDisplay* display = gdk_display_get_default();
|
||||
@@ -154,12 +146,12 @@ static void wintc_logonui_window_set_property(
|
||||
case PROP_PREFER_CLASSIC_LOGON:
|
||||
if (g_value_get_boolean(value))
|
||||
{
|
||||
window->priv->login_ui =
|
||||
window->login_ui =
|
||||
wintc_classic_ui_new();
|
||||
}
|
||||
else
|
||||
{
|
||||
window->priv->login_ui =
|
||||
window->login_ui =
|
||||
wintc_welcome_ui_new();
|
||||
}
|
||||
|
||||
@@ -178,7 +170,7 @@ GtkWidget* wintc_logonui_window_new()
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_LOGONUI_WINDOW,
|
||||
WINTC_TYPE_LOGONUI_WINDOW,
|
||||
"type", GTK_WINDOW_TOPLEVEL,
|
||||
"decorated", FALSE,
|
||||
"resizable", FALSE,
|
||||
@@ -202,9 +194,9 @@ static gboolean on_window_map_event(
|
||||
|
||||
gtk_container_add(
|
||||
GTK_CONTAINER(self),
|
||||
window->priv->login_ui
|
||||
window->login_ui
|
||||
);
|
||||
gtk_widget_show_all(window->priv->login_ui);
|
||||
gtk_widget_show_all(window->login_ui);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -7,16 +7,15 @@
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCLogonUIWindowPrivate WinTCLogonUIWindowPrivate;
|
||||
typedef struct _WinTCLogonUIWindowClass WinTCLogonUIWindowClass;
|
||||
typedef struct _WinTCLogonUIWindow WinTCLogonUIWindow;
|
||||
typedef struct _WinTCLogonUIWindowClass WinTCLogonUIWindowClass;
|
||||
typedef struct _WinTCLogonUIWindow WinTCLogonUIWindow;
|
||||
|
||||
#define TYPE_WINTC_LOGONUI_WINDOW (wintc_logonui_window_get_type())
|
||||
#define WINTC_LOGONUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_LOGONUI_WINDOW, WinTCLogonUIWindow))
|
||||
#define WINTC_LOGONUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_LOGONUI_WINDOW, WinTCLogonUIWindow))
|
||||
#define IS_WINTC_LOGONUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_LOGONUI_WINDOW))
|
||||
#define IS_WINTC_LOGONUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_LOGONUI_WINDOW))
|
||||
#define WINTC_LOGONUI_WINDOW_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), TYPE_WINTC_LOGONUI_WINDOW))
|
||||
#define WINTC_TYPE_LOGONUI_WINDOW (wintc_logonui_window_get_type())
|
||||
#define WINTC_LOGONUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_LOGONUI_WINDOW, WinTCLogonUIWindow))
|
||||
#define WINTC_LOGONUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_LOGONUI_WINDOW, WinTCLogonUIWindow))
|
||||
#define IS_WINTC_LOGONUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_LOGONUI_WINDOW))
|
||||
#define IS_WINTC_LOGONUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_LOGONUI_WINDOW))
|
||||
#define WINTC_LOGONUI_WINDOW_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), WINTC_TYPE_LOGONUI_WINDOW))
|
||||
|
||||
GType wintc_logonui_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
2
docs/api/.gitignore
vendored
Normal file
2
docs/api/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Ignore Doxygen output
|
||||
dox
|
||||
2733
docs/api/Doxyfile
Normal file
2733
docs/api/Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
5
docs/api/README.MD
Normal file
5
docs/api/README.MD
Normal file
@@ -0,0 +1,5 @@
|
||||
# API Documentation
|
||||
This directory contains the Doxygen configuration for generating the API documentation.
|
||||
|
||||
## Usage
|
||||
To generate documentation, simply run `doxygen` in this directory. HTML will be outputted into the `./dox` directory, then you can open `./dox/index.html` in your web browser.
|
||||
4
docs/api/manual/comctl.dox
Normal file
4
docs/api/manual/comctl.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/comctl
|
||||
* \brief This is the Common Controls library.
|
||||
*/
|
||||
4
docs/api/manual/comgtk.dox
Normal file
4
docs/api/manual/comgtk.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/comgtk
|
||||
* \brief This is the Common GLib/GTK Utilities library.
|
||||
*/
|
||||
4
docs/api/manual/exec.dox
Normal file
4
docs/api/manual/exec.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/exec
|
||||
* \brief This is the Launcher library.
|
||||
*/
|
||||
13
docs/api/manual/home.md
Normal file
13
docs/api/manual/home.md
Normal file
@@ -0,0 +1,13 @@
|
||||
\mainpage
|
||||
|
||||
## Hello World!
|
||||
|
||||
Herein lies the automatically generated HTML documentation for the *Windows "Total Conversion" API*. This documentation, as well as the APIs themselves, are extremely preliminary and **not stable**.
|
||||
|
||||
## Have a poke around
|
||||
|
||||
Feel free to have a look around the documentation regardless, and maybe even write your own programs or extensions with this information. The project is designed with extension in mind and one day will hopefully provide stable APIs to interface with systems no matter the distro or the particular software choices on the end user's machine (eg. systemd/runit).
|
||||
|
||||
## Any errors?
|
||||
|
||||
Please report any mistakes or problems you encounter to the project's GitHub issues page. Thank you!
|
||||
4
docs/api/manual/msgina.dox
Normal file
4
docs/api/manual/msgina.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/msgina
|
||||
* \brief This is the GINA services library.
|
||||
*/
|
||||
4
docs/api/manual/shelldpa.dox
Normal file
4
docs/api/manual/shelldpa.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/shelldpa
|
||||
* \brief This is the Shell Display Protocol Abstraction library.
|
||||
*/
|
||||
4
docs/api/manual/shlang.dox
Normal file
4
docs/api/manual/shlang.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/shlang
|
||||
* \brief This is the common shell language strings library.
|
||||
*/
|
||||
4
docs/api/manual/sndapi.dox
Normal file
4
docs/api/manual/sndapi.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/sndapi
|
||||
* \brief This is the system audio abstraction library.
|
||||
*/
|
||||
4
docs/api/manual/winbrand.dox
Normal file
4
docs/api/manual/winbrand.dox
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* \dir ../../shared/winbrand
|
||||
* \brief This is the Windows branding library.
|
||||
*/
|
||||
@@ -1,8 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# Define some constants
|
||||
#
|
||||
set(DEFAULT_LIB_PKGCONFIG ${CMAKE_CURRENT_LIST_DIR}/pkgconfig.pc.in)
|
||||
set(WINTC_LIB_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/wintc)
|
||||
|
||||
# Prevent CMake from prepending 'lib' on libraries
|
||||
#
|
||||
@@ -12,8 +13,9 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||
|
||||
# Extract library's name
|
||||
#
|
||||
if (${PROJECT_NAME} MATCHES "^lib(.+)")
|
||||
set(LIB_NAME ${CMAKE_MATCH_1})
|
||||
if (${PROJECT_NAME} MATCHES "^lib(wintc-(.+))")
|
||||
set(LIB_NAME ${CMAKE_MATCH_1})
|
||||
set(LIB_NAME_SIMPLE ${CMAKE_MATCH_2})
|
||||
else()
|
||||
message(
|
||||
FATAL_ERROR
|
||||
@@ -27,3 +29,33 @@ function(wintc_add_pkgconfig_install)
|
||||
configure_file(${DEFAULT_LIB_PKGCONFIG} ${LIB_NAME}.pc @ONLY)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${LIB_NAME}.pc DESTINATION ${WINTC_SAFE_PKGCONFIG_DIR}/pkgconfig)
|
||||
endfunction()
|
||||
|
||||
# Function for installing public headers
|
||||
#
|
||||
function(wintc_install_public_headers)
|
||||
# Pull out public header sources
|
||||
#
|
||||
get_target_property(LIB_SOURCES ${PROJECT_NAME} SOURCES)
|
||||
|
||||
foreach (SOURCE_FILEPATH IN LISTS LIB_SOURCES)
|
||||
if (${SOURCE_FILEPATH} MATCHES "^public/(.+)")
|
||||
list(APPEND LIB_PUBLIC_HEADERS ${CMAKE_MATCH_0})
|
||||
else()
|
||||
continue()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Add installs
|
||||
#
|
||||
set(LIB_INCLUDEDIR ${WINTC_LIB_INCLUDEDIR}/${LIB_NAME_SIMPLE})
|
||||
|
||||
install(
|
||||
FILES ${LIB_PUBLIC_HEADERS}
|
||||
DESTINATION ${LIB_INCLUDEDIR}
|
||||
)
|
||||
install(
|
||||
FILES public/_api.h
|
||||
DESTINATION ${WINTC_LIB_INCLUDEDIR}
|
||||
RENAME ${LIB_NAME_SIMPLE}.h
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@@ -26,9 +26,42 @@ function(wintc_resolve_library REQUESTED_LIB REQUESTED_LIB_NICE_NAME)
|
||||
${WINTC_USE_LOCAL_LIBS} AND
|
||||
${REQUESTED_LIB} MATCHES "^wintc-(.+)"
|
||||
)
|
||||
# We must look for where the include dir is, in the local libs root
|
||||
#
|
||||
# CMake's file(GLOB_RECURSE) is broken crap, so we have no choice but
|
||||
# to find the file and filter out any unwanted matches ourselves
|
||||
# (such as wintc/exec/exec.h - we only want wintc/exec.h)
|
||||
#
|
||||
# After finding the file, we traverse up two path segments, to the
|
||||
# include/ dir, because source code uses #include "wintc/myapi.h" as
|
||||
# their paths
|
||||
#
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
LIB_INCLUDE_FULL_PATH
|
||||
${WINTC_LOCAL_LIBS_ROOT}/*/${CMAKE_MATCH_1}.h
|
||||
)
|
||||
list(
|
||||
FILTER
|
||||
LIB_INCLUDE_FULL_PATH
|
||||
INCLUDE
|
||||
REGEX
|
||||
wintc/${CMAKE_MATCH_1}.h
|
||||
)
|
||||
get_filename_component(
|
||||
LIB_INCLUDE_DIR
|
||||
${LIB_INCLUDE_FULL_PATH}
|
||||
DIRECTORY
|
||||
)
|
||||
get_filename_component(
|
||||
LIB_INCLUDE_DIR
|
||||
${LIB_INCLUDE_DIR}
|
||||
DIRECTORY
|
||||
)
|
||||
|
||||
wintc_set(
|
||||
"${REQUESTED_LIB_NICE_NAME}_INCLUDE_DIRS"
|
||||
"${REPO_ROOT}/shared/${CMAKE_MATCH_1}/public"
|
||||
"${LIB_INCLUDE_DIR}"
|
||||
)
|
||||
wintc_set(
|
||||
"${REQUESTED_LIB_NICE_NAME}_LIBRARY_DIRS"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -28,7 +28,11 @@ static void wintc_browser_application_activate(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(WinTCBrowserApplication, wintc_browser_application, GTK_TYPE_APPLICATION)
|
||||
G_DEFINE_TYPE(
|
||||
WinTCBrowserApplication,
|
||||
wintc_browser_application,
|
||||
GTK_TYPE_APPLICATION
|
||||
)
|
||||
|
||||
static void wintc_browser_application_class_init(
|
||||
WinTCBrowserApplicationClass* klass
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
typedef struct _WinTCBrowserApplicationClass WinTCBrowserApplicationClass;
|
||||
typedef struct _WinTCBrowserApplication WinTCBrowserApplication;
|
||||
|
||||
#define TYPE_WINTC_BROWSER_APPLICATION (wintc_browser_application_get_type())
|
||||
#define WINTC_BROWSER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_BROWSER_APPLICATION, WinTCBrowserApplication))
|
||||
#define WINTC_BROWSER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_BROWSER_APPLICATION, WinTCBrowserApplicationClass))
|
||||
#define IS_WINTC_BROWSER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_BROWSER_APPLICATION))
|
||||
#define IS_WINTC_BROWSER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_BROWSER_APPLICATION))
|
||||
#define WINTC_BROWSER_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_BROWSER_APPLICATION, WinTCBrowserApplicationClass))
|
||||
#define WINTC_TYPE_BROWSER_APPLICATION (wintc_browser_application_get_type())
|
||||
#define WINTC_BROWSER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_BROWSER_APPLICATION, WinTCBrowserApplication))
|
||||
#define WINTC_BROWSER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_BROWSER_APPLICATION, WinTCBrowserApplicationClass))
|
||||
#define IS_WINTC_BROWSER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_BROWSER_APPLICATION))
|
||||
#define IS_WINTC_BROWSER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_BROWSER_APPLICATION))
|
||||
#define WINTC_BROWSER_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_BROWSER_APPLICATION, WinTCBrowserApplicationClass))
|
||||
|
||||
GType wintc_browser_application_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -188,7 +188,7 @@ GtkWidget* wintc_browser_window_new(
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_BROWSER_WINDOW,
|
||||
WINTC_TYPE_BROWSER_WINDOW,
|
||||
"application", GTK_APPLICATION(app),
|
||||
"title", s_program_title,
|
||||
NULL
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
typedef struct _WinTCBrowserWindowClass WinTCBrowserWindowClass;
|
||||
typedef struct _WinTCBrowserWindow WinTCBrowserWindow;
|
||||
|
||||
#define TYPE_WINTC_BROWSER_WINDOW (wintc_browser_window_get_type())
|
||||
#define WINTC_BROWSER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_BROWSER_WINDOW, WinTCBrowserWindow))
|
||||
#define WINTC_BROWSER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_BROWSER_WINDOW, WinTCBrowserWindowClass))
|
||||
#define IS_WINTC_BROWSER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_BROWSER_WINDOW))
|
||||
#define IS_WINTC_BROWSER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_BROWSER_WINDOW))
|
||||
#define WINTC_BROWSER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_BROWSER_WINDOW, WinTCBrowserWindowClass))
|
||||
#define WINTC_TYPE_BROWSER_WINDOW (wintc_browser_window_get_type())
|
||||
#define WINTC_BROWSER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_BROWSER_WINDOW, WinTCBrowserWindow))
|
||||
#define WINTC_BROWSER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_BROWSER_WINDOW, WinTCBrowserWindowClass))
|
||||
#define IS_WINTC_BROWSER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_BROWSER_WINDOW))
|
||||
#define IS_WINTC_BROWSER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_BROWSER_WINDOW))
|
||||
#define WINTC_BROWSER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_BROWSER_WINDOW, WinTCBrowserWindowClass))
|
||||
|
||||
GType wintc_browser_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -28,7 +28,11 @@ static void wintc_dnd_test_application_activate(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(WinTCDndTestApplication, wintc_dnd_test_application, GTK_TYPE_APPLICATION)
|
||||
G_DEFINE_TYPE(
|
||||
WinTCDndTestApplication,
|
||||
wintc_dnd_test_application,
|
||||
GTK_TYPE_APPLICATION
|
||||
)
|
||||
|
||||
static void wintc_dnd_test_application_class_init(
|
||||
WinTCDndTestApplicationClass* klass
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
typedef struct _WinTCDndTestApplicationClass WinTCDndTestApplicationClass;
|
||||
typedef struct _WinTCDndTestApplication WinTCDndTestApplication;
|
||||
|
||||
#define TYPE_WINTC_DND_TEST_APPLICATION (wintc_dnd_test_application_get_type())
|
||||
#define WINTC_DND_TEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_DND_TEST_APPLICATION, WinTCDndTestApplication))
|
||||
#define WINTC_DND_TEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_DND_TEST_APPLICATION, WinTCDndTestApplicationClass))
|
||||
#define IS_WINTC_DND_TEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_DND_TEST_APPLICATION))
|
||||
#define IS_WINTC_DND_TEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_DND_TEST_APPLICATION))
|
||||
#define WINTC_DND_TEST_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_DND_TEST_APPLICATION, WinTCDndTestApplicationClass))
|
||||
#define WINTC_TYPE_DND_TEST_APPLICATION (wintc_dnd_test_application_get_type())
|
||||
#define WINTC_DND_TEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_DND_TEST_APPLICATION, WinTCDndTestApplication))
|
||||
#define WINTC_DND_TEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_DND_TEST_APPLICATION, WinTCDndTestApplicationClass))
|
||||
#define IS_WINTC_DND_TEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_DND_TEST_APPLICATION))
|
||||
#define IS_WINTC_DND_TEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_DND_TEST_APPLICATION))
|
||||
#define WINTC_DND_TEST_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_DND_TEST_APPLICATION, WinTCDndTestApplicationClass))
|
||||
|
||||
GType wintc_dnd_test_application_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -92,7 +92,7 @@ GtkWidget* wintc_dnd_test_window_new(
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_DND_TEST_WINDOW,
|
||||
WINTC_TYPE_DND_TEST_WINDOW,
|
||||
"application", GTK_APPLICATION(app),
|
||||
"title", "Drag 'n' Drop File(s)!",
|
||||
NULL
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
typedef struct _WinTCDndTestWindowClass WinTCDndTestWindowClass;
|
||||
typedef struct _WinTCDndTestWindow WinTCDndTestWindow;
|
||||
|
||||
#define TYPE_WINTC_DND_TEST_WINDOW (wintc_dnd_test_window_get_type())
|
||||
#define WINTC_DND_TEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_DND_TEST_WINDOW, WinTCDndTestWindow))
|
||||
#define WINTC_DND_TEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_DND_TEST_WINDOW, WinTCDndTestWindowClass))
|
||||
#define IS_WINTC_DND_TEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_DND_TEST_WINDOW))
|
||||
#define IS_WINTC_DND_TEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_DND_TEST_WINDOW))
|
||||
#define WINTC_DND_TEST_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_DND_TEST_WINDOW, WinTCDndTestWindowClass))
|
||||
#define WINTC_TYPE_DND_TEST_WINDOW (wintc_dnd_test_window_get_type())
|
||||
#define WINTC_DND_TEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_DND_TEST_WINDOW, WinTCDndTestWindow))
|
||||
#define WINTC_DND_TEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_DND_TEST_WINDOW, WinTCDndTestWindowClass))
|
||||
#define IS_WINTC_DND_TEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_DND_TEST_WINDOW))
|
||||
#define IS_WINTC_DND_TEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_DND_TEST_WINDOW))
|
||||
#define WINTC_DND_TEST_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_DND_TEST_WINDOW, WinTCDndTestWindowClass))
|
||||
|
||||
GType wintc_dnd_test_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -28,7 +28,11 @@ static void wintc_patest_application_activate(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(WinTCPaTestApplication, wintc_patest_application, GTK_TYPE_APPLICATION)
|
||||
G_DEFINE_TYPE(
|
||||
WinTCPaTestApplication,
|
||||
wintc_patest_application,
|
||||
GTK_TYPE_APPLICATION
|
||||
)
|
||||
|
||||
static void wintc_patest_application_class_init(
|
||||
WinTCPaTestApplicationClass* klass
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
typedef struct _WinTCPaTestApplicationClass WinTCPaTestApplicationClass;
|
||||
typedef struct _WinTCPaTestApplication WinTCPaTestApplication;
|
||||
|
||||
#define TYPE_WINTC_PATEST_APPLICATION (wintc_patest_application_get_type())
|
||||
#define WINTC_PATEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_PATEST_APPLICATION, WinTCPaTestApplication))
|
||||
#define WINTC_PATEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_PATEST_APPLICATION, WinTCPaTestApplicationClass))
|
||||
#define IS_WINTC_PATEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_PATEST_APPLICATION))
|
||||
#define IS_WINTC_PATEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_PATEST_APPLICATION))
|
||||
#define WINTC_PATEST_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_PATEST_APPLICATION, WinTCPaTestApplicationClass))
|
||||
#define WINTC_TYPE_PATEST_APPLICATION (wintc_patest_application_get_type())
|
||||
#define WINTC_PATEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_PATEST_APPLICATION, WinTCPaTestApplication))
|
||||
#define WINTC_PATEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_PATEST_APPLICATION, WinTCPaTestApplicationClass))
|
||||
#define IS_WINTC_PATEST_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_PATEST_APPLICATION))
|
||||
#define IS_WINTC_PATEST_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_PATEST_APPLICATION))
|
||||
#define WINTC_PATEST_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_PATEST_APPLICATION, WinTCPaTestApplicationClass))
|
||||
|
||||
GType wintc_patest_application_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include <pulse/glib-mainloop.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -262,7 +262,7 @@ GtkWidget* wintc_patest_window_new(
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_PATEST_WINDOW,
|
||||
WINTC_TYPE_PATEST_WINDOW,
|
||||
"application", GTK_APPLICATION(app),
|
||||
"title", "PulseAudio Test Program",
|
||||
NULL
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
typedef struct _WinTCPaTestWindowClass WinTCPaTestWindowClass;
|
||||
typedef struct _WinTCPaTestWindow WinTCPaTestWindow;
|
||||
|
||||
#define TYPE_WINTC_PATEST_WINDOW (wintc_patest_window_get_type())
|
||||
#define WINTC_PATEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_PATEST_WINDOW, WinTCPaTestWindow))
|
||||
#define WINTC_PATEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_PATEST_WINDOW, WinTCPaTestWindowClass))
|
||||
#define IS_WINTC_PATEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_PATEST_WINDOW))
|
||||
#define IS_WINTC_PATEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_PATEST_WINDOW))
|
||||
#define WINTC_PATEST_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_PATEST_WINDOW, WinTCPaTestWindowClass))
|
||||
#define WINTC_TYPE_PATEST_WINDOW (wintc_patest_window_get_type())
|
||||
#define WINTC_PATEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_PATEST_WINDOW, WinTCPaTestWindow))
|
||||
#define WINTC_PATEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_PATEST_WINDOW, WinTCPaTestWindowClass))
|
||||
#define IS_WINTC_PATEST_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_PATEST_WINDOW))
|
||||
#define IS_WINTC_PATEST_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_PATEST_WINDOW))
|
||||
#define WINTC_PATEST_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_PATEST_WINDOW, WinTCPaTestWindowClass))
|
||||
|
||||
GType wintc_patest_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -28,7 +28,11 @@ static void wintc_hello_application_activate(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE(WinTCHelloApplication, wintc_hello_application, GTK_TYPE_APPLICATION)
|
||||
G_DEFINE_TYPE(
|
||||
WinTCHelloApplication,
|
||||
wintc_hello_application,
|
||||
GTK_TYPE_APPLICATION
|
||||
)
|
||||
|
||||
static void wintc_hello_application_class_init(
|
||||
WinTCHelloApplicationClass* klass
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
typedef struct _WinTCHelloApplicationClass WinTCHelloApplicationClass;
|
||||
typedef struct _WinTCHelloApplication WinTCHelloApplication;
|
||||
|
||||
#define TYPE_WINTC_HELLO_APPLICATION (wintc_hello_application_get_type())
|
||||
#define WINTC_HELLO_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_HELLO_APPLICATION, WinTCHelloApplication))
|
||||
#define WINTC_HELLO_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_HELLO_APPLICATION, WinTCHelloApplicationClass))
|
||||
#define IS_WINTC_HELLO_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_HELLO_APPLICATION))
|
||||
#define IS_WINTC_HELLO_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_HELLO_APPLICATION))
|
||||
#define WINTC_HELLO_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_HELLO_APPLICATION, WinTCHelloApplicationClass))
|
||||
#define WINTC_TYPE_HELLO_APPLICATION (wintc_hello_application_get_type())
|
||||
#define WINTC_HELLO_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_HELLO_APPLICATION, WinTCHelloApplication))
|
||||
#define WINTC_HELLO_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_HELLO_APPLICATION, WinTCHelloApplicationClass))
|
||||
#define IS_WINTC_HELLO_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_HELLO_APPLICATION))
|
||||
#define IS_WINTC_HELLO_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_HELLO_APPLICATION))
|
||||
#define WINTC_HELLO_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_HELLO_APPLICATION, WinTCHelloApplicationClass))
|
||||
|
||||
GType wintc_hello_application_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "application.h"
|
||||
#include "window.h"
|
||||
@@ -56,7 +56,7 @@ GtkWidget* wintc_hello_window_new(
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_HELLO_WINDOW,
|
||||
WINTC_TYPE_HELLO_WINDOW,
|
||||
"application", GTK_APPLICATION(app),
|
||||
"title", "Hello Windows!",
|
||||
NULL
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
typedef struct _WinTCHelloWindowClass WinTCHelloWindowClass;
|
||||
typedef struct _WinTCHelloWindow WinTCHelloWindow;
|
||||
|
||||
#define TYPE_WINTC_HELLO_WINDOW (wintc_hello_window_get_type())
|
||||
#define WINTC_HELLO_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_HELLO_WINDOW, WinTCHelloWindow))
|
||||
#define WINTC_HELLO_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_HELLO_WINDOW, WinTCHelloWindowClass))
|
||||
#define IS_WINTC_HELLO_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_HELLO_WINDOW))
|
||||
#define IS_WINTC_HELLO_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_HELLO_WINDOW))
|
||||
#define WINTC_HELLO_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_WINTC_HELLO_WINDOW, WinTCHelloWindowClass))
|
||||
#define WINTC_TYPE_HELLO_WINDOW (wintc_hello_window_get_type())
|
||||
#define WINTC_HELLO_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_HELLO_WINDOW, WinTCHelloWindow))
|
||||
#define WINTC_HELLO_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_HELLO_WINDOW, WinTCHelloWindowClass))
|
||||
#define IS_WINTC_HELLO_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_HELLO_WINDOW))
|
||||
#define IS_WINTC_HELLO_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_HELLO_WINDOW))
|
||||
#define WINTC_HELLO_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WINTC_TYPE_HELLO_WINDOW, WinTCHelloWindowClass))
|
||||
|
||||
GType wintc_hello_window_get_type(void) G_GNUC_CONST;
|
||||
|
||||
|
||||
@@ -32,15 +32,14 @@ add_library(
|
||||
libwintc-comctl
|
||||
src/resources.c
|
||||
src/animctl.c
|
||||
src/animctl.h
|
||||
public/animctl.h
|
||||
src/style.c
|
||||
src/style.h
|
||||
public/style.h
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
libwintc-comctl
|
||||
PROPERTIES
|
||||
PUBLIC_HEADER public/wintc-comctl.h
|
||||
SOVERSION 1
|
||||
VERSION ${PROJECT_VERSION}
|
||||
)
|
||||
@@ -80,9 +79,9 @@ target_link_libraries(
|
||||
#
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_add_pkgconfig_install()
|
||||
wintc_install_public_headers()
|
||||
|
||||
install(
|
||||
TARGETS libwintc-comctl
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
)
|
||||
|
||||
7
shared/comctl/public/_api.h
Normal file
7
shared/comctl/public/_api.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef __WINTC_COMCTL_H__
|
||||
#define __WINTC_COMCTL_H__
|
||||
|
||||
#include "comctl/animctl.h"
|
||||
#include "comctl/style.h"
|
||||
|
||||
#endif
|
||||
162
shared/comctl/public/animctl.h
Normal file
162
shared/comctl/public/animctl.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMCTL_ANIMCTL_H__
|
||||
#define __COMCTL_ANIMCTL_H__
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC DEFINES
|
||||
//
|
||||
|
||||
/**
|
||||
* @def WINTC_CTL_ANIMATION_INFINITE
|
||||
*
|
||||
* Specifies that the animation should be looped indefinitely.
|
||||
*/
|
||||
#define WINTC_CTL_ANIMATION_INFINITE 0
|
||||
|
||||
/**
|
||||
* @def WINTC_CTL_ANIMATION_NONE
|
||||
*
|
||||
* Represents no animation.
|
||||
*/
|
||||
#define WINTC_CTL_ANIMATION_NONE 0
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCCtlAnimationClass WinTCCtlAnimationClass;
|
||||
|
||||
/**
|
||||
* A WinTC animation control.
|
||||
*/
|
||||
typedef struct _WinTCCtlAnimation WinTCCtlAnimation;
|
||||
|
||||
#define WINTC_TYPE_CTL_ANIMATION (wintc_ctl_animation_get_type())
|
||||
#define WINTC_CTL_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WINTC_TYPE_CTL_ANIMATION, WinTCCtlAnimation))
|
||||
#define WINTC_CTL_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WINTC_TYPE_CTL_ANIMATION, WinTCCtlAnimation))
|
||||
#define IS_WINTC_CTL_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WINTC_TYPE_CTL_ANIMATION))
|
||||
#define IS_WINTC_CTL_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WINTC_TYPE_CTL_ANIMATION))
|
||||
#define WINTC_CTL_ANIMATION_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), WINTC_TYPE_CTL_ANIMATION))
|
||||
|
||||
GType wintc_ctl_animation_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Creates a new instance of WinTCCtlAnimation.
|
||||
*
|
||||
* @return The new WinTCCtlAnimation instance cast to GtkWidget.
|
||||
*/
|
||||
GtkWidget* wintc_ctl_animation_new(void);
|
||||
|
||||
/**
|
||||
* Adds a framesheet to an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @param framesheet_pixbuf The framesheet.
|
||||
* @param frame_count The number of frames in the framesheet.
|
||||
* @return The ID to reference the framesheet in the animation control.
|
||||
*/
|
||||
guint wintc_ctl_animation_add_framesheet(
|
||||
WinTCCtlAnimation* anim,
|
||||
GdkPixbuf* framesheet_pixbuf,
|
||||
gint frame_count
|
||||
);
|
||||
|
||||
/**
|
||||
* Adds a static frame to an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @param static_pixbuf The single frame.
|
||||
* @return The ID to reference the frame in the animation control.
|
||||
*/
|
||||
guint wintc_ctl_animation_add_static(
|
||||
WinTCCtlAnimation* anim,
|
||||
GdkPixbuf* static_pixbuf
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieves the number of animations in an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
*/
|
||||
guint wintc_ctl_animation_get_count(
|
||||
WinTCCtlAnimation* anim
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieves the horizontal alignment property of an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @return The current horizontal alignment of the animation control.
|
||||
*/
|
||||
GtkAlign wintc_ctl_animation_get_halign(
|
||||
WinTCCtlAnimation* anim
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieves the vertical alignment property of an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @return The current vertical alignment of the animation control.
|
||||
*/
|
||||
GtkAlign wintc_ctl_animation_get_valign(
|
||||
WinTCCtlAnimation* anim
|
||||
);
|
||||
|
||||
/**
|
||||
* Plays an animation in an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @param id The ID of the animation to play.
|
||||
* @param frame_rate The desired frame rate for playback.
|
||||
* @param repeats The number of times to repeat the animation.
|
||||
*/
|
||||
void wintc_ctl_animation_play(
|
||||
WinTCCtlAnimation* anim,
|
||||
guint id,
|
||||
gint frame_rate,
|
||||
gint repeats
|
||||
);
|
||||
|
||||
/**
|
||||
* Removes an animation from an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @param id The ID of the animation to remove.
|
||||
*/
|
||||
void wintc_ctl_animation_remove(
|
||||
WinTCCtlAnimation* anim,
|
||||
guint id
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the horizontal alignment property of an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @param align The desired horizontal alignment.
|
||||
*/
|
||||
void wintc_ctl_animation_set_halign(
|
||||
WinTCCtlAnimation* anim,
|
||||
GtkAlign align
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the vertical alignment property of an animation control.
|
||||
*
|
||||
* @param anim The animation control.
|
||||
* @param align The desired vertical alignment.
|
||||
*/
|
||||
void wintc_ctl_animation_set_valign(
|
||||
WinTCCtlAnimation* anim,
|
||||
GtkAlign align
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
24
shared/comctl/public/style.h
Normal file
24
shared/comctl/public/style.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMCTL_STYLE_H__
|
||||
#define __COMCTL_STYLE_H__
|
||||
|
||||
/**
|
||||
* @def WINTC_CTL_BUTTON_BOX_CSS_CLASS
|
||||
*
|
||||
* The CSS class for applying WinTC standard button box styles, intended for
|
||||
* GtkBox widgets.
|
||||
*/
|
||||
#define WINTC_CTL_BUTTON_BOX_CSS_CLASS "wintc-button-box"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Installs the common controls stylesheet to the default display, the styles
|
||||
* have fallback priority and can be overridden by themes and programs.
|
||||
*/
|
||||
void wintc_ctl_install_default_styles(void);
|
||||
|
||||
#endif
|
||||
@@ -1,73 +0,0 @@
|
||||
#ifndef __WINTC_COMCTL_H__
|
||||
#define __WINTC_COMCTL_H__
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// Animation control
|
||||
//
|
||||
#define WINTC_ANIMATION_INFINITE 0
|
||||
#define WINTC_ANIMATION_NONE 0
|
||||
|
||||
typedef struct _WinTCAnimationPrivate WinTCAnimationPrivate;
|
||||
typedef struct _WinTCAnimationClass WinTCAnimationClass;
|
||||
typedef struct _WinTCAnimation WinTCAnimation;
|
||||
|
||||
#define TYPE_WINTC_ANIMATION (wintc_animation_get_type())
|
||||
#define WINTC_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_ANIMATION, WinTCAnimation))
|
||||
#define WINTC_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_ANIMATION, WinTCAnimation))
|
||||
#define IS_WINTC_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_ANIMATION))
|
||||
#define IS_WINTC_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_ANIMATION))
|
||||
#define WINTC_ANIMATION_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), TYPE_WINTC_ANIMATION))
|
||||
|
||||
GType wintc_animation_get_type(void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget* wintc_animation_new(void);
|
||||
|
||||
guint wintc_animation_add_framesheet(
|
||||
WinTCAnimation* anim,
|
||||
GdkPixbuf* framesheet_pixbuf,
|
||||
gint frame_count
|
||||
);
|
||||
guint wintc_animation_add_static(
|
||||
WinTCAnimation* anim,
|
||||
GdkPixbuf* static_pixbuf
|
||||
);
|
||||
guint wintc_animation_get_count(
|
||||
WinTCAnimation* anim
|
||||
);
|
||||
GtkAlign wintc_animation_get_halign(
|
||||
WinTCAnimation* anim
|
||||
);
|
||||
GtkAlign wintc_animation_get_valign(
|
||||
WinTCAnimation* anim
|
||||
);
|
||||
void wintc_animation_play(
|
||||
WinTCAnimation* anim,
|
||||
guint id,
|
||||
gint frame_rate,
|
||||
gint repeats
|
||||
);
|
||||
void wintc_animation_remove(
|
||||
WinTCAnimation* anim,
|
||||
guint id
|
||||
);
|
||||
void wintc_animation_set_halign(
|
||||
WinTCAnimation* anim,
|
||||
GtkAlign align
|
||||
);
|
||||
void wintc_animation_set_valign(
|
||||
WinTCAnimation* anim,
|
||||
GtkAlign align
|
||||
);
|
||||
|
||||
//
|
||||
// Default CSS stuff
|
||||
//
|
||||
#define WINTC_COMCTL_BUTTON_BOX_CSS_CLASS "wintc-button-box"
|
||||
|
||||
void wintc_comctl_install_default_styles(void);
|
||||
|
||||
#endif
|
||||
@@ -2,9 +2,9 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "animctl.h"
|
||||
#include "../public/animctl.h"
|
||||
|
||||
#define ONE_SECOND_IN_US 1000000
|
||||
|
||||
@@ -21,89 +21,88 @@ enum
|
||||
//
|
||||
// PRIVATE STURCTURE DEFINITIONS
|
||||
//
|
||||
typedef struct _WinTCAnimationData
|
||||
typedef struct _WinTCCtlAnimationData
|
||||
{
|
||||
GdkPixbuf* pixbuf_bmp;
|
||||
cairo_surface_t* surface_bmp;
|
||||
|
||||
gint frame_count;
|
||||
gint frame_height;
|
||||
} WinTCAnimationData;
|
||||
} WinTCCtlAnimationData;
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
struct _WinTCAnimationPrivate
|
||||
struct _WinTCCtlAnimationClass
|
||||
{
|
||||
GtkWidgetClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCCtlAnimation
|
||||
{
|
||||
GtkWidget __parent__;
|
||||
|
||||
// State
|
||||
//
|
||||
GSList* animations;
|
||||
|
||||
gboolean is_animating;
|
||||
guint tick_id;
|
||||
|
||||
WinTCAnimationData* current_anim;
|
||||
gint current_frame;
|
||||
gint desired_repeats;
|
||||
gint last_frame;
|
||||
gint64 origin_frame_time;
|
||||
gint64 per_frame_time;
|
||||
gint64 playback_total_time;
|
||||
WinTCCtlAnimationData* current_anim;
|
||||
gint current_frame;
|
||||
gint desired_repeats;
|
||||
gint last_frame;
|
||||
gint64 origin_frame_time;
|
||||
gint64 per_frame_time;
|
||||
gint64 playback_total_time;
|
||||
|
||||
// UI properties
|
||||
//
|
||||
GtkAlign halign;
|
||||
GtkAlign valign;
|
||||
};
|
||||
|
||||
struct _WinTCAnimationClass
|
||||
{
|
||||
GtkWidgetClass __parent__;
|
||||
};
|
||||
|
||||
struct _WinTCAnimation
|
||||
{
|
||||
GtkWidget __parent__;
|
||||
|
||||
WinTCAnimationPrivate* priv;
|
||||
};
|
||||
|
||||
//
|
||||
// FORWARD DECLARATIONS
|
||||
//
|
||||
static void wintc_animation_finalize(
|
||||
static void wintc_ctl_animation_finalize(
|
||||
GObject* gobject
|
||||
);
|
||||
static void wintc_animation_get_property(
|
||||
static void wintc_ctl_animation_get_property(
|
||||
GObject* object,
|
||||
guint prop_id,
|
||||
GValue* value,
|
||||
GParamSpec* pspec
|
||||
);
|
||||
static void wintc_animation_set_property(
|
||||
static void wintc_ctl_animation_set_property(
|
||||
GObject* object,
|
||||
guint prop_id,
|
||||
const GValue* value,
|
||||
GParamSpec* pspec
|
||||
);
|
||||
|
||||
static gboolean wintc_animation_draw(
|
||||
static gboolean wintc_ctl_animation_draw(
|
||||
GtkWidget* widget,
|
||||
cairo_t* cr
|
||||
);
|
||||
static void wintc_animation_get_preferred_height(
|
||||
static void wintc_ctl_animation_get_preferred_height(
|
||||
GtkWidget* widget,
|
||||
gint* minimum_height,
|
||||
gint* natural_height
|
||||
);
|
||||
static void wintc_animation_get_preferred_height_for_width(
|
||||
static void wintc_ctl_animation_get_preferred_height_for_width(
|
||||
GtkWidget* widget,
|
||||
gint width,
|
||||
gint* minimum_height,
|
||||
gint* natural_height
|
||||
);
|
||||
static void wintc_animation_get_preferred_width(
|
||||
static void wintc_ctl_animation_get_preferred_width(
|
||||
GtkWidget* widget,
|
||||
gint* minimum_width,
|
||||
gint* natural_width
|
||||
);
|
||||
static void wintc_animation_get_preferred_width_for_height(
|
||||
static void wintc_ctl_animation_get_preferred_width_for_height(
|
||||
GtkWidget* widget,
|
||||
gint height,
|
||||
gint* minimum_width,
|
||||
@@ -111,10 +110,10 @@ static void wintc_animation_get_preferred_width_for_height(
|
||||
);
|
||||
|
||||
static void free_anim_data(
|
||||
WinTCAnimationData* anim_data
|
||||
WinTCCtlAnimationData* anim_data
|
||||
);
|
||||
|
||||
static gboolean wintc_animation_step(
|
||||
static gboolean wintc_ctl_animation_step(
|
||||
GtkWidget* widget,
|
||||
GdkFrameClock* frame_clock,
|
||||
gpointer user_data
|
||||
@@ -123,34 +122,33 @@ static gboolean wintc_animation_step(
|
||||
//
|
||||
// GTK TYPE DEFINITIONS & CTORS
|
||||
//
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
WinTCAnimation,
|
||||
wintc_animation,
|
||||
GTK_TYPE_WIDGET,
|
||||
G_ADD_PRIVATE(WinTCAnimation)
|
||||
G_DEFINE_TYPE(
|
||||
WinTCCtlAnimation,
|
||||
wintc_ctl_animation,
|
||||
GTK_TYPE_WIDGET
|
||||
)
|
||||
|
||||
static void wintc_animation_class_init(
|
||||
WinTCAnimationClass* klass
|
||||
static void wintc_ctl_animation_class_init(
|
||||
WinTCCtlAnimationClass* klass
|
||||
)
|
||||
{
|
||||
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
|
||||
GObjectClass* object_class = G_OBJECT_CLASS(klass);
|
||||
|
||||
object_class->finalize = wintc_animation_finalize;
|
||||
object_class->get_property = wintc_animation_get_property;
|
||||
object_class->set_property = wintc_animation_set_property;
|
||||
object_class->finalize = wintc_ctl_animation_finalize;
|
||||
object_class->get_property = wintc_ctl_animation_get_property;
|
||||
object_class->set_property = wintc_ctl_animation_set_property;
|
||||
|
||||
widget_class->draw =
|
||||
wintc_animation_draw;
|
||||
wintc_ctl_animation_draw;
|
||||
widget_class->get_preferred_height =
|
||||
wintc_animation_get_preferred_height;
|
||||
wintc_ctl_animation_get_preferred_height;
|
||||
widget_class->get_preferred_height_for_width =
|
||||
wintc_animation_get_preferred_height_for_width;
|
||||
wintc_ctl_animation_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_width =
|
||||
wintc_animation_get_preferred_width;
|
||||
wintc_ctl_animation_get_preferred_width;
|
||||
widget_class->get_preferred_width_for_height =
|
||||
wintc_animation_get_preferred_width_for_height;
|
||||
wintc_ctl_animation_get_preferred_width_for_height;
|
||||
|
||||
g_object_class_install_property(
|
||||
object_class,
|
||||
@@ -178,57 +176,55 @@ static void wintc_animation_class_init(
|
||||
);
|
||||
}
|
||||
|
||||
static void wintc_animation_init(
|
||||
WinTCAnimation* self
|
||||
static void wintc_ctl_animation_init(
|
||||
WinTCCtlAnimation* self
|
||||
)
|
||||
{
|
||||
self->priv = wintc_animation_get_instance_private(self);
|
||||
|
||||
gtk_widget_set_has_window(GTK_WIDGET(self), FALSE);
|
||||
}
|
||||
|
||||
//
|
||||
// CLASS VIRTUAL METHODS
|
||||
//
|
||||
static void wintc_animation_finalize(
|
||||
static void wintc_ctl_animation_finalize(
|
||||
GObject* gobject
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(gobject);
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(gobject);
|
||||
|
||||
g_slist_free_full(
|
||||
anim->priv->animations,
|
||||
anim->animations,
|
||||
(GDestroyNotify) free_anim_data
|
||||
);
|
||||
|
||||
if (anim->priv->tick_id > 0)
|
||||
if (anim->tick_id > 0)
|
||||
{
|
||||
gtk_widget_remove_tick_callback(
|
||||
GTK_WIDGET(anim),
|
||||
anim->priv->tick_id
|
||||
anim->tick_id
|
||||
);
|
||||
}
|
||||
|
||||
(G_OBJECT_CLASS(wintc_animation_parent_class))->finalize(gobject);
|
||||
(G_OBJECT_CLASS(wintc_ctl_animation_parent_class))->finalize(gobject);
|
||||
}
|
||||
|
||||
static void wintc_animation_get_property(
|
||||
static void wintc_ctl_animation_get_property(
|
||||
GObject* object,
|
||||
guint prop_id,
|
||||
GValue* value,
|
||||
GParamSpec* pspec
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(object);
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_HALIGN:
|
||||
g_value_set_enum(value, anim->priv->halign);
|
||||
g_value_set_enum(value, anim->halign);
|
||||
break;
|
||||
|
||||
case PROP_VALIGN:
|
||||
g_value_set_enum(value, anim->priv->valign);
|
||||
g_value_set_enum(value, anim->valign);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -237,24 +233,24 @@ static void wintc_animation_get_property(
|
||||
}
|
||||
}
|
||||
|
||||
static void wintc_animation_set_property(
|
||||
static void wintc_ctl_animation_set_property(
|
||||
GObject* object,
|
||||
guint prop_id,
|
||||
const GValue* value,
|
||||
GParamSpec* pspec
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(object);
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_HALIGN:
|
||||
anim->priv->halign = g_value_get_enum(value);
|
||||
anim->halign = g_value_get_enum(value);
|
||||
gtk_widget_queue_draw(GTK_WIDGET(object));
|
||||
break;
|
||||
|
||||
case PROP_VALIGN:
|
||||
anim->priv->valign = g_value_get_enum(value);
|
||||
anim->valign = g_value_get_enum(value);
|
||||
gtk_widget_queue_draw(GTK_WIDGET(object));
|
||||
break;
|
||||
|
||||
@@ -264,14 +260,14 @@ static void wintc_animation_set_property(
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean wintc_animation_draw(
|
||||
static gboolean wintc_ctl_animation_draw(
|
||||
GtkWidget* widget,
|
||||
cairo_t* cr
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(widget);
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(widget);
|
||||
|
||||
if (anim->priv->current_anim == NULL)
|
||||
if (anim->current_anim == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -284,19 +280,19 @@ static gboolean wintc_animation_draw(
|
||||
|
||||
graphic_width =
|
||||
cairo_image_surface_get_width(
|
||||
anim->priv->current_anim->surface_bmp
|
||||
anim->current_anim->surface_bmp
|
||||
);
|
||||
|
||||
if (anim->priv->current_anim->frame_count > 1)
|
||||
if (anim->current_anim->frame_count > 1)
|
||||
{
|
||||
graphic_height = anim->priv->current_anim->frame_height;
|
||||
y_offset = (graphic_height * anim->priv->current_frame) * -1.0f;
|
||||
graphic_height = anim->current_anim->frame_height;
|
||||
y_offset = (graphic_height * anim->current_frame) * -1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
graphic_height =
|
||||
cairo_image_surface_get_height(
|
||||
anim->priv->current_anim->surface_bmp
|
||||
anim->current_anim->surface_bmp
|
||||
);
|
||||
y_offset = 0.0f;
|
||||
}
|
||||
@@ -313,7 +309,7 @@ static gboolean wintc_animation_draw(
|
||||
double target_scale_w = 1.0f;
|
||||
double target_scale_h = 1.0f;
|
||||
|
||||
switch (anim->priv->halign)
|
||||
switch (anim->halign)
|
||||
{
|
||||
case GTK_ALIGN_END:
|
||||
target_x = (double) (my_width - graphic_width);
|
||||
@@ -333,7 +329,7 @@ static gboolean wintc_animation_draw(
|
||||
break;
|
||||
}
|
||||
|
||||
switch (anim->priv->valign)
|
||||
switch (anim->valign)
|
||||
{
|
||||
case GTK_ALIGN_END:
|
||||
target_y = (double) (my_height - graphic_height);
|
||||
@@ -372,7 +368,7 @@ static gboolean wintc_animation_draw(
|
||||
|
||||
cairo_set_source_surface(
|
||||
cr,
|
||||
anim->priv->current_anim->surface_bmp,
|
||||
anim->current_anim->surface_bmp,
|
||||
0.0f,
|
||||
y_offset
|
||||
);
|
||||
@@ -385,32 +381,32 @@ static gboolean wintc_animation_draw(
|
||||
|
||||
cairo_restore(cr);
|
||||
|
||||
anim->priv->last_frame = anim->priv->current_frame;
|
||||
anim->last_frame = anim->current_frame;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void wintc_animation_get_preferred_height(
|
||||
static void wintc_ctl_animation_get_preferred_height(
|
||||
GtkWidget* widget,
|
||||
gint* minimum_height,
|
||||
gint* natural_height
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(widget);
|
||||
gint height = 0;
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(widget);
|
||||
gint height = 0;
|
||||
|
||||
if (anim->priv->current_anim != NULL)
|
||||
if (anim->current_anim != NULL)
|
||||
{
|
||||
if (anim->priv->current_anim->frame_count == 1)
|
||||
if (anim->current_anim->frame_count == 1)
|
||||
{
|
||||
height =
|
||||
cairo_image_surface_get_height(
|
||||
anim->priv->current_anim->surface_bmp
|
||||
anim->current_anim->surface_bmp
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
height = anim->priv->current_anim->frame_height;
|
||||
height = anim->current_anim->frame_height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,29 +414,29 @@ static void wintc_animation_get_preferred_height(
|
||||
*natural_height = height;
|
||||
}
|
||||
|
||||
static void wintc_animation_get_preferred_height_for_width(
|
||||
static void wintc_ctl_animation_get_preferred_height_for_width(
|
||||
GtkWidget* widget,
|
||||
WINTC_UNUSED(gint width),
|
||||
gint* minimum_height,
|
||||
gint* natural_height
|
||||
)
|
||||
{
|
||||
wintc_animation_get_preferred_height(
|
||||
wintc_ctl_animation_get_preferred_height(
|
||||
widget,
|
||||
minimum_height,
|
||||
natural_height
|
||||
);
|
||||
}
|
||||
|
||||
static void wintc_animation_get_preferred_width(
|
||||
static void wintc_ctl_animation_get_preferred_width(
|
||||
GtkWidget* widget,
|
||||
gint* minimum_width,
|
||||
gint* natural_width
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(widget);
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(widget);
|
||||
|
||||
if (anim->priv->current_anim == NULL)
|
||||
if (anim->current_anim == NULL)
|
||||
{
|
||||
minimum_width = 0;
|
||||
natural_width = 0;
|
||||
@@ -449,21 +445,21 @@ static void wintc_animation_get_preferred_width(
|
||||
|
||||
gint width =
|
||||
cairo_image_surface_get_width(
|
||||
anim->priv->current_anim->surface_bmp
|
||||
anim->current_anim->surface_bmp
|
||||
);
|
||||
|
||||
*minimum_width = width;
|
||||
*natural_width = width;
|
||||
}
|
||||
|
||||
static void wintc_animation_get_preferred_width_for_height(
|
||||
static void wintc_ctl_animation_get_preferred_width_for_height(
|
||||
GtkWidget* widget,
|
||||
WINTC_UNUSED(gint height),
|
||||
gint* minimum_width,
|
||||
gint* natural_width
|
||||
)
|
||||
{
|
||||
wintc_animation_get_preferred_width(
|
||||
wintc_ctl_animation_get_preferred_width(
|
||||
widget,
|
||||
minimum_width,
|
||||
natural_width
|
||||
@@ -473,24 +469,26 @@ static void wintc_animation_get_preferred_width_for_height(
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GtkWidget* wintc_animation_new(void)
|
||||
GtkWidget* wintc_ctl_animation_new(void)
|
||||
{
|
||||
return GTK_WIDGET(
|
||||
g_object_new(
|
||||
TYPE_WINTC_ANIMATION,
|
||||
WINTC_TYPE_CTL_ANIMATION,
|
||||
NULL
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
guint wintc_animation_add_framesheet(
|
||||
WinTCAnimation* anim,
|
||||
GdkPixbuf* framesheet_pixbuf,
|
||||
gint frame_count
|
||||
guint wintc_ctl_animation_add_framesheet(
|
||||
WinTCCtlAnimation* anim,
|
||||
GdkPixbuf* framesheet_pixbuf,
|
||||
gint frame_count
|
||||
)
|
||||
{
|
||||
WinTCAnimationData* anim_data = g_new0(WinTCAnimationData, 1);
|
||||
gint height = gdk_pixbuf_get_height(framesheet_pixbuf);
|
||||
WinTCCtlAnimationData* anim_data = g_new0(WinTCCtlAnimationData, 1);
|
||||
gint height = gdk_pixbuf_get_height(
|
||||
framesheet_pixbuf
|
||||
);
|
||||
|
||||
g_object_ref(framesheet_pixbuf);
|
||||
|
||||
@@ -505,21 +503,21 @@ guint wintc_animation_add_framesheet(
|
||||
anim_data->frame_count = frame_count;
|
||||
anim_data->frame_height = height / frame_count;
|
||||
|
||||
anim->priv->animations =
|
||||
anim->animations =
|
||||
g_slist_append(
|
||||
anim->priv->animations,
|
||||
anim->animations,
|
||||
anim_data
|
||||
);
|
||||
|
||||
return wintc_animation_get_count(anim);
|
||||
return wintc_ctl_animation_get_count(anim);
|
||||
}
|
||||
|
||||
guint wintc_animation_add_static(
|
||||
WinTCAnimation* anim,
|
||||
GdkPixbuf* static_pixbuf
|
||||
guint wintc_ctl_animation_add_static(
|
||||
WinTCCtlAnimation* anim,
|
||||
GdkPixbuf* static_pixbuf
|
||||
)
|
||||
{
|
||||
WinTCAnimationData* anim_data = g_new0(WinTCAnimationData, 1);
|
||||
WinTCCtlAnimationData* anim_data = g_new0(WinTCCtlAnimationData, 1);
|
||||
|
||||
g_object_ref(static_pixbuf);
|
||||
|
||||
@@ -534,24 +532,24 @@ guint wintc_animation_add_static(
|
||||
anim_data->frame_count = 1;
|
||||
anim_data->frame_height = 0;
|
||||
|
||||
anim->priv->animations =
|
||||
anim->animations =
|
||||
g_slist_append(
|
||||
anim->priv->animations,
|
||||
anim->animations,
|
||||
anim_data
|
||||
);
|
||||
|
||||
return wintc_animation_get_count(anim);
|
||||
return wintc_ctl_animation_get_count(anim);
|
||||
}
|
||||
|
||||
guint wintc_animation_get_count(
|
||||
WinTCAnimation* anim
|
||||
guint wintc_ctl_animation_get_count(
|
||||
WinTCCtlAnimation* anim
|
||||
)
|
||||
{
|
||||
return g_slist_length(anim->priv->animations);
|
||||
return g_slist_length(anim->animations);
|
||||
}
|
||||
|
||||
GtkAlign wintc_animation_get_halign(
|
||||
WinTCAnimation* anim
|
||||
GtkAlign wintc_ctl_animation_get_halign(
|
||||
WinTCCtlAnimation* anim
|
||||
)
|
||||
{
|
||||
GtkAlign value;
|
||||
@@ -561,8 +559,8 @@ GtkAlign wintc_animation_get_halign(
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkAlign wintc_animation_get_valign(
|
||||
WinTCAnimation* anim
|
||||
GtkAlign wintc_ctl_animation_get_valign(
|
||||
WinTCCtlAnimation* anim
|
||||
)
|
||||
{
|
||||
GtkAlign value;
|
||||
@@ -572,24 +570,24 @@ GtkAlign wintc_animation_get_valign(
|
||||
return value;
|
||||
}
|
||||
|
||||
void wintc_animation_play(
|
||||
WinTCAnimation* anim,
|
||||
guint id,
|
||||
gint frame_rate,
|
||||
gint repeats
|
||||
void wintc_ctl_animation_play(
|
||||
WinTCCtlAnimation* anim,
|
||||
guint id,
|
||||
gint frame_rate,
|
||||
gint repeats
|
||||
)
|
||||
{
|
||||
// Reset anim state values
|
||||
//
|
||||
anim->priv->is_animating = FALSE;
|
||||
anim->is_animating = FALSE;
|
||||
|
||||
anim->priv->current_anim = NULL;
|
||||
anim->priv->current_frame = 0;
|
||||
anim->priv->last_frame = 0;
|
||||
anim->priv->desired_repeats = 0;
|
||||
anim->priv->origin_frame_time = 0;
|
||||
anim->priv->per_frame_time = 0;
|
||||
anim->priv->playback_total_time = 0;
|
||||
anim->current_anim = NULL;
|
||||
anim->current_frame = 0;
|
||||
anim->last_frame = 0;
|
||||
anim->desired_repeats = 0;
|
||||
anim->origin_frame_time = 0;
|
||||
anim->per_frame_time = 0;
|
||||
anim->playback_total_time = 0;
|
||||
|
||||
// Queue a draw regardless of what happens
|
||||
//
|
||||
@@ -597,13 +595,13 @@ void wintc_animation_play(
|
||||
|
||||
// Check we're being asked to actually play anything
|
||||
//
|
||||
if (id > wintc_animation_get_count(anim))
|
||||
if (id > wintc_ctl_animation_get_count(anim))
|
||||
{
|
||||
g_warning("WinTCAnimation - attempted to play invalid ID %u", id);
|
||||
g_warning("WinTCCtlAnimation - attempted to play invalid ID %u", id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == WINTC_ANIMATION_NONE)
|
||||
if (id == WINTC_CTL_ANIMATION_NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -612,34 +610,34 @@ void wintc_animation_play(
|
||||
//
|
||||
gint real_id = id - 1; // The consumer is given the count rather than index
|
||||
// in the 'add' APIs, so that we can have a special
|
||||
// meaning for 0 (WINTC_ANIMATION_NONE)
|
||||
// meaning for 0 (WINTC_CTL_ANIMATION_NONE)
|
||||
|
||||
GSList* anim_link = g_slist_nth(
|
||||
anim->priv->animations,
|
||||
anim->animations,
|
||||
real_id
|
||||
);
|
||||
WinTCAnimationData* anim_data = anim_link->data;
|
||||
WinTCCtlAnimationData* anim_data = anim_link->data;
|
||||
|
||||
anim->priv->current_anim = anim_data;
|
||||
anim->current_anim = anim_data;
|
||||
|
||||
if (
|
||||
anim_data->frame_count > 1 &&
|
||||
frame_rate > 0
|
||||
)
|
||||
{
|
||||
anim->priv->is_animating = TRUE;
|
||||
anim->is_animating = TRUE;
|
||||
|
||||
anim->priv->desired_repeats = repeats;
|
||||
anim->priv->origin_frame_time = g_get_monotonic_time();
|
||||
anim->priv->per_frame_time = ONE_SECOND_IN_US / frame_rate;
|
||||
anim->priv->playback_total_time =
|
||||
anim->priv->per_frame_time * anim_data->frame_count;
|
||||
anim->desired_repeats = repeats;
|
||||
anim->origin_frame_time = g_get_monotonic_time();
|
||||
anim->per_frame_time = ONE_SECOND_IN_US / frame_rate;
|
||||
anim->playback_total_time =
|
||||
anim->per_frame_time * anim_data->frame_count;
|
||||
|
||||
if (anim->priv->tick_id == 0)
|
||||
if (anim->tick_id == 0)
|
||||
{
|
||||
gtk_widget_add_tick_callback(
|
||||
GTK_WIDGET(anim),
|
||||
(GtkTickCallback) wintc_animation_step,
|
||||
(GtkTickCallback) wintc_ctl_animation_step,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
@@ -647,40 +645,40 @@ void wintc_animation_play(
|
||||
}
|
||||
}
|
||||
|
||||
void wintc_animation_remove(
|
||||
WinTCAnimation* anim,
|
||||
guint id
|
||||
void wintc_ctl_animation_remove(
|
||||
WinTCCtlAnimation* anim,
|
||||
guint id
|
||||
)
|
||||
{
|
||||
if (id == 0 || id > wintc_animation_get_count(anim))
|
||||
if (id == 0 || id > wintc_ctl_animation_get_count(anim))
|
||||
{
|
||||
g_warning("WinTCAnimation - attempted to remove invalid ID %u", id);
|
||||
g_warning("WinTCCtlAnimation - attempted to remove invalid ID %u", id);
|
||||
return;
|
||||
}
|
||||
|
||||
gint real_id = id - 1;
|
||||
GSList* to_delete = g_slist_nth(anim->priv->animations, real_id);
|
||||
GSList* to_delete = g_slist_nth(anim->animations, real_id);
|
||||
|
||||
free_anim_data(to_delete->data);
|
||||
|
||||
anim->priv->animations =
|
||||
anim->animations =
|
||||
g_slist_delete_link(
|
||||
anim->priv->animations,
|
||||
anim->animations,
|
||||
to_delete
|
||||
);
|
||||
}
|
||||
|
||||
void wintc_animation_set_halign(
|
||||
WinTCAnimation* anim,
|
||||
GtkAlign align
|
||||
void wintc_ctl_animation_set_halign(
|
||||
WinTCCtlAnimation* anim,
|
||||
GtkAlign align
|
||||
)
|
||||
{
|
||||
g_object_set(anim, "gfx-halign", align, NULL);
|
||||
}
|
||||
|
||||
void wintc_animation_set_valign(
|
||||
WinTCAnimation* anim,
|
||||
GtkAlign align
|
||||
void wintc_ctl_animation_set_valign(
|
||||
WinTCCtlAnimation* anim,
|
||||
GtkAlign align
|
||||
)
|
||||
{
|
||||
g_object_set(anim, "gfx-valign", align, NULL);
|
||||
@@ -690,7 +688,7 @@ void wintc_animation_set_valign(
|
||||
// PRIVATE FUNCTIONS
|
||||
//
|
||||
static void free_anim_data(
|
||||
WinTCAnimationData* anim_data
|
||||
WinTCCtlAnimationData* anim_data
|
||||
)
|
||||
{
|
||||
cairo_surface_destroy(anim_data->surface_bmp);
|
||||
@@ -701,39 +699,39 @@ static void free_anim_data(
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static gboolean wintc_animation_step(
|
||||
static gboolean wintc_ctl_animation_step(
|
||||
GtkWidget* widget,
|
||||
GdkFrameClock* frame_clock,
|
||||
WINTC_UNUSED(gpointer user_data)
|
||||
)
|
||||
{
|
||||
WinTCAnimation* anim = WINTC_ANIMATION(widget);
|
||||
WinTCCtlAnimation* anim = WINTC_CTL_ANIMATION(widget);
|
||||
|
||||
if (!anim->priv->is_animating)
|
||||
if (!anim->is_animating)
|
||||
{
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
gint64 frame_time = gdk_frame_clock_get_frame_time(frame_clock);
|
||||
gint64 progress = frame_time - anim->priv->origin_frame_time;
|
||||
gint64 repeat_no = progress / anim->priv->playback_total_time;
|
||||
gint64 within_frame = progress % anim->priv->playback_total_time;
|
||||
gint frame_no = (gint) (within_frame / anim->priv->per_frame_time);
|
||||
gint64 progress = frame_time - anim->origin_frame_time;
|
||||
gint64 repeat_no = progress / anim->playback_total_time;
|
||||
gint64 within_frame = progress % anim->playback_total_time;
|
||||
gint frame_no = (gint) (within_frame / anim->per_frame_time);
|
||||
|
||||
if (
|
||||
anim->priv->desired_repeats != WINTC_ANIMATION_INFINITE &&
|
||||
anim->priv->desired_repeats < repeat_no
|
||||
anim->desired_repeats != WINTC_CTL_ANIMATION_INFINITE &&
|
||||
anim->desired_repeats < repeat_no
|
||||
)
|
||||
{
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
if (anim->priv->last_frame != frame_no)
|
||||
if (anim->last_frame != frame_no)
|
||||
{
|
||||
gtk_widget_queue_draw(widget);
|
||||
}
|
||||
|
||||
anim->priv->current_frame = frame_no;
|
||||
anim->current_frame = frame_no;
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#ifndef __ANIMCTL_H__
|
||||
#define __ANIMCTL_H__
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC DEFINES
|
||||
//
|
||||
#define WINTC_ANIMATION_INFINITE 0
|
||||
#define WINTC_ANIMATION_NONE 0
|
||||
|
||||
//
|
||||
// GTK OOP BOILERPLATE
|
||||
//
|
||||
typedef struct _WinTCAnimationPrivate WinTCAnimationPrivate;
|
||||
typedef struct _WinTCAnimationClass WinTCAnimationClass;
|
||||
typedef struct _WinTCAnimation WinTCAnimation;
|
||||
|
||||
#define TYPE_WINTC_ANIMATION (wintc_animation_get_type())
|
||||
#define WINTC_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_WINTC_ANIMATION, WinTCAnimation))
|
||||
#define WINTC_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_WINTC_ANIMATION, WinTCAnimation))
|
||||
#define IS_WINTC_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_WINTC_ANIMATION))
|
||||
#define IS_WINTC_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_WINTC_ANIMATION))
|
||||
#define WINTC_ANIMATION_GET_CLASS(obj) (G_TYPE_CHECK_INSTANCE_GET_CLASS((obj), TYPE_WINTC_ANIMATION))
|
||||
|
||||
GType wintc_animation_get_type(void) G_GNUC_CONST;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GtkWidget* wintc_animation_new(void);
|
||||
|
||||
guint wintc_animation_add_framesheet(
|
||||
WinTCAnimation* anim,
|
||||
GdkPixbuf* framesheet_pixbuf,
|
||||
gint frame_count
|
||||
);
|
||||
guint wintc_animation_add_static(
|
||||
WinTCAnimation* anim,
|
||||
GdkPixbuf* static_pixbuf
|
||||
);
|
||||
guint wintc_animation_get_count(
|
||||
WinTCAnimation* anim
|
||||
);
|
||||
GtkAlign wintc_animation_get_halign(
|
||||
WinTCAnimation* anim
|
||||
);
|
||||
GtkAlign wintc_animation_get_valign(
|
||||
WinTCAnimation* anim
|
||||
);
|
||||
void wintc_animation_play(
|
||||
WinTCAnimation* anim,
|
||||
guint id,
|
||||
gint frame_rate,
|
||||
gint repeats
|
||||
);
|
||||
void wintc_animation_remove(
|
||||
WinTCAnimation* anim,
|
||||
guint id
|
||||
);
|
||||
void wintc_animation_set_halign(
|
||||
WinTCAnimation* anim,
|
||||
GtkAlign align
|
||||
);
|
||||
void wintc_animation_set_valign(
|
||||
WinTCAnimation* anim,
|
||||
GtkAlign align
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "style.h"
|
||||
#include "../public/style.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
void wintc_comctl_install_default_styles(void)
|
||||
void wintc_ctl_install_default_styles(void)
|
||||
{
|
||||
static gboolean already_done = FALSE;
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#ifndef __STYLE_H__
|
||||
#define __STYLE_H__
|
||||
|
||||
#define WINTC_COMCTL_BUTTON_BOX_CSS_CLASS "wintc-button-box"
|
||||
|
||||
void wintc_comctl_install_default_styles(void);
|
||||
|
||||
#endif
|
||||
@@ -27,46 +27,43 @@ include(../../packaging/cmake-inc/packaging/CMakeLists.txt)
|
||||
wintc_resolve_library(glib-2.0 GLIB)
|
||||
wintc_resolve_library(gtk+-3.0 GTK3)
|
||||
|
||||
configure_file(public/wintc-comgtk.h.in ${PROJECT_ROOT}/public/wintc-comgtk.h @ONLY)
|
||||
configure_file(src/assets.h.in ${PROJECT_ROOT}/src/assets.h @ONLY)
|
||||
configure_file(src/version.c.in ${PROJECT_ROOT}/src/version.c @ONLY)
|
||||
configure_file(public/assets.h.in ${PROJECT_ROOT}/public/assets.h @ONLY)
|
||||
configure_file(src/version.c.in ${PROJECT_ROOT}/src/version.c @ONLY)
|
||||
|
||||
add_library(
|
||||
libwintc-comgtk
|
||||
src/assets.h
|
||||
src/debug.h
|
||||
public/assets.h
|
||||
public/debug.h
|
||||
src/container.c
|
||||
src/container.h
|
||||
public/container.h
|
||||
src/defprocs.c
|
||||
src/defprocs.h
|
||||
public/defprocs.h
|
||||
src/errors.c
|
||||
src/errors.h
|
||||
src/gchar.h
|
||||
public/errors.h
|
||||
src/list.c
|
||||
src/list.h
|
||||
public/list.h
|
||||
src/marshal.c
|
||||
src/marshal.h
|
||||
public/marshal.h
|
||||
src/msgbox.c
|
||||
src/msgbox.h
|
||||
public/msgbox.h
|
||||
src/profile.c
|
||||
src/profile.h
|
||||
src/shorthand.h
|
||||
public/profile.h
|
||||
public/shorthand.h
|
||||
src/signals.c
|
||||
src/signals.h
|
||||
public/signals.h
|
||||
src/strings.c
|
||||
src/strings.h
|
||||
public/strings.h
|
||||
src/styles.c
|
||||
src/styles.h
|
||||
public/styles.h
|
||||
src/version.c
|
||||
src/version.h
|
||||
public/version.h
|
||||
src/window.c
|
||||
src/window.h
|
||||
public/window.h
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
libwintc-comgtk
|
||||
PROPERTIES
|
||||
PUBLIC_HEADER public/wintc-comgtk.h
|
||||
SOVERSION 1
|
||||
VERSION ${PROJECT_VERSION}
|
||||
)
|
||||
@@ -100,9 +97,9 @@ target_link_libraries(
|
||||
#
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_add_pkgconfig_install()
|
||||
wintc_install_public_headers()
|
||||
|
||||
install(
|
||||
TARGETS libwintc-comgtk
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
)
|
||||
|
||||
20
shared/comgtk/public/_api.h
Normal file
20
shared/comgtk/public/_api.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __WINTC_COMGTK_H__
|
||||
#define __WINTC_COMGTK_H__
|
||||
|
||||
#include "comgtk/assets.h"
|
||||
#include "comgtk/container.h"
|
||||
#include "comgtk/debug.h"
|
||||
#include "comgtk/defprocs.h"
|
||||
#include "comgtk/errors.h"
|
||||
#include "comgtk/list.h"
|
||||
#include "comgtk/marshal.h"
|
||||
#include "comgtk/msgbox.h"
|
||||
#include "comgtk/profile.h"
|
||||
#include "comgtk/shorthand.h"
|
||||
#include "comgtk/signals.h"
|
||||
#include "comgtk/strings.h"
|
||||
#include "comgtk/styles.h"
|
||||
#include "comgtk/version.h"
|
||||
#include "comgtk/window.h"
|
||||
|
||||
#endif
|
||||
14
shared/comgtk/public/assets.h.in
Normal file
14
shared/comgtk/public/assets.h.in
Normal file
@@ -0,0 +1,14 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_ASSETS_H__
|
||||
#define __COMGTK_ASSETS_H__
|
||||
|
||||
/**
|
||||
* @def WINTC_ASSETS_DIR
|
||||
*
|
||||
* The absolute path for the directory that contains the assets for WinTC
|
||||
* components.
|
||||
*/
|
||||
#define WINTC_ASSETS_DIR "@CMAKE_INSTALL_PREFIX@/@WINTC_ASSETS_INSTALL_DIR@"
|
||||
|
||||
#endif
|
||||
21
shared/comgtk/public/container.h
Normal file
21
shared/comgtk/public/container.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_CONTAINER_H__
|
||||
#define __COMGTK_CONTAINER_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Destroys all child widgets of a container.
|
||||
*
|
||||
* @param container The container.
|
||||
*/
|
||||
void wintc_container_clear(
|
||||
GtkContainer* container
|
||||
);
|
||||
|
||||
#endif
|
||||
38
shared/comgtk/public/debug.h
Normal file
38
shared/comgtk/public/debug.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_DEBUG_H__
|
||||
#define __COMGTK_DEBUG_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @def WINTC_ENVVAR_DEBUG_LOGGING
|
||||
*
|
||||
* The environment variable that, if set, will enable troubleshooting log
|
||||
* output.
|
||||
*/
|
||||
#define WINTC_ENVVAR_DEBUG_LOGGING "WINDEBUG"
|
||||
|
||||
/**
|
||||
* @def WINTC_LOG_USER_DEBUG(...)
|
||||
*
|
||||
* Logs a message to stdout if the WINDEBUG environment variable is set, this
|
||||
* is intended for messages that will help end users troubleshoot a problem.
|
||||
*/
|
||||
#define WINTC_LOG_USER_DEBUG(...) if (getenv(WINTC_ENVVAR_DEBUG_LOGGING)) { g_message(__VA_ARGS__); }
|
||||
|
||||
/**
|
||||
* @def WINTC_LOG_DEBUG(...)
|
||||
*
|
||||
* Logs a message to stdout if compiled as a checked build, this is intended
|
||||
* for messages that will aid in developer debugging.
|
||||
*/
|
||||
#ifdef WINTC_CHECKED
|
||||
#define WINTC_LOG_DEBUG(...) g_message(__VA_ARGS__);
|
||||
#else
|
||||
#define WINTC_LOG_DEBUG(...)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#ifndef __DEFPROCS_H__
|
||||
#define __DEFPROCS_H__
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_DEFPROCS_H__
|
||||
#define __COMGTK_DEFPROCS_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtk.h>
|
||||
@@ -9,12 +11,19 @@
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Callback for deselecting a GtkMenuShell upon a notify-leave-event.
|
||||
*/
|
||||
void wintc_menu_shell_deselect_on_leave(
|
||||
GtkWidget* widget,
|
||||
WINTC_UNUSED(GdkEvent* event),
|
||||
GtkMenuShell* menu_shell
|
||||
);
|
||||
|
||||
/**
|
||||
* Callback for selecting a GtkMenuShell upon a notify-enter-event.
|
||||
*/
|
||||
void wintc_menu_shell_select_on_enter(
|
||||
GtkWidget* widget,
|
||||
WINTC_UNUSED(GdkEvent* event),
|
||||
50
shared/comgtk/public/errors.h
Normal file
50
shared/comgtk/public/errors.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_ERRORS_H__
|
||||
#define __COMGTK_ERRORS_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#define WINTC_GENERAL_ERROR wintc_general_error_quark()
|
||||
|
||||
/**
|
||||
* Specifies simple errors used by WinTC components.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
WINTC_GENERAL_ERROR_NOTIMPL /** The functionality is not implemented. */
|
||||
} WinTCGeneralError;
|
||||
|
||||
/**
|
||||
* Displays a message box describing the error and clears the associated
|
||||
* GError object.
|
||||
*
|
||||
* @param error A reference to the GError storage location.
|
||||
*/
|
||||
void wintc_display_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
GQuark wintc_general_error_quark(void);
|
||||
|
||||
/**
|
||||
* Logs a message describing the error and clears the associated GError
|
||||
* object.
|
||||
*
|
||||
* @param error A reference to the GError storage location.
|
||||
*/
|
||||
void wintc_log_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
/**
|
||||
* Displays a message box describing the error in a nicer way, if possible, and
|
||||
* clears the associated GError object.
|
||||
*
|
||||
* @param error A reference to the GError storage location.
|
||||
*/
|
||||
void wintc_nice_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
#endif
|
||||
100
shared/comgtk/public/list.h
Normal file
100
shared/comgtk/public/list.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_LIST_H__
|
||||
#define __COMGTK_LIST_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Appends an item to the end of a list, if an item of equal value already
|
||||
* exists in the list it will be removed and freed.
|
||||
*
|
||||
* @param list The list.
|
||||
* @param data The item to append.
|
||||
* @param comparer The function for comparing existing items to the new one.
|
||||
* @param free_func The function for freeing an item, if necessary.
|
||||
* @return The list.
|
||||
*/
|
||||
GList* wintc_list_distinct_append(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
/**
|
||||
* Inserts an item at a specific index to a list, if an item of equal value
|
||||
* already exists in the list it will be removed and freed.
|
||||
*
|
||||
* @param list The list.
|
||||
* @param data The item to insert.
|
||||
* @param position The index in the list, -1 to append to the end of the list.
|
||||
* @param comparer The function for comparing existing items to the new one.
|
||||
* @param free_func The function for freeing an item, if necessary.
|
||||
* @return The list.
|
||||
*/
|
||||
GList* wintc_list_distinct_insert(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
gint position,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
/**
|
||||
* Prepends an item at the start of a list, if an item of equal value already
|
||||
* exists in the list it will be removed and freed.
|
||||
*
|
||||
* @param list The list.
|
||||
* @param data The item to prepend.
|
||||
* @param comparer The function for comparing existing items to the new one.
|
||||
* @param free_func The function for freeing an item, if necessary.
|
||||
* @return The list.
|
||||
*/
|
||||
GList* wintc_list_distinct_prepend(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
/**
|
||||
* Joins all strings together in the list into one single string.
|
||||
*
|
||||
* @param list The list.
|
||||
* @return The compiled string.
|
||||
*/
|
||||
gchar* wintc_list_implode_strings(
|
||||
GList* list
|
||||
);
|
||||
|
||||
/**
|
||||
* Clamps the size of a list, removing and freeing items that exist beyond that
|
||||
* limit.
|
||||
*
|
||||
* @param list The list.
|
||||
* @param limit The max items in the list.
|
||||
* @param free_func The function for freeing an item, if necessary.
|
||||
* @return The list.
|
||||
*/
|
||||
GList* wintc_list_limit(
|
||||
GList* list,
|
||||
gint limit,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
/**
|
||||
* Creates a list out of the lines in a string.
|
||||
*
|
||||
* @param str The string.
|
||||
* @return The newly created list whose contents are the lines of the string.
|
||||
*/
|
||||
GList* wintc_list_read_from_string(
|
||||
const gchar* str
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,7 @@
|
||||
#ifndef __MARSHAL_H__
|
||||
#define __MARSHAL_H__
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_MARSHAL_H__
|
||||
#define __COMGTK_MARSHAL_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
@@ -7,6 +9,11 @@
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* A GClosureMarshal function for use with signals with handlers that take no
|
||||
* arguments and return a boolean.
|
||||
*/
|
||||
void wintc_cclosure_marshal_BOOLEAN__VOID(
|
||||
GClosure* closure,
|
||||
GValue* return_value,
|
||||
@@ -16,6 +23,10 @@ void wintc_cclosure_marshal_BOOLEAN__VOID(
|
||||
gpointer marshal_data
|
||||
);
|
||||
|
||||
/**
|
||||
* A GClosureMarshal function for use with signals with handlers that take no
|
||||
* arguments and return an integer.
|
||||
*/
|
||||
void wintc_cclosure_marshal_INT__VOID(
|
||||
GClosure* closure,
|
||||
GValue* return_value,
|
||||
30
shared/comgtk/public/msgbox.h
Normal file
30
shared/comgtk/public/msgbox.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_MSGBOX_H__
|
||||
#define __COMGTK_MSGBOX_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Displays a message box with specified options.
|
||||
*
|
||||
* @param parent The parent window of the dialog.
|
||||
* @param text The message to display.
|
||||
* @param caption The title of the dialog.
|
||||
* @param buttons The available buttons.
|
||||
* @param type The type of message being displayed.
|
||||
* @return The choice the user made in the dialog.
|
||||
*/
|
||||
gint wintc_messagebox_show(
|
||||
GtkWindow* parent,
|
||||
const gchar* text,
|
||||
const gchar* caption,
|
||||
GtkButtonsType buttons,
|
||||
GtkMessageType type
|
||||
);
|
||||
|
||||
#endif
|
||||
80
shared/comgtk/public/profile.h
Normal file
80
shared/comgtk/public/profile.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_PROFILE_H__
|
||||
#define __COMGTK_PROFILE_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
/**
|
||||
* @def WINTC_COMPONENT_SHELL
|
||||
* The identifier for the shell component.
|
||||
*/
|
||||
#define WINTC_COMPONENT_SHELL "shell"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Ensures that the directory structure for a component's data exists in the
|
||||
* user's profile.
|
||||
*
|
||||
* @param component The component's identifier.
|
||||
* @param out_error Storage location for any error that occurred.
|
||||
* @return True if the directory structure exists.
|
||||
*/
|
||||
gboolean wintc_profile_ensure_exists(
|
||||
const gchar* component,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructs the absolute path for the location of a component's data in the
|
||||
* user's profile.
|
||||
*
|
||||
* @param component The component's identifier.
|
||||
* @param filename The name of the file in the profile.
|
||||
* @return The absolute path for the file in the user's profile.
|
||||
*/
|
||||
gchar* wintc_profile_get_path(
|
||||
const gchar* component,
|
||||
const gchar* filename
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieves the contents of a file in the user's profile.
|
||||
*
|
||||
* @param component The component's identifier.
|
||||
* @param filename The name of the file in the profile.
|
||||
* @param contents Storage location for the file contents.
|
||||
* @param length Storage location for the size of the file.
|
||||
* @param error Storage location for any error that occurred.
|
||||
* @return True if the file was successfully read.
|
||||
*/
|
||||
gboolean wintc_profile_get_file_contents(
|
||||
const gchar* component,
|
||||
const gchar* filename,
|
||||
gchar** contents,
|
||||
gsize* length,
|
||||
GError** error
|
||||
);
|
||||
|
||||
/**
|
||||
* Writes contents to a file in the user's profile.
|
||||
*
|
||||
* @param component The component's identifier.
|
||||
* @param filename The name of the file in the profile.
|
||||
* @param contents The contents to write.
|
||||
* @param length The length of the contents, -1 for NULL terminated.
|
||||
* @param error Storage location for any error that occurred.
|
||||
* @return True if the file was successfully written.
|
||||
*/
|
||||
gboolean wintc_profile_set_file_contents(
|
||||
const gchar* component,
|
||||
const gchar* filename,
|
||||
gchar* contents,
|
||||
gssize length,
|
||||
GError** error
|
||||
);
|
||||
|
||||
#endif
|
||||
27
shared/comgtk/public/shorthand.h
Normal file
27
shared/comgtk/public/shorthand.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_SHORTHAND_H__
|
||||
#define __COMGTK_SHORTHAND_H__
|
||||
|
||||
/**
|
||||
* @def WINTC_SAFE_REF_CLEAR(ref)
|
||||
*
|
||||
* Sets the value pointed at by ref to NULL, checks ref itself is not NULL.
|
||||
*/
|
||||
#define WINTC_SAFE_REF_CLEAR(ref) if (ref != NULL) { *ref = NULL; }
|
||||
|
||||
/**
|
||||
* @def WINTC_SAFE_REF_SET(ref)
|
||||
*
|
||||
* Sets the value pointed at by ref, checks ref itself is not NULL.
|
||||
*/
|
||||
#define WINTC_SAFE_REF_SET(ref, value) if (ref != NULL) { *ref = value; }
|
||||
|
||||
/**
|
||||
* @def WINTC_UNUSED(arg)
|
||||
*
|
||||
* Marks a parameter as unused to the compiler so it doesn't complain.
|
||||
*/
|
||||
#define WINTC_UNUSED(arg) __attribute__((unused)) arg
|
||||
|
||||
#endif
|
||||
28
shared/comgtk/public/signals.h
Normal file
28
shared/comgtk/public/signals.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_SIGNALS_H__
|
||||
#define __COMGTK_SIGNALS_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Connects a callback to a signals on many widgets at once.
|
||||
*
|
||||
* @param widgets The list of widgets.
|
||||
* @param signal_name The signal name.
|
||||
* @param cb The callback to connect.
|
||||
* @param user_data Data that will be passed to the callback.
|
||||
*/
|
||||
void wintc_signal_connect_list(
|
||||
GList* widgets,
|
||||
const gchar* signal_name,
|
||||
GCallback cb,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
#endif
|
||||
74
shared/comgtk/public/strings.h
Normal file
74
shared/comgtk/public/strings.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_STRINGS_H__
|
||||
#define __COMGTK_STRINGS_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Copies a string, ensuring it has the specified prefix.
|
||||
*
|
||||
* @param str The string.
|
||||
* @param prefix The desired prefix.
|
||||
* @return The new string.
|
||||
*/
|
||||
gchar* wintc_str_set_prefix(
|
||||
const gchar* str,
|
||||
const gchar* prefix
|
||||
);
|
||||
|
||||
/**
|
||||
* Copies a string, ensuring it has the specified suffix.
|
||||
*
|
||||
* @param str The string.
|
||||
* @param suffix The desired suffix.
|
||||
* @return The new string.
|
||||
*/
|
||||
gchar* wintc_str_set_suffix(
|
||||
const gchar* str,
|
||||
const gchar* suffix
|
||||
);
|
||||
|
||||
/**
|
||||
* Counts the number of time a string appears within another string.
|
||||
*
|
||||
* @param haystack The subject string.
|
||||
* @param needle The string to search for.
|
||||
* @return The number of times the string appears.
|
||||
*/
|
||||
gint wintc_strstr_count(
|
||||
const gchar* haystack,
|
||||
const gchar* needle
|
||||
);
|
||||
|
||||
/**
|
||||
* Transfers a string between two pointers - if the destination pointer already
|
||||
* refers to a string it will be freed.
|
||||
*
|
||||
* @param dest Reference to the destination pointer.
|
||||
* @param src Reference to the source pointer.
|
||||
*/
|
||||
void wintc_strsteal(
|
||||
gchar** dest,
|
||||
gchar** src
|
||||
);
|
||||
|
||||
/**
|
||||
* Finds and replaces appearances of a string with another string.
|
||||
*
|
||||
* @param str The subject string.
|
||||
* @param findwhat The string to find.
|
||||
* @param replacewith The string to use as the replacement.
|
||||
* @return A new string with the replacements.
|
||||
*/
|
||||
gchar* wintc_strsubst(
|
||||
const gchar* str,
|
||||
const gchar* findwhat,
|
||||
const gchar* replacewith
|
||||
);
|
||||
|
||||
#endif
|
||||
34
shared/comgtk/public/styles.h
Normal file
34
shared/comgtk/public/styles.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_STYLES_H__
|
||||
#define __COMGTK_STYLES_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Adds application priority CSS to the specified widget.
|
||||
*
|
||||
* @param widget The widget.
|
||||
* @param css The CSS to add, which will have application priority.
|
||||
*/
|
||||
void wintc_widget_add_css(
|
||||
GtkWidget* widget,
|
||||
const gchar* css
|
||||
);
|
||||
|
||||
/**
|
||||
* Adds a style class to the specified widget.
|
||||
*
|
||||
* @param widget The widget.
|
||||
* @param class_name The style class.
|
||||
*/
|
||||
void wintc_widget_add_style_class(
|
||||
GtkWidget* widget,
|
||||
const gchar* class_name
|
||||
);
|
||||
|
||||
#endif
|
||||
26
shared/comgtk/public/version.h
Normal file
26
shared/comgtk/public/version.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_VERSION_H__
|
||||
#define __COMGTK_VERSION_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Identifies whether the installed version of WinTC is a debug build.
|
||||
*
|
||||
* @return True if WinTC is a debug build.
|
||||
*/
|
||||
gboolean wintc_build_is_debug(void);
|
||||
|
||||
/**
|
||||
* Retrieves the build tag identifying the installed version of WinTC.
|
||||
*
|
||||
* @return The WinTC build tag (caller is responsible for freeing).
|
||||
*/
|
||||
gchar* wintc_build_get_tag(void);
|
||||
|
||||
#endif
|
||||
21
shared/comgtk/public/window.h
Normal file
21
shared/comgtk/public/window.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __COMGTK_WINDOW_H__
|
||||
#define __COMGTK_WINDOW_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Requests that a window be given focus.
|
||||
*
|
||||
* @param window The window.
|
||||
*/
|
||||
void wintc_focus_window(
|
||||
GtkWindow* window
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,251 +0,0 @@
|
||||
#ifndef __WINTC_COMGTK_H__
|
||||
#define __WINTC_COMGTK_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// Assets-related
|
||||
//
|
||||
#define WINTC_ASSETS_DIR "@CMAKE_INSTALL_PREFIX@/@WINTC_ASSETS_INSTALL_DIR@"
|
||||
|
||||
//
|
||||
// Container-related
|
||||
//
|
||||
void wintc_gtk_container_clear(
|
||||
GtkContainer* container
|
||||
);
|
||||
|
||||
//
|
||||
// Debugging
|
||||
//
|
||||
#define WINTC_ENVVAR_DEBUG_LOGGING "WINDEBUG"
|
||||
#define WINTC_LOG_USER_DEBUG(...) if (getenv(WINTC_ENVVAR_DEBUG_LOGGING)) { g_message(__VA_ARGS__); }
|
||||
|
||||
#ifdef WINTC_CHECKED
|
||||
#define WINTC_LOG_DEBUG(...) g_message(__VA_ARGS__);
|
||||
#else
|
||||
#define WINTC_LOG_DEBUG(...)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Shorthand
|
||||
//
|
||||
#define WINTC_SAFE_REF_CLEAR(ref) if (ref != NULL) { *ref = NULL; }
|
||||
#define WINTC_SAFE_REF_SET(ref, value) if (ref != NULL) { *ref = value; }
|
||||
|
||||
#define WINTC_UNUSED(arg) __attribute__((unused)) arg
|
||||
|
||||
//
|
||||
// gchar-related
|
||||
//
|
||||
#define WINTC_GCHAR_BUFFER_SIZE sizeof(gchar) * 255
|
||||
|
||||
//
|
||||
// Default procedures
|
||||
//
|
||||
void wintc_menu_shell_deselect_on_leave(
|
||||
GtkWidget* widget,
|
||||
WINTC_UNUSED(GdkEvent* event),
|
||||
GtkMenuShell* menu_shell
|
||||
);
|
||||
|
||||
void wintc_menu_shell_select_on_enter(
|
||||
GtkWidget* widget,
|
||||
WINTC_UNUSED(GdkEvent* event),
|
||||
GtkMenuShell* menu_shell
|
||||
);
|
||||
|
||||
//
|
||||
// Error-related
|
||||
//
|
||||
#define WINTC_GENERAL_ERROR wintc_general_error_quark()
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WINTC_GENERAL_ERROR_NOTIMPL
|
||||
} WinTCGeneralError;
|
||||
|
||||
void wintc_display_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
GQuark wintc_general_error_quark(void);
|
||||
|
||||
void wintc_log_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
void wintc_nice_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
//
|
||||
// List-related
|
||||
//
|
||||
GList* wintc_list_distinct_append(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
GList* wintc_list_distinct_insert(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
gint position,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
GList* wintc_list_distinct_prepend(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
gchar* wintc_list_implode_strings(
|
||||
GList* list
|
||||
);
|
||||
|
||||
GList* wintc_list_limit(
|
||||
GList* list,
|
||||
gint limit,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
GList* wintc_list_read_from_string(
|
||||
const gchar* str
|
||||
);
|
||||
|
||||
//
|
||||
// Closure Marshals
|
||||
//
|
||||
void wintc_cclosure_marshal_BOOLEAN__VOID(
|
||||
GClosure* closure,
|
||||
GValue* return_value,
|
||||
guint n_param_values,
|
||||
const GValue* param_values,
|
||||
gpointer invocation_hint,
|
||||
gpointer marshal_data
|
||||
);
|
||||
|
||||
void wintc_cclosure_marshal_INT__VOID(
|
||||
GClosure* closure,
|
||||
GValue* return_value,
|
||||
guint n_param_values,
|
||||
const GValue* param_values,
|
||||
gpointer invocation_hint,
|
||||
gpointer marshal_data
|
||||
);
|
||||
|
||||
//
|
||||
// Message Box-related
|
||||
//
|
||||
gint wintc_messagebox_show(
|
||||
GtkWindow* parent,
|
||||
const gchar* text,
|
||||
const gchar* caption,
|
||||
GtkButtonsType buttons,
|
||||
GtkMessageType type
|
||||
);
|
||||
|
||||
//
|
||||
// Profile-related
|
||||
//
|
||||
#define WINTC_COMPONENT_SHELL "shell"
|
||||
|
||||
gboolean wintc_profile_ensure_exists(
|
||||
const gchar* component,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
gchar* wintc_profile_get_path(
|
||||
const gchar* component,
|
||||
const gchar* filename
|
||||
);
|
||||
|
||||
gboolean wintc_profile_get_file_contents(
|
||||
const gchar* component,
|
||||
const gchar* filename,
|
||||
gchar** contents,
|
||||
gsize* length,
|
||||
GError** error
|
||||
);
|
||||
|
||||
gboolean wintc_profile_set_file_contents(
|
||||
const gchar* component,
|
||||
const gchar* filename,
|
||||
gchar* contents,
|
||||
gssize length,
|
||||
GError** error
|
||||
);
|
||||
|
||||
//
|
||||
// Signal-related
|
||||
//
|
||||
void wintc_signal_connect_list(
|
||||
GList* widgets,
|
||||
const gchar* signal_name,
|
||||
GCallback cb,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
//
|
||||
// Strings-related
|
||||
//
|
||||
gchar* wintc_str_set_prefix(
|
||||
const gchar* str,
|
||||
const gchar* prefix
|
||||
);
|
||||
|
||||
gchar* wintc_str_set_suffix(
|
||||
const gchar* str,
|
||||
const gchar* suffix
|
||||
);
|
||||
|
||||
gint wintc_strstr_count(
|
||||
const gchar* haystack,
|
||||
const gchar* needle
|
||||
);
|
||||
|
||||
void wintc_strsteal(
|
||||
gchar** dest,
|
||||
gchar** src
|
||||
);
|
||||
|
||||
gchar* wintc_strsubst(
|
||||
const gchar* str,
|
||||
const gchar* findwhat,
|
||||
const gchar* replacewith
|
||||
);
|
||||
|
||||
//
|
||||
// Styles-related
|
||||
//
|
||||
void wintc_widget_add_css(
|
||||
GtkWidget* widget,
|
||||
const gchar* css
|
||||
);
|
||||
|
||||
void wintc_widget_add_style_class(
|
||||
GtkWidget* widget,
|
||||
const gchar* class_name
|
||||
);
|
||||
|
||||
//
|
||||
// Version-related
|
||||
//
|
||||
gboolean wintc_build_is_debug();
|
||||
gchar* wintc_get_build_tag(void);
|
||||
|
||||
//
|
||||
// Window-related
|
||||
//
|
||||
void wintc_focus_window(
|
||||
GtkWindow* window
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __ASSETS_H__
|
||||
#define __ASSETS_H__
|
||||
|
||||
#define WINTC_ASSETS_DIR "@CMAKE_INSTALL_PREFIX@/@WINTC_ASSETS_INSTALL_DIR@"
|
||||
|
||||
#endif
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "container.h"
|
||||
#include "../public/container.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
void wintc_gtk_container_clear(
|
||||
void wintc_container_clear(
|
||||
GtkContainer* container
|
||||
)
|
||||
{
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef __CONTAINER_H__
|
||||
#define __CONTAINER_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
void wintc_gtk_container_clear(
|
||||
GtkContainer* container
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef __DEBUG_H__
|
||||
#define __DEBUG_H__
|
||||
|
||||
// Two variants for debug messaging are provided:
|
||||
// USER_DEBUG is at runtime, intended at end user debugging
|
||||
// DEBUG is compile time, intended for development
|
||||
//
|
||||
#define WINTC_ENVVAR_DEBUG_LOGGING "WINDEBUG"
|
||||
#define WINTC_LOG_USER_DEBUG(...) if (getenv(WINTC_ENVVAR_DEBUG_LOGGING)) { g_message(__VA_ARGS__); }
|
||||
|
||||
#ifdef WINTC_CHECKED
|
||||
#define WINTC_LOG_DEBUG(...) g_message(__VA_ARGS__);
|
||||
#else
|
||||
#define WINTC_LOG_DEBUG(...)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "defprocs.h"
|
||||
#include "shorthand.h"
|
||||
#include "../public/defprocs.h"
|
||||
#include "../public/shorthand.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "errors.h"
|
||||
#include "msgbox.h"
|
||||
#include "../public/errors.h"
|
||||
#include "../public/msgbox.h"
|
||||
|
||||
#define RETURN_IF_NO_ERROR(e) if (e == NULL || *e == NULL) { return; }
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#ifndef __ERRORS_H__
|
||||
#define __ERRORS_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#define WINTC_GENERAL_ERROR wintc_general_error_quark()
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WINTC_GENERAL_ERROR_NOTIMPL
|
||||
} WinTCGeneralError;
|
||||
|
||||
void wintc_display_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
GQuark wintc_general_error_quark(void);
|
||||
|
||||
void wintc_log_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
void wintc_nice_error_and_clear(
|
||||
GError** error
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef __GCHAR_H__
|
||||
#define __GCHAR_H__
|
||||
|
||||
#define WINTC_GCHAR_BUFFER_SIZE sizeof(gchar) * 255
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <glib.h>
|
||||
|
||||
#include "list.h"
|
||||
#include "../public/list.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#ifndef __LIST_H__
|
||||
#define __LIST_H__
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
GList* wintc_list_distinct_append(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
GList* wintc_list_distinct_insert(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
gint position,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
GList* wintc_list_distinct_prepend(
|
||||
GList* list,
|
||||
gpointer data,
|
||||
GCompareFunc comparer,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
gchar* wintc_list_implode_strings(
|
||||
GList* list
|
||||
);
|
||||
|
||||
GList* wintc_list_limit(
|
||||
GList* list,
|
||||
gint limit,
|
||||
GDestroyNotify free_func
|
||||
);
|
||||
|
||||
GList* wintc_list_read_from_string(
|
||||
const gchar* str
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "marshal.h"
|
||||
#include "shorthand.h"
|
||||
#include "../public/marshal.h"
|
||||
#include "../public/shorthand.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "msgbox.h"
|
||||
#include "../public/msgbox.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef __MSGBOX_H__
|
||||
#define __MSGBOX_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
gint wintc_messagebox_show(
|
||||
GtkWindow* parent,
|
||||
const gchar* text,
|
||||
const gchar* caption,
|
||||
GtkButtonsType buttons,
|
||||
GtkMessageType type
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <errno.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "profile.h"
|
||||
#include "shorthand.h"
|
||||
#include "../public/profile.h"
|
||||
#include "../public/shorthand.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#ifndef __PROFILE_H__
|
||||
#define __PROFILE_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#define WINTC_COMPONENT_SHELL "shell"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
gboolean wintc_profile_ensure_exists(
|
||||
const gchar* component,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
gchar* wintc_profile_get_path(
|
||||
const gchar* component,
|
||||
const gchar* filename
|
||||
);
|
||||
|
||||
gboolean wintc_profile_get_file_contents(
|
||||
const gchar* component,
|
||||
const gchar* filename,
|
||||
gchar** contents,
|
||||
gsize* length,
|
||||
GError** error
|
||||
);
|
||||
|
||||
gboolean wintc_profile_set_file_contents(
|
||||
const gchar* component,
|
||||
const gchar* filename,
|
||||
gchar* contents,
|
||||
gssize length,
|
||||
GError** error
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef __SHORTHAND_H__
|
||||
#define __SHORTHAND_H__
|
||||
|
||||
#define WINTC_SAFE_REF_CLEAR(ref) if (ref != NULL) { *ref = NULL; }
|
||||
#define WINTC_SAFE_REF_SET(ref, value) if (ref != NULL) { *ref = value; }
|
||||
|
||||
#define WINTC_UNUSED(arg) __attribute__((unused)) arg
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "signals.h"
|
||||
#include "../public/signals.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef __SIGNALS_H__
|
||||
#define __SIGNALS_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
void wintc_signal_connect_list(
|
||||
GList* widgets,
|
||||
const gchar* signal_name,
|
||||
GCallback cb,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <glib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "strings.h"
|
||||
#include "../public/strings.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#ifndef __STRINGS_H__
|
||||
#define __STRINGS_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
gchar* wintc_str_set_prefix(
|
||||
const gchar* str,
|
||||
const gchar* prefix
|
||||
);
|
||||
|
||||
gchar* wintc_str_set_suffix(
|
||||
const gchar* str,
|
||||
const gchar* suffix
|
||||
);
|
||||
|
||||
gint wintc_strstr_count(
|
||||
const gchar* haystack,
|
||||
const gchar* needle
|
||||
);
|
||||
|
||||
void wintc_strsteal(
|
||||
gchar** dest,
|
||||
gchar** src
|
||||
);
|
||||
|
||||
gchar* wintc_strsubst(
|
||||
const gchar* str,
|
||||
const gchar* findwhat,
|
||||
const gchar* replacewith
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "styles.h"
|
||||
#include "../public/styles.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCIONS
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef __STYLES_H__
|
||||
#define __STYLES_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
void wintc_widget_add_css(
|
||||
GtkWidget* widget,
|
||||
const gchar* css
|
||||
);
|
||||
|
||||
void wintc_widget_add_style_class(
|
||||
GtkWidget* widget,
|
||||
const gchar* class_name
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "version.h"
|
||||
#include <glib.h>
|
||||
|
||||
#include "../public/version.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
@@ -12,7 +14,7 @@ gboolean wintc_build_is_debug(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
gchar* wintc_get_build_tag(void)
|
||||
gchar* wintc_build_get_tag(void)
|
||||
{
|
||||
gchar* build_tag = NULL;
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef __VERSION_H__
|
||||
#define __VERSION_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
gboolean wintc_build_is_debug(void);
|
||||
gchar* wintc_get_build_tag(void);
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "window.h"
|
||||
#include "../public/window.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef __WINDOW_H__
|
||||
#define __WINDOW_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
void wintc_focus_window(
|
||||
GtkWindow* window
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -28,20 +28,19 @@ wintc_resolve_library(wintc-comgtk WINTC_COMGTK)
|
||||
|
||||
add_library(
|
||||
libwintc-exec
|
||||
src/action.h
|
||||
public/action.h
|
||||
src/action.c
|
||||
src/desktop.h
|
||||
public/desktop.h
|
||||
src/desktop.c
|
||||
src/exec.h
|
||||
public/exec.h
|
||||
src/exec.c
|
||||
src/mime.h
|
||||
public/mime.h
|
||||
src/mime.c
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
libwintc-exec
|
||||
PROPERTIES
|
||||
PUBLIC_HEADER public/wintc-exec.h
|
||||
SOVERSION 1
|
||||
VERSION ${PROJECT_VERSION}
|
||||
)
|
||||
@@ -84,9 +83,9 @@ target_link_libraries(
|
||||
#
|
||||
wintc_configure_and_install_packaging()
|
||||
wintc_add_pkgconfig_install()
|
||||
wintc_install_public_headers()
|
||||
|
||||
install(
|
||||
TARGETS libwintc-exec
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
)
|
||||
|
||||
9
shared/exec/public/_api.h
Normal file
9
shared/exec/public/_api.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef __WINTC_EXEC_H__
|
||||
#define __WINTC_EXEC_H__
|
||||
|
||||
#include "exec/action.h"
|
||||
#include "exec/desktop.h"
|
||||
#include "exec/exec.h"
|
||||
#include "exec/mime.h"
|
||||
|
||||
#endif
|
||||
63
shared/exec/public/action.h
Normal file
63
shared/exec/public/action.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __EXEC_ACTIONS_H__
|
||||
#define __EXEC_ACTIONS_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC ENUMS
|
||||
//
|
||||
|
||||
/**
|
||||
* Specifies actions common to WinTC that can be launched.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/** Opens the 'My Documents' folder. */
|
||||
WINTC_ACTION_MYDOCS,
|
||||
/** Opens the 'My Recent Documents' view. */
|
||||
WINTC_ACTION_MYRECENTS,
|
||||
/** Opens the 'My Pictures' folder. */
|
||||
WINTC_ACTION_MYPICS,
|
||||
/** Opens the 'My Music' folder. */
|
||||
WINTC_ACTION_MYMUSIC,
|
||||
/** Opens the 'My Computer' folder. */
|
||||
WINTC_ACTION_MYCOMP,
|
||||
/** Opens Control Panel. */
|
||||
WINTC_ACTION_CONTROL,
|
||||
/** Opens the program for managing MIME types. */
|
||||
WINTC_ACTION_MIMEMGMT,
|
||||
/** Opens the program for managing connections. */
|
||||
WINTC_ACTION_CONNECTTO,
|
||||
/** Opens the program for managing printers. */
|
||||
WINTC_ACTION_PRINTERS,
|
||||
/** Opens the program for getting help.*/
|
||||
WINTC_ACTION_HELP,
|
||||
/** Opens the program for performing searches. */
|
||||
WINTC_ACTION_SEARCH,
|
||||
/** Opens the 'Run' dialog. */
|
||||
WINTC_ACTION_RUN,
|
||||
/** Opens the user actions dialog. */
|
||||
WINTC_ACTION_LOGOFF,
|
||||
/** Opens the power options dialog. */
|
||||
WINTC_ACTION_SHUTDOWN
|
||||
} WinTCAction;
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Launches the specified action.
|
||||
*
|
||||
* @param action_id The action.
|
||||
* @param out_error Storage location for any error that occurred.
|
||||
* @return True if the action was launched successfully.
|
||||
*/
|
||||
gboolean wintc_launch_action(
|
||||
WinTCAction action_id,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
#endif
|
||||
41
shared/exec/public/desktop.h
Normal file
41
shared/exec/public/desktop.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __EXEC_DESKTOP_H__
|
||||
#define __EXEC_DESKTOP_H__
|
||||
|
||||
#include <gio/gdesktopappinfo.h>
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Retrieves the command line from a desktop entry.
|
||||
*
|
||||
* @param entry The desktop entry.
|
||||
* @return The command line.
|
||||
*/
|
||||
gchar* wintc_desktop_app_info_get_command(
|
||||
GDesktopAppInfo* entry
|
||||
);
|
||||
|
||||
/**
|
||||
* Fills in the placeholders in a desktop entry's command line.
|
||||
*
|
||||
* @param cmdline The command line.
|
||||
* @param name The translated name of the program.
|
||||
* @param icon_name The icon name.
|
||||
* @param entry_path The path to the desktop entry.
|
||||
* @param needs_terminal Specifies if the program requires a terminal.
|
||||
* @return The expanded command line.
|
||||
*/
|
||||
gchar* wintc_expand_desktop_entry_cmdline(
|
||||
const gchar* cmdline,
|
||||
const gchar* name,
|
||||
const gchar* icon_name,
|
||||
const gchar* entry_path,
|
||||
gboolean needs_terminal
|
||||
);
|
||||
|
||||
#endif
|
||||
24
shared/exec/public/exec.h
Normal file
24
shared/exec/public/exec.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __EXEC_EXEC_H__
|
||||
#define __EXEC_EXEC_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Launches the specified command line.
|
||||
*
|
||||
* @param command The command line.
|
||||
* @param out_error Storage location for any error that occurred.
|
||||
* @return True if the command was launched successfully.
|
||||
*/
|
||||
gboolean wintc_launch_command(
|
||||
const gchar* command,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
#endif
|
||||
38
shared/exec/public/mime.h
Normal file
38
shared/exec/public/mime.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/** @file */
|
||||
|
||||
#ifndef __EXEC_MIME_H__
|
||||
#define __EXEC_MIME_H__
|
||||
|
||||
#include <gio/gdesktopappinfo.h>
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
//
|
||||
|
||||
/**
|
||||
* Queries for the MIME type of the specified file.
|
||||
*
|
||||
* @param filepath The absolute path to the file.
|
||||
* @param out_error Storage location for any error that occurred.
|
||||
* @return The MIME type of the file, if one was detected.
|
||||
*/
|
||||
gchar* wintc_query_mime_for_file(
|
||||
const gchar* filepath,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
/**
|
||||
* Queries for the program that is set as the default for opening resources
|
||||
* of the specified MIME type.
|
||||
*
|
||||
* @param mime_query The MIME type.
|
||||
* @param out_error Storage location for any error that occurred.
|
||||
* @return A GDesktopAppInfo instance that represents the program.
|
||||
*/
|
||||
GDesktopAppInfo* wintc_query_mime_handler(
|
||||
const gchar* mime_query,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,69 +0,0 @@
|
||||
#ifndef __WINTC_EXEC_H__
|
||||
#define __WINTC_EXEC_H__
|
||||
|
||||
#include <gio/gdesktopappinfo.h>
|
||||
#include <glib.h>
|
||||
|
||||
//
|
||||
// Actions
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
WINTC_ACTION_MYDOCS,
|
||||
WINTC_ACTION_MYRECENTS,
|
||||
WINTC_ACTION_MYPICS,
|
||||
WINTC_ACTION_MYMUSIC,
|
||||
WINTC_ACTION_MYCOMP,
|
||||
WINTC_ACTION_CONTROL,
|
||||
WINTC_ACTION_MIMEMGMT,
|
||||
WINTC_ACTION_CONNECTTO,
|
||||
WINTC_ACTION_PRINTERS,
|
||||
WINTC_ACTION_HELP,
|
||||
WINTC_ACTION_SEARCH,
|
||||
WINTC_ACTION_RUN,
|
||||
WINTC_ACTION_LOGOFF,
|
||||
WINTC_ACTION_SHUTDOWN
|
||||
} WinTCAction;
|
||||
|
||||
gboolean wintc_launch_action(
|
||||
WinTCAction action_id,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
//
|
||||
// Desktop entries
|
||||
//
|
||||
gchar* wintc_desktop_app_info_get_command(
|
||||
GDesktopAppInfo* entry
|
||||
);
|
||||
|
||||
gchar* wintc_expand_desktop_entry_cmdline(
|
||||
const gchar* cmdline,
|
||||
const gchar* name,
|
||||
const gchar* icon_name,
|
||||
const gchar* entry_path,
|
||||
gboolean needs_terminal
|
||||
);
|
||||
|
||||
//
|
||||
// Execution
|
||||
//
|
||||
gboolean wintc_launch_command(
|
||||
const gchar* command,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
//
|
||||
// MIME types
|
||||
//
|
||||
gchar* wintc_query_mime_for_file(
|
||||
const gchar* filepath,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
GDesktopAppInfo* wintc_query_mime_handler(
|
||||
const gchar* mime_query,
|
||||
GError** out_error
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <glib.h>
|
||||
#include <wintc-comgtk.h>
|
||||
#include <wintc/comgtk.h>
|
||||
|
||||
#include "action.h"
|
||||
#include "exec.h"
|
||||
#include "../public/action.h"
|
||||
#include "../public/exec.h"
|
||||
|
||||
//
|
||||
// PUBLIC FUNCTIONS
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user