1 #include "compresspopup.h"
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
12 CompressPopup::CompressPopup(int x, int y, int use_dv, char *text)
13 : BC_PopupMenu(x, y, 80, File::compressiontostr(text))
16 this->use_dv = use_dv;
19 int CompressPopup::add_items()
21 if(!use_dv) add_item(format_items[0] = new CompressPopupItem(_("DV")));
22 add_item(format_items[1] = new CompressPopupItem(_("JPEG")));
23 add_item(format_items[2] = new CompressPopupItem(_("MJPA")));
24 add_item(format_items[3] = new CompressPopupItem(_("PNG")));
25 add_item(format_items[4] = new CompressPopupItem(_("PNG-Alpha")));
26 add_item(format_items[5] = new CompressPopupItem(_("RGB")));
27 add_item(format_items[6] = new CompressPopupItem(_("RGB-Alpha")));
28 add_item(format_items[7] = new CompressPopupItem(_("YUV420")));
29 add_item(format_items[8] = new CompressPopupItem(_("YUV422")));
33 CompressPopup::~CompressPopup()
35 for(int i = 0; i < COMPRESS_ITEMS; i++) delete format_items[i];
38 char* CompressPopup::get_compression()
41 return test_file.strtocompression(get_text());
44 char* CompressPopup::compression_to_text(char *compression)
47 return test_file.compressiontostr(compression);
50 CompressPopupItem::CompressPopupItem(char *text)
55 CompressPopupItem::~CompressPopupItem()
59 int CompressPopupItem::handle_event()
61 get_popup_menu()->set_text(get_text());
62 get_popup_menu()->handle_event();