Subversion Repositories Kolibri OS

Rev

Rev 8505 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8505 Rev 9960
Line 1... Line 1...
1
/*==== INCLUDES ====*/
1
/*==== INCLUDES ====*/
Line 2... Line -...
2
 
-
 
3
#include 
2
 
4
#include "fitz.h"
3
#include "fitz.h"
5
#include "mupdf.h"
4
#include "mupdf.h"
6
#include "pdfapp.h"
5
#include "pdfapp.h"
7
#include "icons/allbtns.h"
6
#include "icons/allbtns.h"
Line 232... Line 231...
232
}
231
}
Line 233... Line 232...
233
 
232
 
234
void DrawToolbarButton(int x, char image_id)
233
void DrawToolbarButton(int x, char image_id)
235
{
234
{
236
	kol_btn_define(x, 5, 26-1, 24-1, 10 + image_id + BT_HIDE, 0);
235
	kol_btn_define(x, 5, 26-1, 24-1, 10 + image_id + BT_HIDE, 0);
237
	draw_bitmap(image_id * 24 * 26 * 3 + toolbar_image, x, 5, 26, 24);
236
	kol_paint_image(x, 5, 26, 24, image_id * 24 * 26 * 3 + toolbar_image);
Line 238... Line 237...
238
}
237
}
239
 
238
 
240
void DrawMainWindow(void)
239
void DrawMainWindow(void)
Line 374... Line 373...
374
	kos_screen_max(&screen_max_x, &screen_max_y);
373
	kos_screen_max(&screen_max_x, &screen_max_y);
375
	kol_event_mask(EVENT_REDRAW+EVENT_KEY+EVENT_BUTTON+EVENT_MOUSE_CHANGE);
374
	kol_event_mask(EVENT_REDRAW+EVENT_KEY+EVENT_BUTTON+EVENT_MOUSE_CHANGE);
Line 376... Line 375...
376
 
375
 
377
	for(;;)
376
	for(;;)
378
	{
377
	{
379
		switch(get_os_event())
378
		switch(kol_event_wait())
380
		{
379
		{
381
			case evReDraw:
380
			case evReDraw:
382
				// gapp.shrinkwrap = 2;
381
				// gapp.shrinkwrap = 2;
383
				BeginDraw();
382
				kol_paint_start();
384
				kol_wnd_define(screen_max_x / 2 - 350-50+kos_random(50), 
383
				kol_wnd_define(screen_max_x / 2 - 350-50+kos_random(50), 
385
				screen_max_y / 2 - 300-50+kos_random(50), 
384
				screen_max_y / 2 - 300-50+kos_random(50), 
386
				700, 600, 0x73000000, 0x800000FF, Title);
385
				700, 600, 0x73000000, 0x800000FF, Title);
387
				EndDraw();
386
				kol_paint_end();
Line 388... Line 387...
388
				get_proc_info((char*)&Form);
387
				kol_process_info(-1, (char*)&Form);
Line 389... Line 388...
389
				
388
				
390
				if (Form.window_state > 2) continue; // if Rolled-up
389
				if (Form.window_state & 4) continue; // if Rolled-up
391
				
390
				
Line 392... Line 391...
392
				// Minimal size (700x600)
391
				// Minimal size (700x600)
393
				if (Form.width < 700) sys_change_window(OLD, OLD, 700, OLD);
392
				if (Form.width < 700) kol_wnd_change(-1, -1, 700, -1);
Line 394... Line 393...
394
				if (Form.height < 600) sys_change_window(OLD, OLD, OLD, 600);
393
				if (Form.height < 600)  kol_wnd_change(-1, -1, -1, 600);
Line 416... Line 415...
416
				if (key=='-') PageZoomOut();
415
				if (key=='-') PageZoomOut();
417
				if ((key=='=') || (key=='+')) PageZoomIn();
416
				if ((key=='=') || (key=='+')) PageZoomIn();
418
				break;
417
				break;
Line 419... Line 418...
419
 
418
 
420
			case evButton:
419
			case evButton:
421
				butt = get_os_button();
420
				butt = kol_btn_get();
422
				if(butt==1) exit(0);
421
				if(butt==1) exit(0);
423
				if(butt==10) RunOpenApp(argv[0]);
422
				if(butt==10) RunOpenApp(argv[0]);
424
				if(butt==11) PageZoomOut(); //magnify -
423
				if(butt==11) PageZoomOut(); //magnify -
425
				if(butt==12) PageZoomIn(); //magnify +
424
				if(butt==12) PageZoomIn(); //magnify +