Rev 8436 | Rev 8446 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8436 | Rev 8438 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | // getrusage |
- | |
2 | #include "resource.h" |
- | |
3 | - | ||
4 | #include |
1 | #include |
5 | #include "fitz.h" |
2 | #include "fitz.h" |
6 | #include "mupdf.h" |
3 | #include "mupdf.h" |
7 | #include "pdfapp.h" |
4 | #include "pdfapp.h" |
8 | #include "icons/allbtns.h" |
5 | #include "icons/allbtns.h" |
Line 92... | Line 89... | ||
92 | return r; |
89 | return r; |
93 | random(); |
90 | random(); |
94 | } |
91 | } |
Line 95... | Line 92... | ||
95 | 92 | ||
96 | 93 | ||
97 | void wintitle(pdfapp_t *app, char *s) |
- | |
98 | { |
94 | void wintitle(pdfapp_t *app, char *s, char param[]) |
99 | char* param = *(char**)0x1C; |
95 | { |
Line 100... | Line 96... | ||
100 | sprintf(Title,"%s - uPDF", strrchr(param, '/') + 1 ); |
96 | sprintf(Title,"%s - uPDF", strrchr(param, '/') + 1 ); |
Line 366... | Line 362... | ||
366 | 362 | ||
367 | int main (int argc, char* argv[]) |
363 | int main (int argc, char* argv[]) |
368 | { |
364 | { |
Line -... | Line 365... | ||
- | 365 | char ii, mouse_wheels_state; |
|
- | 366 | ||
- | 367 | // argv without spaces |
|
- | 368 | char full_argv[1024]; |
|
- | 369 | for (int i = 1; i |
|
- | 370 | if (i != 1) strcat(full_argv, " "); |
|
- | 371 | strcat(full_argv, argv[i]); |
|
369 | char ii, mouse_wheels_state; |
372 | } |
370 | 373 | ||
371 | if (argc == 1) { |
374 | if (argc == 1) { |
372 | kol_board_puts("uPDF: no param set, showing OpenDialog"); |
375 | kol_board_puts("uPDF: no param set, showing OpenDialog"); |
373 | RunOpenApp(argv[0]); |
376 | RunOpenApp(argv[0]); |
Line 374... | Line 377... | ||
374 | exit(0); |
377 | exit(0); |
375 | } |
378 | } |
Line 376... | Line 379... | ||
376 | 379 | ||
377 | kol_board_puts(argv[1]); |
380 | kol_board_puts(full_argv); |
378 | kol_board_puts("\n"); |
381 | kol_board_puts("\n"); |
Line 386... | Line 389... | ||
386 | gapp.scrw = 600; |
389 | gapp.scrw = 600; |
387 | gapp.scrh = 400; |
390 | gapp.scrh = 400; |
388 | gapp.resolution = resolution; |
391 | gapp.resolution = resolution; |
389 | gapp.pageno = pageno; |
392 | gapp.pageno = pageno; |
390 | kol_board_puts("PDF Open\n"); |
393 | kol_board_puts("PDF Open\n"); |
391 | pdfapp_open(&gapp, argv[1], 0, 0); |
394 | pdfapp_open(&gapp, full_argv, 0, 0); |
392 | kol_board_puts("PDF Opened\n"); |
395 | kol_board_puts("PDF Opened\n"); |
393 | wintitle(&gapp, 0); |
396 | wintitle(&gapp, 0, full_argv); |
Line 394... | Line 397... | ||
394 | 397 | ||
Line 395... | Line 398... | ||
395 | kol_board_puts("Inital paint\n"); |
398 | kol_board_puts("Inital paint\n"); |
396 | 399 | ||
Line 409... | Line 412... | ||
409 | screen_max_y / 2 - 300-50+kos_random(50), |
412 | screen_max_y / 2 - 300-50+kos_random(50), |
410 | 700, 600, 0x73000000, 0x800000FF, Title); |
413 | 700, 600, 0x73000000, 0x800000FF, Title); |
411 | __menuet__window_redraw(2); |
414 | __menuet__window_redraw(2); |
412 | __menuet__get_process_table(&Form, PID_WHOAMI); |
415 | __menuet__get_process_table(&Form, PID_WHOAMI); |
413 | if (Form.window_state > 2) continue; //fix rolled up |
416 | if (Form.window_state > 2) continue; //fix rolled up |
- | 417 | ||
- | 418 | // ?? |
|
414 | Form.client_width++; //fix for Menuet kernel bug |
419 | Form.client_width++; //fix for Menuet kernel bug |
415 | Form.client_height++; //fix for Menuet kernel bug |
420 | Form.client_height++; //fix for Menuet kernel bug |
- | 421 | ||
416 | DrawWindow(); |
422 | DrawWindow(); |
417 | break; |
423 | break; |
Line 418... | Line 424... | ||
418 | 424 | ||
419 | case evKey: |
425 | case evKey: |