static void menu_onselect() { switch (view.menu.currentitem) { case 0: view_load(&view.applistview->base); break; case 1: view_load(&view.applistview->base); break; case 2: view_load(&view.applistview->base); break; case 3: view_load(&view.applistview->base); break; } }
static bool load_views (ply_boot_splash_plugin_t *plugin) { ply_list_node_t *node; bool view_loaded; view_loaded = false; node = ply_list_get_first_node (plugin->views); while (node != NULL) { ply_list_node_t *next_node; view_t *view; view = ply_list_node_get_data (node); next_node = ply_list_get_next_node (plugin->views, node); if (view_load (view)) view_loaded = true; node = next_node; } return view_loaded; }
static void menu_onselect() { switch (view.menu.currentitem) { case 0: runpackage(); break; case 1: view_load(&view.installview->base); break; case 2: view_load(&view.uninstallview->base); break; } }
static void add_pixel_display (ply_boot_splash_plugin_t *plugin, ply_pixel_display_t *display) { view_t *view; ply_trace ("adding pixel display to plugin"); view = view_new (plugin, display); ply_pixel_display_set_draw_handler (view->display, (ply_pixel_display_draw_handler_t) on_draw, view); if (plugin->is_visible) { if (view_load (view)) ply_list_append_data (plugin->views, view); else view_free (view); } else { ply_list_append_data (plugin->views, view); } }
static void applistview_onquit() { view_load(&view.base); }
static void xinstallview_onquit() { view_load(&view.base); }
int viewglut_key(viewglut *P, int k, int d) { double s = 5; int mine = 1; assert(P); if (d) { /* Interpret a key press. */ switch (tolower(k)) { case 27: exit(EXIT_SUCCESS); break; case 7: viewglut_grab(); break; case 6: viewglut_fwd(P); break; case 2: viewglut_rev(P); break; case 16: view_prev(P->V); break; case 14: view_next(P->V); break; case 8: view_home(P->V); break; case 10: view_jump(P->V); break; case 19: view_save(P->V, VIEW_DAT); break; case 12: view_load(P->V, VIEW_DAT); break; case 18: view_remove(P->V); break; case 9: view_insert(P->V); break; case 3: view_clear (P->V); break; case 'd': case 'e': P->d[0] += s; break; case 'a': P->d[0] -= s; break; case 'r': case 'p': P->d[1] += s; break; case 'f': case 'u': P->d[1] -= s; break; case 's': case 'o': P->d[2] += s; break; case 'w': case ',': P->d[2] -= s; break; default: mine = 0; /* Not a viewglut key */ } } else { /* Interpret a key release. */ switch (tolower(k)) { case 'd': case 'e': P->d[0] -= s; break; case 'a': P->d[0] += s; break; case 'r': case 'p': P->d[1] -= s; break; case 'f': case 'u': P->d[1] += s; break; case 's': case 'o': P->d[2] -= s; break; case 'w': case ',': P->d[2] += s; break; default: mine = 0; /* Not a viewglut key */ } } if (mine) { view_move(P->V, P->d); glutPostRedisplay(); } return mine; }