Subversion Repositories Kolibri OS

Rev

Rev 9634 | Rev 9643 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9634 Rev 9635
Line 60... Line 60...
60
scroll_bar scroll_h = { NULL,TOOLBAR_W+PAD+PAD,15,NULL,15,2,NULL,0,0,COL_DARK,COL_LIGHT,COL_LINE};
60
scroll_bar scroll_h = { NULL,TOOLBAR_W+PAD+PAD,15,NULL,15,2,NULL,0,0,COL_DARK,COL_LIGHT,COL_LINE};
Line 61... Line 61...
61
 
61
 
62
enum { SAVE_AS_PNG=1, SAVE_AS_BMP=2, SAVE_AS_RAW=4 };
62
enum { SAVE_AS_PNG=1, SAVE_AS_BMP=2, SAVE_AS_RAW=4 };
Line 63... Line 63...
63
int saving_type=SAVE_AS_PNG;
63
int saving_type=SAVE_AS_PNG;
64
 
64
 
Line 65... Line 65...
65
char* libimg_bpp[] = { "???", "8pal", "24", "32", "15", "16",
65
char* libimg_bpp[] = { "-", "8pal", "24", "32", "15", "16",
66
"mono", "8gray", "2pal", "4pal", "8gr/a" };
66
"mono", "8gray", "2pal", "4pal", "8gr/a" };
67
 
67
 
Line 192... Line 192...
192
	draw_tool_btn(#event_open, ECTRL + SCAN_CODE_KEY_O, PAD, tx.inc(GAP_S), 00, "Open image", false);
192
	draw_tool_btn(#event_open, ECTRL + SCAN_CODE_KEY_O, PAD, tx.inc(GAP_S), 00, "Open image", false);
193
	//draw_tool_btn(13, ECTRL + SCAN_CODE_LEFT,  PAD, tx.inc(GAP_B), 30, false);
193
	//draw_tool_btn(13, ECTRL + SCAN_CODE_LEFT,  PAD, tx.inc(GAP_B), 30, false);
194
	//draw_tool_btn(14, ECTRL + SCAN_CODE_RIGHT, PAD, tx.inc(GAP_S), 31, false);
194
	//draw_tool_btn(14, ECTRL + SCAN_CODE_RIGHT, PAD, tx.inc(GAP_S), 31, false);
195
	//draw_tool_btn(15, ECTRL + SCAN_CODE_UP,    PAD, tx.inc(GAP_S), 32, false);
195
	//draw_tool_btn(15, ECTRL + SCAN_CODE_UP,    PAD, tx.inc(GAP_S), 32, false);
196
	//draw_tool_btn(16, ECTRL + SCAN_CODE_DOWN,  PAD, tx.inc(GAP_S), 33, false);
196
	//draw_tool_btn(16, ECTRL + SCAN_CODE_DOWN,  PAD, tx.inc(GAP_S), 33, false);
-
 
197
	if (!main_image.image) goto _NO_IMAGE;
Line 197... Line 198...
197
 
198
 
198
 	draw_tool_btn(#event_save, ECTRL + SCAN_CODE_KEY_S, PAD, tx.inc(GAP_B), 05, "Save as", false);
199
 	draw_tool_btn(#event_save, ECTRL + SCAN_CODE_KEY_S, PAD, tx.inc(GAP_B), 05, "Save as", false);
199
 	draw_tool_btn(#event_save_png, 0, PAD, tx.inc(GAP_S), -1, "PNG", saving_type & SAVE_AS_PNG);
200
 	draw_tool_btn(#event_save_png, 0, PAD, tx.inc(GAP_S), -1, "PNG", saving_type & SAVE_AS_PNG);
200
	draw_tool_btn(#event_save_bmp, 0, PAD*2+34, tx.n,     -1, "BMP", saving_type & SAVE_AS_BMP);
201
	draw_tool_btn(#event_save_bmp, 0, PAD*2+34, tx.n,     -1, "BMP", saving_type & SAVE_AS_BMP);
Line 201... Line 202...
201
	draw_tool_btn(#event_save_raw, 0, PAD*3+68, tx.n,     -1, "RAW", saving_type & SAVE_AS_RAW);
202
	draw_tool_btn(#event_save_raw, 0, PAD*3+68, tx.n,     -1, "RAW", saving_type & SAVE_AS_RAW);
202
 
203
 
203
 	draw_tool_btn(#event_activate_crop,  0, PAD, tx.inc(GAP_B), 46, "Crop", active_tool & TOOL_CROP);
204
 	draw_tool_btn(#event_activate_crop,  0, PAD, tx.inc(GAP_B), 46, "Crop", active_tool & TOOL_CROP);
204
	draw_tool_btn(#event_activate_resize,0, PAD, tx.inc(GAP_S), 06, "Resize", active_tool & TOOL_RESIZE);
205
	draw_tool_btn(#event_activate_resize,0, PAD, tx.inc(GAP_S), 06, "Resize", active_tool & TOOL_RESIZE);
-
 
206
	draw_tool_btn(#event_activate_depth, 0, PAD, tx.inc(GAP_S), 52, "Color depth", active_tool & TOOL_COLOR_DEPTH);
Line 205... Line 207...
205
	draw_tool_btn(#event_activate_depth, 0, PAD, tx.inc(GAP_S), 52, "Color depth", active_tool & TOOL_COLOR_DEPTH);
207
	draw_tool_btn(#event_activate_flprot,0, PAD, tx.inc(GAP_S), 36, "Flip/Rotate", active_tool & TOOL_FLIP_ROTATE);
206
	draw_tool_btn(#event_activate_flprot,0, PAD, tx.inc(GAP_S), 36, "Flip/Rotate", active_tool & TOOL_FLIP_ROTATE);
208
	_NO_IMAGE:
207
 
209
 
Line 345... Line 347...
345
					img_create stdcall(1, 1, main_image.type);
347
					img_create stdcall(1, 1, main_image.type);
346
					img_convert stdcall(EAX, 0, i, 0, 0);
348
					img_convert stdcall(EAX, 0, i, 0, 0);
347
					if (EAX) {
349
					if (EAX) {
348
						img_destroy stdcall(EAX); 
350
						img_destroy stdcall(EAX); 
349
					} else {
351
					} else {
350
						//continue;
-
 
351
						a = -1;
352
						a = -1;
352
					}
353
					}
353
				}
354
				}
354
				x += draw_tool_btn(#event_set_color_depth, SCAN_CODE_ENTER, x, 7, -1, libimg_bpp[i], a) + PAD;			
355
				x += draw_tool_btn(#event_set_color_depth, SCAN_CODE_ENTER, x, 7, -1, libimg_bpp[i], a) + PAD;			
355
			}
356
			}
Line 366... Line 367...
366
			// DrawTopPanelButton1(#EventMoveRight,      ECTRL + SCAN_CODE_RIGHT, tx.inc(GAP_S), 31);
367
			// DrawTopPanelButton1(#EventMoveRight,      ECTRL + SCAN_CODE_RIGHT, tx.inc(GAP_S), 31);
367
			// DrawTopPanelButton1(#EventMoveUp,         ECTRL + SCAN_CODE_UP,    tx.inc(GAP_S), 32);
368
			// DrawTopPanelButton1(#EventMoveUp,         ECTRL + SCAN_CODE_UP,    tx.inc(GAP_S), 32);
368
			// DrawTopPanelButton1(#EventMoveDown,       ECTRL + SCAN_CODE_DOWN,  tx.inc(GAP_S), 33);
369
			// DrawTopPanelButton1(#EventMoveDown,       ECTRL + SCAN_CODE_DOWN,  tx.inc(GAP_S), 33);
369
			break;
370
			break;
370
		default:
371
		default:
371
			WriteText(CANVASX+PAD, HEADER_TEXTY, 0x90, COL_WORK_TEXT, "Welcome to ImageEditor Pro! Try to open some file.");
372
			WriteText(CANVASX+PAD, HEADER_TEXTY, 0x90, COL_WORK_TEXT, "Welcome to ImageEditor Pro! Try to open a file.");
372
	}
373
	}
373
}
374
}
Line 374... Line 375...
374
 
375
 
375
//===================================================//
376
//===================================================//
Line 382... Line 383...
382
{
383
{
383
	o_dialog.type = 0; //open file
384
	o_dialog.type = 0; //open file
384
	OpenDialog_start stdcall (#o_dialog);
385
	OpenDialog_start stdcall (#o_dialog);
385
	if (o_dialog.status) {
386
	if (o_dialog.status) {
386
		open_image(#openfile_path);
387
		open_image(#openfile_path);
387
		draw_canvas();
388
		draw_window();
388
	}
389
	}
389
}
390
}
Line 390... Line 391...
390
 
391
 
391
void event_flip_hor()
392
void event_flip_hor()