gboolean gtk_mng_view_load_mng_from_memory_remaining (GtkMngView * mng_view, guchar * data_to_eat, guint data_size) { mng_read_pushdata (mng_view->MNG_handle, data_to_eat, data_size, MNG_FALSE); //printf("Calling read\n"); mng_read(mng_view->MNG_handle); //printf("mng_get_totalframes %d\n", mng_get_totalframes (mng_view->MNG_handle)); //printf("mng_get_totallayers %d\n", mng_get_totallayers (mng_view->MNG_handle)); //printf("mng_get_totalplaytime %d\n", mng_get_totalplaytime (mng_view->MNG_handle)); //printf("Iterate chunks\n"); int i = 0; mng_iterate_chunks (mng_view->MNG_handle, 0, myiterchunk); for (i = 0; i < 1000; i++) { //printf("calling iterate i %d\n", i); //printf("out of iterate\n"); } printf("Calling display\n"); //mng_display(mng_view->MNG_handle); //printf("Display over\n"); printf("mng_get_framecount %d\n", mng_get_framecount(mng_view->MNG_handle)); printf("mng_get_layercount %d\n", mng_get_layercount(mng_view->MNG_handle)); printf("mng_get_playtime %d\n", mng_get_playtime(mng_view->MNG_handle)); printf("mng_get_ticks %d\n", mng_get_ticks(mng_view->MNG_handle)); printf("mng_get_starttime %d\n", mng_get_starttime (mng_view->MNG_handle)); printf("mng_get_runtime %d\n", mng_get_runtime (mng_view->MNG_handle)); printf("mng_get_currentframe %d\n", mng_get_currentframe (mng_view->MNG_handle)); printf("mng_get_currentlayer %d\n", mng_get_currentlayer (mng_view->MNG_handle)); printf("mng_get_currentplaytime %d\n", mng_get_currentplaytime (mng_view->MNG_handle)); printf("mng_get_totalframes %d\n", mng_get_totalframes (mng_view->MNG_handle)); printf("mng_get_totallayers %d\n", mng_get_totallayers (mng_view->MNG_handle)); printf("mng_get_totalplaytime %d\n", mng_get_totalplaytime (mng_view->MNG_handle)); return TRUE; }
static mng_bool mng_process_mend_callback (mng_handle mng_h, mng_uint32 iIterationsdone, mng_uint32 iIterationsleft) { printf("MEND MEND MEND MEND\n"); printf("iIterationsdone %d\n", iIterationsdone); printf("iIterationsleft %d\n", iIterationsleft); printf("mng_get_framecount %d\n", mng_get_framecount(mng_h)); printf("mng_get_layercount %d\n", mng_get_layercount(mng_h)); printf("mng_get_playtime %d\n", mng_get_playtime(mng_h)); printf("mng_get_ticks %d\n", mng_get_ticks(mng_h)); printf("mng_get_totalframes %d\n", mng_get_totalframes (mng_h)); printf("mng_get_totallayers %d\n", mng_get_totallayers (mng_h)); printf("mng_get_totalplaytime %d\n", mng_get_totalplaytime (mng_h)); }
static mng_bool mng_process_header_callback (mng_handle mng_h, mng_uint32 width, mng_uint32 height) { FUNCTION_ENTRY(); GtkMngView * mng_view; mng_view = GTK_MNG_VIEW (mng_get_userdata (mng_h)); mng_view->width = width; mng_view->height = height; g_width = width; g_height = height; g_free (mng_view->MNG_drawing_buffer); mng_view->MNG_drawing_buffer = g_new0 (guchar, 3 * width * height); g_free (mng_view->MNG_alpha_buffer); mng_view->MNG_alpha_buffer = g_new0 (guchar, width * height); printf("width %d height %d\n", width, height); printf("mng_get_framecount %d\n", mng_get_framecount(mng_view->MNG_handle)); printf("mng_get_layercount %d\n", mng_get_layercount(mng_view->MNG_handle)); printf("mng_get_playtime %d\n", mng_get_playtime(mng_view->MNG_handle)); printf("mng_get_ticks %d\n", mng_get_ticks(mng_view->MNG_handle)); printf("mng_get_colortype %d\n", mng_get_colortype(mng_view->MNG_handle)); printf("mng_get_interlace %d\n", mng_get_interlace(mng_view->MNG_handle)); printf("mng_get_viewgamma %f\n", mng_get_viewgamma(mng_view->MNG_handle)); printf("mng_get_displaygamma %f\n", mng_get_displaygamma(mng_view->MNG_handle)); printf("mng_get_dfltimggamma %f\n", mng_get_dfltimggamma(mng_view->MNG_handle)); printf("mng_get_viewgammaint %d\n", mng_get_viewgammaint(mng_view->MNG_handle)); printf("mng_get_displaygammaint %d\n", mng_get_displaygammaint(mng_view->MNG_handle)); printf("mng_get_dfltimggammaint %d\n", mng_get_dfltimggammaint(mng_view->MNG_handle)); gtk_widget_queue_resize (GTK_WIDGET (mng_view)); FUNCTION_EXIT(); return MNG_TRUE; }
static LRESULT CALLBACK DlgProcProp(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { char buf[4096],buf2[1024]; switch(Msg) { case WM_INITDIALOG: { DWORD tabs[1]; PluginInstance *This=(PluginInstance*)lParam; tabs[0]= 60; SendDlgItemMessage(hWnd,IDC_IMGINFO,EM_SETTABSTOPS,(WPARAM)1,(LPARAM)tabs); wsprintf(buf,"URL:\t%s\r\n",This->url); if(This->lpdib) { wsprintf(buf2,"Dimensions:\t%d x %d\r\n",This->lpdibinfo->biWidth, This->lpdibinfo->biHeight); lstrcat(buf,buf2); } if(This->lpdib && This->fMode==NP_EMBED) { wsprintf(buf2,"Window:\t%d x %d\r\n",This->windowwidth, This->windowheight); lstrcat(buf,buf2); } if(This->filesize) { wsprintf(buf2,"File size:\t%u bytes\r\n",This->filesize); lstrcat(buf,buf2); } #ifdef _DEBUG if(This->mngdata && This->lpdib && This->bytesalloc && This->dibsize) { // note this doesn't include memory used by libmng wsprintf(buf2,"Memory used:\t%u bytes\r\n", This->bytesalloc + This->dibsize); lstrcat(buf,buf2); } #endif if(This->islink) { wsprintf(buf2,"Link to:\t%s\r\n",This->linkurl); lstrcat(buf,buf2); if(strcmp(This->linktarget,"_self")) { wsprintf(buf2,"Link target:\t%s\r\n",This->linktarget); lstrcat(buf,buf2); } } if(This->loadstate >= STATE_VALIDFRAME) { wsprintf(buf2,"Signature:\t%s\r\n",get_imagetype_name(mng_get_sigtype(This->mng))); lstrcat(buf,buf2); wsprintf(buf2,"Image type:\t%s\r\n",get_imagetype_name(mng_get_imagetype(This->mng))); lstrcat(buf,buf2); wsprintf(buf2,"Simplicity:\t0x%08x\r\n",mng_get_simplicity(This->mng)); lstrcat(buf,buf2); wsprintf(buf2,"Frame count:\t%u\r\n",mng_get_framecount(This->mng)); lstrcat(buf,buf2); wsprintf(buf2,"Layer count:\t%u\r\n",mng_get_layercount(This->mng)); lstrcat(buf,buf2); wsprintf(buf2,"Play time:\t%u\r\n",mng_get_playtime(This->mng)); lstrcat(buf,buf2); } SetDlgItemText(hWnd,IDC_IMGINFO,buf); if(This->textdata) SetDlgItemText(hWnd,IDC_MNGTEXT,This->textdata); } return(TRUE); case WM_CLOSE: EndDialog(hWnd,0); return(TRUE); case WM_COMMAND: switch(wParam) { case IDOK: case IDCANCEL: EndDialog(hWnd,0); return(TRUE); } } return(FALSE); }