4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "aboutprefs.h"
23 #include "bcsignals.h"
26 #include "libzmpeg3.h"
33 AboutPrefs::AboutPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
34 : PreferencesDialog(mwindow, pwindow)
38 AboutPrefs::~AboutPrefs()
40 about.remove_all_objects();
43 void AboutPrefs::create_objects()
48 BC_Resources *resources = BC_WindowBase::get_resources();
50 // add_subwindow(new BC_Title(mwindow->theme->preferencestitle_x,
51 // mwindow->theme->preferencestitle_y,
54 // resources->text_default));
56 x = mwindow->theme->preferencesoptions_x;
57 y = mwindow->theme->preferencesoptions_y +
58 get_text_height(LARGEFONT);
60 char license1[BCTEXTLEN];
61 sprintf(license1, "%s %s", PROGRAM_NAME, CINELERRA_VERSION);
64 set_color(resources->text_default);
65 draw_text(x, y, license1);
67 y += get_text_height(LARGEFONT);
68 char license2[BCTEXTLEN];
70 _("(C) %d Adam Williams\n\nheroinewarrior.com"),
73 draw_text(x, y, license2);
77 y += get_text_height(MEDIUMFONT) * 3;
79 // char versions[BCTEXTLEN];
81 // _("Libmpeg3 version %d.%d.%d\n"),
85 // draw_text(x, y, versions);
88 char exe_path[BCTEXTLEN], msg_path[BCTEXTLEN];
89 get_exe_path(exe_path);
90 snprintf(msg_path, sizeof(msg_path), "%s/msg.txt", exe_path);
91 FILE *fp = fopen(msg_path, "r");
94 draw_text(x, y, _("About:"));
95 y += get_text_height(LARGEFONT);
97 while( fgets(msg, sizeof(msg), fp) )
98 about.append(new BC_ListBoxItem(msg));
101 add_subwindow(listbox = new BC_ListBox(x, y, 300, 300,
102 LISTBOX_TEXT, &about, 0, 0, 1));
103 y += listbox->get_h() + get_text_height(LARGEFONT) + 10;
106 y += 300 + get_text_height(LARGEFONT) + 10;
109 set_color(resources->text_default);
110 draw_text(x, y, _("License:"));
111 y += get_text_height(LARGEFONT);
112 set_font(MEDIUMFONT);
114 char license3[BCTEXTLEN];
116 "This program is free software; you can redistribute it and/or modify it under the terms\n"
117 "of the GNU General Public License as published by the Free Software Foundation; either version\n"
118 "2 of the License, or (at your option) any later version.\n"
120 "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n"
121 "without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n"
122 "PURPOSE. See the GNU General Public License for more details.\n"
124 draw_text(x, y, license3);
126 x = get_w() - mwindow->theme->about_bg->get_w() - 10;
127 y = mwindow->theme->preferencesoptions_y;
128 BC_Pixmap *temp_pixmap = new BC_Pixmap(this,
129 mwindow->theme->about_bg,
131 draw_pixmap(temp_pixmap,
138 x += mwindow->theme->about_bg->get_w() + 10;
139 y += get_text_height(LARGEFONT) * 2;