From 14b326435b424f51c29e7efa0439edc86b060a07 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 10 Nov 2023 10:07:01 +0100 Subject: [PATCH] WIP: suite lecture + mises en forme (arrays) perso; qui fait quoi ? (include/ui.h) --- include/ui.h | 113 ++++++++++++++++----------------------------------- 1 file changed, 34 insertions(+), 79 deletions(-) diff --git a/include/ui.h b/include/ui.h index d78d5dd..24c79e4 100644 --- a/include/ui.h +++ b/include/ui.h @@ -56,79 +56,42 @@ G_DECLARE_FINAL_TYPE (GemGraphClientApplication, GemGraphClientApplication *gem_graph_client_application_new(const char *application_id, GApplicationFlags flags); - G_END_DECLS -void ui_enable_action(const char *name); +void ui_enable_action (const char *name); +void ui_disable_action (const char *name); -void ui_disable_action(const char *name); - -// // Actions -// -void on_about_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_quit_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_preferences_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_togglesidebar_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_editmode_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_runmode_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_presentmode_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_openfile_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_closefile_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_savefile_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); - -void on_toast_close_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data); +void on_about_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_quit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_preferences_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_togglesidebar_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_editmode_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_runmode_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_presentmode_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_openfile_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_closefile_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_savefile_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); +void on_toast_close_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); static const GActionEntry app_actions[] = { - { "quit", on_quit_action, NULL, NULL, NULL }, - { "about", on_about_action, NULL, NULL, NULL }, - { "preferences", on_preferences_action, NULL, NULL, NULL }, + { "quit", on_quit_action, NULL, NULL, NULL }, + { "about", on_about_action, NULL, NULL, NULL }, + { "preferences", on_preferences_action, NULL, NULL, NULL }, { "togglesidebar", on_togglesidebar_action, NULL, NULL, NULL }, - { "editmode", on_editmode_action, NULL, NULL, NULL }, - { "runmode", on_runmode_action, NULL, NULL, NULL }, - { "presentmode", on_presentmode_action, NULL, NULL, NULL }, - { "openfile", on_openfile_action, NULL, NULL, NULL }, - { "closefile", on_closefile_action, NULL, NULL, NULL }, - { "savefile", on_savefile_action, NULL, NULL, NULL }, - { "toastclose", on_toast_close_action, NULL, NULL, NULL }, + { "editmode", on_editmode_action, NULL, NULL, NULL }, + { "runmode", on_runmode_action, NULL, NULL, NULL }, + { "presentmode", on_presentmode_action, NULL, NULL, NULL }, + { "openfile", on_openfile_action, NULL, NULL, NULL }, + { "closefile", on_closefile_action, NULL, NULL, NULL }, + { "savefile", on_savefile_action, NULL, NULL, NULL }, + { "toastclose", on_toast_close_action, NULL, NULL, NULL }, }; -// // Actions responses -// + void on_openfile_response(GtkNativeDialog *native, int response, GemGraphClientWindow *self); @@ -137,29 +100,21 @@ void on_openfile_response_complete(GObject *source_object, GAsyncResult *result, GemGraphClientWindow *self); -// // General events -// -void on_axis_value_change(GtkAdjustment *adjustment, gpointer data); -gboolean on_render(GtkGLArea * area, GdkGLContext * context); - -void on_realize(GtkWidget *widget); - -void on_unrealize(GtkWidget *widget); - -void on_close_window(GtkWidget *widget); +void on_axis_value_change (GtkAdjustment *adjustment, gpointer data); +gboolean on_render (GtkGLArea * area, GdkGLContext * context); +void on_realize (GtkWidget *widget); +void on_unrealize (GtkWidget *widget); +void on_close_window (GtkWidget *widget); /* -------------------------------------------------------------------------- */ -// // Window primitives -// -void ui_set_stack(const char *mode); - -void ui_setup_glarea(GtkGLArea *target, GtkBox *target_controls); -void ui_send_internal_notification(const char *message); -void ui_close_internal_notification(void); -void ui_toggle_sidebar(); +void ui_set_stack (const char *mode); +void ui_setup_glarea (GtkGLArea *target, GtkBox *target_controls); +void ui_send_internal_notification (const char *message); +void ui_close_internal_notification (void); +void ui_toggle_sidebar ();