38 |
#define SAT_WIDTH 330 |
#define SAT_WIDTH 330 |
39 |
#define SAT_HEIGHT 60 |
#define SAT_HEIGHT 60 |
40 |
|
|
|
/* http://www.gtk.org/tutorial1.2/gtk_tut-30.html */ |
|
|
/* http://developer.gimp.org/api/2.0/gdk/gdk-Drawing-Primitives.html */ |
|
|
|
|
|
|
|
41 |
static float rad2deg(float rad) { |
static float rad2deg(float rad) { |
42 |
return fmodf(360.0 + (180.0/M_PI) * rad, 360.0); |
return fmodf(360.0 + (180.0/M_PI) * rad, 360.0); |
43 |
} |
} |
84 |
/* draw the locked/unlocked icon */ |
/* draw the locked/unlocked icon */ |
85 |
gdk_draw_pixbuf(context->gotoc.compass_pixmap, |
gdk_draw_pixbuf(context->gotoc.compass_pixmap, |
86 |
widget->style->fg_gc[GTK_STATE_NORMAL], |
widget->style->fg_gc[GTK_STATE_NORMAL], |
87 |
icon_get(ICON_MISC, context->appdata->compass_locked?1:2), |
icon_get(ICON_MISC, context->appdata->compass_locked?0:1), |
88 |
0, 0, (width-diameter)/2 + diameter/32, |
0, 0, (width-diameter)/2 + diameter/32, |
89 |
(height+diameter)/2 - 16 - diameter/32 , 16, 16, |
(height+diameter)/2 - 16 - diameter/32 , 16, 16, |
90 |
GDK_RGB_DITHER_NONE,0,0); |
GDK_RGB_DITHER_NONE,0,0); |
448 |
return TRUE; // fire again |
return TRUE; // fire again |
449 |
} |
} |
450 |
|
|
|
#ifdef ENABLE_MAEMO_MAPPER |
|
|
static void on_mm_button_clicked(GtkButton *button, gpointer data) { |
|
|
cache_context_t *context = (cache_context_t*)data; |
|
|
|
|
|
dbus_mm_set_position(context->appdata, &context->gotoc.pos); |
|
|
} |
|
|
#endif |
|
|
|
|
451 |
static gboolean compass_clicked_event(GtkWidget *widget, GdkEventButton *event, |
static gboolean compass_clicked_event(GtkWidget *widget, GdkEventButton *event, |
452 |
gpointer user_data) { |
gpointer user_data) { |
453 |
cache_context_t *context = (cache_context_t*)user_data; |
cache_context_t *context = (cache_context_t*)user_data; |
522 |
g_signal_connect(G_OBJECT(context->gotoc.lon_entry), "changed", |
g_signal_connect(G_OBJECT(context->gotoc.lon_entry), "changed", |
523 |
G_CALLBACK(pos_modified), context); |
G_CALLBACK(pos_modified), context); |
524 |
|
|
525 |
context->gotoc.coo_popup = preset_coordinate_picker(context->appdata, |
gtk_table_attach_defaults(GTK_TABLE(table), preset_coordinate_picker(context->appdata, |
526 |
context->gotoc.lat_entry, context->gotoc.lon_entry); |
context->gotoc.lat_entry, context->gotoc.lon_entry), 2,3,0,1); |
527 |
gtk_table_attach_defaults(GTK_TABLE(table), |
|
528 |
context->gotoc.coo_popup, 2,3,0,1); |
gtk_table_attach_defaults(GTK_TABLE(table), goto_coordinate(context->appdata, |
529 |
|
context->gotoc.lat_entry, context->gotoc.lon_entry), 2,3,1,2); |
530 |
|
|
531 |
gtk_table_set_row_spacing(GTK_TABLE(table), 1, 16); |
gtk_table_set_row_spacing(GTK_TABLE(table), 1, 16); |
532 |
gtk_table_set_col_spacing(GTK_TABLE(table), 0, 16); |
gtk_table_set_col_spacing(GTK_TABLE(table), 0, 16); |
564 |
|
|
565 |
gtk_box_pack_start(GTK_BOX(ihbox), context->gotoc.sat_area, 1,0,0); |
gtk_box_pack_start(GTK_BOX(ihbox), context->gotoc.sat_area, 1,0,0); |
566 |
|
|
|
#ifdef ENABLE_MAEMO_MAPPER |
|
|
GtkWidget *mm_button = gtk_button_new(); |
|
|
gtk_button_set_image(GTK_BUTTON(mm_button), icon_get_widget(ICON_MISC, 0)); |
|
|
gtk_signal_connect(GTK_OBJECT(mm_button), "clicked", |
|
|
(GtkSignalFunc)on_mm_button_clicked, context); |
|
|
gtk_box_pack_start(GTK_BOX(ihbox), mm_button, 1,0,0); |
|
|
#endif |
|
|
|
|
567 |
gtk_table_attach_defaults(GTK_TABLE(table), ihbox, 0,3,5,6); |
gtk_table_attach_defaults(GTK_TABLE(table), ihbox, 0,3,5,6); |
568 |
|
|
569 |
/* ------------------------------------------------------- */ |
/* ------------------------------------------------------- */ |