From 540f06d9fea6413b9dba22a16cc24d0d9a8f07b3 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 10 Nov 2024 11:10:05 +0100 Subject: [PATCH] move code --- src/x49gpng/ui.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/x49gpng/ui.c b/src/x49gpng/ui.c index 391ba9c..603ae50 100644 --- a/src/x49gpng/ui.c +++ b/src/x49gpng/ui.c @@ -1424,30 +1424,6 @@ static gboolean react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpoin return true; } -static int redraw_lcd( GtkWidget* widget, cairo_t* cr, gpointer user_data ) -{ - x49gp_t* x49gp = user_data; - x49gp_ui_t* ui = x49gp->ui; - - cairo_set_source_surface( cr, ui->lcd_surface, 0, 0 ); - cairo_paint( cr ); - - return false; -} - -static int draw_lcd( GtkWidget* widget, GdkEventConfigure* event, gpointer user_data ) -{ - x49gp_t* x49gp = user_data; - x49gp_ui_t* ui = x49gp->ui; - - if ( NULL != ui->lcd_surface ) - return false; - - ui->lcd_surface = cairo_image_surface_create( CAIRO_FORMAT_RGB24, LCD_WIDTH, LCD_HEIGHT ); - - return false; -} - static gboolean react_to_window_click( GtkWidget* widget, GdkEventButton* event, gpointer user_data ) { #ifdef DEBUG_X49GP_UI @@ -1486,6 +1462,30 @@ static gboolean react_to_window_click( GtkWidget* widget, GdkEventButton* event, return false; } +static int redraw_lcd( GtkWidget* widget, cairo_t* cr, gpointer user_data ) +{ + x49gp_t* x49gp = user_data; + x49gp_ui_t* ui = x49gp->ui; + + cairo_set_source_surface( cr, ui->lcd_surface, 0, 0 ); + cairo_paint( cr ); + + return false; +} + +static int draw_lcd( GtkWidget* widget, GdkEventConfigure* event, gpointer user_data ) +{ + x49gp_t* x49gp = user_data; + x49gp_ui_t* ui = x49gp->ui; + + if ( NULL != ui->lcd_surface ) + return false; + + ui->lcd_surface = cairo_image_surface_create( CAIRO_FORMAT_RGB24, LCD_WIDTH, LCD_HEIGHT ); + + return false; +} + static void do_quit( gpointer user_data, GtkWidget* widget, GdkEvent* event ) { x49gp_t* x49gp = user_data;