#include #include #include #include "pz.h" static PzModule *circle; int x, y; static PzWidget *wid; void draw_circle (PzWidget *wid, ttk_surface srf) { ttk_fillellipse(srf, x, y, 6, 6, ttk_makecol(255,0,0)); } int event_circle (PzEvent *ev) { switch (ev->type) { case PZ_EVENT_BUTTON_DOWN: switch (ev->arg) { case PZ_BUTTON_MENU: y-=5; wid->dirty++; break; case PZ_BUTTON_PLAY: y+=5; wid->dirty++; break; case PZ_BUTTON_NEXT: x-=5; wid->dirty++; break; case PZ_BUTTON_PREVIOUS: x+=5; wid->dirty++; break; } break; case PZ_EVENT_DESTROY: //ttk_free_surface (image); //free (text); break; } return 0; } PzWindow *new_circle_window() { PzWindow *ret; x = 25; y = 10; ret = pz_new_window ("Circle", PZ_WINDOW_NORMAL); pz_add_widget (ret, draw_circle, event_circle); return pz_finish_window (ret); } void cleanup_circle() { printf ("Bye-bye now...\n"); } void init_circle() { circle = pz_register_module ("circle", cleanup_circle); pz_menu_add_action ("/Extras/Games/Circle", new_circle_window); } PZ_MOD_INIT (init_circle)