1
0
Fork 0
forked from Miroirs/x49gp

no need for gboolean when we have stdbool

This commit is contained in:
Gwenhael Le Moine 2024-11-14 16:45:05 +01:00
parent e41e501e4b
commit e529092b0e
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 10 additions and 7 deletions

View file

@ -617,8 +617,9 @@ static x49gp_ui_key_t ui_keys[ NB_KEYS ] = {
char* css_global = "window {" char* css_global = "window {"
" background-color: %s;" " background-color: %s;"
" font-weight: normal;"
"}" "}"
"window * {" ".label-key, .label-left, .label-right, .label-letter, .label-below {"
" font-weight: bold;" " font-weight: bold;"
"}" "}"
/* "box { border: 1px dashed red; }" */ /* "box { border: 1px dashed red; }" */
@ -752,7 +753,7 @@ static bool ui_press_button( x49gp_ui_button_t* button, bool hold )
return GDK_EVENT_STOP; return GDK_EVENT_STOP;
} }
static gboolean react_to_button_press( GtkWidget* widget, GdkEventButton* event, gpointer user_data ) static bool react_to_button_press( GtkWidget* widget, GdkEventButton* event, gpointer user_data )
{ {
x49gp_ui_button_t* button = user_data; x49gp_ui_button_t* button = user_data;
const x49gp_ui_key_t* key = button->key; const x49gp_ui_key_t* key = button->key;
@ -769,7 +770,7 @@ static gboolean react_to_button_press( GtkWidget* widget, GdkEventButton* event,
return GDK_EVENT_STOP; return GDK_EVENT_STOP;
} }
static gboolean react_to_button_release( GtkWidget* widget, GdkEventButton* event, gpointer user_data ) static bool react_to_button_release( GtkWidget* widget, GdkEventButton* event, gpointer user_data )
{ {
x49gp_ui_button_t* button = user_data; x49gp_ui_button_t* button = user_data;
@ -842,7 +843,7 @@ static void do_emulator_reset( GtkMenuItem* menuitem, gpointer user_data )
} }
#endif #endif
static gboolean react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpointer user_data ) static bool react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpointer user_data )
{ {
x49gp_t* x49gp = user_data; x49gp_t* x49gp = user_data;
x49gp_ui_t* ui = x49gp->ui; x49gp_ui_t* ui = x49gp->ui;
@ -1130,7 +1131,7 @@ static gboolean react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpoin
} }
#if GTK_MAJOR_VERSION == 3 #if GTK_MAJOR_VERSION == 3
static gboolean react_to_display_click( GtkWidget* widget, GdkEventButton* event, gpointer user_data ) static bool react_to_display_click( GtkWidget* widget, GdkEventButton* event, gpointer user_data )
{ {
gdk_window_focus( gtk_widget_get_window( widget ), event->time ); gdk_window_focus( gtk_widget_get_window( widget ), event->time );
gdk_window_raise( gtk_widget_get_window( widget ) ); gdk_window_raise( gtk_widget_get_window( widget ) );

View file

@ -1,6 +1,8 @@
#ifndef _X49GP_UI_H #ifndef _X49GP_UI_H
#define _X49GP_UI_H 1 #define _X49GP_UI_H 1
#include <stdbool.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib.h> #include <glib.h>
#include <cairo.h> #include <cairo.h>
@ -116,8 +118,8 @@ typedef struct {
x49gp_t* x49gp; x49gp_t* x49gp;
const x49gp_ui_key_t* key; const x49gp_ui_key_t* key;
GtkWidget* button; GtkWidget* button;
gboolean down; bool down;
gboolean hold; bool hold;
} x49gp_ui_button_t; } x49gp_ui_button_t;
struct __x49gp_ui_s__ { struct __x49gp_ui_s__ {