/***************************************************************************** * Manage: handle aa events ***************************************************************************** * This function should be called regularly by video output thread. It manages * console events. It returns a non null value on error. *****************************************************************************/ static int Manage( vout_thread_t *p_vout ) { int event, x, y, b; event = aa_getevent( p_vout->p_sys->aa_context, 0 ); switch ( event ) { case AA_MOUSE: aa_getmouse( p_vout->p_sys->aa_context, &x, &y, &b ); if ( b & AA_BUTTON3 ) { intf_thread_t *p_intf; p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE ); if( p_intf ) { p_intf->b_menu_change = 1; vlc_object_release( p_intf ); } } break; case AA_RESIZE: p_vout->i_changes |= VOUT_SIZE_CHANGE; aa_resize( p_vout->p_sys->aa_context ); p_vout->p_sys->i_width = aa_imgwidth( p_vout->p_sys->aa_context ); p_vout->p_sys->i_height = aa_imgheight( p_vout->p_sys->aa_context ); break; default: break; } return( 0 ); }
static void AA_ResizeHandler(aa_context *context) { aa_resize(context); local_this->hidden->x_ratio = ((double)aa_imgwidth(context)) / ((double)local_this->screen->w); local_this->hidden->y_ratio = ((double)aa_imgheight(context)) / ((double)local_this->screen->h); fastscale (local_this->hidden->buffer, aa_image(context), local_this->hidden->w, aa_imgwidth (context), local_this->hidden->h, aa_imgheight (context)); aa_renderpalette(context, local_this->hidden->palette, local_this->hidden->rparams, 0, 0, aa_scrwidth(context), aa_scrheight(context)); aa_flush(context); }
static void resize(void){ /* * this function is called by aa lib if windows resizes * further during init, because here we have to calculate * a little bit */ aa_resize(c); aspect_save_screenres(aa_imgwidth(c),aa_imgheight(c)); image_height = aa_imgheight(c); //src_height; image_width = aa_imgwidth(c); //src_width; aspect(&image_width,&image_height,A_ZOOM); image_x = (aa_imgwidth(c) - image_width) / 2; image_y = (aa_imgheight(c) - image_height) / 2; screen_w = image_width * aa_scrwidth(c) / aa_imgwidth(c); screen_h = image_height * aa_scrheight(c) / aa_imgheight(c); screen_x = (aa_scrwidth(c) - screen_w) / 2; screen_y = (aa_scrheight(c) - screen_h) / 2; if(sws) sws_freeContext(sws); sws = sws_getContextFromCmdLine(src_width,src_height,image_format, image_width,image_height,IMGFMT_Y8); memset(image, 0, sizeof(image)); image[0] = aa_image(c) + image_y * aa_imgwidth(c) + image_x; memset(image_stride, 0, sizeof(image_stride)); image_stride[0] = aa_imgwidth(c); showosdmessage=0; }
/** * Proccess pending event */ static void Manage(vout_display_t *vd) { vout_display_sys_t *sys = vd->sys; for (;;) { const int event = aa_getevent(sys->aa_context, 0); if (!event) return; switch (event) { case AA_MOUSE: { int x, y; int button; int vlc; aa_getmouse(sys->aa_context, &x, &y, &button); vlc = 0; if (button & AA_BUTTON1) vlc |= 1 << MOUSE_BUTTON_LEFT; if (button & AA_BUTTON2) vlc |= 1 << MOUSE_BUTTON_CENTER; if (button & AA_BUTTON3) vlc |= 1 << MOUSE_BUTTON_RIGHT; vout_display_SendEventMouseState(vd, x, y, vlc); aa_showcursor(sys->aa_context); /* Not perfect, we show it on click too */ break; } case AA_RESIZE: aa_resize(sys->aa_context); vout_display_SendEventDisplaySize(vd, aa_imgwidth(sys->aa_context), aa_imgheight(sys->aa_context)); break; /* TODO keys support to complete */ case AA_UP: vout_display_SendEventKey(vd, KEY_UP); break; case AA_DOWN: vout_display_SendEventKey(vd, KEY_DOWN); break; case AA_RIGHT: vout_display_SendEventKey(vd, KEY_RIGHT); break; case AA_LEFT: vout_display_SendEventKey(vd, KEY_LEFT); break; case AA_BACKSPACE: vout_display_SendEventKey(vd, KEY_BACKSPACE); break; case AA_ESC: vout_display_SendEventKey(vd, KEY_ESC); break; default: if (event >= 0x20 && event <= 0x7f) vout_display_SendEventKey(vd, event); break; } } }
int bb(void) { aa_gotoxy(context, 0, 0); introscreen(); params = aa_getrenderparams(); aa_render(context, params, 0, 0, 1, 1); font = uncompressfont( /*context->params.font */ &aa_font16); scenetimer = tl_create_timer(); srand(time(NULL)); if (stage != 1) finish_stuff = 1; do switch (stage) { default: case 1: load_song("bb.s3m"); bbupdate(); starttime = endtime = TIME; aa_resize (context); scene1(); aa_resize (context); scene3(); if (quitnow) goto quit; aa_resize (context); vezen(&fk1, &fk2, &fk3, &fk4); messager("FILIP KUPSA known as FK, Tingle Notions, Dawn Music\n" "birth: June 22 1979, Tabor, Czech Republic, sex: male\n" "\n" "1992 - Changed his piano for 386/mp.com/pc-speaker music\n" "1993 - Got his first Sound Blaster\n" "1995 - Changed his SB for a new GUS technology\n" "1996 - Composed his first great hits\n" "1996 - FAT recomposition made by Windows 95\n" "1997 - Released his musac in BB\n" "\n" "1998 - Got retired\n" "\n" "Contact address: via KT"); devezen2(); aa_resize (context); scene4(); aa_resize (context); scene2(); aa_resize (context); if (quitnow) goto quit; vezen(&ms1, &ms2, &ms3, &ms4); messager("MOJMIR SVOBODA known as MS, TiTania, MSS, Bill\n" "birth: ??, Tabor, Czech Republic, sex: ? male ?\n" "\n" "1993 - Installed Linux on his 386sx/25 + 40MB HDD\n" "1994 - Removed Linux to make space for Doom\n" "1995 - Reinstalled Linux on his 486Dx4/120 + 850MB\n" "1996 - Removed Linux to make space for Windows 95\n" "\n" "1997 - Removed Windows 95 to make space for aalib\n" "\n" "Contact address: [email protected]"); devezen3(); aa_resize (context); scene8(); aa_resize (context); scene6(); aa_resize (context); case 2: if (quitnow) goto quit; aa_resize (context); vezen(&kt1, &kt2, &kt3, &kt4); messager("KAMIL TOMAN known as KT, Kato, Whale, Bart\n" "birth: May 19 1979, Tabor, Czech Republic, sex: male\n" "\n" "1993 - Became a linux extremist\n" "1993 - Successful attempt to establish a secret organization\n" " Commandline Brotherhood\n" "1995 - Action 'koules' - a secret project to train brotherhood\n" " members - covered under a game design\n" "\n" "1998 - Heading a new wave of command line revolution\n" "\n" "Contact address: [email protected]"); bbupdate(); starttime = endtime = TIME; devezen1(); aa_resize (context); if (quitnow) goto quit; aa_resize (context); scene7(); if (quitnow) goto quit; aa_resize (context); scene5(); if (quitnow) goto quit; aa_resize (context); scene10(); vezen(&hh1, &hh2, &hh3, &hh4); messager("JAN HUBICKA known as HH, Jahusoft, HuJaSoft, JHS, UNIX, Honza\n" "birth: Apr 1 1978, Tabor, Czech Republic, sex: male\n" "\n" "1991 - Installed underground hackers OS Linux\n" "1995 - Headed Action 'koules'\n" "1996 - Famous troan XaoS to convert all windows instalations\n" " into Linux\n" "\n" "1998 - Secret plan to make `Text Windows` system to confuse users\n" "2001 - Planning an assassination of dictator Bill G.\n" "\n" "Contact address: [email protected]"); aa_resize (context); devezen4(); if (quitnow) goto quit; aa_resize (context); credits(); if (quitnow) goto quit; case 3: if (loopmode) break; aa_resize (context); credits2(); } while (loopmode); quit:; aa_close(context); return (0); }