summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/minifig.h2
-rwxr-xr-xcommon/system.h2
-rw-r--r--linux/basewnd.cpp13
-rw-r--r--linux/dialogs.cpp506
-rw-r--r--linux/dialogs.h2
-rwxr-xr-xlinux/gtkmisc.cpp24
-rwxr-xr-xlinux/gtkmisc.h14
-rw-r--r--linux/gtktools.cpp8
-rw-r--r--linux/gtktools.h4
-rw-r--r--linux/main.cpp78
-rw-r--r--linux/main.h9
-rw-r--r--linux/menu.cpp83
-rw-r--r--linux/pixmaps/ac-brick.xpm2
-rw-r--r--linux/pixmaps/ac-cam.xpm2
-rw-r--r--linux/pixmaps/ac-erase.xpm2
-rw-r--r--linux/pixmaps/ac-light.xpm2
-rw-r--r--linux/pixmaps/ac-move.xpm2
-rw-r--r--linux/pixmaps/ac-next.xpm2
-rw-r--r--linux/pixmaps/ac-paint.xpm2
-rw-r--r--linux/pixmaps/ac-pan.xpm2
-rw-r--r--linux/pixmaps/ac-prev.xpm2
-rw-r--r--linux/pixmaps/ac-roll.xpm2
-rw-r--r--linux/pixmaps/ac-rot.xpm2
-rw-r--r--linux/pixmaps/ac-rotv.xpm2
-rw-r--r--linux/pixmaps/ac-sel.xpm2
-rw-r--r--linux/pixmaps/ac-spot.xpm2
-rw-r--r--linux/pixmaps/ac-zoom.xpm2
-rw-r--r--linux/pixmaps/ac-zoome.xpm2
-rw-r--r--linux/pixmaps/ac-zoomr.xpm2
-rw-r--r--linux/pixmaps/an-anim.xpm2
-rw-r--r--linux/pixmaps/an-first.xpm2
-rw-r--r--linux/pixmaps/an-key.xpm2
-rw-r--r--linux/pixmaps/an-last.xpm2
-rw-r--r--linux/pixmaps/an-next.xpm2
-rw-r--r--linux/pixmaps/an-play.xpm2
-rw-r--r--linux/pixmaps/an-prev.xpm2
-rw-r--r--linux/pixmaps/an-stop.xpm2
-rw-r--r--linux/pixmaps/cr_brick.xpm2
-rw-r--r--linux/pixmaps/cr_cam.xpm2
-rw-r--r--linux/pixmaps/cr_erase.xpm2
-rw-r--r--linux/pixmaps/cr_light.xpm2
-rw-r--r--linux/pixmaps/cr_move.xpm2
-rw-r--r--linux/pixmaps/cr_paint.xpm2
-rw-r--r--linux/pixmaps/cr_pan.xpm2
-rw-r--r--linux/pixmaps/cr_roll.xpm2
-rw-r--r--linux/pixmaps/cr_rot.xpm2
-rw-r--r--linux/pixmaps/cr_rotv.xpm2
-rw-r--r--linux/pixmaps/cr_sel.xpm2
-rw-r--r--linux/pixmaps/cr_selm.xpm2
-rw-r--r--linux/pixmaps/cr_spot.xpm2
-rw-r--r--linux/pixmaps/cr_zoom.xpm2
-rw-r--r--linux/pixmaps/cr_zoomr.xpm2
-rw-r--r--linux/pixmaps/icon32.xpm2
-rw-r--r--linux/pixmaps/info.xpm2
-rw-r--r--linux/pixmaps/photo.xpm2
-rw-r--r--linux/pixmaps/pi-acces.xpm2
-rw-r--r--linux/pixmaps/pi-brick.xpm2
-rw-r--r--linux/pixmaps/pi-extra.xpm2
-rw-r--r--linux/pixmaps/pi-misc.xpm2
-rw-r--r--linux/pixmaps/pi-plate.xpm2
-rw-r--r--linux/pixmaps/pi-slope.xpm2
-rw-r--r--linux/pixmaps/pi-space.xpm2
-rw-r--r--linux/pixmaps/pi-tech.xpm2
-rw-r--r--linux/pixmaps/pi-tile.xpm2
-rw-r--r--linux/pixmaps/pi-train.xpm2
-rw-r--r--linux/pixmaps/st-about.xpm2
-rw-r--r--linux/pixmaps/st-bg.xpm2
-rw-r--r--linux/pixmaps/st-copy.xpm2
-rw-r--r--linux/pixmaps/st-cut.xpm2
-rw-r--r--linux/pixmaps/st-fast.xpm2
-rw-r--r--linux/pixmaps/st-help.xpm2
-rwxr-xr-xlinux/pixmaps/st-lock.xpm34
-rw-r--r--linux/pixmaps/st-new.xpm2
-rw-r--r--linux/pixmaps/st-open.xpm2
-rw-r--r--linux/pixmaps/st-paste.xpm2
-rw-r--r--linux/pixmaps/st-prev.xpm2
-rw-r--r--linux/pixmaps/st-print.xpm2
-rw-r--r--linux/pixmaps/st-redo.xpm2
-rw-r--r--linux/pixmaps/st-save.xpm2
-rw-r--r--linux/pixmaps/st-snap.xpm2
-rw-r--r--linux/pixmaps/st-snapa.xpm2
-rw-r--r--linux/pixmaps/st-undo.xpm2
-rwxr-xr-xlinux/pixmaps/vports01.xpm2
-rwxr-xr-xlinux/pixmaps/vports02.xpm2
-rwxr-xr-xlinux/pixmaps/vports03.xpm2
-rwxr-xr-xlinux/pixmaps/vports04.xpm2
-rwxr-xr-xlinux/pixmaps/vports05.xpm2
-rwxr-xr-xlinux/pixmaps/vports06.xpm2
-rwxr-xr-xlinux/pixmaps/vports07.xpm2
-rwxr-xr-xlinux/pixmaps/vports08.xpm2
-rwxr-xr-xlinux/pixmaps/vports09.xpm2
-rwxr-xr-xlinux/pixmaps/vports10.xpm2
-rwxr-xr-xlinux/pixmaps/vports11.xpm2
-rwxr-xr-xlinux/pixmaps/vports12.xpm2
-rwxr-xr-xlinux/pixmaps/vports13.xpm2
-rwxr-xr-xlinux/pixmaps/vports14.xpm2
-rw-r--r--linux/system.cpp95
-rw-r--r--linux/toolbar.cpp179
-rw-r--r--linux/toolbar.h3
-rw-r--r--win/System.cpp2
100 files changed, 779 insertions, 445 deletions
diff --git a/common/minifig.h b/common/minifig.h
index f18d4f0..a73b3fe 100644
--- a/common/minifig.h
+++ b/common/minifig.h
@@ -8,7 +8,7 @@
class PieceInfo;
-typedef enum LC_MFW_TYPES
+enum LC_MFW_TYPES
{
LC_MFW_HAT,
LC_MFW_HEAD,
diff --git a/common/system.h b/common/system.h
index 0010bc6..cd79b10 100755
--- a/common/system.h
+++ b/common/system.h
@@ -98,7 +98,7 @@ void SystemUpdateCategories(bool SearchOnly);
void SystemInit();
void SystemFinish();
-int SystemDoMessageBox(char* prompt, int nMode);
+int SystemDoMessageBox(const char* prompt, int nMode);
bool SystemDoDialog(int nMode, void* param);
void SystemDoPopupMenu(int nMenu, int x, int y);
void SystemDoWaitCursor(int nCode);
diff --git a/linux/basewnd.cpp b/linux/basewnd.cpp
index 5593062..8c4260b 100644
--- a/linux/basewnd.cpp
+++ b/linux/basewnd.cpp
@@ -11,6 +11,7 @@
BaseWnd::BaseWnd (BaseWnd *parent, int menu_count)
{
m_pMenuItems = new BaseMenuItem[menu_count];
+ memset(m_pMenuItems, 0, sizeof(BaseMenuItem[menu_count]));
m_pParent = parent;
m_pXID = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -168,6 +169,9 @@ int BaseWnd::MessageBox (const char* text, const char* caption, int flags)
void BaseWnd::ShowMenuItem (int id, bool show)
{
+ if (!m_pMenuItems[id].widget)
+ return;
+
if (show)
gtk_widget_show (m_pMenuItems[id].widget);
else
@@ -176,11 +180,17 @@ void BaseWnd::ShowMenuItem (int id, bool show)
void BaseWnd::EnableMenuItem (int id, bool enable)
{
+ if (!m_pMenuItems[id].widget)
+ return;
+
gtk_widget_set_sensitive (m_pMenuItems[id].widget, enable);
}
void BaseWnd::CheckMenuItem (int id, bool check)
{
+ if (!m_pMenuItems[id].widget)
+ return;
+
ignore_commands = true;
gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (m_pMenuItems[id].widget), check);
ignore_commands = false;
@@ -195,6 +205,9 @@ void BaseWnd::SetMenuItemText (int id, const char *text)
gchar *pattern;
gint length;
+ if (!m_pMenuItems[id].widget)
+ return;
+
length = strlen (text);
pattern = g_new (gchar, length+1);
diff --git a/linux/dialogs.cpp b/linux/dialogs.cpp
index 7f9d2f0..1c987d1 100644
--- a/linux/dialogs.cpp
+++ b/linux/dialogs.cpp
@@ -56,130 +56,70 @@ gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
int msgbox_execute (const char* text, const char *caption, int flags)
{
- GtkWidget *window, *w, *vbox, *hbox;
- GtkAccelGroup *group;
- int mode = (flags & LC_MB_TYPEMASK), ret, loop = 1;
- guint tmp_key;
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (((GtkWidget*)(*main_window))));
- gtk_signal_connect (GTK_OBJECT (window), "delete_event",
- GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
- gtk_signal_connect (GTK_OBJECT (window), "destroy",
- GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
- gtk_window_set_title (GTK_WINDOW (window), caption);
- gtk_container_border_width (GTK_CONTAINER (window), 10);
- gtk_object_set_data (GTK_OBJECT (window), "loop", &loop);
- gtk_object_set_data (GTK_OBJECT (window), "ret", &ret);
- gtk_widget_realize (window);
-
- group = gtk_accel_group_new ();
- gtk_window_add_accel_group (GTK_WINDOW (window), group);
-
- vbox = gtk_vbox_new (FALSE, 10);
- gtk_container_add (GTK_CONTAINER (window), vbox);
- gtk_widget_show (vbox);
-
- w = gtk_label_new (text);
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2);
- gtk_label_set_justify (GTK_LABEL (w), GTK_JUSTIFY_LEFT);
- gtk_widget_show (w);
-
- w = gtk_hseparator_new ();
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2);
- gtk_widget_show (w);
-
- hbox = gtk_hbox_new (FALSE, 10);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);
- gtk_widget_show (hbox);
-
- if (mode == LC_MB_OK)
- {
- w = gtk_button_new_with_label ("Ok");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_OK));
- GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
- gtk_widget_grab_default (w);
- gtk_widget_show (w);
- ret = LC_OK;
- }
- else if (mode == LC_MB_OKCANCEL)
- {
- w = gtk_button_new_with_label ("Ok");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_OK));
- GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
- gtk_widget_grab_default (w);
- gtk_widget_show (w);
-
- w = gtk_button_new_with_label ("Cancel");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_CANCEL));
- gtk_widget_show (w);
- ret = LC_CANCEL;
- }
- else if (mode == LC_MB_YESNOCANCEL)
- {
- w = gtk_button_new_with_label ("");
- tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (w)->child), "_Yes");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_YES));
- gtk_widget_add_accelerator (w, "clicked", group, tmp_key, (GdkModifierType)0, (GtkAccelFlags)0);
- GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
- gtk_widget_grab_default (w);
- gtk_widget_show (w);
- gtk_window_set_focus (GTK_WINDOW (window), w);
-
- w = gtk_button_new_with_label ("");
- tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (w)->child), "_No");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_NO));
- gtk_widget_add_accelerator (w, "clicked", group, tmp_key, (GdkModifierType)0, (GtkAccelFlags)0);
- gtk_widget_show (w);
-
- w = gtk_button_new_with_label ("");
- tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (w)->child), "_Cancel");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_CANCEL));
- gtk_widget_add_accelerator (w, "clicked", group, tmp_key, (GdkModifierType)0, (GtkAccelFlags)0);
- gtk_widget_add_accelerator (w, "clicked", group, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0);
- gtk_widget_show (w);
- ret = LC_CANCEL;
- }
- else /* if (mode == LC_MB_YESNO) */
- {
- w = gtk_button_new_with_label ("Yes");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_YES));
- GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
- gtk_widget_grab_default (w);
- gtk_widget_show (w);
-
- w = gtk_button_new_with_label ("No");
- gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
- gtk_signal_connect (GTK_OBJECT (w), "clicked",
- GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (LC_NO));
- gtk_widget_show (w);
- ret = LC_NO;
- }
-
- gtk_widget_show (window);
- gtk_grab_add (window);
-
- while (loop)
- gtk_main_iteration ();
-
- gtk_grab_remove (window);
- gtk_widget_destroy (window);
-
- return ret;
+ GtkWidget* dlg;
+ GtkMessageType Message;
+
+ switch (flags & LC_MB_ICONMASK)
+ {
+ case LC_MB_ICONERROR:
+ Message = GTK_MESSAGE_ERROR;
+ break;
+ case LC_MB_ICONQUESTION:
+ Message = GTK_MESSAGE_QUESTION;
+ break;
+ case LC_MB_ICONWARNING:
+ Message = GTK_MESSAGE_WARNING;
+ break;
+ default:
+ case LC_MB_ICONINFORMATION:
+ Message = GTK_MESSAGE_INFO;
+ break;
+ }
+
+ dlg = gtk_message_dialog_new(GTK_WINDOW (((GtkWidget*)(*main_window))),
+ GTK_DIALOG_MODAL, Message, GTK_BUTTONS_NONE, "%s", text);
+ gtk_window_set_title(GTK_WINDOW(dlg), caption);
+
+ switch (flags & LC_MB_TYPEMASK)
+ {
+ default:
+ case LC_MB_OK:
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_OK, GTK_RESPONSE_OK);
+ break;
+ case LC_MB_OKCANCEL:
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_OK, GTK_RESPONSE_OK);
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ break;
+ case LC_MB_YESNOCANCEL:
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_YES, GTK_RESPONSE_YES);
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_NO, GTK_RESPONSE_NO);
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ break;
+ case LC_MB_YESNO:
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_YES, GTK_RESPONSE_YES);
+ gtk_dialog_add_button(GTK_DIALOG(dlg), GTK_STOCK_NO, GTK_RESPONSE_NO);
+ break;
+ }
+
+ gint result = gtk_dialog_run(GTK_DIALOG(dlg));
+ gtk_widget_destroy(dlg);
+
+ switch (result)
+ {
+ case GTK_RESPONSE_OK: return LC_OK;
+ case GTK_RESPONSE_CANCEL: return LC_CANCEL;
+ case GTK_RESPONSE_YES: return LC_YES;
+ case GTK_RESPONSE_NO: return LC_NO;
+ }
+
+ switch (flags & LC_MB_TYPEMASK)
+ {
+ default:
+ case LC_MB_OK: return LC_OK;
+ case LC_MB_OKCANCEL: return LC_CANCEL;
+ case LC_MB_YESNOCANCEL: return LC_CANCEL;
+ case LC_MB_YESNO: return LC_NO;
+ }
}
@@ -293,7 +233,8 @@ static void filedlg_callback(GtkWidget *widget, gpointer data)
*cur_ret = LC_CANCEL;
}
-int filedlg_execute(char* caption, char* filename)
+// FIXME: Deprecated, use GtkFileChooserDialog instead
+int filedlg_execute(const char* caption, char* filename)
{
GtkWidget* dlg;
dlg = gtk_file_selection_new (caption);
@@ -902,6 +843,7 @@ int aboutdlg_execute (void* param)
typedef struct
{
void* data;
+ GtkWidget *dlg;
GtkWidget *single, *multiple, *index;
GtkWidget *list_end, *list_step, *images;
GtkWidget *highlight, *htmlext, *directory;
@@ -953,6 +895,29 @@ static void htmldlg_list (GtkWidget *widget, gpointer data)
gtk_widget_set_sensitive (s->images, FALSE);
}
+static void htmldlg_browse_output(GtkWidget *widget, gpointer data)
+{
+ LC_HTMLDLG_STRUCT* s = (LC_HTMLDLG_STRUCT*)data;
+ GtkWidget* dlg;
+
+ dlg = gtk_file_chooser_dialog_new("Select output path", GTK_WINDOW(s->dlg),
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
+
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dlg), gtk_entry_get_text(GTK_ENTRY(s->directory)));
+
+ if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
+ gtk_entry_set_text(GTK_ENTRY(s->directory), filename);
+ g_free(filename);
+ }
+
+ gtk_widget_destroy(dlg);
+}
+
int htmldlg_execute (void* param)
{
GtkWidget *dlg;
@@ -968,6 +933,7 @@ int htmldlg_execute (void* param)
gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
GTK_SIGNAL_FUNC (dlg_delete_callback), NULL);
gtk_window_set_title (GTK_WINDOW (dlg), "HTML Options");
+ s.dlg = dlg;
vbox = gtk_vbox_new (FALSE, 10);
gtk_widget_show (vbox);
@@ -1080,12 +1046,14 @@ int htmldlg_execute (void* param)
button = gtk_button_new_with_label ("...");
gtk_widget_show (button);
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, TRUE, 0);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(htmldlg_browse_output), &s);
gtk_signal_connect (GTK_OBJECT (s.single), "toggled", GTK_SIGNAL_FUNC (htmldlg_layout), &s);
gtk_signal_connect (GTK_OBJECT (s.multiple), "toggled", GTK_SIGNAL_FUNC (htmldlg_layout), &s);
gtk_signal_connect (GTK_OBJECT (s.list_step), "toggled", GTK_SIGNAL_FUNC (htmldlg_list), &s);
gtk_signal_connect (GTK_OBJECT (s.list_end), "toggled", GTK_SIGNAL_FUNC (htmldlg_list), &s);
+ gtk_entry_set_text(GTK_ENTRY(s.directory), opts->path);
if (opts->singlepage)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (s.single), TRUE);
else
@@ -1405,6 +1373,7 @@ int imageoptsdlg_execute(void* param, bool from_htmldlg)
typedef struct
{
void* data;
+ GtkWidget* dlg;
GtkWidget *lgeo, *pov, *output, *render;
} LC_POVRAYDLG_STRUCT;
@@ -1418,108 +1387,221 @@ static void povraydlg_ok(GtkWidget *widget, gpointer data)
strcpy(opts->outpath, gtk_entry_get_text (GTK_ENTRY (s->output)));
strcpy(opts->libpath, gtk_entry_get_text (GTK_ENTRY (s->lgeo)));
+ Sys_ProfileSaveInt("Settings", "POV Render", opts->render);
+ Sys_ProfileSaveString("Settings", "POV-Ray", opts->povpath);
+ Sys_ProfileSaveString("Settings", "LGEO", opts->libpath);
+
*cur_ret = LC_OK;
}
-int povraydlg_execute(void* param)
+static void povraydlg_browse_output(GtkWidget *widget, gpointer data)
{
- GtkWidget *dlg;
- GtkWidget *vbox, *hbox1, *hbox2;
- GtkWidget *label, *button;
- LC_POVRAYDLG_STRUCT s;
- s.data = param;
-
- dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (((GtkWidget*)(*main_window))));
- gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
- GTK_SIGNAL_FUNC (dlg_delete_callback), NULL);
- gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
- GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
- gtk_widget_set_usize (dlg, 375, 190);
- gtk_window_set_title (GTK_WINDOW (dlg), "POV-Ray Export");
- gtk_window_set_policy (GTK_WINDOW (dlg), FALSE, FALSE, FALSE);
- gtk_widget_realize (dlg);
-
- hbox1 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox1);
- gtk_container_add (GTK_CONTAINER (dlg), hbox1);
-
- vbox = gtk_vbox_new (FALSE, 10);
- gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (hbox1), vbox, FALSE, TRUE, 0);
- gtk_widget_set_usize (vbox, 250, -2);
- gtk_container_border_width (GTK_CONTAINER (vbox), 10);
-
- hbox2 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox2);
- gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0);
-
- label = gtk_label_new ("LGEO Path (optional)");
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, TRUE, 0);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
- s.lgeo = gtk_entry_new ();
- gtk_widget_show (s.lgeo);
- gtk_box_pack_start (GTK_BOX (vbox), s.lgeo, FALSE, TRUE, 0);
+ LC_POVRAYDLG_STRUCT* s = (LC_POVRAYDLG_STRUCT*)data;
+ GtkFileFilter* filter;
+ GtkWidget* dlg;
+
+ dlg = gtk_file_chooser_dialog_new("Export As", GTK_WINDOW(s->dlg),
+ GTK_FILE_CHOOSER_ACTION_SAVE,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
+
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dlg), gtk_entry_get_text(GTK_ENTRY(s->output)));
+ gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dlg), TRUE);
+
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_pattern(filter, "*");
+ gtk_file_filter_set_name(GTK_FILE_FILTER(filter), "All Files");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dlg), filter);
+
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_pattern(filter, "*.[pP][oO][vV]");
+ gtk_file_filter_set_name(GTK_FILE_FILTER(filter), "POV-Ray files (*.pov)");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dlg), filter);
+
+ if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
+ gtk_entry_set_text(GTK_ENTRY(s->output), filename);
+ g_free(filename);
+ }
+
+ gtk_widget_destroy(dlg);
+}
- hbox2 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox2);
- gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0);
+static void povraydlg_browse_povray(GtkWidget *widget, gpointer data)
+{
+ LC_POVRAYDLG_STRUCT* s = (LC_POVRAYDLG_STRUCT*)data;
+ GtkWidget* dlg;
- label = gtk_label_new ("POV-Ray Executable");
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, TRUE, 0);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ dlg = gtk_file_chooser_dialog_new("Select POV-Ray executable", GTK_WINDOW(s->dlg),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
- s.pov = gtk_entry_new ();
- gtk_widget_show (s.pov);
- gtk_box_pack_start (GTK_BOX (vbox), s.pov, FALSE, TRUE, 0);
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dlg), gtk_entry_get_text(GTK_ENTRY(s->pov)));
- hbox2 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox2);
- gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0);
+ if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
+ gtk_entry_set_text(GTK_ENTRY(s->pov), filename);
+ g_free(filename);
+ }
- label = gtk_label_new ("Output File");
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, TRUE, 0);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_widget_destroy(dlg);
+}
- s.output = gtk_entry_new ();
- gtk_widget_show (s.output);
- gtk_box_pack_start (GTK_BOX (vbox), s.output, FALSE, TRUE, 0);
+static void povraydlg_browse_lgeo(GtkWidget *widget, gpointer data)
+{
+ LC_POVRAYDLG_STRUCT* s = (LC_POVRAYDLG_STRUCT*)data;
+ GtkWidget* dlg;
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (hbox1), vbox, FALSE, TRUE, 0);
- gtk_container_border_width (GTK_CONTAINER (vbox), 10);
+ dlg = gtk_file_chooser_dialog_new("Select LGEO path", GTK_WINDOW(s->dlg),
+ GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
- button = gtk_button_new_with_label ("OK");
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (povraydlg_ok), &s);
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, TRUE, 5);
- gtk_widget_set_usize (button, -2, 25);
- GtkAccelGroup *accel_group = gtk_accel_group_new ();
- gtk_window_add_accel_group (GTK_WINDOW (dlg), accel_group);
- gtk_widget_add_accelerator (button, "clicked", accel_group,
- GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE);
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dlg), gtk_entry_get_text(GTK_ENTRY(s->lgeo)));
- button = gtk_button_new_with_label ("Cancel");
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (dlg_default_callback), GINT_TO_POINTER (LC_CANCEL));
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, TRUE, 5);
- gtk_widget_set_usize (button, -2, 25);
- gtk_widget_add_accelerator (button, "clicked", accel_group,
- GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE);
+ if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
+ gtk_entry_set_text(GTK_ENTRY(s->lgeo), filename);
+ g_free(filename);
+ }
- s.render = gtk_check_button_new_with_label ("Render Scene");
- gtk_widget_show (s.render);
- gtk_box_pack_start (GTK_BOX (vbox), s.render, FALSE, TRUE, 5);
- gtk_widget_set_sensitive (s.render, FALSE);
+ gtk_widget_destroy(dlg);
+}
- return dlg_domodal(dlg, LC_CANCEL);
+int povraydlg_execute(void* param)
+{
+ GtkWidget *dlg;
+ GtkWidget *vbox, *hbox1, *hbox2;
+ GtkWidget *label, *button;
+ LC_POVRAYDLG_STRUCT s;
+ s.data = param;
+
+ dlg = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_transient_for(GTK_WINDOW(dlg), GTK_WINDOW(((GtkWidget*)(*main_window))));
+ gtk_signal_connect(GTK_OBJECT(dlg), "delete_event", GTK_SIGNAL_FUNC(dlg_delete_callback), NULL);
+ gtk_signal_connect(GTK_OBJECT(dlg), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroy), NULL);
+ gtk_window_set_title(GTK_WINDOW(dlg), "POV-Ray Export");
+ gtk_window_set_policy(GTK_WINDOW(dlg), FALSE, FALSE, FALSE);
+ gtk_widget_realize(dlg);
+ s.dlg = dlg;
+
+ hbox1 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox1);
+ gtk_container_add(GTK_CONTAINER(dlg), hbox1);
+
+ vbox = gtk_vbox_new(FALSE, 10);
+ gtk_widget_show(vbox);
+ gtk_box_pack_start(GTK_BOX(hbox1), vbox, FALSE, TRUE, 0);
+ gtk_widget_set_usize(vbox, 250, -2);
+ gtk_container_border_width(GTK_CONTAINER(vbox), 10);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, TRUE, 0);
+
+ label = gtk_label_new("Output File");
+ gtk_widget_show(label);
+ gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, TRUE, 0);
+ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, TRUE, 0);
+
+ s.output = gtk_entry_new();
+ gtk_widget_show(s.output);
+ gtk_box_pack_start(GTK_BOX(hbox2), s.output, TRUE, TRUE, 0);
+
+ button = gtk_button_new_with_label("...");
+ gtk_widget_show(button);
+ gtk_box_pack_end(GTK_BOX(hbox2), button, FALSE, TRUE, 0);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(povraydlg_browse_output), &s);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, TRUE, 0);
+
+ label = gtk_label_new("POV-Ray Executable");
+ gtk_widget_show(label);
+ gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, TRUE, 0);
+ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, TRUE, 0);
+
+ s.pov = gtk_entry_new();
+ gtk_widget_show(s.pov);
+ gtk_box_pack_start(GTK_BOX(hbox2), s.pov, TRUE, TRUE, 0);
+
+ button = gtk_button_new_with_label("...");
+ gtk_widget_show(button);
+ gtk_box_pack_end(GTK_BOX(hbox2), button, FALSE, TRUE, 0);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(povraydlg_browse_povray), &s);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, TRUE, 0);
+
+ label = gtk_label_new("LGEO Path");
+ gtk_widget_show(label);
+ gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, TRUE, 0);
+ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
+
+ hbox2 = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show(hbox2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, TRUE, 0);
+
+ s.lgeo = gtk_entry_new();
+ gtk_widget_show(s.lgeo);
+ gtk_box_pack_start(GTK_BOX(hbox2), s.lgeo, TRUE, TRUE, 0);
+
+ button = gtk_button_new_with_label("...");
+ gtk_widget_show(button);
+ gtk_box_pack_end(GTK_BOX(hbox2), button, FALSE, TRUE, 0);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(povraydlg_browse_lgeo), &s);
+
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_widget_show(vbox);
+ gtk_box_pack_start(GTK_BOX(hbox1), vbox, FALSE, TRUE, 0);
+ gtk_container_border_width(GTK_CONTAINER(vbox), 10);
+
+ button = gtk_button_new_with_label("OK");
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(povraydlg_ok), &s);
+ gtk_widget_show(button);
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, TRUE, 5);
+ gtk_widget_set_usize(button, -2, 25);
+ GtkAccelGroup *accel_group = gtk_accel_group_new();
+ gtk_window_add_accel_group(GTK_WINDOW(dlg), accel_group);
+ gtk_widget_add_accelerator(button, "clicked", accel_group,
+ GDK_Return,(GdkModifierType)0, GTK_ACCEL_VISIBLE);
+
+ button = gtk_button_new_with_label("Cancel");
+ gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ GTK_SIGNAL_FUNC(dlg_default_callback), GINT_TO_POINTER(LC_CANCEL));
+ gtk_widget_show(button);
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, TRUE, 5);
+ gtk_widget_set_usize(button, -2, 25);
+ gtk_widget_add_accelerator(button, "clicked", accel_group,
+ GDK_Escape,(GdkModifierType)0, GTK_ACCEL_VISIBLE);
+
+ s.render = gtk_check_button_new_with_label("Render Scene");
+ gtk_widget_show(s.render);
+ gtk_box_pack_start(GTK_BOX(vbox), s.render, FALSE, TRUE, 5);
+
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(s.render),
+ Sys_ProfileLoadInt("Settings", "POV Render", 1) ? TRUE : FALSE);
+ gtk_entry_set_text(GTK_ENTRY(s.pov), Sys_ProfileLoadString("Settings", "POV-Ray", ""));
+ gtk_entry_set_text(GTK_ENTRY(s.lgeo), Sys_ProfileLoadString("Settings", "LGEO", ""));
+
+ return dlg_domodal(dlg, LC_CANCEL);
}
// Preferences Dialog
diff --git a/linux/dialogs.h b/linux/dialogs.h
index cf69fc3..1cacd8b 100644
--- a/linux/dialogs.h
+++ b/linux/dialogs.h
@@ -18,7 +18,7 @@ int openprojectdlg_execute (char* filename);
int saveprojectdlg_execute (char* filename);
int savepicturedlg_execute (void* param);
int msgbox_execute (const char* text, const char *caption, int flags);
-int filedlg_execute(char* caption, char* filename);
+int filedlg_execute(const char* caption, char* filename);
int arraydlg_execute(void* param);
int aboutdlg_execute(void* param);
int htmldlg_execute(void* param);
diff --git a/linux/gtkmisc.cpp b/linux/gtkmisc.cpp
index e0d1d5e..067b38c 100755
--- a/linux/gtkmisc.cpp
+++ b/linux/gtkmisc.cpp
@@ -32,7 +32,7 @@
// Load a pixmap file from the disk
void load_pixmap (const char* filename, GdkPixmap **gdkpixmap, GdkBitmap **mask)
{
- struct { char* name; char** data; } table[14] =
+ struct { const char* name; const char** data; } table[14] =
{
{ "vports01.xpm", vports01 },
{ "vports02.xpm", vports02 },
@@ -54,19 +54,19 @@ void load_pixmap (const char* filename, GdkPixmap **gdkpixmap, GdkBitmap **mask)
for (int i = 0; i < 14; i++)
if (strcmp (table[i].name, filename) == 0)
{
- *gdkpixmap = gdk_pixmap_create_from_xpm_d (GDK_ROOT_PARENT(), mask, NULL, table[i].data);
+ *gdkpixmap = gdk_pixmap_create_from_xpm_d (GDK_ROOT_PARENT(), mask, NULL, (gchar**)table[i].data);
break;
}
if (*gdkpixmap == NULL)
{
- char *dummy[] = { "1 1 1 1", " c None", " " };
- *gdkpixmap = gdk_pixmap_create_from_xpm_d (GDK_ROOT_PARENT(), mask, NULL, dummy);
+ const char *dummy[] = { "1 1 1 1", " c None", " " };
+ *gdkpixmap = gdk_pixmap_create_from_xpm_d (GDK_ROOT_PARENT(), mask, NULL, (gchar**)dummy);
}
}
// Load a xpm file and return a pixmap widget
-GtkWidget* create_pixmap (char* filename)
+GtkWidget* create_pixmap (const char* filename)
{
GdkPixmap *gdkpixmap;
GdkBitmap *mask;
@@ -103,7 +103,7 @@ GtkWidget* menu_tearoff (GtkWidget *menu)
return menu_item;
}
-GtkWidget* create_sub_menu (GtkWidget *bar, char *label, GtkAccelGroup *accel)
+GtkWidget* create_sub_menu(GtkWidget* bar, const char* label, GtkAccelGroup* accel)
{
GtkWidget *item, *menu;
@@ -117,7 +117,7 @@ GtkWidget* create_sub_menu (GtkWidget *bar, char *label, GtkAccelGroup *accel)
return menu;
}
-GtkWidget* create_menu_in_menu (GtkWidget *menu, gchar *label, GtkAccelGroup *accel)
+GtkWidget* create_menu_in_menu(GtkWidget* menu, const char* label, GtkAccelGroup* accel)
{
GtkWidget *item, *submenu;
@@ -131,7 +131,7 @@ GtkWidget* create_menu_in_menu (GtkWidget *menu, gchar *label, GtkAccelGroup *ac
return submenu;
}
-GtkWidget* create_menu_item (GtkWidget *menu, gchar *label, GtkAccelGroup *menu_accel,
+GtkWidget* create_menu_item(GtkWidget *menu, const char *label, GtkAccelGroup *menu_accel,
GtkSignalFunc func, GtkObject *window, int id, const char* data)
{
GtkWidget *item;
@@ -147,7 +147,7 @@ GtkWidget* create_menu_item (GtkWidget *menu, gchar *label, GtkAccelGroup *menu_
return item;
}
-GtkWidget* create_pixmap_menu_item (GtkWidget *menu, gchar *label, gchar **pixmap, GtkAccelGroup *menu_accel,
+GtkWidget* create_pixmap_menu_item(GtkWidget *menu, const gchar *label, const char **pixmap, GtkAccelGroup *menu_accel,
GtkSignalFunc func, GtkObject *window, int id, const char* data)
{
GtkWidget *item, *pixmap_widget;
@@ -168,7 +168,7 @@ GtkWidget* create_pixmap_menu_item (GtkWidget *menu, gchar *label, gchar **pixma
return item;
}
-GtkWidget* create_check_menu_item (GtkWidget *menu, gchar *label, GtkAccelGroup *menu_accel,
+GtkWidget* create_check_menu_item(GtkWidget *menu, const char *label, GtkAccelGroup *menu_accel,
GtkSignalFunc func, GtkObject *window, int id, const char* data)
{
GtkWidget *item;
@@ -184,7 +184,7 @@ GtkWidget* create_check_menu_item (GtkWidget *menu, gchar *label, GtkAccelGroup
return item;
}
-GtkWidget* create_radio_menu_item (GtkWidget *menu, GtkWidget *last, gchar *label,
+GtkWidget* create_radio_menu_item(GtkWidget *menu, GtkWidget *last, const char *label,
GtkAccelGroup *menu_accel, GtkSignalFunc func,
GtkObject *window, int id, const char* data)
{
@@ -204,7 +204,7 @@ GtkWidget* create_radio_menu_item (GtkWidget *menu, GtkWidget *last, gchar *labe
return item;
}
-GtkWidget* create_radio_menu_pixmap (GtkWidget *menu, GtkWidget *last, gchar *filename,
+GtkWidget* create_radio_menu_pixmap(GtkWidget *menu, GtkWidget *last, const char *filename,
GtkAccelGroup *menu_accel, GtkSignalFunc func,
GtkObject *window, int id, const char* data)
{
diff --git a/linux/gtkmisc.h b/linux/gtkmisc.h
index eed42d3..224db0f 100755
--- a/linux/gtkmisc.h
+++ b/linux/gtkmisc.h
@@ -6,18 +6,18 @@ void load_pixmap (const char* filename, GdkPixmap **gdkpixmap, GdkBitmap **mask)
GtkWidget* menu_separator (GtkWidget *menu);
GtkWidget* menu_tearoff (GtkWidget *menu);
-GtkWidget* create_sub_menu (GtkWidget *bar, char *label, GtkAccelGroup *accel);
-GtkWidget* create_menu_in_menu (GtkWidget *menu, gchar *label, GtkAccelGroup *accel);
-GtkWidget* create_menu_item (GtkWidget *menu, gchar *label, GtkAccelGroup *accel,
+GtkWidget* create_sub_menu(GtkWidget *bar, const char *label, GtkAccelGroup *accel);
+GtkWidget* create_menu_in_menu(GtkWidget *menu, const char *label, GtkAccelGroup *accel);
+GtkWidget* create_menu_item(GtkWidget *menu, const char *label, GtkAccelGroup *accel,
GtkSignalFunc func, GtkObject *window, int id, const char* data);
-GtkWidget* create_pixmap_menu_item (GtkWidget *menu, gchar *label, gchar **pixmap, GtkAccelGroup *accel,
+GtkWidget* create_pixmap_menu_item(GtkWidget *menu, const char *label, const char **pixmap, GtkAccelGroup *accel,
GtkSignalFunc func, GtkObject *window, int id, const char* data);
-GtkWidget* create_check_menu_item (GtkWidget *menu, gchar *label, GtkAccelGroup *menu_accel,
+GtkWidget* create_check_menu_item(GtkWidget *menu, const char *label, GtkAccelGroup *menu_accel,
GtkSignalFunc func, GtkObject *window, int id, const char* data);
-GtkWidget* create_radio_menu_item (GtkWidget *menu, GtkWidget *last, gchar *label,
+GtkWidget* create_radio_menu_item(GtkWidget *menu, GtkWidget *last, const char *label,
GtkAccelGroup *menu_accel, GtkSignalFunc func,
GtkObject *window, int id, const char* data);
-GtkWidget* create_radio_menu_pixmap (GtkWidget *menu, GtkWidget *last, gchar *filename,
+GtkWidget* create_radio_menu_pixmap(GtkWidget *menu, GtkWidget *last, const char *filename,
GtkAccelGroup *menu_accel, GtkSignalFunc func,
GtkObject *window, int id, const char* data);
diff --git a/linux/gtktools.cpp b/linux/gtktools.cpp
index d285ce5..070fbb5 100644
--- a/linux/gtktools.cpp
+++ b/linux/gtktools.cpp
@@ -4,14 +4,13 @@
#include <gtk/gtk.h>
#include "gtktools.h"
-GtkWidget* new_pixmap (GtkWidget *widget, char **data)
+GtkWidget* new_pixmap(GtkWidget *widget, const char **data)
{
GdkPixmap *gdkpixmap;
GdkBitmap *mask;
GtkWidget *pixmap;
- gdkpixmap = gdk_pixmap_create_from_xpm_d (widget->window, &mask,
- &widget->style->bg[GTK_STATE_NORMAL], data);
+ gdkpixmap = gdk_pixmap_create_from_xpm_d(widget->window, &mask, &widget->style->bg[GTK_STATE_NORMAL], (gchar**)data);
pixmap = gtk_pixmap_new (gdkpixmap, mask);
gdk_pixmap_unref (gdkpixmap);
@@ -20,7 +19,7 @@ GtkWidget* new_pixmap (GtkWidget *widget, char **data)
return pixmap;
}
-GtkWidget* clist_title_with_arrow (GtkWidget* clist, char col, char* label_text)
+GtkWidget* clist_title_with_arrow(GtkWidget* clist, char col, const char* label_text)
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
GtkWidget *arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
@@ -32,6 +31,7 @@ GtkWidget* clist_title_with_arrow (GtkWidget* clist, char col, char* label_text)
gtk_widget_show (hbox);
gtk_clist_set_column_widget (GTK_CLIST (clist), col, hbox);
+
return arrow;
}
diff --git a/linux/gtktools.h b/linux/gtktools.h
index e524500..09c4a74 100644
--- a/linux/gtktools.h
+++ b/linux/gtktools.h
@@ -2,8 +2,8 @@
#ifndef _GTKTOOLS_H_
#define _GTKTOOLS_H_
-GtkWidget* new_pixmap (GtkWidget *widget, char **data);
-GtkWidget* clist_title_with_arrow (GtkWidget* clist, char col, char* label_text);
+GtkWidget* new_pixmap(GtkWidget* widget, const char** data);
+GtkWidget* clist_title_with_arrow(GtkWidget* clist, char col, const char* label_text);
void set_notebook_tab (GtkWidget *notebook, gint page_num, GtkWidget *widget);
void set_button_pixmap (GtkWidget* widget, float* color);
void set_button_pixmap2 (GtkWidget* widget, unsigned char* color);
diff --git a/linux/main.cpp b/linux/main.cpp
index c0c8a74..3f4de0c 100644
--- a/linux/main.cpp
+++ b/linux/main.cpp
@@ -52,7 +52,6 @@ static gint main_quit (GtkWidget *widget, GdkEvent* event, gpointer data);
// =============================================================================
// Static functions
-// try to find the path of the executable
static void init_paths (char *argv0)
{
char temppath[PATH_MAX];
@@ -74,9 +73,6 @@ static void init_paths (char *argv0)
endpwent();
}
- if (home == NULL)
- home = ".";
-
strcpy (temppath, argv0);
if (!strrchr(temppath, '/'))
{
@@ -96,8 +92,11 @@ static void init_paths (char *argv0)
if (*path == '~')
{
+ if (home)
strcpy(temppath, home);
- ++path;
+ else
+ strcpy(temppath, ".");
+ path++;
}
if (last > (path+1))
@@ -109,7 +108,7 @@ static void init_paths (char *argv0)
strcat (temppath, argv0);
if (access(temppath, X_OK) == 0 )
- ++found;
+ found++;
path = last+1;
} while (*last && !found);
@@ -180,6 +179,61 @@ void OnCommand(GtkWidget* widget, gpointer data)
project->HandleCommand(LC_TOOLBAR_SNAPMENU, 5);
} break;
+ case ID_SNAP_X:
+ {
+ project->HandleCommand(LC_TOOLBAR_SNAPMENU, 0);
+ } break;
+
+ case ID_SNAP_Y:
+ {
+ project->HandleCommand(LC_TOOLBAR_SNAPMENU, 1);
+ } break;
+
+ case ID_SNAP_Z:
+ {
+ project->HandleCommand(LC_TOOLBAR_SNAPMENU, 2);
+ } break;
+
+ case ID_SNAP_ALL:
+ {
+ project->HandleCommand(LC_TOOLBAR_SNAPMENU, 3);
+ } break;
+
+ case ID_SNAP_NONE:
+ {
+ project->HandleCommand(LC_TOOLBAR_SNAPMENU, 4);
+ } break;
+
+ case ID_SNAP_ON:
+ {
+ project->HandleCommand(LC_TOOLBAR_SNAPMENU, 6);
+ } break;
+
+ case ID_LOCK_X:
+ {
+ project->HandleCommand(LC_TOOLBAR_LOCKMENU, 0);
+ } break;
+
+ case ID_LOCK_Y:
+ {
+ project->HandleCommand(LC_TOOLBAR_LOCKMENU, 1);
+ } break;
+
+ case ID_LOCK_Z:
+ {
+ project->HandleCommand(LC_TOOLBAR_LOCKMENU, 2);
+ } break;
+
+ case ID_LOCK_NONE:
+ {
+ project->HandleCommand(LC_TOOLBAR_LOCKMENU, 3);
+ } break;
+
+ case ID_LOCK_ON:
+ {
+ project->HandleCommand(LC_TOOLBAR_LOCKMENU, 4);
+ } break;
+
case ID_VIEW_CREATE:
{
GtkWidget *wnd, *w, *frame;
@@ -328,6 +382,16 @@ static gint key_press_event(GtkWidget* widget, GdkEventKey* event, gpointer data
}
}
+ if ((code >= '0') && (code <= '9') && ((event->state & GDK_CONTROL_MASK) == 0))
+ {
+ if (event->state & GDK_SHIFT_MASK)
+ lcGetActiveProject()->HandleCommand((LC_COMMANDS)(LC_EDIT_MOVEZ_SNAP_0 + code - '0'), 0);
+ else
+ lcGetActiveProject()->HandleCommand((LC_COMMANDS)(LC_EDIT_MOVEXY_SNAP_0 + code - '0'), 0);
+
+ return TRUE;
+ }
+
if (code != 0)
{
if (lcGetActiveProject()->OnKeyDown(code, (event->state & GDK_CONTROL_MASK) != 0,
@@ -666,7 +730,7 @@ int main (int argc, char* argv[])
GdkBitmap *mask;
gdkpixmap = gdk_pixmap_create_from_xpm_d (((GtkWidget*)(*main_window))->window, &mask,
- &((GtkWidget*)(*main_window))->style->bg[GTK_STATE_NORMAL], icon32);
+ &((GtkWidget*)(*main_window))->style->bg[GTK_STATE_NORMAL], (gchar**)icon32);
gdk_window_set_icon (((GtkWidget*)(*main_window))->window, NULL, gdkpixmap, mask);
gtk_widget_show (GTK_WIDGET (((GtkWidget*)(*main_window))));
diff --git a/linux/main.h b/linux/main.h
index eb27c4a..6a63cda 100644
--- a/linux/main.h
+++ b/linux/main.h
@@ -65,6 +65,15 @@ void OnCommandDirect(GtkWidget *w, gpointer data);
#define ID_SNAP_X 131
#define ID_SNAP_Y 132
#define ID_SNAP_Z 133
+#define ID_SNAP_ALL 134
+#define ID_SNAP_NONE 135
+#define ID_SNAP_ON 136
+
+#define ID_LOCK_X 140
+#define ID_LOCK_Y 141
+#define ID_LOCK_Z 142
+#define ID_LOCK_NONE 143
+#define ID_LOCK_ON 144
#endif
diff --git a/linux/menu.cpp b/linux/menu.cpp
index 8d48354..78459fc 100644
--- a/linux/menu.cpp
+++ b/linux/menu.cpp
@@ -67,8 +67,6 @@ void create_main_menu (GtkObject *window, GtkWidget *vbox)
window, LC_FILE_PROPERTIES, "menu_file_properties");
create_menu_item (menu, "Pieces _Library Manager...", accel, GTK_SIGNAL_FUNC (OnCommandDirect),
window, LC_FILE_LIBRARY, "menu_file_library");
- create_menu_item (menu, "Terrain _Editor...", accel, GTK_SIGNAL_FUNC (OnCommandDirect),
- window, LC_FILE_TERRAIN, "menu_file_terrain");
menu_separator (menu);
BaseMenuItem base;
@@ -295,3 +293,84 @@ void create_main_menu (GtkObject *window, GtkWidget *vbox)
item = GTK_WIDGET (gtk_object_get_data (window, "menu_piece_group_add"));
gtk_widget_add_accelerator (item, "activate", accel, 'D', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
}
+
+GtkWidget* create_snap_menu()
+{
+ GtkWidget* menu;
+ GtkWidget* menu_item;
+
+ menu = gtk_menu_new();
+
+ menu_item = gtk_check_menu_item_new_with_mnemonic("Snap _X");
+ gtk_object_set_data(GTK_OBJECT(menu), "snap_x", menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_SNAP_X));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_check_menu_item_new_with_mnemonic("Snap _Y");
+ gtk_object_set_data(GTK_OBJECT(menu), "snap_y", menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_SNAP_Y));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_check_menu_item_new_with_mnemonic("Snap _Z");
+ gtk_object_set_data(GTK_OBJECT(menu), "snap_z", menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_SNAP_Z));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_menu_item_new_with_mnemonic("Snap _None");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_SNAP_NONE));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_menu_item_new_with_mnemonic("Snap _All");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_SNAP_ALL));
+ gtk_widget_show(menu_item);
+
+ return menu;
+}
+
+GtkWidget* create_lock_menu()
+{
+ GtkWidget* menu;
+ GtkWidget* menu_item;
+
+ menu = gtk_menu_new();
+
+ menu_item = gtk_check_menu_item_new_with_mnemonic("Lock _X");
+ gtk_object_set_data(GTK_OBJECT(menu), "lock_x", menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_LOCK_X));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_check_menu_item_new_with_mnemonic("Lock _Y");
+ gtk_object_set_data(GTK_OBJECT(menu), "lock_y", menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_LOCK_Y));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_check_menu_item_new_with_mnemonic("Lock _Z");
+ gtk_object_set_data(GTK_OBJECT(menu), "lock_z", menu_item);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_LOCK_Z));
+ gtk_widget_show(menu_item);
+
+ menu_item = gtk_menu_item_new_with_mnemonic("Unlock All");
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
+ gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(OnCommand),
+ GINT_TO_POINTER(ID_LOCK_NONE));
+ gtk_widget_show(menu_item);
+
+ return menu;
+}
+
diff --git a/linux/pixmaps/ac-brick.xpm b/linux/pixmaps/ac-brick.xpm
index f56ac14..b034104 100644
--- a/linux/pixmaps/ac-brick.xpm
+++ b/linux/pixmaps/ac-brick.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_brick[] = {
+static const char*ac_brick[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c #00007f",
diff --git a/linux/pixmaps/ac-cam.xpm b/linux/pixmaps/ac-cam.xpm
index 00516b9..cfb6913 100644
--- a/linux/pixmaps/ac-cam.xpm
+++ b/linux/pixmaps/ac-cam.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * ac_cam[] = {
+static const char* ac_cam[] = {
"16 15 6 1",
". c None",
"+ c #7F7F7F",
diff --git a/linux/pixmaps/ac-erase.xpm b/linux/pixmaps/ac-erase.xpm
index afce83f..650f0e4 100644
--- a/linux/pixmaps/ac-erase.xpm
+++ b/linux/pixmaps/ac-erase.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_erase[] = {
+static const char*ac_erase[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-light.xpm b/linux/pixmaps/ac-light.xpm
index d3aeb7e..388b959 100644
--- a/linux/pixmaps/ac-light.xpm
+++ b/linux/pixmaps/ac-light.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * ac_light[] = {
+static const char* ac_light[] = {
"16 15 5 1",
". c None",
"+ c #000000",
diff --git a/linux/pixmaps/ac-move.xpm b/linux/pixmaps/ac-move.xpm
index df6f9a1..845cca4 100644
--- a/linux/pixmaps/ac-move.xpm
+++ b/linux/pixmaps/ac-move.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_move[] = {
+static const char*ac_move[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-next.xpm b/linux/pixmaps/ac-next.xpm
index e1bb7a0..4f9d417 100644
--- a/linux/pixmaps/ac-next.xpm
+++ b/linux/pixmaps/ac-next.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_next[] = {
+static const char*ac_next[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-paint.xpm b/linux/pixmaps/ac-paint.xpm
index 416542d..ba511da 100644
--- a/linux/pixmaps/ac-paint.xpm
+++ b/linux/pixmaps/ac-paint.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_paint[] = {
+static const char*ac_paint[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-pan.xpm b/linux/pixmaps/ac-pan.xpm
index 1b312c7..ce88b77 100644
--- a/linux/pixmaps/ac-pan.xpm
+++ b/linux/pixmaps/ac-pan.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_pan[] = {
+static const char*ac_pan[] = {
"16 15 5 1",
". c None",
"+ c #000000",
diff --git a/linux/pixmaps/ac-prev.xpm b/linux/pixmaps/ac-prev.xpm
index 0e8b3aa..1bfcdd3 100644
--- a/linux/pixmaps/ac-prev.xpm
+++ b/linux/pixmaps/ac-prev.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_prev[] = {
+static const char*ac_prev[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-roll.xpm b/linux/pixmaps/ac-roll.xpm
index ab2dc78..c61ff1a 100644
--- a/linux/pixmaps/ac-roll.xpm
+++ b/linux/pixmaps/ac-roll.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_roll[] = {
+static const char*ac_roll[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-rot.xpm b/linux/pixmaps/ac-rot.xpm
index e02a276..360f69c 100644
--- a/linux/pixmaps/ac-rot.xpm
+++ b/linux/pixmaps/ac-rot.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_rot[] = {
+static const char*ac_rot[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-rotv.xpm b/linux/pixmaps/ac-rotv.xpm
index 16ef97f..94b441d 100644
--- a/linux/pixmaps/ac-rotv.xpm
+++ b/linux/pixmaps/ac-rotv.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_rotv[] = {
+static const char*ac_rotv[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-sel.xpm b/linux/pixmaps/ac-sel.xpm
index 5a0d157..fef7ec5 100644
--- a/linux/pixmaps/ac-sel.xpm
+++ b/linux/pixmaps/ac-sel.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_sel[] = {
+static const char*ac_sel[] = {
/* columns rows colors chars-per-pixel */
"16 15 2 1",
" c Gray0",
diff --git a/linux/pixmaps/ac-spot.xpm b/linux/pixmaps/ac-spot.xpm
index cc96760..4ad9388 100644
--- a/linux/pixmaps/ac-spot.xpm
+++ b/linux/pixmaps/ac-spot.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * ac_spot[] = {
+static const char* ac_spot[] = {
"16 15 6 1",
". c None",
"+ c #000000",
diff --git a/linux/pixmaps/ac-zoom.xpm b/linux/pixmaps/ac-zoom.xpm
index 86d5ba7..b5dc0cc 100644
--- a/linux/pixmaps/ac-zoom.xpm
+++ b/linux/pixmaps/ac-zoom.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_zoom[] = {
+static const char*ac_zoom[] = {
"16 15 7 1",
". c None",
"+ c #00007F",
diff --git a/linux/pixmaps/ac-zoome.xpm b/linux/pixmaps/ac-zoome.xpm
index e7a0b4c..60833fb 100644
--- a/linux/pixmaps/ac-zoome.xpm
+++ b/linux/pixmaps/ac-zoome.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_zoome[] = {
+static const char*ac_zoome[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c #00007f",
diff --git a/linux/pixmaps/ac-zoomr.xpm b/linux/pixmaps/ac-zoomr.xpm
index bbbb268..8d6188c 100644
--- a/linux/pixmaps/ac-zoomr.xpm
+++ b/linux/pixmaps/ac-zoomr.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *ac_zoomr[] = {
+static const char*ac_zoomr[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c Gray0",
diff --git a/linux/pixmaps/an-anim.xpm b/linux/pixmaps/an-anim.xpm
index 77003b6..04b21f2 100644
--- a/linux/pixmaps/an-anim.xpm
+++ b/linux/pixmaps/an-anim.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * an_anim[] = {
+static const char* an_anim[] = {
"16 15 5 1",
". c #000000",
"+ c #7F7F7F",
diff --git a/linux/pixmaps/an-first.xpm b/linux/pixmaps/an-first.xpm
index 50be91d..d27c819 100644
--- a/linux/pixmaps/an-first.xpm
+++ b/linux/pixmaps/an-first.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_first[] = {
+static const char*an_first[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c #00007f",
diff --git a/linux/pixmaps/an-key.xpm b/linux/pixmaps/an-key.xpm
index 67ea35c..546c269 100644
--- a/linux/pixmaps/an-key.xpm
+++ b/linux/pixmaps/an-key.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_key[] = {
+static const char*an_key[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c Gray0",
diff --git a/linux/pixmaps/an-last.xpm b/linux/pixmaps/an-last.xpm
index d603cca..14ffa05 100644
--- a/linux/pixmaps/an-last.xpm
+++ b/linux/pixmaps/an-last.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_last[] = {
+static const char*an_last[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c #00007f",
diff --git a/linux/pixmaps/an-next.xpm b/linux/pixmaps/an-next.xpm
index 93bbbf8..891a24e 100644
--- a/linux/pixmaps/an-next.xpm
+++ b/linux/pixmaps/an-next.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_next[] = {
+static const char*an_next[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c #00007f",
diff --git a/linux/pixmaps/an-play.xpm b/linux/pixmaps/an-play.xpm
index e07663c..f1f0aad 100644
--- a/linux/pixmaps/an-play.xpm
+++ b/linux/pixmaps/an-play.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_play[] = {
+static const char*an_play[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c #00007f",
diff --git a/linux/pixmaps/an-prev.xpm b/linux/pixmaps/an-prev.xpm
index 01e536d..b0ef885 100644
--- a/linux/pixmaps/an-prev.xpm
+++ b/linux/pixmaps/an-prev.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_prev[] = {
+static const char*an_prev[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c #00007f",
diff --git a/linux/pixmaps/an-stop.xpm b/linux/pixmaps/an-stop.xpm
index a15274b..a70eb48 100644
--- a/linux/pixmaps/an-stop.xpm
+++ b/linux/pixmaps/an-stop.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *an_stop[] = {
+static const char*an_stop[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c #00007f",
diff --git a/linux/pixmaps/cr_brick.xpm b/linux/pixmaps/cr_brick.xpm
index 78b9a0c..2595cf2 100644
--- a/linux/pixmaps/cr_brick.xpm
+++ b/linux/pixmaps/cr_brick.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_brick[] = {
+static const char* cr_brick[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_cam.xpm b/linux/pixmaps/cr_cam.xpm
index 87c27bf..c413f1e 100644
--- a/linux/pixmaps/cr_cam.xpm
+++ b/linux/pixmaps/cr_cam.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_cam[] = {
+static const char* cr_cam[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_erase.xpm b/linux/pixmaps/cr_erase.xpm
index b801260..ad34e45 100644
--- a/linux/pixmaps/cr_erase.xpm
+++ b/linux/pixmaps/cr_erase.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_erase[] = {
+static const char* cr_erase[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_light.xpm b/linux/pixmaps/cr_light.xpm
index 563cfb5..7ce3039 100644
--- a/linux/pixmaps/cr_light.xpm
+++ b/linux/pixmaps/cr_light.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_light[] = {
+static const char* cr_light[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_move.xpm b/linux/pixmaps/cr_move.xpm
index a5d5b3f..e9cf1b0 100644
--- a/linux/pixmaps/cr_move.xpm
+++ b/linux/pixmaps/cr_move.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_move[] = {
+static const char* cr_move[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_paint.xpm b/linux/pixmaps/cr_paint.xpm
index 51177ff..16190d3 100644
--- a/linux/pixmaps/cr_paint.xpm
+++ b/linux/pixmaps/cr_paint.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_paint[] = {
+static const char* cr_paint[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_pan.xpm b/linux/pixmaps/cr_pan.xpm
index a640dad..94763e0 100644
--- a/linux/pixmaps/cr_pan.xpm
+++ b/linux/pixmaps/cr_pan.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_pan[] = {
+static const char* cr_pan[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_roll.xpm b/linux/pixmaps/cr_roll.xpm
index 279bd53..1b5e340 100644
--- a/linux/pixmaps/cr_roll.xpm
+++ b/linux/pixmaps/cr_roll.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_roll[] = {
+static const char* cr_roll[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_rot.xpm b/linux/pixmaps/cr_rot.xpm
index 8dbbcc6..bca82a2 100644
--- a/linux/pixmaps/cr_rot.xpm
+++ b/linux/pixmaps/cr_rot.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_rot[] = {
+static const char* cr_rot[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_rotv.xpm b/linux/pixmaps/cr_rotv.xpm
index 9ebea8a..b92b0a0 100644
--- a/linux/pixmaps/cr_rotv.xpm
+++ b/linux/pixmaps/cr_rotv.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_rotv[] = {
+static const char* cr_rotv[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_sel.xpm b/linux/pixmaps/cr_sel.xpm
index 5bb7885..cb0e27c 100644
--- a/linux/pixmaps/cr_sel.xpm
+++ b/linux/pixmaps/cr_sel.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_sel[] = {
+static const char* cr_sel[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_selm.xpm b/linux/pixmaps/cr_selm.xpm
index 331db8b..7488ea9 100644
--- a/linux/pixmaps/cr_selm.xpm
+++ b/linux/pixmaps/cr_selm.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_selm[] = {
+static const char* cr_selm[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_spot.xpm b/linux/pixmaps/cr_spot.xpm
index 72b445d..1301227 100644
--- a/linux/pixmaps/cr_spot.xpm
+++ b/linux/pixmaps/cr_spot.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_spot[] = {
+static const char* cr_spot[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_zoom.xpm b/linux/pixmaps/cr_zoom.xpm
index 07b4038..5820aed 100644
--- a/linux/pixmaps/cr_zoom.xpm
+++ b/linux/pixmaps/cr_zoom.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_zoom[] = {
+static const char* cr_zoom[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/cr_zoomr.xpm b/linux/pixmaps/cr_zoomr.xpm
index 6da8c8c..7e417ed 100644
--- a/linux/pixmaps/cr_zoomr.xpm
+++ b/linux/pixmaps/cr_zoomr.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *cr_zoomr[] = {
+static const char* cr_zoomr[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c None",
diff --git a/linux/pixmaps/icon32.xpm b/linux/pixmaps/icon32.xpm
index 230ca60..d0ea2ea 100644
--- a/linux/pixmaps/icon32.xpm
+++ b/linux/pixmaps/icon32.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *icon32[] = {
+static const char* icon32[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c Gray0",
diff --git a/linux/pixmaps/info.xpm b/linux/pixmaps/info.xpm
index d37937d..8d26786 100644
--- a/linux/pixmaps/info.xpm
+++ b/linux/pixmaps/info.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *info[] = {
+static const char* info[] = {
/* width height ncolors chars_per_pixel */
"16 15 4 1",
/* colors */
diff --git a/linux/pixmaps/photo.xpm b/linux/pixmaps/photo.xpm
index 9ae4b91..30dbbbf 100644
--- a/linux/pixmaps/photo.xpm
+++ b/linux/pixmaps/photo.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *photo[] = {
+static const char* photo[] = {
/* width height ncolors chars_per_pixel */
"16 15 6 1",
/* colors */
diff --git a/linux/pixmaps/pi-acces.xpm b/linux/pixmaps/pi-acces.xpm
index bf4792a..db31015 100644
--- a/linux/pixmaps/pi-acces.xpm
+++ b/linux/pixmaps/pi-acces.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_acces[] = {
+static const char* pi_acces[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-brick.xpm b/linux/pixmaps/pi-brick.xpm
index 1690760..e5a4267 100644
--- a/linux/pixmaps/pi-brick.xpm
+++ b/linux/pixmaps/pi-brick.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_brick[] = {
+static const char* pi_brick[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-extra.xpm b/linux/pixmaps/pi-extra.xpm
index 5702389..3b0e220 100644
--- a/linux/pixmaps/pi-extra.xpm
+++ b/linux/pixmaps/pi-extra.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_extra[] = {
+static const char* pi_extra[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-misc.xpm b/linux/pixmaps/pi-misc.xpm
index 2e5d5e0..4450f98 100644
--- a/linux/pixmaps/pi-misc.xpm
+++ b/linux/pixmaps/pi-misc.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_misc[] = {
+static const char* pi_misc[] = {
/* columns rows colors chars-per-pixel */
"16 15 2 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-plate.xpm b/linux/pixmaps/pi-plate.xpm
index c253307..6a5d564 100644
--- a/linux/pixmaps/pi-plate.xpm
+++ b/linux/pixmaps/pi-plate.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_plate[] = {
+static const char* pi_plate[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-slope.xpm b/linux/pixmaps/pi-slope.xpm
index a2d9cdf..1a043b3 100644
--- a/linux/pixmaps/pi-slope.xpm
+++ b/linux/pixmaps/pi-slope.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_slope[] = {
+static const char* pi_slope[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-space.xpm b/linux/pixmaps/pi-space.xpm
index d5c69b9..b338d07 100644
--- a/linux/pixmaps/pi-space.xpm
+++ b/linux/pixmaps/pi-space.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_space[] = {
+static const char* pi_space[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-tech.xpm b/linux/pixmaps/pi-tech.xpm
index 0c1c80a..ea0dfa9 100644
--- a/linux/pixmaps/pi-tech.xpm
+++ b/linux/pixmaps/pi-tech.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_tech[] = {
+static const char* pi_tech[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-tile.xpm b/linux/pixmaps/pi-tile.xpm
index f3421f4..7b8746b 100644
--- a/linux/pixmaps/pi-tile.xpm
+++ b/linux/pixmaps/pi-tile.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_tile[] = {
+static const char* pi_tile[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/pi-train.xpm b/linux/pixmaps/pi-train.xpm
index a0037af..ae3a98c 100644
--- a/linux/pixmaps/pi-train.xpm
+++ b/linux/pixmaps/pi-train.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *pi_train[] = {
+static const char* pi_train[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/st-about.xpm b/linux/pixmaps/st-about.xpm
index e0dd59e..fa2060f 100644
--- a/linux/pixmaps/st-about.xpm
+++ b/linux/pixmaps/st-about.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_about[] = {
+static const char*st_about[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/st-bg.xpm b/linux/pixmaps/st-bg.xpm
index 0843ac0..31362e9 100644
--- a/linux/pixmaps/st-bg.xpm
+++ b/linux/pixmaps/st-bg.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * st_bg[] = {
+static const char* st_bg[] = {
"16 15 5 1",
". c None",
"+ c #000000",
diff --git a/linux/pixmaps/st-copy.xpm b/linux/pixmaps/st-copy.xpm
index 4a1bd19..6dfb848 100644
--- a/linux/pixmaps/st-copy.xpm
+++ b/linux/pixmaps/st-copy.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_copy[] = {
+static const char*st_copy[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/st-cut.xpm b/linux/pixmaps/st-cut.xpm
index eace7c9..b4be3c3 100644
--- a/linux/pixmaps/st-cut.xpm
+++ b/linux/pixmaps/st-cut.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_cut[] = {
+static const char*st_cut[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/st-fast.xpm b/linux/pixmaps/st-fast.xpm
index 6c21876..dce93c5 100644
--- a/linux/pixmaps/st-fast.xpm
+++ b/linux/pixmaps/st-fast.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * st_fast[] = {
+static const char* st_fast[] = {
"16 15 3 1",
". c None",
"+ c #7F7F7F",
diff --git a/linux/pixmaps/st-help.xpm b/linux/pixmaps/st-help.xpm
index d1396ce..ba99d46 100644
--- a/linux/pixmaps/st-help.xpm
+++ b/linux/pixmaps/st-help.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_help[] = {
+static const char*st_help[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/st-lock.xpm b/linux/pixmaps/st-lock.xpm
new file mode 100755
index 0000000..4bff423
--- /dev/null
+++ b/linux/pixmaps/st-lock.xpm
@@ -0,0 +1,34 @@
+/* XPM */
+static const char* st_lock[] = {
+"16 15 16 1",
+" c #000000",
+". c #800000",
+"+ c #008000",
+"@ c #808000",
+"# c #000080",
+"$ c #800080",
+"% c #008080",
+"& c #C0C0C0",
+"* c #808080",
+"= c #FF0000",
+"- c #00FF00",
+"; c #FFFF00",
+"> c #0000FF",
+", c None",
+"' c #00FFFF",
+") c #FFFFFF",
+",,****,,,,,,*,,,",
+",** *,,,,,*,,,",
+",* &&* ,,,,,*,,,",
+",* &&* ,,,,,*,,,",
+"******* ********",
+"* ,,,,*,,,",
+"******* ,,,,*,,,",
+"* ,,,,*,,,",
+"******* ,,,,*,,,",
+", ,,,,,*,,,",
+",,,,*,,,,,,,*,,,",
+",,,,*,,,,,,,*,,,",
+"****************",
+",,,,*,,,,,,,*,,,",
+",,,,*,,,,,,,*,,,"};
diff --git a/linux/pixmaps/st-new.xpm b/linux/pixmaps/st-new.xpm
index a34f0d2..21d4e84 100644
--- a/linux/pixmaps/st-new.xpm
+++ b/linux/pixmaps/st-new.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_new[] = {
+static const char*st_new[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c Gray0",
diff --git a/linux/pixmaps/st-open.xpm b/linux/pixmaps/st-open.xpm
index 62424f3..50d9e93 100644
--- a/linux/pixmaps/st-open.xpm
+++ b/linux/pixmaps/st-open.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_open[] = {
+static const char*st_open[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c Gray0",
diff --git a/linux/pixmaps/st-paste.xpm b/linux/pixmaps/st-paste.xpm
index 526f54a..f2c7244 100644
--- a/linux/pixmaps/st-paste.xpm
+++ b/linux/pixmaps/st-paste.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_paste[] = {
+static const char*st_paste[] = {
/* columns rows colors chars-per-pixel */
"16 15 8 1",
" c Gray0",
diff --git a/linux/pixmaps/st-prev.xpm b/linux/pixmaps/st-prev.xpm
index 1487070..d8be122 100644
--- a/linux/pixmaps/st-prev.xpm
+++ b/linux/pixmaps/st-prev.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * st_prev[] = {
+static const char* st_prev[] = {
"16 15 6 1",
"+ c None",
". c #000000",
diff --git a/linux/pixmaps/st-print.xpm b/linux/pixmaps/st-print.xpm
index 3d9c902..a3dc02a 100644
--- a/linux/pixmaps/st-print.xpm
+++ b/linux/pixmaps/st-print.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * st_print[] = {
+static const char* st_print[] = {
"16 15 6 1",
". c None",
"+ c #000000",
diff --git a/linux/pixmaps/st-redo.xpm b/linux/pixmaps/st-redo.xpm
index 0487db7..c1c8234 100644
--- a/linux/pixmaps/st-redo.xpm
+++ b/linux/pixmaps/st-redo.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_redo[] = {
+static const char*st_redo[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c #00007f",
diff --git a/linux/pixmaps/st-save.xpm b/linux/pixmaps/st-save.xpm
index 7f7b00d..862aea8 100644
--- a/linux/pixmaps/st-save.xpm
+++ b/linux/pixmaps/st-save.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_save[] = {
+static const char*st_save[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c Gray0",
diff --git a/linux/pixmaps/st-snap.xpm b/linux/pixmaps/st-snap.xpm
index 42a7495..95414e4 100644
--- a/linux/pixmaps/st-snap.xpm
+++ b/linux/pixmaps/st-snap.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_snap[] = {
+static const char*st_snap[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c Gray0",
diff --git a/linux/pixmaps/st-snapa.xpm b/linux/pixmaps/st-snapa.xpm
index 4be915c..5a691d7 100644
--- a/linux/pixmaps/st-snapa.xpm
+++ b/linux/pixmaps/st-snapa.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * st_snapa[] = {
+static const char* st_snapa[] = {
"16 15 5 1",
". c None",
"+ c #000000",
diff --git a/linux/pixmaps/st-undo.xpm b/linux/pixmaps/st-undo.xpm
index de76087..30fefaf 100644
--- a/linux/pixmaps/st-undo.xpm
+++ b/linux/pixmaps/st-undo.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char *st_undo[] = {
+static const char*st_undo[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c #00007f",
diff --git a/linux/pixmaps/vports01.xpm b/linux/pixmaps/vports01.xpm
index 92c7b93..9e6e25d 100755
--- a/linux/pixmaps/vports01.xpm
+++ b/linux/pixmaps/vports01.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports01[] = {
+static const char* vports01[] = {
"41 31 2 1",
". c #000000",
"+ c #808080",
diff --git a/linux/pixmaps/vports02.xpm b/linux/pixmaps/vports02.xpm
index f62ac43..d78f0d2 100755
--- a/linux/pixmaps/vports02.xpm
+++ b/linux/pixmaps/vports02.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports02[] = {
+static const char* vports02[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports03.xpm b/linux/pixmaps/vports03.xpm
index 17d3062..da35c97 100755
--- a/linux/pixmaps/vports03.xpm
+++ b/linux/pixmaps/vports03.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports03[] = {
+static const char* vports03[] = {
"41 31 3 1",
". c #000000",
"+ c #808080",
diff --git a/linux/pixmaps/vports04.xpm b/linux/pixmaps/vports04.xpm
index 0759397..f723fc0 100755
--- a/linux/pixmaps/vports04.xpm
+++ b/linux/pixmaps/vports04.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports04[] = {
+static const char* vports04[] = {
"41 31 3 1",
". c #000000",
"+ c #808080",
diff --git a/linux/pixmaps/vports05.xpm b/linux/pixmaps/vports05.xpm
index 6f380c3..61493e2 100755
--- a/linux/pixmaps/vports05.xpm
+++ b/linux/pixmaps/vports05.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports05[] = {
+static const char* vports05[] = {
"41 31 3 1",
". c #000000",
"+ c #808080",
diff --git a/linux/pixmaps/vports06.xpm b/linux/pixmaps/vports06.xpm
index 94af19f..bd161a0 100755
--- a/linux/pixmaps/vports06.xpm
+++ b/linux/pixmaps/vports06.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports06[] = {
+static const char* vports06[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports07.xpm b/linux/pixmaps/vports07.xpm
index 292e157..8be7f61 100755
--- a/linux/pixmaps/vports07.xpm
+++ b/linux/pixmaps/vports07.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports07[] = {
+static const char* vports07[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports08.xpm b/linux/pixmaps/vports08.xpm
index d304f88..6b0218c 100755
--- a/linux/pixmaps/vports08.xpm
+++ b/linux/pixmaps/vports08.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports08[] = {
+static const char* vports08[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports09.xpm b/linux/pixmaps/vports09.xpm
index e65369a..a16554e 100755
--- a/linux/pixmaps/vports09.xpm
+++ b/linux/pixmaps/vports09.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports09[] = {
+static const char* vports09[] = {
"41 31 3 1",
". c #000000",
"+ c #808080",
diff --git a/linux/pixmaps/vports10.xpm b/linux/pixmaps/vports10.xpm
index b346695..dd9afc2 100755
--- a/linux/pixmaps/vports10.xpm
+++ b/linux/pixmaps/vports10.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports10[] = {
+static const char* vports10[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports11.xpm b/linux/pixmaps/vports11.xpm
index 05d30ea..4cec015 100755
--- a/linux/pixmaps/vports11.xpm
+++ b/linux/pixmaps/vports11.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports11[] = {
+static const char* vports11[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports12.xpm b/linux/pixmaps/vports12.xpm
index 15885b9..7ad6c38 100755
--- a/linux/pixmaps/vports12.xpm
+++ b/linux/pixmaps/vports12.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports12[] = {
+static const char* vports12[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/pixmaps/vports13.xpm b/linux/pixmaps/vports13.xpm
index b9e72c8..69d7047 100755
--- a/linux/pixmaps/vports13.xpm
+++ b/linux/pixmaps/vports13.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports13[] = {
+static const char* vports13[] = {
"41 31 3 1",
". c #000000",
"+ c #808080",
diff --git a/linux/pixmaps/vports14.xpm b/linux/pixmaps/vports14.xpm
index 1930532..b1d1f91 100755
--- a/linux/pixmaps/vports14.xpm
+++ b/linux/pixmaps/vports14.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vports14[] = {
+static const char* vports14[] = {
"41 31 3 1",
". c #000000",
"+ c #C0C0C0",
diff --git a/linux/system.cpp b/linux/system.cpp
index b4f726e..f4f4ef0 100644
--- a/linux/system.cpp
+++ b/linux/system.cpp
@@ -180,7 +180,7 @@ void SystemUpdateCategories(bool SearchOnly)
{
}
-static void create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, gchar **xpm)
+static void create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, const char **xpm)
{
int height, width, colors;
char pixmap_buffer [(32 * 32)/8];
@@ -241,7 +241,7 @@ void SystemUpdateAction(int new_action, int old_action)
return;
GtkWidget* button;
- char** xpm = NULL;
+ const char** xpm = NULL;
int x, y;
switch (new_action)
@@ -320,7 +320,7 @@ void SystemUpdateRenderingMode(bool bBackground, bool bFast)
return;
ignore_commands = true;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(main_toolbar.fast), bFast);
+ gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(main_toolbar.fast), bFast);
ignore_commands = false;
}
@@ -357,10 +357,28 @@ void SystemUpdateSnap(const unsigned long snap)
return;
ignore_commands = true;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(main_toolbar.angle), (snap & LC_DRAW_SNAP_A) != 0);
+ gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(main_toolbar.angle), (snap & LC_DRAW_SNAP_A) != 0);
ignore_commands = false;
- // TODO: popup menu
+ void* item;
+
+ ignore_commands = true;
+
+ item = gtk_object_get_data(GTK_OBJECT(main_toolbar.snap_menu), "snap_x");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), (snap & LC_DRAW_SNAP_X) ? TRUE : FALSE);
+ item = gtk_object_get_data(GTK_OBJECT(main_toolbar.snap_menu), "snap_y");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), (snap & LC_DRAW_SNAP_Y) ? TRUE : FALSE);
+ item = gtk_object_get_data(GTK_OBJECT(main_toolbar.snap_menu), "snap_z");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), (snap & LC_DRAW_SNAP_Z) ? TRUE : FALSE);
+
+ item = gtk_object_get_data(GTK_OBJECT(main_toolbar.lock_menu), "lock_x");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), (snap & LC_DRAW_LOCK_X) ? TRUE : FALSE);
+ item = gtk_object_get_data(GTK_OBJECT(main_toolbar.lock_menu), "lock_y");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), (snap & LC_DRAW_LOCK_Y) ? TRUE : FALSE);
+ item = gtk_object_get_data(GTK_OBJECT(main_toolbar.lock_menu), "lock_z");
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), (snap & LC_DRAW_LOCK_Z) ? TRUE : FALSE);
+
+ ignore_commands = false;
}
void SystemUpdateCurrentCamera(Camera* pOld, Camera* pNew, Camera* pCamera)
@@ -610,7 +628,7 @@ void SystemFinish()
}
// FIXME: remove
-int SystemDoMessageBox(char* prompt, int mode)
+int SystemDoMessageBox(const char* prompt, int mode)
{
return msgbox_execute (prompt, "LeoCAD", mode);
}
@@ -619,71 +637,59 @@ bool SystemDoDialog(int mode, void* param)
{
switch (mode)
{
- case LC_DLG_FILE_OPEN_PROJECT: {
+ case LC_DLG_FILE_OPEN_PROJECT:
return openprojectdlg_execute ((char*)param) == LC_OK;
- } break;
- case LC_DLG_FILE_SAVE_PROJECT: {
+ case LC_DLG_FILE_SAVE_PROJECT:
return saveprojectdlg_execute ((char*)param) == LC_OK;
- } break;
- case LC_DLG_FILE_MERGE_PROJECT: {
+ case LC_DLG_FILE_MERGE_PROJECT:
return openprojectdlg_execute ((char*)param) == LC_OK;
- } break;
- case LC_DLG_ABOUT: {
+ case LC_DLG_FILE_OPEN:
+ return openprojectdlg_execute ((char*)param) == LC_OK;
+
+ case LC_DLG_ABOUT:
return aboutdlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_ARRAY: {
+ case LC_DLG_ARRAY:
return arraydlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_HTML: {
+ case LC_DLG_HTML:
return htmldlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_POVRAY: {
+ case LC_DLG_POVRAY:
return povraydlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_WAVEFRONT: {
+ case LC_DLG_WAVEFRONT:
return filedlg_execute("Save File", (char*)param) == LC_OK;
- } break;
- case LC_DLG_PREFERENCES: {
+ case LC_DLG_PREFERENCES:
return preferencesdlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_PICTURE_SAVE: {
+ case LC_DLG_PICTURE_SAVE:
return savepicturedlg_execute (param) == LC_OK;
- } break;
- case LC_DLG_MINIFIG: {
+ case LC_DLG_MINIFIG:
return minifigdlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_PROPERTIES: {
+ case LC_DLG_PROPERTIES:
return propertiesdlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_LIBRARY: {
+ case LC_DLG_LIBRARY:
return librarydlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_SELECTBYNAME: {
- } break;
+ case LC_DLG_SELECTBYNAME:
+ break;
- case LC_DLG_STEPCHOOSE: {
- } break;
+ case LC_DLG_STEPCHOOSE:
+ break;
- case LC_DLG_EDITGROUPS: {
+ case LC_DLG_EDITGROUPS:
return groupeditdlg_execute(param) == LC_OK;
- } break;
- case LC_DLG_GROUP: {
+ case LC_DLG_GROUP:
return groupdlg_execute(param) == LC_OK;
- } break;
}
return false;
@@ -695,16 +701,21 @@ void SystemDoPopupMenu(int nMenu, int x, int y)
void SystemDoWaitCursor(int code)
{
+ GdkWindow* window = ((GtkWidget*)(*main_window))->window;
+
+ if (!GDK_IS_WINDOW(window))
+ return;
+
if (code == 1)
{
GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (((GtkWidget*)(*main_window))->window, cursor);
+ gdk_window_set_cursor(window, cursor);
gdk_cursor_destroy (cursor);
}
else
{
GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR);
- gdk_window_set_cursor (((GtkWidget*)(*main_window))->window, cursor);
+ gdk_window_set_cursor(window, cursor);
gdk_cursor_destroy (cursor);
}
}
diff --git a/linux/toolbar.cpp b/linux/toolbar.cpp
index 3854c3f..30e2f0e 100644
--- a/linux/toolbar.cpp
+++ b/linux/toolbar.cpp
@@ -31,6 +31,9 @@ TOOL_TOOLBAR tool_toolbar;
MAIN_TOOLBAR main_toolbar;
ANIM_TOOLBAR anim_toolbar;
+extern GtkWidget* create_snap_menu();
+extern GtkWidget* create_lock_menu();
+
// =========================================================
void create_toolbars(GtkWidget *window, GtkWidget *vbox)
@@ -67,6 +70,7 @@ void create_toolbars(GtkWidget *window, GtkWidget *vbox)
#include "pixmaps/st-help.xpm"
#include "pixmaps/st-prev.xpm"
#include "pixmaps/st-snap.xpm"
+#include "pixmaps/st-lock.xpm"
#include "pixmaps/st-copy.xpm"
#include "pixmaps/st-new.xpm"
#include "pixmaps/st-print.xpm"
@@ -76,83 +80,122 @@ void create_toolbars(GtkWidget *window, GtkWidget *vbox)
#include "pixmaps/st-redo.xpm"
#include "pixmaps/st-undo.xpm"
- GtkWidget *button;
+ GtkToolItem* item;
+
+ // Main Toolbar
+ main_toolbar.handle_box = gtk_handle_box_new();
+ gtk_box_pack_start(GTK_BOX(vbox), main_toolbar.handle_box, FALSE, FALSE, 0);
+ gtk_widget_show(main_toolbar.handle_box);
+
+ main_toolbar.toolbar = gtk_toolbar_new();
+ gtk_toolbar_set_orientation(GTK_TOOLBAR(main_toolbar.toolbar), GTK_ORIENTATION_HORIZONTAL);
+ gtk_toolbar_set_style(GTK_TOOLBAR(main_toolbar.toolbar), GTK_TOOLBAR_ICONS);
+ gtk_container_add(GTK_CONTAINER(main_toolbar.handle_box), main_toolbar.toolbar);
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_NEW);
+ gtk_tool_item_set_tooltip_text(item, "Create a new project");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_FILE_NEW));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
+ gtk_tool_item_set_tooltip_text(item, "Open an existing project");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_FILE_OPEN));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE);
+ gtk_tool_item_set_tooltip_text(item, "Save the current project");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_FILE_SAVE));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+
+ item = gtk_separator_tool_item_new();
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_UNDO);
+ gtk_tool_item_set_tooltip_text(item, "Undo the last action");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_EDIT_UNDO));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.undo = (GtkWidget*)item;
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_REDO);
+ gtk_tool_item_set_tooltip_text(item, "Redo the last undone action");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_EDIT_REDO));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.redo = (GtkWidget*)item;
+
+ item = gtk_separator_tool_item_new();
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_CUT);
+ gtk_tool_item_set_tooltip_text(item, "Cut the selection");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_EDIT_CUT));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.cut = (GtkWidget*)item;
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_COPY);
+ gtk_tool_item_set_tooltip_text(item, "Copy the selection");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_EDIT_COPY));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.copy = (GtkWidget*)item;
+
+ item = gtk_tool_button_new_from_stock(GTK_STOCK_PASTE);
+ gtk_tool_item_set_tooltip_text(item, "Insert the clipboard contents");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_EDIT_PASTE));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.paste = (GtkWidget*)item;
+
+ item = gtk_separator_tool_item_new();
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+
+ item = gtk_menu_tool_button_new(new_pixmap(window, st_lock), "3D lock");
+ gtk_tool_item_set_tooltip_text(item, "Toggle 3D lock");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommand), GINT_TO_POINTER(ID_LOCK_ON));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.lock = (GtkWidget*)item;
+
+ main_toolbar.lock_menu = create_lock_menu();
+ gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(item), main_toolbar.lock_menu);
+
+ item = gtk_menu_tool_button_new(new_pixmap(window, st_snap), "3D snap");
+ gtk_tool_item_set_tooltip_text(item, "Toggle 3D snap");
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommand), GINT_TO_POINTER(ID_SNAP_ON));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.snap = (GtkWidget*)item;
+
+ main_toolbar.snap_menu = create_snap_menu();
+ gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(item), main_toolbar.snap_menu);
+
+ item = gtk_toggle_tool_button_new();
+ gtk_tool_item_set_tooltip_text(item, "Toggle angle snap");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Angle snap");
+ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(item), new_pixmap(window, st_snapa));
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommand), GINT_TO_POINTER(ID_SNAP_A));
+ gtk_toolbar_insert(GTK_TOOLBAR(main_toolbar.toolbar), item, -1);
+ main_toolbar.angle = (GtkWidget*)item;
+
+ item = gtk_toggle_tool_button_new();
+ gtk_tool_item_set_tooltip_text(item, "Toggle fast rendering");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Fast render");
+ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(item), new_pixmap(window, st_fast));
+ g_signal_connect(item, "clicked", G_CALLBACK(OnCommandDirect), GINT_TO_POINTER(LC_TOOLBAR_FASTRENDER));
+ gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar.toolbar), item, -1);
+ main_toolbar.fast = (GtkWidget*)item;
+
+ gtk_widget_show_all(main_toolbar.handle_box);
+
- // Main Toolbar
- main_toolbar.handle_box = gtk_handle_box_new ();
- gtk_box_pack_start (GTK_BOX (vbox), main_toolbar.handle_box, FALSE, FALSE, 0);
- // if (user_rc.view_main_toolbar)
- gtk_widget_show (main_toolbar.handle_box);
- main_toolbar.toolbar = gtk_toolbar_new ();
- gtk_toolbar_set_orientation(GTK_TOOLBAR(main_toolbar.toolbar), GTK_ORIENTATION_HORIZONTAL);
- gtk_toolbar_set_style(GTK_TOOLBAR(main_toolbar.toolbar), GTK_TOOLBAR_ICONS);
- // gtk_toolbar_set_style (GTK_TOOLBAR (main_toolbar.toolbar), user_rc.toolbar_style);
- gtk_container_add (GTK_CONTAINER (main_toolbar.handle_box), main_toolbar.toolbar);
- gtk_widget_show (main_toolbar.toolbar);
-
- // gtk_toolbar_set_button_relief (GTK_TOOLBAR (main_toolbar.toolbar), GTK_RELIEF_NONE);
- // gtk_toolbar_set_space_style (GTK_TOOLBAR (main_toolbar.toolbar), GTK_TOOLBAR_SPACE_LINE);
- // gtk_toolbar_set_space_size (GTK_TOOLBAR (main_toolbar.toolbar), 10);
-
- gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "New",
- "Create a new project", "", new_pixmap (window, st_new),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_FILE_NEW);
- gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Open",
- "Open an existing project", "", new_pixmap (window, st_open),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_FILE_OPEN);
- gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Save",
- "Save the active project", "", new_pixmap (window, st_save),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_FILE_SAVE);
- button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Print",
- " ", "", new_pixmap (window, st_print), GTK_SIGNAL_FUNC (OnCommand), NULL);
- gtk_widget_set_sensitive (button, FALSE);
- button = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Preview",
- " ", "", new_pixmap (window, st_prev), GTK_SIGNAL_FUNC (OnCommand), NULL);
- gtk_widget_set_sensitive (button, FALSE);
- main_toolbar.cut = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Cut",
- "Cut the selection", "", new_pixmap (window, st_cut),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_EDIT_CUT);
- main_toolbar.copy = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Copy",
- "Copy the selection", "", new_pixmap (window, st_copy),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_EDIT_COPY);
- main_toolbar.paste = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Paste",
- "Insert Clipboard contents", "", new_pixmap (window, st_paste),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_EDIT_PASTE);
- main_toolbar.undo = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Undo",
- "Undo last action", "", new_pixmap (window, st_undo),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_EDIT_UNDO);
- main_toolbar.redo = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Redo",
- "Redo the last undone action", "", new_pixmap (window, st_redo),
- GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_EDIT_REDO);
- main_toolbar.snap = gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Snap",
- "Toggle 3D snap", "", new_pixmap (window, st_snap), GTK_SIGNAL_FUNC (OnCommand), NULL);
- main_toolbar.angle = gtk_toolbar_append_element (GTK_TOOLBAR (main_toolbar.toolbar),
- GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, "Angle", "Toggle angle snap", "",
- new_pixmap (window, st_snapa), GTK_SIGNAL_FUNC (OnCommand), (void*)ID_SNAP_A);
- main_toolbar.fast = gtk_toolbar_append_element (GTK_TOOLBAR (main_toolbar.toolbar),
- GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, "Fast", "Fast rendering", "",
- new_pixmap (window, st_fast), GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_TOOLBAR_FASTRENDER);
- gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "About", "About LeoCAD", "",
- new_pixmap (window, st_about), GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_HELP_ABOUT);
- gtk_toolbar_append_item (GTK_TOOLBAR (main_toolbar.toolbar), "Help", "Help", "",
- new_pixmap (window, st_help), GTK_SIGNAL_FUNC (OnCommand), NULL);
- gtk_widget_set_sensitive (button, FALSE);
+ GtkWidget *button;
// Tools Toolbar
tool_toolbar.handle_box = gtk_handle_box_new ();
gtk_box_pack_start (GTK_BOX (vbox),tool_toolbar. handle_box, FALSE, FALSE, 0);
- // if (user_rc.view_tool_toolbar)
- gtk_widget_show (tool_toolbar.handle_box);
+ gtk_widget_show (tool_toolbar.handle_box);
tool_toolbar.toolbar = gtk_toolbar_new();
gtk_toolbar_set_orientation(GTK_TOOLBAR(tool_toolbar.toolbar), GTK_ORIENTATION_HORIZONTAL);
gtk_toolbar_set_style(GTK_TOOLBAR(tool_toolbar.toolbar), GTK_TOOLBAR_ICONS);
- // gtk_toolbar_set_style (GTK_TOOLBAR (tool_toolbar.toolbar), user_rc.toolbar_style);
gtk_container_add (GTK_CONTAINER (tool_toolbar.handle_box), tool_toolbar.toolbar);
gtk_widget_show (tool_toolbar.toolbar);
- // gtk_toolbar_set_button_relief (GTK_TOOLBAR (tool_toolbar.toolbar), GTK_RELIEF_NONE);
-
tool_toolbar.brick = button = gtk_toolbar_append_element (GTK_TOOLBAR (tool_toolbar.toolbar),
GTK_TOOLBAR_CHILD_RADIOBUTTON, NULL, "Piece", "Insert Piece", "",
new_pixmap (window, ac_brick), GTK_SIGNAL_FUNC (OnCommand), (void*)ID_ACTION_INSERT);
@@ -205,18 +248,14 @@ void create_toolbars(GtkWidget *window, GtkWidget *vbox)
// Animation Toolbar
anim_toolbar.handle_box = gtk_handle_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), anim_toolbar.handle_box, FALSE, FALSE, 0);
- // if (user_rc.view_anim_toolbar)
- gtk_widget_show (anim_toolbar.handle_box);
+ gtk_widget_show (anim_toolbar.handle_box);
anim_toolbar.toolbar = gtk_toolbar_new();
gtk_toolbar_set_orientation(GTK_TOOLBAR(anim_toolbar.toolbar), GTK_ORIENTATION_HORIZONTAL);
gtk_toolbar_set_style(GTK_TOOLBAR(anim_toolbar.toolbar), GTK_TOOLBAR_ICONS);
-// gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), user_rc.toolbar_style);
gtk_container_add (GTK_CONTAINER (anim_toolbar.handle_box), anim_toolbar.toolbar);
gtk_widget_show (anim_toolbar.toolbar);
- // gtk_toolbar_set_button_relief (GTK_TOOLBAR (anim_toolbar.toolbar), GTK_RELIEF_NONE);
-
anim_toolbar.first = gtk_toolbar_append_item (GTK_TOOLBAR (anim_toolbar.toolbar),
"First", "Go to the Start", "", new_pixmap (window, an_first),
GTK_SIGNAL_FUNC (OnCommandDirect), (void*)LC_VIEW_STEP_FIRST);
diff --git a/linux/toolbar.h b/linux/toolbar.h
index 3fa1663..857327d 100644
--- a/linux/toolbar.h
+++ b/linux/toolbar.h
@@ -22,7 +22,10 @@ typedef struct
GtkWidget* paste;
GtkWidget* undo;
GtkWidget* redo;
+ GtkWidget* lock;
+ GtkWidget* lock_menu;
GtkWidget* snap;
+ GtkWidget* snap_menu;
GtkWidget* angle;
GtkWidget* fast;
diff --git a/win/System.cpp b/win/System.cpp
index 652346a..5c310aa 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -1128,7 +1128,7 @@ void SystemSetWindowCaption(char* caption)
AfxSetWindowText(AfxGetMainWnd()->m_hWnd, caption);
}
-int SystemDoMessageBox(char* prompt, int nMode)
+int SystemDoMessageBox(const char* prompt, int nMode)
{
return AfxMessageBox(prompt, nMode);
}