Update of /cvsroot/exult/exult/mapedit In directory sc8-pr-cvs1:/tmp/cvs-serv12904/mapedit Modified Files: Makefile.am compile.cc execbox.cc execbox.h exult_studio.glade objbrowse.cc objbrowse.h shapeedit.cc shapegroup.cc shapegroup.h shapelst.cc studio.cc studio.h u7shp.c Removed Files: dirbrowser.cc dirbrowser.h Log Message: Merged GTK+ 2.x port Index: Makefile.am =================================================================== RCS file: /cvsroot/exult/exult/mapedit/Makefile.am,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- Makefile.am 8 Oct 2002 19:41:19 -0000 1.48 +++ Makefile.am 18 Apr 2003 09:18:06 -0000 1.49 @@ -1,7 +1,7 @@ INCLUDES = -I$(srcdir)/../headers -I$(srcdir)/.. -I$(srcdir)/../shapes \ -I$(srcdir)/../imagewin -I$(srcdir)/../conf \ -I$(srcdir)/../files -I$(srcdir)/../server \ - $(GTK_INCLUDES) $(LIBGLADE_INCLUDES) $(INCDIRS) $(WINDOWING_SYSTEM) $(DEBUG_FLAGS) $(CPPFLAGS) -DEXULT_DATADIR=\"$(EXULT_DATADIR)\" + $(GLADE_INCLUDES) $(INCDIRS) $(WINDOWING_SYSTEM) $(DEBUG_FLAGS) $(CPPFLAGS) -DEXULT_DATADIR=\"$(EXULT_DATADIR)\" if GIMP_PLUGIN GIMP_PLUGINS=u7shp @@ -9,8 +9,6 @@ GIMP_PLUGINS= endif -GTK_LIBS = @GTK_LIBS@ - if BUILD_STUDIO bin_PROGRAMS = exult_studio else @@ -25,8 +23,6 @@ combo.cc \ combo.h \ compile.cc \ - dirbrowser.cc \ - dirbrowser.h \ eggedit.cc \ execbox.h \ execbox.cc \ @@ -60,8 +56,7 @@ ../imagewin/libimagewin.la \ ../shapes/libshapes.la \ ../server/libserver.la \ - -lpng $(GTK_LIBS) $(FREETYPE2_LIBS) $(SYSLIBS) $(x_libraries) \ - $(LIBGLADE_LIBS) + -lpng $(FREETYPE2_LIBS) $(SYSLIBS) $(x_libraries) $(GLADE_LIBS) exult_studio_CFLAGS = $(LIBGLADE_INCLUDES) @@ -70,7 +65,7 @@ mapedit_DATA = exult_studio.glade u7shp$(EXEEXT): u7shp.c - gimptool --build $< + $(GIMPTOOL) --build $< EXTRA_DIST= \ exult_studio.glade \ Index: compile.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/compile.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- compile.cc 3 Nov 2002 17:29:47 -0000 1.3 +++ compile.cc 18 Apr 2003 09:18:06 -0000 1.4 @@ -90,7 +90,7 @@ { compilewin = glade_xml_get_widget( app_xml, "compile_win" ); compile_box = new Exec_box( - GTK_TEXT( + GTK_TEXT_VIEW( glade_xml_get_widget(app_xml, "compile_msgs")), GTK_STATUSBAR( glade_xml_get_widget(app_xml, "compile_status")), Index: execbox.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/execbox.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- execbox.cc 7 Nov 2002 22:25:17 -0000 1.8 +++ execbox.cc 18 Apr 2003 09:18:07 -0000 1.9 @@ -250,7 +250,7 @@ Exec_box::Exec_box ( - GtkText *b, + GtkTextView *b, GtkStatusbar *s, Exec_done_fun dfun, // Called when child exits. gpointer udata // Passed to dfun. @@ -310,9 +310,8 @@ { if (datalen > 0) { - gtk_text_freeze(box); // Looks better this way. - gtk_text_insert(box, NULL, NULL, NULL, data, datalen); - gtk_text_thaw(box); + GtkTextBuffer *buffer = gtk_text_view_get_buffer(box); + gtk_text_buffer_insert_at_cursor(buffer,data,datalen); return; } if (exit_code == 0) // Child is done, so check result. @@ -332,9 +331,8 @@ const char *txt ) { - gtk_text_freeze(box); // Looks better this way. - gtk_text_insert(box, NULL, NULL, NULL, txt, strlen(txt)); - gtk_text_thaw(box); + GtkTextBuffer *buffer = gtk_text_view_get_buffer(box); + gtk_text_buffer_insert_at_cursor(buffer,txt,strlen(txt)); } /* @@ -349,8 +347,8 @@ char *argv[] // Args. 1st is filename, last is 0. ) { - gtk_text_set_point(box, 0); // Clear out old text. - gtk_text_forward_delete(box, gtk_text_get_length(box)); + GtkTextBuffer *buffer = gtk_text_view_get_buffer(box); + gtk_text_buffer_set_text(buffer, "", 0); // Clear out old text if (!executor->exec(file, argv, Exec_callback, this)) return false; return true; Index: execbox.h =================================================================== RCS file: /cvsroot/exult/exult/mapedit/execbox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- execbox.h 7 Nov 2002 21:46:20 -0000 1.5 +++ execbox.h 18 Apr 2003 09:18:07 -0000 1.6 @@ -90,13 +90,13 @@ class Exec_box { Exec_process *executor; // Handles child process. - GtkText *box; // Where we show responses. + GtkTextView *box; // Where we show responses. GtkStatusbar *status; // For showing status. guint status_ctx; // Context for status. Exec_done_fun done_fun; // Called when child has exited. gpointer user_data; // Passed to done_fun. public: - Exec_box(GtkText *b, GtkStatusbar *s, Exec_done_fun dfun = 0, + Exec_box(GtkTextView *b, GtkStatusbar *s, Exec_done_fun dfun = 0, gpointer udata = 0); ~Exec_box(); void show_status(const char *msg); // Set status bar. Index: exult_studio.glade =================================================================== RCS file: /cvsroot/exult/exult/mapedit/exult_studio.glade,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- exult_studio.glade 19 Feb 2003 07:45:17 -0000 1.103 +++ exult_studio.glade 18 Apr 2003 09:18:07 -0000 1.104 @@ -1,12954 +1,14441 @@ -<?xml version="1.0"?> -<GTK-Interface> +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> -<project> - <name>ExultStudio</name> - <program_name>exultstudio</program_name> - <directory></directory> - <source_directory>.</source_directory> - <pixmaps_directory>pixmaps</pixmaps_directory> [...26303 lines suppressed...] - <padding>0</padding> - <expand>False</expand> - <fill>False</fill> + <widget class="GtkStatusbar" id="compile_status"> + <property name="visible">True</property> + <property name="has_resize_grip">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> </child> </widget> - </widget> + </child> </widget> -</GTK-Interface> +</glade-interface> Index: objbrowse.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/objbrowse.cc,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- objbrowse.cc 6 Mar 2003 03:05:27 -0000 1.21 +++ objbrowse.cc 18 Apr 2003 09:18:08 -0000 1.22 @@ -159,7 +159,7 @@ { GtkFileSelection *fsel = GTK_FILE_SELECTION(gtk_widget_get_toplevel( GTK_WIDGET(btn))); - char *fname = gtk_file_selection_get_filename(fsel); + const char *fname = gtk_file_selection_get_filename(fsel); File_sel_okay_fun fun = (File_sel_okay_fun) gtk_object_get_user_data(GTK_OBJECT(fsel)); if (fname && *fname && fun) Index: objbrowse.h =================================================================== RCS file: /cvsroot/exult/exult/mapedit/objbrowse.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- objbrowse.h 6 Mar 2003 03:05:27 -0000 1.22 +++ objbrowse.h 18 Apr 2003 09:18:08 -0000 1.23 @@ -86,7 +86,7 @@ }; GtkWidget *create_controls(int controls); // Virtuals for controls. - virtual void search(char *srch, int dir) + virtual void search(const char *srch, int dir) { } virtual void locate(bool upwards)// Locate terrain on game map. { } @@ -96,7 +96,7 @@ // File-selector utility: // Callback for file-selector 'ok': -typedef void (*File_sel_okay_fun)(char *, gpointer); +typedef void (*File_sel_okay_fun)(const char *, gpointer); GtkFileSelection *Create_file_selection ( const char *title, Index: shapeedit.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/shapeedit.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- shapeedit.cc 19 Feb 2003 07:45:17 -0000 1.27 +++ shapeedit.cc 18 Apr 2003 09:18:08 -0000 1.28 @@ -927,7 +927,7 @@ if (info && // If 'shapes.vga', get name. shnum < 1024) // But only for the first 1024. { - char *nm = get_text_entry("shinfo_name"); + const gchar *nm = get_text_entry("shinfo_name"); if (!nm) nm = ""; char *oldname = get_shape_name(shnum); Index: shapegroup.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/shapegroup.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- shapegroup.cc 6 Mar 2003 03:22:29 -0000 1.27 +++ shapegroup.cc 18 Apr 2003 09:18:08 -0000 1.28 @@ -50,7 +50,7 @@ Shape_group::Shape_group ( - char *nm, // Name. Copied. + const char *nm, // Name. Copied. Shape_group_file *f ) : name(nm), file(f) { @@ -378,13 +378,13 @@ return; GtkCList *clist = GTK_CLIST( glade_xml_get_widget(app_xml, "group_list")); - char *nm = get_text_entry("groups_new_name"); + const char *nm = get_text_entry("groups_new_name"); Shape_group_file *groups = curfile->get_groups(); // Make sure name isn't already there. if (nm && *nm && groups->find(nm) < 0) { groups->add(new Shape_group(nm, groups)); - gtk_clist_append(clist, &nm); + gtk_clist_append(clist, (gchar **)&nm); } set_entry("groups_new_name", ""); } @@ -526,7 +526,7 @@ int row = (int) list->data; Shape_group_file *groups = curfile->get_groups(); Shape_group *grp = groups->get(row); - GladeXML *xml = glade_xml_new(glade_path, "group_window"); + GladeXML *xml = glade_xml_new(glade_path, "group_window", NULL); glade_xml_signal_autoconnect(xml); GtkWidget *grpwin = glade_xml_get_widget(xml, "group_window"); Object_browser *chooser = curfile->create_browser(vgafile,palbuf, grp); Index: shapegroup.h =================================================================== RCS file: /cvsroot/exult/exult/mapedit/shapegroup.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- shapegroup.h 6 Mar 2003 03:05:27 -0000 1.10 +++ shapegroup.h 18 Apr 2003 09:18:09 -0000 1.11 @@ -39,7 +39,7 @@ Shape_group_file *file; // Where this comes from. public: friend class Shape_group_file; - Shape_group(char *nm, Shape_group_file *f); + Shape_group(const char *nm, Shape_group_file *f); ~Shape_group() { } Shape_group_file *get_file() { return file; } Index: shapelst.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/shapelst.cc,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- shapelst.cc 6 Mar 2003 03:05:27 -0000 1.103 +++ shapelst.cc 18 Apr 2003 09:18:09 -0000 1.104 @@ -1465,7 +1465,7 @@ static void font_file_chosen ( - char *fname, + const char *fname, gpointer user_data ) { Index: studio.cc =================================================================== RCS file: /cvsroot/exult/exult/mapedit/studio.cc,v retrieving revision 1.150 retrieving revision 1.151 diff -u -d -r1.150 -r1.151 --- studio.cc 5 Feb 2003 13:55:36 -0000 1.150 +++ studio.cc 18 Apr 2003 09:18:09 -0000 1.151 @@ -50,7 +50,6 @@ #include "shapevga.h" #include "Flex.h" #include "studio.h" -// #include "dirbrowser.h" #include "utils.h" #include "u7drag.h" #include "shapegroup.h" @@ -87,15 +86,35 @@ ComboArchive }; -C_EXPORT void on_filelist_tree_select_row (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gpointer user_data) +typedef struct _FileTreeItem FileTreeItem; +struct _FileTreeItem { - int type = (int)gtk_ctree_node_get_row_data( ctree, node ); - gboolean leaf; + const gchar *label; + ExultFileTypes datatype; + FileTreeItem *children; +}; + +/* columns */ +enum +{ + FOLDER_COLUMN = 0, + FILE_COLUMN, + DATA_COLUMN, + NUM_COLUMNS +}; + + +C_EXPORT void on_filelist_tree_select_row(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data) +{ + int type = -1; char *text; - gtk_ctree_get_node_info( ctree, node, &text, 0, 0, 0, 0, 0, &leaf, 0); + GtkTreeIter iter; + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview)); + + gtk_tree_model_get_iter(model, &iter, path); + gtk_tree_model_get(model, &iter, FILE_COLUMN, &text, DATA_COLUMN, &type,-1); + printf("%s %d\n",text,type); + ExultStudio *studio = ExultStudio::get_instance(); switch(type) { case ShapeArchive: @@ -117,6 +136,7 @@ default: break; } + g_free(text); } C_EXPORT void @@ -476,7 +496,7 @@ strcpy(path,"."); strcat(path, "/exult_studio.glade"); // Load the Glade interface - app_xml = glade_xml_new(path, NULL); + app_xml = glade_xml_new(path, NULL, NULL); app = glade_xml_get_widget( app_xml, "main_window" ); glade_path = g_strdup(path); @@ -704,7 +724,7 @@ void on_choose_new_game_dir ( - char *dir, + const char *dir, gpointer udata // ->studio. ) { @@ -712,7 +732,7 @@ } void ExultStudio::create_new_game ( - char *dir // Directory for new game. + const char *dir // Directory for new game. ) { // Take basename as game name. @@ -794,17 +814,15 @@ * Prompt for a 'new game' directory. */ -void ExultStudio::new_game - ( - ) - { +void ExultStudio::new_game() +{ if (!okay_to_close()) // Okay to close prev. game? return; GtkFileSelection *fsel = Create_file_selection( "Choose new game directory", - on_choose_new_game_dir, this); + on_choose_new_game_dir, this); gtk_widget_show(GTK_WIDGET(fsel)); - } +} /* * Choose game directory. @@ -830,115 +848,16 @@ return; } } -#if 0 - GtkWidget *dirbrowser = xmms_create_dir_browser( - "Select game directory", - cwd, GTK_SELECTION_SINGLE, - on_choose_directory); - gtk_signal_connect(GTK_OBJECT(dirbrowser), "destroy", - GTK_SIGNAL_FUNC(gtk_widget_destroyed), &dirbrowser); - gtk_window_set_transient_for(GTK_WINDOW(dirbrowser), GTK_WINDOW(app)); - gtk_widget_show (dirbrowser); -#else GtkFileSelection *fsel = Create_file_selection( "Select game directory", (File_sel_okay_fun) on_choose_directory, 0L); gtk_file_selection_set_filename(fsel, cwd); gtk_widget_show(GTK_WIDGET(fsel)); -#endif delete [] cwd; // Prevent leakage } -/* - * Add a node to a tree. - */ -static GtkCTreeNode *Create_tree_node - ( - GtkCTree *ctree, - char *fname, // Filename to add. - GtkCTreeNode *parent, // Subtree this is to go under. - GtkCTreeNode *sibling, // Sibling to go after. - gpointer data - ) - { - char *text[1]; - text[0] = fname; - GtkCTreeNode *newnd = gtk_ctree_insert_node(ctree, parent, sibling, - text, 0,0,0,0,0, TRUE, FALSE ); - gtk_ctree_node_set_row_data(ctree, newnd, data); - return newnd; - } -/* - * Add a subtree to a clist using files from the patch or static dirs. - * OR, add files to an existing subtree. - * - * Output: Parent of subtree. - */ -GtkCTreeNode *Create_subtree( GtkCTree *ctree, - GtkCTreeNode *previous, - const char *name, - const char *ext, // Or whole filename. - gpointer data, - GtkCTreeNode *parent = 0 - ) -{ - struct dirent *entry; - GtkCTreeNode *sibling = 0; - char *text[1]; - text[0] = (char *) name; - if (!parent) - parent = gtk_ctree_insert_node( ctree, - 0, - previous, - text, - 0, - 0,0,0,0, - FALSE, - TRUE ); - gtk_ctree_node_set_selectable( ctree, - parent, - FALSE ); - int extlen = strlen(ext); - string spath("<STATIC>"), ppath("<PATCH>"); - spath = get_system_path(spath); - ppath = get_system_path(ppath); - DIR *dir = opendir(ppath.c_str());// Get names from 'patch' first. - if (dir) { - while(entry=readdir(dir)) { - char *fname = entry->d_name; - int flen = strlen(fname); - // Ignore case of extension. - if(!strcmp(fname,".")||!strcmp(fname,"..") || - strcasecmp(fname + flen - extlen, ext) != 0) - continue; - sibling = Create_tree_node(ctree, fname, parent, - sibling, data); - } - closedir(dir); - } - dir = opendir(spath.c_str()); // Now go through 'static'. - if (dir) { - while(entry=readdir(dir)) { - char *fname = entry->d_name; - int flen = strlen(fname); - // Ignore case of extension. - if(!strcmp(fname,".")||!strcmp(fname,"..") || - strcasecmp(fname + flen - extlen, ext) != 0) - continue; - // See if also in 'patch'. - string fullpath(ppath); - fullpath += "/"; - fullpath += fname; - if (U7exists(fullpath)) - continue; - sibling = Create_tree_node(ctree, fname, parent, - sibling, data); - } - closedir(dir); - } - return parent; -} + void ExultStudio::set_game_path(const char *gamepath) { @@ -1008,57 +927,133 @@ connect_to_server(); // Connect to server with 'gamedat'. } +void add_to_tree(GtkTreeStore *model, const char *folderName, const char *files, ExultFileTypes file_type) +{ + struct dirent *entry; + GtkTreeIter iter; + + // First, we add the folder + gtk_tree_store_append(model, &iter, NULL); + gtk_tree_store_set(model, &iter, + FOLDER_COLUMN, folderName, + FILE_COLUMN, NULL, + DATA_COLUMN, -1, + -1); + + // Scan the files which are separated by commas + GtkTreeIter child_iter; + char *startpos = (char *)files; + int adding_children = 1; + do { + char *pattern; + char *commapos = strstr(startpos, ","); + if(commapos==0) { + pattern = strdup(startpos); + adding_children = 0; + } else { + pattern = g_strndup(startpos, commapos-startpos); + startpos = commapos+1; + } + + string spath("<STATIC>"), ppath("<PATCH>"); + spath = get_system_path(spath); + ppath = get_system_path(ppath); + char *ext = strstr(pattern,"*"); + if(!ext) + ext = pattern; + else + ext++; + DIR *dir = opendir(ppath.c_str());// Get names from 'patch' first. + if (dir) { + while(entry=readdir(dir)) { + char *fname = entry->d_name; + int flen = strlen(fname); + // Ignore case of extension. + if(!strcmp(fname,".")||!strcmp(fname,"..") ||strcasecmp(fname + flen - strlen(ext), ext) != 0) + continue; + gtk_tree_store_append (model, &child_iter, &iter); + gtk_tree_store_set (model, &child_iter, + FOLDER_COLUMN, NULL, + FILE_COLUMN, fname, + DATA_COLUMN, file_type, + -1); + + } + closedir(dir); + } + dir = opendir(spath.c_str()); // Now go through 'static'. + if (dir) { + while(entry=readdir(dir)) { + char *fname = entry->d_name; + int flen = strlen(fname); + // Ignore case of extension. + if(!strcmp(fname,".")||!strcmp(fname,"..")||strcasecmp(fname + flen - strlen(ext), ext) != 0) + continue; + // See if also in 'patch'. + string fullpath(ppath); + fullpath += "/"; + fullpath += fname; + if (U7exists(fullpath)) + continue; + gtk_tree_store_append (model, &child_iter, &iter); + gtk_tree_store_set (model, &child_iter, + FOLDER_COLUMN, NULL, + FILE_COLUMN, fname, + DATA_COLUMN, file_type, + -1); + } + closedir(dir); + } + + free(pattern); + } while (adding_children); +} + /* * Set up the file list to the left of the main window. */ -void ExultStudio::setup_file_list - ( - ) - { +void ExultStudio::setup_file_list() { GtkWidget *file_list = glade_xml_get_widget( app_xml, "file_list" ); - gtk_clist_clear( GTK_CLIST( file_list ) ); - - gtk_clist_freeze( GTK_CLIST( file_list ) ); + /* create tree store */ + GtkTreeStore *model = gtk_tree_store_new(NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT); + add_to_tree(model, "Shape Files", "*.vga,*.shp,combos.flx", ShapeArchive); + add_to_tree(model, "Map Files", "u7chunks", ChunkArchive); + add_to_tree(model, "Palette Files", "*.pal,palettes.flx", PaletteFile); - GtkCTreeNode *shapefiles = Create_subtree( GTK_CTREE( file_list ), - 0, - "Shape Files", - ".vga", - (gpointer)ShapeArchive ); - // Put .shps in same subtree. - Create_subtree( GTK_CTREE( file_list ), - 0, - "Shape Files", - ".shp", - (gpointer)ShapeArchive, - shapefiles ); - // And always add combos.flx. - Create_tree_node(GTK_CTREE(file_list), "combos.flx", shapefiles, 0, - (gpointer)ComboArchive ); - - GtkCTreeNode *chunkfiles = Create_subtree( GTK_CTREE( file_list ), - 0, - "Map Files", - "u7chunks", - (gpointer)ChunkArchive ); - GtkCTreeNode *palettefiles = Create_subtree( GTK_CTREE( file_list ), - 0, - "Palette Files", - ".pal", - (gpointer)PaletteFile ); - // Always include main palettes file. - Create_tree_node(GTK_CTREE(file_list), "palettes.flx", palettefiles, 0, - (gpointer)PaletteFile ); #if 0 /* Skip this until we can do something with these files. */ - GtkCTreeNode *flexfiles = Create_subtree( GTK_CTREE( file_list ), - palettefiles, - "FLEX Files", - ".flx", - (gpointer)FlexArchive ); + add_to_tree(model, "FLEX Files", "*.flx", FlexArchive); #endif - gtk_clist_thaw( GTK_CLIST( file_list ) ); + gtk_tree_view_set_model(GTK_TREE_VIEW(file_list), GTK_TREE_MODEL(model)); + g_object_unref(model); + gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(file_list), TRUE); + gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(file_list)), GTK_SELECTION_SINGLE); + + gint col_offset; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + /* column for folder names */ + renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "xalign", 0.0, NULL); + col_offset = gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(file_list), + -1, "Folders", + renderer, "text", + FOLDER_COLUMN, + NULL); + column = gtk_tree_view_get_column(GTK_TREE_VIEW(file_list), col_offset - 1); + gtk_tree_view_column_set_clickable(GTK_TREE_VIEW_COLUMN(column), TRUE); + + /* column for file names */ + col_offset = gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(file_list), + -1, "Files", + renderer, "text", + FILE_COLUMN, + NULL); + column = gtk_tree_view_get_column(GTK_TREE_VIEW(file_list), col_offset - 1); + gtk_tree_view_column_set_clickable(GTK_TREE_VIEW_COLUMN(column), TRUE); + } /* @@ -1315,9 +1310,9 @@ ) { int nshapes = datalen*8; - GtkText *text = GTK_TEXT(glade_xml_get_widget(app_xml, "msg_text")); - gtk_text_set_point(text, 0); // Clear out old text. - gtk_text_forward_delete(text, gtk_text_get_length(text)); + GtkTextView *text = GTK_TEXT_VIEW(glade_xml_get_widget(app_xml, "msg_text")); + GtkTextBuffer *buffer = gtk_text_view_get_buffer(text); + gtk_text_buffer_set_text(buffer, "", 0); // Clear out old text set_visible("msg_win", TRUE); // Show message window. int pos = 0; GtkEditable *ed = GTK_EDITABLE(text); @@ -1334,7 +1329,7 @@ Insert_text(ed, msg, pos); g_free(msg); } - gtk_text_set_point(text, 0); // Scroll back to top. + // FIXME: gtk_text_set_point(text, 0); // Scroll back to top. } @@ -1572,7 +1567,7 @@ GtkWidget *field = glade_xml_get_widget(app_xml, name); if (!field) return -1; - char *txt = gtk_entry_get_text(GTK_ENTRY(field)); + const gchar *txt = gtk_entry_get_text(GTK_ENTRY(field)); if (!txt) return -1; while (*txt == ' ') @@ -1589,7 +1584,7 @@ * Output: ->text, or null if not found. */ -char *ExultStudio::get_text_entry +const gchar *ExultStudio::get_text_entry ( char *name ) @@ -2013,7 +2008,7 @@ ( ) { - char *text = get_text_entry("prefs_image_editor"); + const char *text = get_text_entry("prefs_image_editor"); g_free(image_editor); image_editor = g_strdup(text); config->set("config/estudio/image_editor", image_editor, true); Index: studio.h =================================================================== RCS file: /cvsroot/exult/exult/mapedit/studio.h,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- studio.h 30 Jan 2003 04:16:32 -0000 1.92 +++ studio.h 18 Apr 2003 09:18:09 -0000 1.93 @@ -140,7 +140,7 @@ void set_browser(const char *name, Object_browser *obj); bool has_focus(); // Any of our windows has focus? - void create_new_game(char *dir); + void create_new_game(const char *dir); void new_game(); void choose_game_path(); Object_browser *create_browser(const char *fname); @@ -246,7 +246,7 @@ void set_spin(char *name, int val, bool sensitive = true); void set_spin(char *name, int val, int low, int high); int get_num_entry(char *name); - char *get_text_entry(char *name); + const gchar *get_text_entry(char *name); void set_entry(char *name, int val, bool hex = false, bool sensitive = true); void set_entry(char *name, const char *val, bool sensitive = true); Index: u7shp.c =================================================================== RCS file: /cvsroot/exult/exult/mapedit/u7shp.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- u7shp.c 21 Dec 2001 21:08:55 -0000 1.7 +++ u7shp.c 18 Apr 2003 09:18:09 -0000 1.8 @@ -29,7 +29,7 @@ gint32 image_ID, gint32 drawable_ID, gint32 orig_image_ID); -static GimpRunModeType run_mode; +static GimpRunMode run_mode; static guchar gimp_cmap[768] = { 0x00, 0x00, 0x00, 0xF8, 0xF0, 0xCC, 0xF4, 0xE4, 0xA4, 0xF0, 0xDC, 0x78, 0xEC, 0xD0, 0x50, 0xEC, 0xC8, 0x28, 0xD8, 0xAC, 0x20, 0xC4, 0x94, 0x18, @@ -683,7 +683,7 @@ #endif orientation = gimp_image_get_guide_orientation(image_ID, guide_ID); switch(orientation) { - case GIMP_HORIZONTAL: + case GIMP_ORIENTATION_HORIZONTAL: if(hoty<0) { hoty = gimp_image_get_guide_position(image_ID, guide_ID); #ifdef DEBUG @@ -691,7 +691,7 @@ #endif } break; - case GIMP_VERTICAL: + case GIMP_ORIENTATION_VERTICAL: if(hotx<0) { hotx = gimp_image_get_guide_position(image_ID, guide_ID); #ifdef DEBUG --- dirbrowser.cc DELETED --- --- dirbrowser.h DELETED --- |