/* * taken from gkrellmms-2.1.22/gkrellmms.c#create_gkrellmms */ void audkrellm_create_led( GkrellmMargin *m ) { GkrellmPiximage *led_image = NULL; if( gkrellm_load_piximage( "led_indicator", NULL, &led_image, GKRELLMMS_STYLE ) ) { audkrellm_led_decal = gkrellm_make_scaled_decal_pixmap( audkrellm_control_panel, led_image, audkrellm_style, 4, 0, -1, 0, 0); led_off_index = 0; led_running_index = 1; led_paused_index = 2; led_playing_index = 3; } else { audkrellm_led_decal = gkrellm_create_decal_pixmap( audkrellm_control_panel, gkrellm_decal_misc_pixmap(), gkrellm_decal_misc_mask(), N_MISC_DECALS, audkrellm_style, 0, -1 ); led_off_index = D_MISC_LED0; led_running_index = D_MISC_LED1; led_paused_index = D_MISC_LED1; led_playing_index = D_MISC_LED1; } audkrellm_led_decal->x = gkrellm_chart_width() - audkrellm_led_decal->w - m->right; gkrellm_draw_decal_pixmap( audkrellm_control_panel, audkrellm_led_decal, led_off_index ); }
static void panel_button_press( GtkWidget *widget, GdkEventButton *ev ) { gint x; if ( ev->button != 1 ) return; slider_in_motion = 1; x = ev->x * krell->full_scale / (gkrellm_chart_width() - 1); if ( x < MIN_LCD ) x = MIN_LCD; else if ( x > MAX_LCD ) x = MAX_LCD; write_vaio_lcd( x ); gkrellm_update_krell( panel, krell, (gulong)x ); gkrellm_draw_layers( panel ); }
static void slider_motion( GtkWidget *widget, GdkEventButton *ev, gpointer data ) { gint x; GdkModifierType state; if ( !slider_in_motion ) return; state = ev->state; if ( !(state & GDK_BUTTON1_MASK)) { slider_in_motion = 0; return; } x = ev->x * krell->full_scale / (gkrellm_chart_width() - 1); if ( x < MIN_LCD ) x = MIN_LCD; else if ( x > MAX_LCD ) x = MAX_LCD; write_vaio_lcd( x ); gkrellm_update_krell( panel, krell, (gulong)x ); gkrellm_draw_layers( panel ); }