1
0
Fork 0
forked from Miroirs/x49gp

move code

This commit is contained in:
Gwenhael Le Moine 2024-11-10 11:10:05 +01:00
parent 0f9dffe8ea
commit 540f06d9fe
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -1424,30 +1424,6 @@ static gboolean react_to_key_event( GtkWidget* widget, GdkEventKey* event, gpoin
return true; 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 ) static gboolean react_to_window_click( GtkWidget* widget, GdkEventButton* event, gpointer user_data )
{ {
#ifdef DEBUG_X49GP_UI #ifdef DEBUG_X49GP_UI
@ -1486,6 +1462,30 @@ static gboolean react_to_window_click( GtkWidget* widget, GdkEventButton* event,
return false; 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 ) static void do_quit( gpointer user_data, GtkWidget* widget, GdkEvent* event )
{ {
x49gp_t* x49gp = user_data; x49gp_t* x49gp = user_data;