Added initial mape code, and added it to the CMake build system

The code is not yet working properly, but it compiles
TODO: autotools build, material colors, Material&Texture overload,
relicensing, maybe algo=script
scancodes-fix
Armin Burgmeier 2009-09-21 00:04:52 -04:00
parent e2c68254a5
commit 2ef403728e
47 changed files with 7824 additions and 29 deletions

View File

@ -37,7 +37,6 @@ set(OC_CLONK_SOURCES
src/C4Include.h
src/C4Prototypes.h
src/C4Version.h
src/C4WinMain.cpp
src/config/C4Config.cpp
src/config/C4Config.h
src/config/C4ConfigShareware.cpp
@ -379,8 +378,56 @@ set(OC_CLONK_SOURCES
src/zlib/gzio.c
src/zlib/zutil.h
)
set(MAPE_SOURCES
src/mape/configfile.c
src/mape/configfile.h
src/mape/diskview.c
src/mape/diskview.h
src/mape/editview.c
src/mape/editview.h
src/mape/fileicon.c
src/mape/fileicon.h
src/mape/forward.h
src/mape/group.cpp
src/mape/group.h
src/mape/header.c
src/mape/header.h
src/mape/iconview.c
src/mape/iconview.h
src/mape/mape.c
src/mape/mapgen.cpp
src/mape/mapgen.h
src/mape/material.cpp
src/mape/material.h
src/mape/mattexview.c
src/mape/mattexview.h
src/mape/preferences.c
src/mape/preferences.h
src/mape/preferencesdialog.c
src/mape/preferencesdialog.h
src/mape/preview.c
src/mape/preview.h
src/mape/random.cpp
src/mape/random.h
src/mape/statusbar.c
src/mape/statusbar.h
src/mape/texture.cpp
src/mape/texture.h
src/mape/window.c
src/mape/window.h
src/mape/icon/c4d.c
src/mape/icon/c4f.c
src/mape/icon/c4g.c
src/mape/icon/c4m.c
src/mape/icon/c4s.c
src/mape/icon/tex.c
src/mape/icon/icons.h
)
mark_as_advanced(OC_CLONK_SOURCES)
mark_as_advanced(OC_SYSTEM_SOURCES)
mark_as_advanced(MAPE_SOURCES)
if(WIN32)
list(APPEND OC_CLONK_SOURCES
@ -437,11 +484,17 @@ if(USE_GTK)
)
endif()
add_executable(clonk WIN32 MACOSX_BUNDLE
add_library(libclonk STATIC
${OC_SYSTEM_SOURCES}
${OC_CLONK_SOURCES}
)
add_executable(clonk WIN32 MACOSX_BUNDLE
src/C4WinMain.cpp
)
target_link_libraries(clonk)
set(OC_CLONK_LIBRARIES libclonk)
source_group("Unsorted" .*)
source_group("Library\\Platform abstraction" src/platform/.*)
source_group("Library\\Utility" src/lib/.*)
@ -457,6 +510,7 @@ source_group("Scripting" src/script/.*)
source_group("Config" src/config/.*)
source_group("Control" src/control/.*)
source_group("Editing" src/editor/.*)
source_group("Mape" src/mape/.*)
add_executable(c4group
src/c4group/c4group_ng.cpp
@ -497,7 +551,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/script
)
set_property(TARGET clonk APPEND PROPERTY COMPILE_DEFINITIONS C4ENGINE GLEW_STATIC)
set_property(TARGET libclonk APPEND PROPERTY COMPILE_DEFINITIONS C4ENGINE GLEW_STATIC)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG)
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(direct.h HAVE_DIRECT_H)
@ -533,6 +587,7 @@ include(CheckFunctionExists)
CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
# User selectable options
option(USE_MAPE "Build Mape" ON)
option(USE_GL "Enable OpenGL support" ON)
if(APPLE)
SET(INITIAL_USE_SDL_MAINLOOP_VALUE ON)
@ -606,18 +661,12 @@ FINDLIB(OPENSSL NAMES crypto libeay32)
if(USE_GL)
include(FindOpenGL)
FINDLIB(GLEW NAMES GLEW glew32 glew32s)
target_link_libraries(clonk
${GLEW}
${OPENGL_LIBRARIES}
)
set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${GLEW} ${OPENGL_LIBRARIES})
endif()
if(USE_DIRECTX)
FINDLIB(DIRECT3D d3d9)
FINDLIB(DIRECT3DX d3dx9)
target_link_libraries(clonk
${DIRECT3D}
${DIRECT3DX}
)
set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${DIRECT3D} ${DIRECT3DX})
endif()
if(USE_GTK)
include(FindPkgConfig)
@ -629,9 +678,19 @@ if(USE_GTK)
link_directories(${GTK_LIBRARY_DIRS})
SET(WITH_DEVELOPER_MODE ${GTK_FOUND})
SET(WITH_GLIB ${GTK_FOUND})
target_link_libraries(clonk
${GTK_LIBRARIES}
)
set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${GTK_LIBRARIES})
endif()
endif()
if(USE_MAPE)
include(FindPkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(MAPE_GTK glib-2.0>=2.14 gthread-2.0 gtk+-2.0>=2.12 gtksourceview-2.0)
endif()
if(MAPE_GTK_FOUND)
# hrm, cmake doesn't have target_include_directories...
include_directories(${MAPE_GTK_INCLUDE_DIRS} src/mape src/mape/icon)
link_directories(${MAPE_GTK_LIBRARY_DIRS})
set(MAPE_LIBRARIES ${MAPE_LIBRARIES} ${MAPE_GTK_LIBRARIES})
endif()
endif()
if(USE_X11)
@ -639,22 +698,13 @@ if(USE_X11)
FINDLIB(XPM Xpm)
FINDLIB(XXF86VM Xxf86vm)
FINDLIB(XRANDR Xrandr)
target_link_libraries(clonk
${X11}
${XPM}
${XXF86VM}
${XRANDR}
)
set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${X11} ${XPM} ${XXF86VM} ${XRANDR})
endif()
if (WIN32)
FINDLIB(VFW vfw32)
FINDLIB(WS2 ws2_32)
FINDLIB(WINMM winmm)
target_link_libraries(clonk
${VFW}
${WS2}
${WINMM}
)
set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${VFW} ${WS2} ${WINMM})
target_link_libraries(c4group
${WS2}
)
@ -665,13 +715,11 @@ if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
FINDLIB(SDLMIXER SDL_mixer)
SET(HAVE_LIBSDL_MIXER ${SDLMIXER})
target_link_libraries(clonk
${SDL_LIBRARY}
${SDLMIXER}
)
set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${SDL_LIBRARY} ${SDLMIXER})
endif()
target_link_libraries(clonk
${OC_CLONK_LIBRARIES}
${FREETYPE_LIBRARIES}
${ZLIB_LIBRARIES}
${PNG_LIBRARIES}
@ -683,6 +731,21 @@ target_link_libraries(c4group
${OPENSSL}
)
if(USE_MAPE)
add_executable(mape ${MAPE_SOURCES})
# TODO: Remove duplicates in MAPE_LIBRARIES and OC_CLONK_LIBRARIES...
# GTK+ might be in both.
target_link_libraries(mape
${MAPE_LIBRARIES}
${OC_CLONK_LIBRARIES}
${FREETYPE_LIBRARIES}
${ZLIB_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${OPENSSL}
)
endif()
include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX)
CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" USE_GCC_STD_0X)

View File

@ -0,0 +1,180 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "configfile.h"
MapeConfigFile* mape_config_file_new(const gchar* filename)
{
/* If filename does not exist, we return an empty config file. */
MapeConfigFile* file;
gchar* contents;
gchar** lines;
gchar** cur_line;
gchar* sep;
gsize length;
file = malloc(sizeof(MapeConfigFile) );
file->file_path = g_strdup(filename);
file->entries = NULL;
file->entry_count = 0;
if(g_file_get_contents(filename, &contents, &length, NULL) == FALSE)
return file;
lines = g_strsplit(contents, "\n", 0);
g_free(contents);
for(cur_line = lines; *cur_line != NULL; ++ cur_line)
{
sep = strchr(*cur_line, '=');
if(sep == NULL) continue;
*sep = '\0';
mape_config_file_set_entry(file, *cur_line, sep + 1);
*sep = '=';
}
g_strfreev(lines);
return file;
}
void mape_config_file_destroy(MapeConfigFile* file)
{
gsize i;
for(i = 0; i < file->entry_count; ++ i)
{
g_free(file->entries[i].key);
g_free(file->entries[i].value);
}
g_free(file->entries);
g_free(file->file_path);
free(file);
}
gboolean mape_config_file_serialise(MapeConfigFile* file,
GError** error)
{
gchar* dir;
gchar* content;
gchar* temp;
gsize i;
int dir_result;
gboolean cont_result;
dir = g_dirname(file->file_path);
dir_result = g_mkdir_with_parents(dir, 0755);
g_free(dir);
if(dir_result == -1)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_CONFIG_FILE_ERROR"),
errno,
"%s",
g_strerror(errno)
);
return FALSE;
}
content = g_strdup("");
for(i = 0; i < file->entry_count; ++ i)
{
temp = g_strconcat(
content,
file->entries[i].key,
"=",
file->entries[i].value,
"\n",
NULL
);
g_free(content);
content = temp;
}
cont_result = g_file_set_contents(file->file_path, content, -1, error);
g_free(content);
return(cont_result);
}
gsize mape_config_file_get_entry_count(MapeConfigFile* file)
{
return file->entry_count;
}
MapeConfigFileEntry* mape_config_file_get_entry(MapeConfigFile* file,
gsize index)
{
g_assert(index < file->entry_count);
return &file->entries[index];
}
MapeConfigFileEntry* mape_config_file_get_entry_by_key(MapeConfigFile* file,
const gchar* key)
{
gsize i;
for(i = 0; i < file->entry_count; ++ i)
if(g_strcasecmp(file->entries[i].key, key) == 0)
return &file->entries[i];
return NULL;
}
void mape_config_file_set_entry(MapeConfigFile* file,
const gchar* key,
const gchar* value)
{
MapeConfigFileEntry* entry;
entry = mape_config_file_get_entry_by_key(file, key);
if(entry != NULL)
{
g_free(entry->value);
entry->value = g_strdup(value);
}
else
{
++ file->entry_count;
file->entries = realloc(
file->entries,
sizeof(MapeConfigFileEntry) * file->entry_count
);
entry = &file->entries[file->entry_count - 1];
entry->key = g_strdup(key);
entry->value = g_strdup(value);
}
}
const gchar* mape_config_file_entry_get_key(MapeConfigFileEntry* entry)
{
return entry->key;
}
const gchar* mape_config_file_entry_get_value(MapeConfigFileEntry* entry)
{
return entry->value;
}

View File

@ -0,0 +1,56 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_CONFIGFILE_H
#define INC_MAPE_CONFIGFILE_H
#include <glib.h>
#include "forward.h"
struct MapeConfigFileEntry_ {
gchar* key;
gchar* value;
};
struct MapeConfigFile_ {
gchar* file_path;
MapeConfigFileEntry* entries;
gsize entry_count;
};
MapeConfigFile* mape_config_file_new(const gchar* filename);
void mape_config_file_destroy(MapeConfigFile* file);
gboolean mape_config_file_serialise(MapeConfigFile* file,
GError** error);
gsize mape_config_file_get_entry_count(MapeConfigFile* file);
MapeConfigFileEntry* mape_config_file_get_entry(MapeConfigFile* file,
gsize index);
MapeConfigFileEntry* mape_config_file_get_entry_by_key(MapeConfigFile* file,
const gchar* key);
void mape_config_file_set_entry(MapeConfigFile* file,
const gchar* key,
const gchar* value);
const gchar* mape_config_file_entry_get_key(MapeConfigFileEntry* entry);
const gchar* mape_config_file_entry_get_value(MapeConfigFileEntry* entry);
#endif /* INC_MAPE_CONFIGFILE_H */

1116
src/mape/diskview.c 100644

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_DISKVIEW_H
#define INC_MAPE_DISKVIEW_H
#include <gtk/gtkwidget.h>
#include <gtk/gtktreeview.h>
#include <gtk/gtktreestore.h>
#include "forward.h"
typedef enum MapeDiskViewColumns_ {
MAPE_DISK_VIEW_COLUMN_ICON,
MAPE_DISK_VIEW_COLUMN_FILE,
MAPE_DISK_VIEW_COLUMN_GROUP,
MAPE_DISK_VIEW_COLUMN_COUNT
} MapeDiskViewColumns;
typedef enum MapeDiskViewError_ {
MAPE_DISK_VIEW_ERROR_NOENT,
MAPE_DISK_VIEW_ERROR_FAILED
} MapeDiskViewError;
struct MapeDiskView_ {
GtkWidget* window;
GtkWidget* view;
GtkTreeModel* tree_store;
GtkCellRenderer* renderer_icon;
GtkCellRenderer* renderer_file;
GtkTreeViewColumn* col_file;
MapeMatTexView* mat_tex;
MapeEditView* edit_view;
MapeFileIconSet* icon_set;
MapeGroup* group_top;
MapeConfigFile* config;
};
MapeDiskView* mape_disk_view_new(MapeFileIconSet* icon_set,
MapeMatTexView* mat_tex,
MapeEditView* edit_view,
MapeConfigFile* config,
GError** error);
void mape_disk_view_destroy(MapeDiskView* disk_view);
gboolean mape_disk_view_extend_to_path(MapeDiskView* disk_view,
const gchar* filepath,
GError** error);
#endif /* INC_MAPE_DISKVIEW_H */

644
src/mape/editview.c 100644
View File

@ -0,0 +1,644 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourcebuffer.h>
#include "mapgen.h"
#include "random.h"
#include "preferences.h"
#include "mattexview.h"
#include "editview.h"
#include "statusbar.h"
#include "preview.h"
typedef struct _ThreadData ThreadData;
struct _ThreadData {
MapeEditView* view;
gchar* source;
MapeMaterialMap* mat_map;
MapeTextureMap* tex_map;
guint map_width;
guint map_height;
};
typedef struct _ThreadResult ThreadResult;
struct _ThreadResult {
MapeEditView* view;
GdkPixbuf* pixbuf;
GError* error;
guint idle_id;
};
static void
mape_edit_view_thread_result_destroy_func(gpointer data)
{
ThreadResult* result = (ThreadResult*)data;
if(result->pixbuf != NULL) g_object_unref(G_OBJECT(result->pixbuf));
if(result->error != NULL) g_error_free(result->error);
/* Don't need to g_source_remove(result->idle_id) since this is
* only called when the idle handler is removed anyway. */
}
static void mape_edit_view_cb_changed(GtkTextBuffer* buffer,
gpointer user_data)
{
mape_edit_view_reload((MapeEditView*)user_data);
}
static void mape_edit_view_cb_update(GtkWidget* widget,
GdkEvent* event,
gpointer user_data)
{
mape_edit_view_reload((MapeEditView*)user_data);
}
static GdkPixbuf* mape_edit_view_render_map(const gchar* source,
MapeMaterialMap* mat_map,
MapeTextureMap* tex_map,
guint map_width,
guint map_height,
GError** error)
{
GdkPixbuf* pixbuf;
if(mat_map == NULL || tex_map == NULL)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_EDIT_VIEW_ERROR"),
MAPE_EDIT_VIEW_ERROR_MISSING_MAPS,
"Material.c4g is not loaded"
);
return NULL;
}
pixbuf = mape_mapgen_generate(
source,
mat_map,
tex_map,
error,
map_width,
map_height
);
return pixbuf;
}
static gboolean
mape_edit_view_thread_result(gpointer data_)
{
ThreadResult* result;
MapeEditView* view;
result = (ThreadResult*)data_;
view = result->view;
if(result->pixbuf == NULL)
{
g_assert(result->error != NULL);
mape_statusbar_set_compile(
view->statusbar,
result->error->message
);
}
else
{
mape_statusbar_set_compile(
view->statusbar,
"Landscape rendered successfully"
);
}
mape_pre_view_update(view->pre_view, result->pixbuf);
/* Finish thread */
g_thread_join(view->render_thread);
view->render_thread = NULL;
/* Do we have to render again (someone changed
the source while rendering)? */
if(view->rerender == TRUE)
mape_edit_view_reload(view);
return FALSE;
}
static gpointer mape_edit_view_thread_entry(gpointer data_)
{
ThreadData* data;
ThreadResult* result;
GError* error = NULL;
GdkPixbuf* res_buf;
data = (ThreadData*)data_;
res_buf = mape_edit_view_render_map(
data->source,
data->mat_map,
data->tex_map,
data->map_width,
data->map_height,
&error
);
result = g_slice_new(ThreadResult);
result->view = data->view;
result->pixbuf = res_buf;
result->error = error;
g_free(data->source);
g_slice_free(ThreadData, data);
result->idle_id = g_idle_add_full(
G_PRIORITY_DEFAULT_IDLE,
mape_edit_view_thread_result,
result,
mape_edit_view_thread_result_destroy_func
);
/* Note that you can only use this securly with g_thread_join,
* otherwise the idle handler might already have been run */
return result;
}
MapeEditView* mape_edit_view_new(MapePreView* pre_view,
MapeStatusbar* statusbar,
GError** error)
{
MapeEditView* view;
GtkSourceBuffer* buf;
GtkSourceLanguage* lang;
GtkSourceStyleScheme* style;
GtkWidget* error_dialog;
GPtrArray* search_dirs;
const gchar* const* data_dirs;
const gchar* const* dir;
view = malloc(sizeof(MapeEditView) );
view->pre_view = pre_view;
view->statusbar = statusbar;
view->file_path = NULL;
view->encoding = "UTF-8";
view->render_thread = NULL;
view->rerender = FALSE;
view->fixed_seed = FALSE;
view->view = gtk_source_view_new();
buf = GTK_SOURCE_BUFFER(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view) )
);
g_signal_connect_after(
G_OBJECT(buf),
"changed",
G_CALLBACK(mape_edit_view_cb_changed),
view
);
g_signal_connect(
G_OBJECT(pre_view->event_box),
"button-press-event",
G_CALLBACK(mape_edit_view_cb_update),
view
);
view->font_desc = pango_font_description_new();
pango_font_description_set_family(view->font_desc, "monospace");
gtk_widget_modify_font(view->view, view->font_desc);
search_dirs = g_ptr_array_new();
#ifdef G_OS_WIN32
g_ptr_array_add(
search_dirs,
g_win32_get_package_installation_subdirectory(NULL, NULL, "mape-syntax")
);
#endif
g_ptr_array_add(
search_dirs,
g_build_filename(g_get_home_dir(), ".mape-syntax", NULL)
);
data_dirs = g_get_system_data_dirs();
for(dir = data_dirs; *dir != NULL; ++ dir)
g_ptr_array_add(search_dirs, g_build_filename(*dir, "mape", NULL));
g_ptr_array_add(search_dirs, NULL);
view->lang_manager = gtk_source_language_manager_new();
gtk_source_language_manager_set_search_path(
view->lang_manager,
(gchar**)search_dirs->pdata
);
view->style_manager = gtk_source_style_scheme_manager_new();
gtk_source_style_scheme_manager_set_search_path(
view->style_manager,
(gchar**)search_dirs->pdata
);
g_ptr_array_foreach(search_dirs, (GFunc)g_free, NULL);
g_ptr_array_free(search_dirs, TRUE);
lang = gtk_source_language_manager_get_language(
view->lang_manager,
"c4landscape"
);
style = gtk_source_style_scheme_manager_get_scheme(
view->style_manager,
"c4landscape"
);
if(lang == NULL || style == NULL)
{
/* TODO: Show location where we search in */
error_dialog = gtk_message_dialog_new(
NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"The syntax highlighting file for Landscape.txt files "
"could not be located. Perhaps mape has not been "
"properly installed. Syntax highlighting is disabled."
);
gtk_window_set_title(GTK_WINDOW(error_dialog), "Mape");
gtk_dialog_run(GTK_DIALOG(error_dialog) );
gtk_widget_destroy(error_dialog);
}
else
{
gtk_source_buffer_set_language(buf, lang);
gtk_source_buffer_set_style_scheme(buf, style);
}
gtk_widget_show(view->view);
view->window = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(
GTK_SCROLLED_WINDOW(view->window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC
);
gtk_scrolled_window_set_shadow_type(
GTK_SCROLLED_WINDOW(view->window),
GTK_SHADOW_IN
);
gtk_container_add(
GTK_CONTAINER(view->window),
view->view
);
gtk_widget_show(view->window);
return view;
}
void mape_edit_view_destroy(MapeEditView* view)
{
gpointer data;
/* Wait for render thread to finish */
if(view->render_thread != NULL)
{
data = g_thread_join(view->render_thread);
view->render_thread = NULL;
/* Don't let idle handler run since edit_view is about to be destroyed */
g_assert(((ThreadResult*)data)->idle_id != 0);
g_source_remove(((ThreadResult*)data)->idle_id);
}
g_object_unref(G_OBJECT(view->lang_manager) );
g_object_unref(G_OBJECT(view->style_manager));
g_free(view->file_path);
free(view);
}
void mape_edit_view_clear(MapeEditView* view)
{
/* TODO: Undoable action dingsen */
/* (statische mape_edit_view_set_contents-Call?) */
gtk_text_buffer_set_text(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view)),
"",
0
);
gtk_text_buffer_set_modified(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view)),
FALSE
);
g_free(view->file_path);
view->file_path = NULL;
}
gboolean mape_edit_view_open(MapeEditView* view,
const gchar* filename,
GError** error)
{
gboolean result;
gchar* contents;
gchar* conv;
gchar* utf8_file;
gchar* new_path;
gsize length;
result = g_file_get_contents(filename, &contents, &length, error);
if(result == FALSE) return FALSE;
/* Assume UTF-8 */
result = g_utf8_validate(contents, length, NULL);
if(result == FALSE)
{
/* No UTF-8, try LATIN1 */
conv = g_convert(
contents,
-1,
"UTF-8",
"LATIN1",
NULL,
NULL,
NULL
);
g_free(contents);
if(conv == NULL)
{
utf8_file = g_filename_to_utf8(
filename,
-1,
NULL,
NULL,
NULL
);
if(utf8_file == NULL)
utf8_file = g_strdup("<unknown file name>");
g_set_error(
error,
g_quark_from_static_string(
"MAPE_EDIT_VIEW_ERROR"
),
MAPE_EDIT_VIEW_ERROR_UNKNOWN_ENCODING,
"Could not read file %s: Either the encoding "
"is unknown or it is a binary file",
utf8_file
);
g_free(utf8_file);
return FALSE;
}
/* Conversion succeeded */
contents = conv;
view->encoding = "LATIN1";
}
else
{
view->encoding = "UTF-8";
}
/* TODO: Undoable action dingsen */
/* (statische mape_edit_view_set_contents-Call?) */
gtk_text_buffer_set_text(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view)),
contents,
length
);
g_free(contents);
gtk_text_buffer_set_modified(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view)),
FALSE
);
/* TODO: Verify that filename is absolute and make it absolute if
it is not */
new_path = g_strdup(filename);
g_free(view->file_path);
view->file_path = new_path;
return TRUE;
}
gboolean mape_edit_view_save(MapeEditView* view,
const gchar* filename,
GError** error)
{
GtkTextBuffer* buffer;
GtkTextIter begin;
GtkTextIter end;
gchar* new_path;
gchar* source;
gchar* conv;
gboolean result;
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view) );
gtk_text_buffer_get_start_iter(buffer, &begin);
gtk_text_buffer_get_end_iter(buffer, &end);
source = gtk_text_buffer_get_text(buffer, &begin, &end, TRUE);
conv = g_convert(
source,
-1,
view->encoding,
"UTF-8",
NULL,
NULL,
error
);
g_free(source);
if(conv == NULL) return FALSE;
result = g_file_set_contents(filename, conv, -1, error);
g_free(conv);
if(result == FALSE) return FALSE;
gtk_text_buffer_set_modified(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view)),
FALSE
);
new_path = g_strdup(filename);
g_free(view->file_path);
view->file_path = new_path;
return TRUE;
}
gboolean mape_edit_view_get_modified(MapeEditView* view)
{
return gtk_text_buffer_get_modified(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view->view))
);
}
void mape_edit_view_undo(MapeEditView* edit_view)
{
gtk_source_buffer_undo(
GTK_SOURCE_BUFFER(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit_view->view))
)
);
}
void mape_edit_view_redo(MapeEditView* edit_view)
{
gtk_source_buffer_redo(
GTK_SOURCE_BUFFER(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit_view->view))
)
);
}
void mape_edit_view_apply_preferences(MapeEditView* edit_view,
MapePreferences* preferences)
{
GtkSourceView* view;
GtkSourceBuffer* buffer;
GtkWrapMode wrap_mode;
view = GTK_SOURCE_VIEW(edit_view->view);
buffer = GTK_SOURCE_BUFFER(
gtk_text_view_get_buffer(GTK_TEXT_VIEW(view))
);
gtk_source_view_set_tab_width(
view,
preferences->tab_width
);
gtk_source_view_set_insert_spaces_instead_of_tabs(
view,
preferences->tab_to_spaces
);
gtk_source_view_set_auto_indent(
view,
preferences->auto_indentation
);
wrap_mode = GTK_WRAP_CHAR;
if(preferences->text_wrapping == FALSE)
wrap_mode = GTK_WRAP_NONE;
gtk_text_view_set_wrap_mode(
GTK_TEXT_VIEW(view),
wrap_mode
);
gtk_source_view_set_show_line_numbers(
view,
preferences->line_numbers
);
gtk_source_view_set_highlight_current_line(
view,
preferences->highlight_line
);
gtk_source_buffer_set_highlight_matching_brackets(
buffer,
preferences->bracket_matching
);
edit_view->fixed_seed = preferences->fixed_seed;
edit_view->random_seed = preferences->random_seed;
edit_view->map_width = preferences->map_width;
edit_view->map_height = preferences->map_height;
/* Rerender with new random settings */
mape_edit_view_reload(edit_view);
}
void mape_edit_view_reload(MapeEditView* edit_view)
{
GError* error = NULL;
ThreadData* data;
GtkTextBuffer* buffer;
GtkTextIter begin;
GtkTextIter end;
if(edit_view->render_thread == NULL)
{
data = g_slice_new(ThreadData);
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit_view->view) );
gtk_text_buffer_get_start_iter(buffer, &begin);
gtk_text_buffer_get_end_iter(buffer, &end);
/* TODO: We need to ref view so that it is guaranteed to be alive in the
* thread result handler */
data->view = edit_view;
data->source = gtk_text_buffer_get_text(buffer, &begin, &end, TRUE);
/* TODO: We need to ref these so noone can delete them while the thread
* uses them. */
data->mat_map = edit_view->pre_view->mat_tex->mat_map,
data->tex_map = edit_view->pre_view->mat_tex->tex_map,
data->map_width = edit_view->map_width;
data->map_height = edit_view->map_height;
if(edit_view->fixed_seed == TRUE)
mape_random_seed(edit_view->random_seed);
mape_statusbar_set_compile(
edit_view->statusbar,
"Rendering map..."
);
edit_view->rerender = FALSE;
edit_view->render_thread = g_thread_create(
mape_edit_view_thread_entry,
data,
TRUE,
&error
);
if(edit_view->render_thread == NULL)
{
mape_statusbar_set_compile(
edit_view->statusbar,
error->message
);
g_free(data->source);
g_slice_free(ThreadData, data);
g_error_free(error);
}
}
else
{
/* Rerender when thread finished */
edit_view->rerender = TRUE;
}
}

View File

@ -0,0 +1,78 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_EDITVIEW_H
#define INC_MAPE_EDITVIEW_H
#include <gtk/gtkwidget.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourcestyleschememanager.h>
#include "forward.h"
typedef enum MapeEditViewError_ {
MAPE_EDIT_VIEW_ERROR_MISSING_MAPS,
MAPE_EDIT_VIEW_ERROR_UNKNOWN_ENCODING,
MAPE_EDIT_VIEW_ERROR_FAILED
} MapeEditViewError;
struct MapeEditView_ {
GtkWidget* window;
GtkWidget* view;
gchar* file_path;
const gchar* encoding;
GtkSourceLanguageManager* lang_manager;
GtkSourceStyleSchemeManager* style_manager;
PangoFontDescription* font_desc;
MapePreView* pre_view;
MapeStatusbar* statusbar;
gboolean fixed_seed;
unsigned int random_seed;
unsigned int map_width;
unsigned int map_height;
GThread* render_thread;
gboolean rerender;
};
MapeEditView* mape_edit_view_new(MapePreView* pre_view,
MapeStatusbar* statusbar,
GError** error);
void mape_edit_view_destroy(MapeEditView* view);
void mape_edit_view_clear(MapeEditView* view);
gboolean mape_edit_view_open(MapeEditView* view,
const gchar* filename,
GError** error);
gboolean mape_edit_view_save(MapeEditView* view,
const gchar* filename,
GError** error);
gboolean mape_edit_view_get_modified(MapeEditView* view);
void mape_edit_view_undo(MapeEditView* edit_view);
void mape_edit_view_redo(MapeEditView* edit_view);
void mape_edit_view_apply_preferences(MapeEditView* edit_view,
MapePreferences* preferences);
void mape_edit_view_reload(MapeEditView* edit_view);
#endif /* INC_MAPE_EDITVIEW_H */

170
src/mape/fileicon.c 100644
View File

@ -0,0 +1,170 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtkstock.h>
#include "icons.h"
#include "fileicon.h"
static MapeFileIcon* mape_file_icon_new(GtkWidget* widget,
MapeFileIconType type)
{
MapeFileIcon* icon;
GdkPixbuf* pixbuf;
gint width, height;
GdkPixbuf* scaled_pixbuf;
switch(type)
{
case MAPE_FILE_ICON_DRIVE:
pixbuf = gtk_widget_render_icon(
widget,
GTK_STOCK_HARDDISK,
GTK_ICON_SIZE_BUTTON,
NULL
);
break;
case MAPE_FILE_ICON_FOLDER:
pixbuf = gtk_widget_render_icon(
widget,
GTK_STOCK_DIRECTORY,
GTK_ICON_SIZE_BUTTON,
NULL
);
break;
case MAPE_FILE_ICON_C4OBJECT:
pixbuf = gdk_pixbuf_new_from_inline(
-1,
mape_icon_c4d,
FALSE,
NULL
);
break;
case MAPE_FILE_ICON_C4FOLDER:
pixbuf = gdk_pixbuf_new_from_inline(
-1,
mape_icon_c4f,
FALSE,
NULL
);
break;
case MAPE_FILE_ICON_C4GROUP:
pixbuf = gdk_pixbuf_new_from_inline(
-1,
mape_icon_c4g,
FALSE,
NULL
);
break;
case MAPE_FILE_ICON_C4SCENARIO:
pixbuf = gdk_pixbuf_new_from_inline(
-1,
mape_icon_c4s,
FALSE,
NULL
);
break;
case MAPE_FILE_ICON_C4MATERIAL:
pixbuf = gdk_pixbuf_new_from_inline(
-1,
mape_icon_c4m,
FALSE,
NULL
);
break;
case MAPE_FILE_ICON_C4TEXTURE:
pixbuf = gdk_pixbuf_new_from_inline(
-1,
mape_icon_tex,
FALSE,
NULL
);
break;
default:
g_assert_not_reached();
break;
}
if(pixbuf == NULL)
return NULL;
gtk_icon_size_lookup(GTK_ICON_SIZE_BUTTON, &width, &height);
/* Scale pixbuf to size of GTK_ICON_SIZE_BUTTON */
if(gdk_pixbuf_get_width(pixbuf) != width ||
gdk_pixbuf_get_height(pixbuf) != height)
{
scaled_pixbuf = gdk_pixbuf_scale_simple(
pixbuf,
width,
height,
GDK_INTERP_HYPER
);
g_object_unref(pixbuf);
pixbuf = scaled_pixbuf;
if(pixbuf == NULL)
return NULL;
}
icon = malloc(sizeof(MapeFileIcon) );
icon->type = type;
icon->pixbuf = pixbuf;
return icon;
}
static void mape_file_icon_destroy(MapeFileIcon* icon)
{
g_object_unref(G_OBJECT(icon->pixbuf) );
free(icon);
}
MapeFileIconSet* mape_file_icon_set_new(GtkWidget* widget)
{
MapeFileIconSet* set;
unsigned int i;
set = malloc(sizeof(MapeFileIconSet) );
for(i = 0; i < MAPE_FILE_ICON_COUNT; ++ i)
set->icons[i] = mape_file_icon_new(widget, (MapeFileIconType)i);
return set;
}
void mape_file_icon_set_destroy(MapeFileIconSet* set)
{
unsigned int i;
for(i = 0; i < MAPE_FILE_ICON_COUNT; ++ i)
mape_file_icon_destroy(set->icons[i]);
}
MapeFileIcon* mape_file_icon_set_lookup(MapeFileIconSet* set,
MapeFileIconType type)
{
g_assert(type < MAPE_FILE_ICON_COUNT);
return set->icons[type];
}
GdkPixbuf* mape_file_icon_get(MapeFileIcon* icon)
{
return icon->pixbuf;
}

View File

@ -0,0 +1,56 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_FILEICON_H
#define INC_MAPE_FILEICON_H
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtkwidget.h>
#include "forward.h"
typedef enum MapeFileIconType_ {
MAPE_FILE_ICON_DRIVE,
MAPE_FILE_ICON_FOLDER,
MAPE_FILE_ICON_C4GROUP,
MAPE_FILE_ICON_C4SCENARIO,
MAPE_FILE_ICON_C4OBJECT,
MAPE_FILE_ICON_C4FOLDER,
MAPE_FILE_ICON_C4MATERIAL,
MAPE_FILE_ICON_C4TEXTURE,
MAPE_FILE_ICON_COUNT
} MapeFileIconType;
struct MapeFileIcon_ {
MapeFileIconType type;
GdkPixbuf* pixbuf;
};
struct MapeFileIconSet_ {
MapeFileIcon* icons[MAPE_FILE_ICON_COUNT];
};
MapeFileIconSet* mape_file_icon_set_new(GtkWidget* widget);
void mape_file_icon_set_destroy(MapeFileIconSet* set);
MapeFileIcon* mape_file_icon_set_lookup(MapeFileIconSet* set,
MapeFileIconType type);
GdkPixbuf* mape_file_icon_get(MapeFileIcon* icon);
#endif /* INC_MAPE_FILEICON_H */

40
src/mape/forward.h 100644
View File

@ -0,0 +1,40 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_FORWARD_H
#define INC_MAPE_FORWARD_H
typedef struct MapeGroup_ MapeGroup;
typedef struct MapeMaterialMap_ MapeMaterialMap;
typedef struct MapeTextureMap_ MapeTextureMap;
typedef struct MapeFileIcon_ MapeFileIcon;
typedef struct MapeFileIconSet_ MapeFileIconSet;
typedef struct MapeConfigFileEntry_ MapeConfigFileEntry;
typedef struct MapeConfigFile_ MapeConfigFile;
typedef struct MapePreferences_ MapePreferences;
typedef struct MapePreferencesDialog_ MapePreferencesDialog;
typedef struct MapeHeader_ MapeHeader;
typedef struct MapeStatusbar_ MapeStatusbar;
typedef struct MapeDiskView_ MapeDiskView;
typedef struct MapeIconView_ MapeIconView;
typedef struct MapeMatTexView_ MapeMatTexView;
typedef struct MapeEditView_ MapeEditView;
typedef struct MapePreView_ MapePreView;
typedef struct MapeWindow_ MapeWindow;
#endif /* INC_MAPE_FORWARD_H */

263
src/mape/group.cpp 100644
View File

@ -0,0 +1,263 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define MAPE_COMPILING_CPP
#include <C4Group.h>
#include <glib.h>
#include "group.h"
#define CPPGROUP(group) ((C4Group*)group->group_handle)
extern "C" {
/* On Windows, / is interpreted as a directory containing the local drives
(C:\, D:\, etc.). group_handle will be NULL in this case. */
MapeGroup* mape_group_new(const char* path,
GError** error)
{
MapeGroup* group;
group = (MapeGroup*)malloc(sizeof(MapeGroup) );
group->group_handle = NULL;
#ifdef G_OS_WIN32
group->drive_idtf = 0;
if(strcmp(path, "/") == 0)
{
//group->drive_idtf = TRUE;
return group;
}
#endif
group->group_handle = new C4Group;
if(CPPGROUP(group)->Open(path, FALSE) == FALSE)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_GROUP_ERROR"),
MAPE_GROUP_ERROR_OPEN,
"Could not open '%s': %s",
path,
CPPGROUP(group)->GetError()
);
delete CPPGROUP(group);
free(group);
return NULL;
}
return group;
}
MapeGroup* mape_group_new_from_parent(MapeGroup* parent,
const char* entry,
GError** error)
{
MapeGroup* group;
bool result;
group = (MapeGroup*)malloc(sizeof(MapeGroup) );
group->group_handle = new C4Group;
#ifdef G_OS_WIN32
if(parent->group_handle == NULL)
{
result = CPPGROUP(group)->Open(entry, FALSE);
}
else
#endif
{
result = CPPGROUP(group)->OpenAsChild(
CPPGROUP(parent),
entry,
FALSE
);
}
if(result == FALSE)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_GROUP_ERROR"),
MAPE_GROUP_ERROR_OPEN,
"%s",
CPPGROUP(group)->GetError()
);
delete CPPGROUP(group);
free(group);
return NULL;
}
return group;
}
void mape_group_destroy(MapeGroup* group)
{
if(group->group_handle != NULL)
delete CPPGROUP(group);
free(group);
}
const char* mape_group_get_name(MapeGroup* group)
{
g_assert(group->group_handle != NULL);
return CPPGROUP(group)->GetName();
}
const char* mape_group_get_full_name(MapeGroup* group)
{
g_assert(group->group_handle != NULL);
// TODO: Might this corrupt memory? Should we return a copy?
return CPPGROUP(group)->GetFullName().getData();
}
gboolean mape_group_has_entry(MapeGroup* group,
const char* entry)
{
#ifdef G_OS_WIN32
DWORD chk_drv;
if(group->group_handle == NULL)
{
if(entry[0] == '\0') return FALSE;
if(entry[1] != ':') return FALSE;
chk_drv = 1 << (entry[0] - 'A');
if( (GetLogicalDrives() & chk_drv) != 0)
return TRUE;
else
return FALSE;
}
#endif
CPPGROUP(group)->ResetSearch();
return CPPGROUP(group)->FindEntry(entry) ? TRUE : FALSE;
}
void mape_group_rewind(MapeGroup* group)
{
#ifdef G_OS_WIN32
if(group->group_handle == NULL)
{
group->drive_idtf = 0;
return;
}
#endif
CPPGROUP(group)->ResetSearch();
}
char* mape_group_get_next_entry(MapeGroup* group)
{
char* buf;
bool result;
#ifdef G_OS_WIN32
static const int DRV_C_SUPPORT = 26;
DWORD drv_c;
if(group->group_handle == NULL)
{
drv_c = GetLogicalDrives();
/* Find next available drive or wait for overflow */
while( (group->drive_idtf < DRV_C_SUPPORT) &&
(~drv_c & (1 << group->drive_idtf)) )
++ group->drive_idtf;
if(group->drive_idtf >= DRV_C_SUPPORT) return NULL;
buf = (char*)malloc(3 * sizeof(char) );
buf[0] = 'A' + group->drive_idtf;
buf[1] = ':'; buf[2] = '\0';
++ group->drive_idtf;
return buf;
}
#endif
buf = (char*)malloc(_MAX_PATH);
result = CPPGROUP(group)->FindNextEntry("*", buf);
if(result == false)
free(buf);
return result ? buf : NULL;
}
gboolean mape_group_is_folder(MapeGroup* group)
{
g_assert(group->group_handle != NULL);
int status = CPPGROUP(group)->GetStatus();
if(status == GRPF_Folder) return TRUE;
return FALSE;
}
gboolean mape_group_is_child_folder(MapeGroup* group,
const char* child)
{
gchar* filename;
const gchar* ext;
gboolean result;
#ifdef G_OS_WIN32
/* Drives are always folders */
if(group->group_handle == NULL)
return TRUE;
#endif
// Check for C4? extension
ext = strrchr(child, '.');
if(ext != NULL)
{
if(stricmp(ext, ".c4s") == 0 ||
stricmp(ext, ".c4d") == 0 ||
stricmp(ext, ".c4f") == 0 ||
stricmp(ext, ".c4g") == 0)
{
return TRUE;
}
}
// Packed directories are not supported
if(CPPGROUP(group)->GetStatus() == GRPF_File)
return FALSE;
// No C4Group folder: Check for regular directory
filename = g_build_filename(
CPPGROUP(group)->GetName(),
child,
NULL
);
result = g_file_test(
filename,
G_FILE_TEST_IS_DIR
);
g_free(filename);
return result;
}
}

67
src/mape/group.h 100644
View File

@ -0,0 +1,67 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_GROUP_H
#define INC_MAPE_GROUP_H
#include <glib/gerror.h>
#include "forward.h"
/* Simple C-based interface to C4Group */
#ifdef MAPE_COMPILING_CPP
extern "C" {
#endif
typedef enum MapeGroupError_ {
MAPE_GROUP_ERROR_OPEN,
MAPE_GROUP_ERROR_FAILED
} MapeGroupError;
struct MapeGroup_ {
void* group_handle;
#ifdef G_OS_WIN32
unsigned int drive_idtf;
#endif
};
MapeGroup* mape_group_new(const char* path,
GError** error);
MapeGroup* mape_group_new_from_parent(MapeGroup* parent,
const char* entry,
GError** error);
void mape_group_destroy(MapeGroup* group);
const char* mape_group_get_name(MapeGroup* group);
const char* mape_group_get_full_name(MapeGroup* group);
gboolean mape_group_has_entry(MapeGroup* group,
const char* entry);
void mape_group_rewind(MapeGroup* group);
char* mape_group_get_next_entry(MapeGroup* group);
gboolean mape_group_is_folder(MapeGroup* group);
gboolean mape_group_is_child_folder(MapeGroup* group,
const char* child);
#ifdef MAPE_COMPILING_CPP
} /* extern "C" */
#endif
#endif /* INC_MAPE_GORUP_H */

281
src/mape/header.c 100644
View File

@ -0,0 +1,281 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtkstock.h>
#include "header.h"
static const GtkActionEntry mape_header_file_entries[] = {
{
"File",
NULL,
"_File",
NULL,
NULL,
NULL
}, {
"FileNew",
GTK_STOCK_NEW,
"_New",
"<control>N",
"Opens a new document",
NULL
}, {
"FileOpen",
GTK_STOCK_OPEN,
"_Open",
"<control>O",
"Opens an already existing document from disk",
NULL
}, {
"FileSave",
GTK_STOCK_SAVE,
"_Save",
"<control>S",
"Saves the current document to disk",
NULL
}, {
"FileSaveAs",
GTK_STOCK_SAVE_AS,
"Save as",
"<control><shift>S",
"Save the current map to another path on disk",
NULL
}, {
"FileQuit",
GTK_STOCK_QUIT,
"_Quit",
"<alt>F4",
"Exit the program",
NULL
}
};
static const GtkActionEntry mape_header_edit_entries[] = {
{
"Edit",
NULL,
"_Edit",
NULL,
NULL,
NULL
}, {
"EditUndo",
GTK_STOCK_UNDO,
"_Undo",
"<control>Z",
"Undo the last action",
NULL
}, {
"EditRedo",
GTK_STOCK_REDO,
"_Redo",
"<control>Y",
"Redo the last action",
NULL
}, {
"EditPreferences",
GTK_STOCK_PREFERENCES,
"Pr_eferences",
NULL,
"Configure the application",
NULL
}
};
static const GtkActionEntry mape_header_help_entries[] = {
{
"Help",
NULL,
"_Help",
NULL,
NULL,
NULL
}, {
"HelpAbout",
GTK_STOCK_ABOUT,
"_About",
NULL,
"Shows authors and copyright information",
NULL
}
};
static const gchar* mape_header_ui_desc =
"<ui>"
" <menubar name='MenuBar'>"
" <menu action='File'>"
" <menuitem action='FileNew' />"
" <menuitem action='FileOpen' />"
" <menuitem action='FileSave' />"
" <menuitem action='FileSaveAs' />"
" <separator />"
" <menuitem action='FileQuit' />"
" </menu>"
" <menu action='Edit'>"
" <menuitem action='EditUndo' />"
" <menuitem action='EditRedo' />"
" <separator />"
" <menuitem action='EditPreferences' />"
" </menu>"
" <menu action='Help'>"
" <menuitem action='HelpAbout' />"
" </menu>"
" </menubar>"
" <toolbar name='ToolBar'>"
" <toolitem action='FileNew' />"
" <toolitem action='FileOpen' />"
" <toolitem action='FileSave' />"
" <toolitem action='FileSaveAs' />"
" <separator />"
" <toolitem action='EditUndo' />"
" <toolitem action='EditRedo' />"
" </toolbar>"
"</ui>";
MapeHeader* mape_header_new(void)
{
MapeHeader* header;
gint result;
header = malloc(sizeof(MapeHeader) );
header->group_file = gtk_action_group_new("FileActions");
gtk_action_group_add_actions(
header->group_file,
mape_header_file_entries,
G_N_ELEMENTS(mape_header_file_entries),
header
);
header->group_edit = gtk_action_group_new("EditActions");
gtk_action_group_add_actions(
header->group_edit,
mape_header_edit_entries,
G_N_ELEMENTS(mape_header_edit_entries),
header
);
header->group_help = gtk_action_group_new("HelpActions");
gtk_action_group_add_actions(
header->group_help,
mape_header_help_entries,
G_N_ELEMENTS(mape_header_help_entries),
header
);
header->ui_manager = gtk_ui_manager_new();
gtk_ui_manager_insert_action_group(
header->ui_manager,
header->group_file,
0
);
gtk_ui_manager_insert_action_group(
header->ui_manager,
header->group_edit,
0
);
gtk_ui_manager_insert_action_group(
header->ui_manager,
header->group_help,
0
);
result = gtk_ui_manager_add_ui_from_string(
header->ui_manager,
mape_header_ui_desc,
-1,
NULL
);
g_assert(result != 0);
header->menubar = gtk_ui_manager_get_widget(
header->ui_manager,
"/MenuBar"
);
header->toolbar = gtk_ui_manager_get_widget(
header->ui_manager,
"/ToolBar"
);
g_assert(header->menubar != NULL);
g_assert(header->toolbar != NULL);
header->accel_group = gtk_ui_manager_get_accel_group(
header->ui_manager
);
g_assert(header->accel_group != NULL);
header->file_new = gtk_action_group_get_action(
header->group_file,
"FileNew"
);
header->file_open = gtk_action_group_get_action(
header->group_file,
"FileOpen"
);
header->file_save = gtk_action_group_get_action(
header->group_file,
"FileSave"
);
header->file_save_as = gtk_action_group_get_action(
header->group_file,
"FileSaveAs"
);
header->file_quit = gtk_action_group_get_action(
header->group_file,
"FileQuit"
);
header->edit_undo = gtk_action_group_get_action(
header->group_edit,
"EditUndo"
);
header->edit_redo = gtk_action_group_get_action(
header->group_edit,
"EditRedo"
);
header->edit_preferences = gtk_action_group_get_action(
header->group_edit,
"EditPreferences"
);
header->help_about = gtk_action_group_get_action(
header->group_help,
"HelpAbout"
);
return header;
}
void mape_header_destroy(MapeHeader* header)
{
g_object_unref(G_OBJECT(header->ui_manager) );
free(header);
}

54
src/mape/header.h 100644
View File

@ -0,0 +1,54 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_HEADER_H
#define INC_MAPE_HEADER_H
#include <gtk/gtkwidget.h>
#include <gtk/gtkuimanager.h>
#include <gtk/gtkactiongroup.h>
#include <gtk/gtkaction.h>
#include "forward.h"
struct MapeHeader_ {
GtkUIManager* ui_manager;
GtkAccelGroup* accel_group;
GtkWidget* menubar;
GtkWidget* toolbar;
GtkActionGroup* group_file;
GtkAction* file_new;
GtkAction* file_open;
GtkAction* file_save;
GtkAction* file_save_as;
GtkAction* file_quit;
GtkActionGroup* group_edit;
GtkAction* edit_undo;
GtkAction* edit_redo;
GtkAction* edit_preferences;
GtkActionGroup* group_help;
GtkAction* help_about;
};
MapeHeader* mape_header_new(void);
void mape_header_destroy(MapeHeader* header);
#endif /* INC_MAPE_HEADER_H */

149
src/mape/icon/c4d.c 100644
View File

@ -0,0 +1,149 @@
/* GdkPixbuf RGBA C-Source image dump */
#include <glib/gtypes.h>
#ifdef __SUNPRO_C
#pragma align 4 (mape_icon_c4d)
#endif
#ifdef __GNUC__
const guint8 mape_icon_c4d[] __attribute__ ((__aligned__ (4))) =
#else
const guint8 mape_icon_c4d[] =
#endif
{ ""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (4096) */
"\0\0\20\30"
/* pixdata_type (0x1010002) */
"\1\1\0\2"
/* rowstride (128) */
"\0\0\0\200"
/* width (32) */
"\0\0\0\40"
/* height (32) */
"\0\0\0\40"
/* pixel_data: */
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0""00.\377//.\37700/\37700/\37711/\377210\377"
"110\377221\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""443\377432\377442\377"
"442\377443\377543\377443\377443\377553\377654\377554\377664\377665\377"
"664\377664\377665\377665\377765\377765\377765\377654\377,+*\377\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""998\377997\377887\377997"
"\377987\377997\377997\377998\377:98\377::8\377::9\377;;9\377;;:\377;"
";9\377;;9\377<;:\377;;:\377<<;\377<;:\377<<;\377<<;\377<<;\377<<:\377"
"553\377**)\377\"!\40\377\0\0\0\0\0\0\0\0\0\0\0\0UUS\377NML\377IIG\377"
"GFE\377EEC\377BBA\377@@\77\377\77\77>\377>>=\377\77\77=\377@@>\377@\77"
">\377@@\77\377@@\77\377@@\77\377@@\77\377AA@\377AA\77\377A@\77\377AA"
"\77\377AA\77\377BA@\377BA@\377BA@\377==<\377221\377''&\377##!\377!!\40"
"\377\0\0\0\0\0\0\0\0\0\0\0\0__]\377``_\377ba`\377cca\377ddb\377cba\377"
"aa`\377``_\377^^\\\377\\\\[\377[ZY\377WWU\377TTS\377RRP\377ONM\377MM"
"K\377IIH\377HHF\377FFE\377GGF\377GFE\377GFE\377FFD\377::9\377--,\377"
"('&\377%%$\377##!\377!!\37\377\0\0\0\0\0\0\0\0\0\0\0\0__]\377`_^\377"
"ba`\377ccb\377ddc\377ffd\377hhf\377iih\377kki\377lkj\377mmk\377edc\377"
"VVj\377ZZk\377qpo\377qqo\377onm\377mmk\377kji\377hhg\377eec\377[ZY\377"
"665\377,+*\377))'\377'&%\377$$#\377#\"!\377!\40\37\377\0\0\0\0\0\0\0"
"\0\0\0\0\0^]\\\377_^]\377aa_\377cca\377dcb\377eed\377gge\377iig\377j"
"ji\377kkj\377YYq\377//\263\377)(\340\37721|\377iih\377ttr\377tts\377"
"vut\377wvu\377xxv\377yyx\377kki\37700.\377++)\377(('\377&&%\377$$\"\377"
"\"!\40\377\40\40\37\377\0\0\0\0\0\0\0\0\0\0\0\0]]\\\377^^]\377``_\377"
"bb`\377ccb\377eed\377ffe\377hhf\377iih\377iig\377EE\225\377))\377\377"
"''\317\377KJ[\377rqp\377ssq\377tts\377uts\377vvu\377wwv\377xxw\377ii"
"h\377/.-\377**(\377((&\377&&$\377##\"\377\"\"\40\377\37\37\36\377\0\0"
"\0\0\0\0\0\0\0\0\0\0]][\377^^\\\377``^\377aa`\377ccb\377edc\377gfe\377"
"hgf\377iih\377eed\37788\257\377((\376\377-,\207\377cba\377rqp\377mlk"
"\377tsr\377tts\377uut\377wwu\377xxv\377gge\377.-,\377))(\377((&\377%"
"%#\377#\"!\377!!\37\377\40\37\36\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"^]\\\377_^]\377aa`\377bb`\377dcb\377eed\377_^]\377\\[Z\377ZYf\377..\334"
"\377&&\312\377IGY\377pon\377TSy\37765\227\377LKx\377onm\377uut\377vv"
"t\377wwv\377eed\377,,+\377))'\377''%\377%$#\377\"\"!\377!!\37\377\37"
"\36\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0]\\[\377_^]\377a`_\377bb`\377"
"cba\377tss\377\200\177\177\377\203\202\202\377kj\223\377++\364\377,+"
"\211\377`_^\377gge\37733\260\377++\377\377-,\224\377gfe\377uts\377uu"
"t\377wvu\377edc\377++)\377))'\377&&%\377$$#\377#\"!\377\40\40\36\377"
"\36\36\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0]][\377^]\\\377``^\377w"
"vu\377\267\267\267\377\333\333\333\377\327\327\327\377\337\337\337\377"
"\331\331\333\377]]\330\377A@g\377mmk\377gfq\37711\332\377((\360\377@"
"\77m\377ssr\377uts\377vut\377vvt\377bba\377**)\377(('\377&&%\377$$\""
"\377\"\"\40\377\40\40\36\377\37\36\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\\\\Z\377^]\\\377\\\\Z\377\232\232\231\377\323\323\323\377\215\214"
"\214\377CBA\377ddc\377\222\222\231\377XX\323\377<;\200\377XWZ\377XX}"
"\377,,\361\377&&\275\377XW]\377ssr\377tts\377uut\377vut\377a`_\377**"
"(\377''&\377%%$\377$#\"\377!!\37\377\37\37\36\377\36\35\34\377\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\\\\Z\377]\\[\377YXW\377\252\252\251\377\330"
"\330\330\377\204\203\203\377ZYX\377YXW\37766^\377''\351\377)(\362\377"
"('\271\377.-\256\377**\377\377'&\236\377DB_\377XWb\377tsr\377uus\377"
"vut\377``^\377)('\377'&%\377%%#\377##\"\377\40\40\37\377\36\36\35\377"
"\36\35\34\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0[[Z\377]\\[\377VVU\377\245"
"\245\245\377\343\343\343\377\236\235\235\377^^\\\377gfe\377ZZY\3770/"
"l\377+*\252\377--\323\377((\355\377**\377\377**\326\377--\256\377LKp"
"\377srq\377tts\377vut\377^^]\377)('\377&&$\377$$\"\377\"\"!\377\40\40"
"\37\377\36\36\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ZZY\377\\"
"[Z\377VUT\377\210\210\210\377\334\334\334\377\315\314\314\377WVU\377"
"edc\377hhg\377aa`\377aa_\377VV\\\377,+\261\377%%\307\377HGa\377eef\377"
"rrq\377ttr\377uus\377vut\377\\[Z\377''&\377&&$\377$#\"\377\"\"\40\377"
"\40\37\36\377\36\36\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ZZ"
"X\377\\[Z\377VVU\377VVU\377\310\310\310\377\352\352\352\377\272\271\271"
"\377srr\377^]\\\377ccb\377hhf\377cba\377..\304\377)(\236\377``^\377q"
"qo\377srq\377tsr\377tts\377uus\377[[Y\377'&%\377%%#\377##!\377!!\37\377"
"\37\37\36\377\35\35\33\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ZZ"
"Y\377[[Z\377\\[Z\377KKI\377xxw\377\316\316\316\377\336\336\336\377\324"
"\324\324\377\263\263\263\377\210\207\207\377_^]\377ddl\37700\315\377"
"98{\377mmk\377qqp\377rrp\377ttr\377ttr\377vut\377YYW\377'&%\377%%#\377"
"##\"\377!!\37\377\37\36\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0ZZX\377[[Y\377]\\[\377[ZY\377A@\77\377__^\377\233\232\232\377"
"\301\301\301\377\321\321\321\377\212\211\211\377^^\\\377hhf\377LLj\377"
"a`_\377ppo\377rrp\377rrq\377tsr\377uus\377uut\377WWU\377&&%\377$$\"\377"
"#\"!\377\40\40\36\377\37\37\35\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0[ZY\377\\\\[\377^]\\\377^]\\\377VVU\377BB@\377"
"==<\377PPO\377aa_\377kkj\377mlk\377jih\377pon\377qpo\377rqp\377srq\377"
"ttr\377vut\377wvu\377WVU\377%%$\377##\"\377!!\40\377\40\40\37\377\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ZZY\377\\"
"\\[\377^]\\\377``^\377ba`\377a`_\377__^\377``_\377jjh\377kkj\377mmk\377"
"oom\377pon\377rqp\377rrq\377ttr\377uts\377vut\377vvu\377UTS\377%$#\377"
"##!\377\"!\40\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ba`\377ddc\377ff"
"d\377hgf\377jjh\377llk\377mml\377oon\377qpo\377rqp\377ssq\377uts\377"
"vut\377vvu\377wwv\377TSR\377$$\"\377#\"!\377\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0jjh\377llj\377nm"
"l\377oon\377qpo\377rrq\377uts\377uus\377vvu\377xwv\377xxw\377SRQ\377"
"##\"\377#\"!\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0rrp\377ssr\377"
"uts\377vvu\377wwv\377yyx\377zzx\377RRQ\377$#\"\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0xxw\377"
"zzy\377|{z\377XWV\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};

162
src/mape/icon/c4f.c 100644
View File

@ -0,0 +1,162 @@
/* GdkPixbuf RGBA C-Source image dump */
#include <glib/gtypes.h>
#ifdef __SUNPRO_C
#pragma align 4 (mape_icon_c4f)
#endif
#ifdef __GNUC__
const guint8 mape_icon_c4f[] __attribute__ ((__aligned__ (4))) =
#else
const guint8 mape_icon_c4f[] =
#endif
{ ""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (4096) */
"\0\0\20\30"
/* pixdata_type (0x1010002) */
"\1\1\0\2"
/* rowstride (128) */
"\0\0\0\200"
/* width (32) */
"\0\0\0\40"
/* height (32) */
"\0\0\0\40"
/* pixel_data: */
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\226[/\377\231]0\377\230\\0\377\227\\"
"0\377\226\\0\377\225[/\377\224Z/\377\222Y.\377\221X.\377\220X.\377\216"
"V-\377\215V-\377\214U,\377\212T,\377\211T,\377\207R+\377\206Q*\377\205"
"Q*\377\203P)\377\202O)\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220W-\377\230]0\377\231"
"]1\377\230]1\377\227\\0\377\226[0\377\225[0\377\224Z/\377\222Y/\377\222"
"Y/\377\220X/\377\216W-\377\215V-\377\214U,\377\212U,\377\211S,\377\207"
"R+\377\206Q*\377\204Q*\377\201O)\377}L'\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\223Y."
"\377\232^2\377\231]1\377\231]1\377\227]1\377\226\\0\377\225[0\377\224"
"[0\377\223Z0\377\222Y/\377\220X/\377\217X.\377\215V-\377\214V-\377\212"
"T,\377\210S+\377\207R+\377\205Q*\377\200N)\377|K'\377zJ'\377\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\215U+\377\230\\0\377\232^2\377\231^2\377\231^2\377\227]1\377\227"
"]1\377\225\\1\377\225[1\377\223Z0\377\222Y/\377\204TH\377sM`\377tKD\377"
"\214V.\377\212T,\377\211T,\377\207R+\377\206R+\377\177M(\377\177M(\377"
"uL.\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\221X-\377\233_2\377\233_3\377\232_3\377\231^2\377"
"\230]2\377\227]2\377\226\\1\377\224[1\377\213W/\377^F\202\377D\77\316"
"\37733\265\377>0F\377\202P,\377\213U-\377\211T,\377\210S,\377\206R+\377"
"\177N)\377\203P*\377lQ=\377\177S1\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\227\\0\377\234`4\377\233_3\377"
"\232_3\377\231_3\377\230^2\377\226]2\377\226]2\377\225\\2\377lK^\377"
"==\322\37776\271\3773+N\377nG*\377\213V.\377\212U-\377\211T-\377\207"
"S,\377\205R+\377\177N)\377\177N)\377iTD\377\177Q.\377\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220W-\377\233_3\377"
"\234`4\377\232_4\377\232`4\377\231_4\377\230_4\377\227^3\377\226]3\377"
"\202UM\377MD\274\377:9\277\3775-R\377kF*\377yOG\377_G\202\377dGd\377"
"{M+\377\207S,\377\202P*\377\177N)\377zP1\377pXG\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\224Z/\377\234"
"a5\377\234a5\377\233`4\377\244pJ\377\262\211k\377\270\225{\377\262\220"
"x\377\242\200k\377hY\247\377==\305\3772-R\377jF+\377\205T/\377NA\225"
"\377>>\331\3770/\212\377[=(\377\207S,\377\200O*\377\200O*\377uU<\377"
"y[E\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\215U,\377\231^2\377\234a5\377\241jB\377\305\247\222\377\342\331\324"
"\377\342\340\341\377\325\323\324\377\324\322\323\377\335\334\334\377"
"|{\320\3771-]\377dB*\377\220Z1\377gJi\377@@\327\37777\260\377@0;\377"
"\177P,\377\207S-\377\177O*\377\204Q,\377pYH\377}X=\377\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\221X.\377\234a5\377"
"\236e;\377\316\266\246\377\352\350\351\377\264\262\262\377hef\377IDC"
"\377LEG\377hg\267\377KK\260\377O<C\377\203T1\377}R=\377JC\264\377>=\314"
"\3776.T\377nG*\377\210T.\377\207T.\377\200O+\377\202P+\377r^N\377\201"
"T3\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\212S*"
"\377\226\\1\377\233a5\377\264\223|\377\354\352\353\377\254\252\252\377"
"MB;\377gE-\377\177R0\377sM>\377DC\276\377JJ\353\377HG\323\377ID\254\377"
"KD\254\377FF\341\377>>\301\377<7\211\377G8Z\377vK,\377\203Q,\377\200"
"O+\377}R2\377vbR\377\202P*\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\216V,\377\232`4\377\230b:\377\317\303\273\377\335"
"\334\334\377`ZX\377uL/\377\230`6\377\227_6\377\217[5\377K9E\3770.m\377"
"54\211\377:9\237\377GG\340\377>>\272\3770/{\3773-[\377=/5\377sI*\377"
"\202Q,\377\202Q,\377{X>\377~dP\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\222Y/\377\232`5\377\234pO\377\335\333"
"\333\377\305\303\304\377N>4\377\227_6\377\230`6\377\227_6\377\226_5\377"
"\213X2\377pI,\377fC+\377E=z\377DD\325\377:1V\377gD*\377{O.\377\206T/"
"\377\207T/\377\201P,\377\205S.\377y`L\377\203`E\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\212S+\377\227^3\377\232`5\377"
"\233nM\377\326\324\324\377\337\336\336\377\210\201}\377\201]C\377\225"
"a;\377\231d=\377\225a:\377\224^5\377\223]5\377xRH\377JH\304\37776\216"
"\377\\\77*\377\214Y2\377\213W1\377\211V0\377\210U/\377\201Q-\377\204"
"S-\377{gX\377\204[<\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\216W.\377\231`5\377\231`5\377\221]5\377\244\226\214\377\341"
"\337\337\377\343\341\342\377\307\305\306\377\311\276\270\377\315\300"
"\271\377yj`\377\204U3\377\223]5\377`Ig\377=<\244\377C4@\377\206U1\377"
"\213X2\377\212W1\377\211V0\377\204S.\377\201Q-\377\200S1\377\177l]\377"
"\204T0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\207Q*\377"
"\223Z0\377\231`6\377\230`6\377\230`6\377zR4\377ne`\377\222\221\221\377"
"\261\257\260\377\270\266\267\377\251\247\250\377\\K@\377\220\\5\377\222"
"]5\377oK5\377P9+\377vM/\377\215Z3\377\213X2\377\212W1\377\210V0\377\203"
"R.\377\202R.\377\200Z>\377\205n]\377\203R-\377\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\212T+\377\226^4\377\227_5\377\227_5\377\230"
"`6\377\227`7\377}Q1\377W=+\377G8-\377E80\377K<2\377kG.\377\223^7\377"
"\222]6\377\221]6\377\220\\5\377\216Z4\377\215Z3\377\213X2\377\211W1\377"
"\210V1\377\202R.\377\205T/\377\203fQ\377\212jS\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\204O(\377\217X/\377\227_5\377\227_5\377"
"\226_5\377\227_6\377\226_6\377\226`7\377\225_7\377\223^6\377\220\\5\377"
"\221]6\377\223^7\377\222]6\377\221]6\377\220\\5\377\217[5\377\215Z4\377"
"\214Y3\377\213X3\377\211W1\377\210V1\377\202R.\377\204S/\377\207sd\377"
"\210bE\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\206Q*\377"
"\222[1\377\220Z2\377\212W0\377\213X1\377\213X2\377\213X2\377\217[4\377"
"\222]5\377\224^7\377\223^6\377\222^6\377\222^6\377\221]6\377\220\\6\377"
"\216[5\377\215Z4\377\214Y3\377\213Y3\377\211W2\377\210W2\377\205T0\377"
"\201Q.\377\202T2\377\212xj\377\207Y7\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0vH&\377\212V0\377\222\\4\377\225^5\377\224^5\377"
"\220[4\377\212X2\377\213X2\377\212X2\377\210W2\377\211X3\377\210W2\377"
"\206V1\377\210W3\377\212Y3\377\215[5\377\215[5\377\214Z4\377\212X3\377"
"\211W2\377\207V1\377\202R.\377\202R/\377\204^A\377\220{l\377\205S/\377"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""0\35\17\377Y6\35\377fD*\377"
"YB1\377ZC1\377fH1\377qL/\377{O.\377\206U1\377\217[4\377\222]6\377\221"
"]6\377\221]6\377\214Y4\377\210W2\377\206V2\377\204T0\377\203T1\377\202"
"S/\377\201R/\377\200R/\377\201R/\377\177Q.\377\204T0\377\213mW\377\223"
"xc\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\203P)\377\214Z5\377|X=\377hQ@\377\\L@\377RF=\377RF=\377WH<\377`J:"
"\377hL6\377qN3\377wN/\377\200R/\377\211X3\377\214Z4\377\213Y4\377\212"
"X3\377\211W2\377\203T0\377\200Q/\377\200Q.\377\203S/\377\221|l\377\220"
"mR\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0}N+\377\203R.\377\207U/\377\211Y5\377\211];\377\201"
"\\@\377y[E\377q[K\377hXL\377_TL\377\\RJ\377`RH\377gRC\377lQ=\377qP7\377"
"tM0\377yM-\377\177Q.\377\202S/\377\201S0\377\225\203v\377\214`@\377\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0tI)\377~P-\377\203"
"S/\377\210W2\377\215]9\377\213`\77\377\205`E\377\177cN\377|gW\377vf["
"\377oe\\\377mc\\\377obX\377q^P\377ycR\377\227\205w\377\207V2\377\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0oF(\377yM,\377\177Q.\377\202S/\377\206V1\377\213"
"\\9\377\213aB\377\210fL\377\210lX\377\207sc\377\220qZ\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"sH)\377xL+\377|O-\377\177Q.\377\203S/\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};

194
src/mape/icon/c4g.c 100644
View File

@ -0,0 +1,194 @@
/* GdkPixbuf RGBA C-Source image dump */
#include <glib/gtypes.h>
#ifdef __SUNPRO_C
#pragma align 4 (mape_icon_c4g)
#endif
#ifdef __GNUC__
const guint8 mape_icon_c4g[] __attribute__ ((__aligned__ (4))) =
#else
const guint8 mape_icon_c4g[] =
#endif
{ ""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (4096) */
"\0\0\20\30"
/* pixdata_type (0x1010002) */
"\1\1\0\2"
/* rowstride (128) */
"\0\0\0\200"
/* width (32) */
"\0\0\0\40"
/* height (32) */
"\0\0\0\40"
/* pixel_data: */
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\366\320)\377\365\320(\377\366\320(\377\365\317(\377\365\317"
"(\377\364\317(\377\365\317)\377\364\317)\377\364\316)\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\370\322)\377\370\321)\377\367\321)\377\367"
"\321)\377\367\321)\377\367\321)\377\366\320(\377\366\320)\377\365\320"
")\377\364\317(\377\364\316)\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\371\323)\377\371"
"\323)\377\371\323*\377\370\322)\377\371\323*\377\370\322*\377\370\322"
")\377\367\321)\377\367\322*\377\366\320)\377\366\320)\377\365\320)\377"
"\365\317)\377\0\0\0\0\0\0\0\0\0\0\0\0\362\315)\377\361\314(\377\360\313"
"(\377\357\312(\377\356\312(\377\355\311(\377\354\310'\377\353\307'\377"
"\352\306'\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\372\324+\377\361\322I\377\353\315I\377\351\314I\377\353\315J\377\353"
"\315I\377\354\316I\377\352\314H\377\352\314H\377\351\314H\377\351\313"
"H\377\346\310G\377\345\310G\377\351\313H\377\351\313F\377\350\312E\377"
"\350\312F\377\347\311E\377\346\310E\377\343\306D\377\342\305D\377\345"
"\310G\377\335\275/\377\331\270$\377\352\306'\377\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\346\327\224\377\354\326x\377\325\321\275"
"\377\324\323\315\377\327\325\317\377\326\325\316\377\324\322\314\377"
"\326\324\316\377\323\322\314\377\321\320\312\377\320\317\311\377\321"
"\320\312\377\320\317\311\377\316\315\307\377\316\314\307\377\316\315"
"\307\377\316\314\307\377\313\312\304\377\311\310\302\377\313\312\304"
"\377\317\316\310\377\301\300\272\377\330\327\321\377\210\200V\377k[\23"
"\377\331\270$\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\336"
"\336\336\377\336\336\336\377\335\335\335\377\335\335\335\377\334\334"
"\334\377\333\333\333\377\332\332\332\377\331\331\331\377\332\332\332"
"\377\331\331\331\377\331\331\331\377\331\331\331\377\330\330\330\377"
"\330\330\330\377\330\330\330\377\327\327\327\377\327\327\327\377\327"
"\327\327\377\326\326\326\377\326\326\326\377\321\321\321\377\205\205"
"\205\377\335\335\335\377\177yY\377[N\21\377\331\270$\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\361\361\361\377\357\357\357\377"
"\360\360\360\377\360\360\360\377\361\361\361\377\361\361\361\377\361"
"\361\361\377\362\362\362\377\362\362\362\377\363\363\363\377\363\363"
"\363\377\363\363\363\377\364\364\364\377\364\364\364\377\365\365\365"
"\377\364\364\364\377\363\363\363\377\371\371\371\377\364\364\364\377"
"\362\362\362\377\345\345\345\377vvv\377\323\323\323\377{tS\377bT\22\377"
"\333\272%\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\316\270X\377\304"
"\265r\377\273\254l\377\272\254m\377\270\253n\377\274\257t\377\277\262"
"w\377\277\262y\377\300\264~\377\301\265\201\377\303\267\205\377\303\270"
"\210\377\306\273\214\377\306\274\220\377\312\300\225\377\310\277\225"
"\377\305\274\223\377\305\274\224\377\304\273\224\377\303\273\226\377"
"\310\300\234\377\303\274\232\377\213\204d\377\320\312\253\377\220\204"
"K\377xf\25\377\307\250\"\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\367\321"
"(\377\367\321(\377\367\321)\377\367\321)\377\367\321)\377\366\321)\377"
"\366\320)\377\365\320)\377\365\320)\377\364\316(\377\364\317)\377\363"
"\316)\377\362\315)\377\355\311(\377\312\253*\377\315\256*\377\355\310"
"'\377\352\306'\377\351\305'\377\346\303&\377\343\301&\377\342\277&\377"
"\341\277&\377\337\275%\377\334\272$\377\336\274%\377\275\240\37\377x"
"f\25\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\366\320(\377\366\320(\377\366"
"\320(\377\365\317(\377\365\320(\377\365\317(\377\364\316(\377\364\316"
"(\377\363\316(\377\363\316(\377\362\315(\377\361\314(\377\312\254'\377"
"h\\f\37797\230\377^ST\377\340\275&\377\355\310'\377\353\307'\377\353"
"\307'\377\351\306'\377\351\305'\377\347\304'\377\346\302&\377\345\302"
"&\377\343\300%\377\342\277%\377\207s\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\364\316'\377\364\316'\377\364\317(\377\364\316(\377\364\316(\377"
"\363\316(\377\363\315'\377\363\315(\377\362\314'\377\362\315(\377\361"
"\314(\377\360\313'\377\207uI\37744\275\37721\251\377\223~7\377\354\310"
"'\377\353\307'\377\352\306&\377\351\305&\377\350\304&\377\347\303&\377"
"\345\302%\377\345\301%\377\344\301%\377\342\277%\377\341\277%\377\211"
"t\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\363\315'\377\362\315'\377\362"
"\315'\377\363\315'\377\362\315'\377\362\315'\377\361\314'\377\361\314"
"(\377\360\313'\377\360\313'\377\357\312'\377\356\312'\377uf\\\37744\301"
"\377@;o\377\317\260%\377\353\307'\377\317\257$\377\335\273$\377\350\304"
"&\377\346\303%\377\345\302%\377\345\302&\377\343\300%\377\342\277$\377"
"\341\276%\377\337\275$\377\213v\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\361\314'\377\361\314'\377\361\314'\377\360\313&\377\360\313'\377\360"
"\313'\377\357\312&\377\357\312&\377\357\312'\377\357\312'\377\356\311"
"'\377\331\270%\377KE\204\377/.\250\377l]6\377\342\300%\377\225\2007\377"
"84l\377TJG\377\316\257$\377\346\302&\377\344\301%\377\343\300$\377\342"
"\277%\377\341\276$\377\340\275$\377\336\274$\377\213v\30\377\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\360\313'\377\360\312&\377\357\312&\377\357\312"
"&\377\357\312&\377\357\312&\377\357\312'\377\355\310&\377\321\261#\377"
"\263\230\"\377\235\206!\377\204q*\37731\242\37751t\377\271\235#\377\340"
"\275$\377WN]\377//\271\377\77""9k\377\317\260\"\377\344\301%\377\342"
"\277$\377\342\277%\377\341\276$\377\340\275$\377\336\274#\377\335\273"
"#\377\214w\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\356\311&\377\356\311"
"&\377\356\311&\377\356\311&\377\355\311&\377\355\310&\377\353\306&\377"
"\242\2141\377{t]\377\200}|\377\204\202\203\377yw\202\377LK\251\377KC"
"A\377\330\266#\377\325\264$\377A<w\377--\264\377QG@\377\324\264\"\377"
"\342\277$\377\342\277$\377\341\276$\377\337\275$\377\336\274$\377\335"
"\273$\377\334\272$\377\213v\27\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\354"
"\310%\377\354\310&\377\354\307%\377\353\307%\377\354\307&\377\352\306"
"%\377\250\2239\377\234\232\227\377\301\300\300\377\243\241\242\377\241"
"\235\227\377\255\252\251\377ml\221\377]P$\377\306\250!\377\260\225\40"
"\37720\213\377*)\223\377yg\"\377\311\252!\377\341\276$\377\340\275$\377"
"\337\275$\377\335\273#\377\335\273#\377\334\272#\377\332\270\"\377\215"
"x\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\353\307%\377\352\306"
"%\377\352\306%\377\352\305%\377\320\260#\377\217\210t\377\303\302\302"
"\377mi`\377xh#\377\261\226\40\377\201qQ\37765\252\377('v\3774/N\3774"
"/F\377)(\240\377&%\205\3772-I\377ND,\377\316\256!\377\336\274#\377\336"
"\273#\377\334\272#\377\334\272#\377\332\271#\377\331\267\"\377\213v\27"
"\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\351\305%\377\351\305%\377"
"\350\304$\377\351\305%\377\277\242%\377\240\235\227\377\247\245\246\377"
"TJ!\377\317\257!\377\345\302$\377\265\232/\377=8|\377((\244\377))\255"
"\377''\246\377))\261\377('\216\377@:h\377gX)\377\323\262\"\377\335\273"
"#\377\334\272#\377\333\271#\377\332\270\"\377\331\270#\377\330\266\""
"\377\214w\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\347\303$\377"
"\347\303$\377\346\303$\377\347\303%\377\306\250(\377\250\245\237\377"
"\244\242\242\377RH\37\377\327\266\"\377\344\301$\377\344\300$\377\273"
"\237#\377\214x3\377\213w;\377B;_\377&&\241\377VJ2\377\277\241\36\377"
"\323\262\"\377\334\272#\377\334\272#\377\332\270\"\377\331\267\"\377"
"\331\267#\377\330\266\"\377\326\265!\377\214w\30\377\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\345\302$\377\345\301$\377\345\301$\377\345\301"
"$\377\321\260!\377\254\245\213\377\272\270\271\377VQA\377\255\223\40"
"\377\327\266\"\377\337\275#\377\335\273#\377\333\271#\377\326\264!\377"
"KBX\377&%\210\377\210s\34\377\330\267\"\377\334\272#\377\333\271\"\377"
"\332\270\"\377\331\270#\377\330\267\"\377\327\266\"\377\326\264!\377"
"\325\264\"\377\213v\27\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\343"
"\277#\377\343\300$\377\343\277#\377\343\277#\377\342\277#\377\306\264"
"f\377\300\276\277\377\212\210\211\377ID6\377SG\34\377q`\33\377vf!\377"
"\276\240\40\377\315\255!\377>8e\3774/g\377\271\235\37\377\332\270\"\377"
"\333\271#\377\332\270#\377\330\267\"\377\330\266\"\377\327\265\"\377"
"\326\265\"\377\324\263!\377\323\263!\377\216y\30\377\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\341\276#\377\341\276#\377\341\276#\377\341\276"
"#\377\340\275#\377\327\2700\377\300\265\214\377\277\275\275\377\253\251"
"\251\377\216\214\214\377\207\205\206\377rok\377\236\206\35\377\330\266"
"\"\377\207s8\377sb*\377\320\260!\377\332\270\"\377\331\267\"\377\330"
"\267\"\377\327\266\"\377\326\264!\377\325\264!\377\324\263!\377\323\262"
"!\377\322\262!\377\217y\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\342\277$\377\337\274#\377\337\275#\377\337\274\"\377\337\274#\377"
"\336\274#\377\324\2661\377\270\251i\377\244\236\215\377\251\245\237\377"
"\250\245\237\377\206\177h\377\243\212\34\377\327\266\"\377\331\270\""
"\377\320\260!\377\330\267\"\377\330\266\"\377\326\265!\377\326\265\""
"\377\325\264!\377\325\264!\377\323\263!\377\323\262!\377\322\261!\377"
"\320\260!\377\216y\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\340"
"\276$\377\335\273\"\377\335\273#\377\336\273#\377\335\272\"\377\334\272"
"\"\377\334\272\"\377\330\266!\377\304\246\40\377\277\243)\377\300\244"
")\377\312\253$\377\325\264!\377\331\267\"\377\330\267\"\377\330\266\""
"\377\327\266\"\377\327\265\"\377\326\265\"\377\324\263!\377\324\263!"
"\377\323\262!\377\322\262!\377\321\261!\377\320\260!\377\317\257!\377"
"\215w\30\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\334\272\"\377\334\271\"\377\333\271\"\377\333\271\"\377\333\271\"\377"
"\332\270\"\377\332\270\"\377\332\270\"\377\331\267\"\377\330\266!\377"
"\330\267\"\377\327\266!\377\327\266\"\377\326\265!\377\325\264\"\377"
"\325\264!\377\323\262!\377\323\262!\377\322\262!\377\321\261!\377\320"
"\260!\377\317\257\40\377\316\256\40\377\316\256\40\377\221{\30\377\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\322\261!\377\321"
"\261!\377\320\260!\377\317\257\40\377\316\256\40\377\315\255\40\377\314"
"\255\40\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};

197
src/mape/icon/c4m.c 100644
View File

@ -0,0 +1,197 @@
/* GdkPixbuf RGBA C-Source image dump */
#include <glib/gtypes.h>
#ifdef __SUNPRO_C
#pragma align 4 (mape_icon_c4m)
#endif
#ifdef __GNUC__
const guint8 mape_icon_c4m[] __attribute__ ((__aligned__ (4))) =
#else
const guint8 mape_icon_c4m[] =
#endif
{ ""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (4096) */
"\0\0\20\30"
/* pixdata_type (0x1010002) */
"\1\1\0\2"
/* rowstride (128) */
"\0\0\0\200"
/* width (32) */
"\0\0\0\40"
/* height (32) */
"\0\0\0\40"
/* pixel_data: */
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\253\253\331\377\253"
"\253\332\377\261\261\341\377\264\264\343\377\256\256\336\377\251\251"
"\327\377\243\243\317\377\233\233\305\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\271\271\351\377\277\277\357\377\313\313\372\377\320\320"
"\375\377\324\324\377\377\323\323\376\377\320\320\376\377\312\312\375"
"\377\302\302\365\377\270\270\352\377\252\252\331\377\234\234\306\377"
"\217\217\267\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\271\271\352\377\305\305\364\377\325\325\376\377\340"
"\340\377\377\345\345\377\377\350\350\377\377\350\350\377\377\346\346"
"\377\377\343\343\377\377\335\335\377\377\325\325\377\377\314\314\376"
"\377\300\300\364\377\264\264\345\377\242\242\317\377\224\224\274\377"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\306\306\370\377"
"\323\323\376\377\341\341\377\377\353\353\377\377\360\360\377\377\364"
"\364\377\377\365\365\377\377\364\364\377\377\362\362\377\377\357\357"
"\377\377\322\321\362\377\240\237\341\377\202\200\323\377\236\232\313"
"\377\303\303\367\377\265\265\347\377\244\244\321\377\223\223\273\377"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\370\377\332\332\376\377"
"\351\351\377\377\361\361\377\377\367\367\377\377\373\373\377\377\375"
"\375\377\377\376\376\377\377\374\374\377\377\373\373\377\377\267\264"
"\322\377VT\310\377>>\326\3772.\242\377[Rp\377\302\302\363\377\270\270"
"\353\377\260\260\341\377\240\240\314\377\220\220\270\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\331\331\376\377\355\355\377\377\365\365\377\377\373"
"\373\377\377\376\376\377\377\377\377\377\377\377\377\377\377\377\377"
"\377\377\377\377\377\377\377\377\377\377{v\266\377@@\331\37799\312\377"
",\40P\377pk\205\377\215\215\264\377\216\216\265\377\233\233\305\377\240"
"\240\314\377\227\227\300\377\215\215\263\377\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\322\322\372"
"\377\352\352\377\377\367\367\377\377\375\375\377\377\377\377\377\377"
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
"\377\377\377\346\344\351\377^[\307\377@@\331\377.&{\377H=J\377xx\231"
"\377ww\227\377}|\236\377\204\204\250\377\213\213\261\377\214\214\263"
"\377\214\214\263\377\214\214\262\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\341\341\377\377\364\364\377"
"\377\375\375\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\244"
"\242\326\377BB\333\3773/\240\3774'<\377ec}\377ki\204\377JF\227\377EB"
"\245\377ZV\207\377\216\215\263\377\225\225\276\377\216\216\266\377\214"
"\214\263\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\322\322\374\377\353\353\377\377\371\371\377\377\377\377\377"
"\377\377\377\377\377\377\377\377\377\375\375\375\377\360\357\357\377"
"\335\332\332\377\316\312\312\377\272\263\263\377da\302\377\77>\323\377"
"+\37N\377QJ[\377ll\212\377YU\203\37798\300\37777\313\37790l\377\237\235"
"\305\377\247\247\324\377\231\231\302\377\217\217\266\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\326\326\375\377"
"\360\360\377\377\373\373\377\377\377\377\377\377\377\377\377\377\367"
"\367\367\377\360\360\360\377\345\344\344\377\345\344\344\377\341\340"
"\340\377\314\311\311\377~}\262\377+%x\377=1<\377ff\201\377on\215\377"
"IE\227\37799\316\377/+\235\377aXu\377\233\233\304\377\226\226\276\377"
"\230\230\302\377\224\224\275\377\221\221\270\377\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\333\333\377\377\362\362\377\377"
"\374\374\377\377\377\377\377\377\364\364\364\377\355\355\355\377\347"
"\347\347\377\267\264\264\377\231\223\223\377\233\224\224\377\265\262"
"\275\377{{\225\377$\32""7\377YUj\377kk\210\377nk\212\377=:\254\37799"
"\315\3777.o\377\210\205\245\377\224\224\275\377\227\227\300\377\232\232"
"\305\377\233\233\305\377\226\226\277\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\333\333\377\377\360\360\377\377\372\372"
"\377\377\364\363\364\377\355\355\355\377\351\351\351\377\201yy\3770\""
"$\3775*2\377E=I\377B<\206\377EE\300\37770\177\377OJv\377^Xq\377ga\223"
"\377::\310\3772/\250\377G<V\377\200|\235\377\224\224\274\377\235\235"
"\310\377\241\241\315\377\242\242\316\377\236\236\311\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\277\277\361\377\330\330\376\377"
"\354\354\377\377\367\367\377\377\352\351\352\377\354\354\354\377\261"
"\255\255\377/!#\377=9F\377ff\177\377\260\260\312\377\212\206\277\377"
"BA\324\377AA\330\377>=\311\37795\251\377:6\255\377::\316\37753\266\377"
"4/\223\3770'j\377rl\212\377\245\245\322\377\250\250\327\377\252\252\331"
"\377\246\246\323\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\270\270\351\377\323\323\375\377\347\347\377\377\357\357\375\377\352"
"\352\354\377\351\351\351\377\200xx\3771&-\377II\\\377\266\266\313\377"
"\366\366\373\377\334\331\333\377yr\233\377@8}\3774-\204\3774.\215\377"
"87\302\37765\277\3772+|\377D=x\377ZRw\377\217\213\260\377\254\254\333"
"\377\260\260\341\377\263\263\343\377\255\255\335\377\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\371\377\336\336\377"
"\377\350\350\375\377\352\352\355\377\347\347\347\377pgg\3772(/\377UU"
"j\377\323\323\342\377\376\376\377\377\376\376\377\377\375\374\376\377"
"\315\312\316\377\226\222\244\377[So\37796\266\377-'\204\377jb{\377\236"
"\235\310\377\250\250\326\377\257\257\337\377\265\265\346\377\270\270"
"\353\377\272\272\355\377\264\264\345\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\272\272\354\377\324\324\377\377\340\340"
"\377\377\350\350\357\377\351\351\351\377\220\214\214\377.\40$\377TQb"
"\377\322\322\344\377\372\372\377\377\375\375\377\377\376\376\377\377"
"\375\375\377\377\367\367\375\377\177z\251\37799\314\377=4n\377\227\226"
"\276\377\251\251\330\377\260\260\341\377\267\267\352\377\274\274\360"
"\377\301\301\365\377\301\301\366\377\272\272\355\377\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\253\253\332\377\306\306\370"
"\377\325\325\377\377\343\343\364\377\351\351\351\377\330\330\330\377"
"\204||\377SHL\377skw\377\271\265\272\377\324\321\324\377\314\310\313"
"\377\373\373\377\377\360\357\365\377_Z\246\37720\255\377qj\206\377\260"
"\260\335\377\262\262\343\377\270\270\353\377\277\277\364\377\305\305"
"\372\377\310\310\376\377\307\307\375\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\234\234\307\377\264\264\344\377"
"\311\311\374\377\331\331\375\377\341\341\353\377\347\347\347\377\346"
"\346\346\377\323\322\322\377\300\274\274\377\275\271\271\377\247\243"
"\243\377kbm\377\312\312\344\377\306\305\334\377^W\223\377UM}\377\266"
"\262\302\377\272\272\350\377\271\271\355\377\301\301\366\377\311\311"
"\376\377\315\315\377\377\317\317\377\377\314\314\377\377\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\234\234"
"\307\377\272\272\355\377\314\314\374\377\321\320\361\377\300\275\311"
"\377\266\262\263\377\306\304\304\377\323\321\321\377\314\312\312\377"
"\221\213\213\377WNa\377\217\217\267\377\231\231\302\377\247\246\312\377"
"\350\347\362\377\357\357\376\377\305\305\363\377\302\302\370\377\311"
"\311\375\377\317\317\377\377\323\323\377\377\325\325\377\377\317\317"
"\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\212\212\260\377\245\245\322\377\277\277\362\377\321\321"
"\377\377\335\335\377\377\272\266\313\377\235\227\246\377wp\203\377c\\"
"n\377icx\377\200}\236\377\227\227\300\377\244\244\320\377\274\274\351"
"\377\345\345\376\377\372\372\377\377\347\347\377\377\323\323\376\377"
"\322\322\377\377\327\327\377\377\332\332\377\377\330\330\377\377\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\220\220\267\377\254\254\333\377\302\302\366\377\321"
"\321\377\377\334\334\377\377\345\345\377\377\323\323\362\377\261\261"
"\332\377\232\232\304\377\231\231\303\377\241\241\315\377\256\256\335"
"\377\312\312\367\377\351\351\377\377\370\370\377\377\355\355\377\377"
"\341\341\377\377\333\333\377\377\334\334\377\377\334\334\377\377\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\222\222\272\377\255\255\335\377\303"
"\303\366\377\321\321\377\377\332\332\377\377\342\342\377\377\343\343"
"\377\377\327\327\370\377\313\313\357\377\301\301\352\377\303\303\360"
"\377\313\313\373\377\330\330\377\377\333\333\377\377\341\341\377\377"
"\337\337\377\377\337\337\377\377\337\337\377\377\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\224\224\275\377\252\252\331\377\300"
"\300\363\377\315\315\376\377\327\327\377\377\335\335\377\377\342\342"
"\377\377\344\344\377\377\344\344\377\377\342\342\377\377\336\336\377"
"\377\334\334\377\377\331\331\377\377\333\333\377\377\336\336\377\377"
"\337\337\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\246\246\324\377\267\267\351\377\306\306\371"
"\377\317\317\377\377\327\327\377\377\332\332\377\377\334\334\377\377"
"\334\334\377\377\333\333\377\377\332\332\377\377\332\332\377\377\334"
"\334\377\377\335\335\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\257\257"
"\337\377\272\272\355\377\304\304\370\377\314\314\375\377\320\320\377"
"\377\323\323\377\377\326\326\377\377\331\331\377\377\333\333\377\377"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0"};

194
src/mape/icon/c4s.c 100644
View File

@ -0,0 +1,194 @@
/* GdkPixbuf RGBA C-Source image dump */
#include <glib/gtypes.h>
#ifdef __SUNPRO_C
#pragma align 4 (mape_icon_c4s)
#endif
#ifdef __GNUC__
const guint8 mape_icon_c4s[] __attribute__ ((__aligned__ (4))) =
#else
const guint8 mape_icon_c4s[] =
#endif
{ ""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (4096) */
"\0\0\20\30"
/* pixdata_type (0x1010002) */
"\1\1\0\2"
/* rowstride (128) */
"\0\0\0\200"
/* width (32) */
"\0\0\0\40"
/* height (32) */
"\0\0\0\40"
/* pixel_data: */
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\260\332\377\377\261"
"\332\377\377\260\331\377\377\257\330\377\377\257\330\377\377\255\326"
"\377\377\255\326\377\377\254\324\377\377\253\323\377\377\253\323\377"
"\377\251\321\377\377\251\321\377\377\250\317\377\377\247\316\377\377"
"\246\314\377\377\245\313\377\377\244\312\377\377\243\311\377\377\242"
"\307\377\377\236\303\375\377p\211\265\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\251\320\371\377\263\334\377\377\263\334\377\377\263\334\377\377"
"\213\314\302\377t\272\237\377\241\312\344\377\265\335\377\377\264\335"
"\377\377\265\335\377\377\264\335\377\377\264\334\377\377\264\334\377"
"\377\263\332\377\377\263\332\377\377\262\331\377\377\261\330\377\377"
"\260\326\377\377\257\325\377\377\255\324\377\377\254\322\377\377\253"
"\321\377\377\252\317\377\377\250\315\377\377\246\313\377\377\244\311"
"\377\377\221\261\344\377FUr\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\247\316"
"\370\377\262\332\377\377\262\333\377\377\256\330\370\377R\255a\377(|"
"$\377i\215\221\377\265\336\377\377\265\335\377\377\265\335\377\377\265"
"\335\377\377\265\335\377\377\265\334\377\377\264\333\377\377\264\333"
"\377\377\263\332\377\377\262\330\377\377\261\327\377\377\260\326\377"
"\377\256\324\377\377\254\322\377\377\253\321\377\377\251\316\377\377"
"\247\314\377\377\246\313\377\377\244\310\377\377\214\253\336\377DSp\377"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\250\316\371\377\260\331\377\377\261"
"\331\377\377\231\316\332\3772\2425\377\36r\35\377^~\203\377\263\333\377"
"\377\264\334\377\377\265\334\377\377\264\333\377\377\264\333\377\377"
"\263\332\377\377\263\332\377\377\263\332\377\377\262\330\377\377\261"
"\327\377\377\260\326\377\377\257\324\377\377\255\322\377\377\253\321"
"\377\377\252\317\377\377\250\315\377\377\246\313\377\377\245\311\377"
"\377\243\307\377\377\205\243\324\377AOk\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\251\320\373\377t\264\237\377\226\302\330\377\207\304\300\377)"
"\234(\377\40c\35\377\\{\203\377\262\332\377\377\263\332\377\377\263\332"
"\377\377\263\332\377\377\263\332\377\377\262\331\377\377\261\330\377"
"\377\261\330\377\377\260\327\377\377\273\331\342\377\311\336\267\377"
"\320\335\241\377\277\317\271\377\252\310\346\377\251\315\377\377\250"
"\314\377\377\246\312\377\377\244\310\377\377\242\306\377\377~\232\311"
"\377@Ni\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\244\316\364\377D\226U\377"
"\213\265\311\377x\274\251\377)\233(\377\35X\32\377d\203\221\377\260\327"
"\377\377\260\330\377\377\261\330\377\377\261\330\377\377\261\327\377"
"\377\261\330\377\377\260\326\377\377\260\326\377\377\310\340\301\377"
"\363\365[\377\377\377A\377\377\372=\377\373\3457\377\317\301\\\377\242"
"\275\326\377\246\312\377\377\244\310\377\377\243\307\377\377\241\305"
"\377\377v\220\276\377@Ni\377\0\0\0\0\0\0\0\0\0\0\0\0\224\267\352\377"
"\231\310\342\377<\213E\377\217\270\323\377r\257\227\377,\226*\377\33"
"O\30\377l\213\235\377\257\325\377\377\220\310\317\377\246\317\362\377"
"\257\326\377\377\257\326\377\377\257\326\377\377\256\324\377\377\277"
"\331\321\377\367\370Q\377\377\377D\377\377\377E\377\377\370A\377\377"
"\350:\377\354\3141\377\250\241`\377\237\300\357\377\243\307\377\377\241"
"\305\377\377\240\303\377\377p\210\265\377\77Mh\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\227\272\355\377\223\302\333\377.\2133\377F\241X\377:\233A\377"
"&\225%\377\22D\21\377u\223\254\377\222\305\320\3770\2263\377h\232\226"
"\377\256\324\377\377\255\323\377\377\255\323\377\377\255\323\377\377"
"\325\340\223\377\377\376\77\377\377\376D\377\377\372D\377\377\357\77"
"\377\375\3409\377\347\3070\377\257\231,\377\221\252\313\377\241\305\377"
"\377\240\303\377\377\237\302\377\377h~\251\377\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\227\272\356\377\250\316\377\377u\241\255\377U\203x\377,\216"
"4\377#\221#\377\16@\16\377~\236\275\377s\270\245\377!\211!\377X\202\200"
"\377\253\321\377\377\254\321\377\377\253\321\377\377\253\316\370\377"
"\336\330i\377\377\357;\377\377\362\77\377\377\354>\377\375\340;\377\363"
"\3236\377\326\271-\377\235\207\40\377\200\225\260\377\241\304\377\377"
"\237\302\377\377\236\301\377\377_t\234\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\227\272\357\377\246\315\377\377\247\315\377\377\242\313\370\377"
"<\241N\377#\215#\377\23@\26\377\206\250\312\377d\257\214\377\"~\40\377"
"\\\201\210\377\252\317\377\377\252\317\377\377\251\316\377\377\251\316"
"\377\377\317\311y\377\370\3314\377\375\3368\377\371\3317\377\357\317"
"4\377\335\277/\377\274\242'\377}p*\377\210\243\320\377\237\302\377\377"
"\235\300\377\377\234\277\377\377Ym\223\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\227\272\360\377\244\312\377\377\245\313\377\377\224\303\343\377"
"/\2309\377\36~\36\377\25C\32\377}\251\274\377[\243y\377\37l\35\377f\210"
"\232\377\247\315\377\377\250\315\377\377\250\315\377\377\247\313\377"
"\377\253\267\245\377\321\264*\377\337\301.\377\334\276.\377\321\265,"
"\377\271\240'\377\222~\36\377gmc\377\237\302\377\377\236\301\377\377"
"\234\277\377\377\231\273\373\377Sf\211\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\227\272\361\377\243\311\377\377\243\311\377\377\207\272\321\377"
"&\226)\377\40y\37\377&\200#\3778\243>\3771\2171\377\40I$\377\204\243"
"\314\377\245\312\377\377\246\312\377\377\245\312\377\377\245\311\377"
"\377\242\306\374\377\230\233x\377\242\214!\377\255\225#\377\241\213!"
"\377zi\32\377im^\377\212\250\334\377\235\300\377\377\234\276\377\377"
"\233\275\376\377\224\265\364\377N_\201\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\225\256\324\377\240\277\355\377\241\303\367\377z\263\272\377!"
"\223!\377\34u\34\377\35R\31\377\36V\34\377\30F\34\377Zu\215\377\244\311"
"\377\377\243\310\377\377\243\310\377\377\243\310\377\377\242\307\377"
"\377\242\306\377\377\234\276\363\377\205\232\263\377v\177}\377r|}\377"
"r\206\244\377\223\263\356\377\235\277\377\377\233\276\377\377\232\274"
"\375\377\231\273\374\377\217\257\353\377HXw\377\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\205e\"\377\216q2\377\217w\77\377d\202<\377!\221!\377\31j\30"
"\377\"4\32\377jeJ\377xxl\377\232\245\257\377\234\255\301\377\236\262"
"\320\377\236\267\334\377\237\275\355\377\240\301\366\377\240\302\374"
"\377\240\304\377\377\237\302\377\377\236\301\377\377\235\300\377\377"
"\235\300\377\377\233\276\377\377\233\275\376\377\232\274\375\377\231"
"\273\373\377\227\271\371\377\210\247\340\377CQn\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\205_\17\377\211b\20\377\211b\20\377Sv\27\377!\221!\377"
"\32b\30\377*1\11\377\213c\22\377\212c\22\377\213d\23\377\213d\23\377"
"\214h\34\377\215k%\377\215q3\377\216v@\377\217{M\377\220\201^\377\220"
"\207n\377\222\214~\377\222\222\216\377\223\230\236\377\224\236\257\377"
"\224\242\274\377\224\247\311\377\224\253\324\377\224\260\343\377\177"
"\230\307\377\77Lf\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\206_\17\377\210"
"`\17\377\207`\17\377Jw\31\377\40\215\40\377\26\\\25\377/1\11\377\211"
"b\21\377\212c\22\377\211c\22\377\211b\22\377\211b\22\377\211c\23\377"
"\211c\23\377\210b\23\377\210b\23\377\210b\24\377\207b\23\377\207a\23"
"\377\206a\23\377\205`\23\377\205`\23\377\204_\22\377\204b\32\377\203"
"c\40\377\203h.\377n[1\3776/\37\377\0\0\0\0\0\0\0\0\0\0\0\0tR\15\377\206"
"_\17\377\206_\17\377\206`\17\377Jv\"\377#\210\"\377\22S\22\37774\11\377"
"\207a\24\377\215q5\377\213p7\377\205c\34\377\210b\22\377\207a\22\377"
"\207a\22\377\207a\23\377\206`\22\377\206a\23\377\206`\23\377\205`\22"
"\377\205`\23\377\204_\22\377\203_\22\377\203^\22\377\202]\22\377\201"
"]\21\377\200\\\21\377dH\14\3773%\6\377\0\0\0\0\0\0\0\0\0\0\0\0tS\14\377"
"\204]\16\377\204^\17\377\201`\17\3775\200\34\377\36\207\36\377\20M\20"
"\377=6\14\377\222\203b\377\246\247\247\377\244\245\246\377\210\202r\377"
"{_$\377\206`\22\377\205`\22\377\205`\22\377\204_\22\377\204_\21\377\204"
"_\22\377\204_\22\377\203^\22\377\202^\22\377\202]\22\377\201\\\21\377"
"\200\\\21\377\177[\21\377\177[\21\377^D\14\3772$\5\377\0\0\0\0\0\0\0"
"\0\0\0\0\0vT\15\377\203]\16\377\203]\16\377va\20\377(\202\33\377\40\201"
"\37\377\16F\16\377C@\36\377\211\210\205\377\226\227\227\377\225\226\226"
"\377\202\203\204\377h]C\377\212l/\377\204c\35\377\203^\21\377\203^\21"
"\377\203^\21\377\202^\21\377\202]\21\377\201\\\21\377\200\\\21\377\200"
"[\20\377\177[\21\377\177[\21\377~Z\20\377}Y\20\377X\77\13\3772$\5\377"
"\0\0\0\0\0\0\0\0\0\0\0\0vT\15\377\201\\\16\377\202\\\16\377kb\21\377"
"#\203\36\377'v#\377\15;\14\377F;\23\377hcV\377nop\377lmm\377XYY\377v"
"ww\377\244\243\241\377\216\210z\377z_'\377\202]\21\377\201\\\20\377\201"
"\\\21\377\200\\\20\377\200\\\21\377\177\\\21\377~Z\20\377~[\20\377}Y"
"\20\377|Y\20\377|Y\20\377R;\12\3771$\5\377\0\0\0\0\0\0\0\0\0\0\0\0uS"
"\15\377\177Z\15\377\200[\16\377`d\21\377\37\207\36\377$p\40\377\22""4"
"\20\377Q=\13\377jQ\34\377JB1\37774.\377C<,\377ttr\377\206\207\207\377"
"vww\377eV5\377\200\\\20\377\177[\20\377~Z\17\377~[\20\377~[\20\377}Y"
"\17\377}Z\20\377|Y\17\377|Y\20\377{X\17\377zX\17\377L6\11\377\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0vT\15\377~Z\16\377\177Z\16\377cc\24\377,\177"
"\40\377\36o\32\377\24""0\16\377YB\13\377\177Z\16\377yV\17\377pP\16\377"
"xU\16\377dS.\377HE\77\377FA5\377cJ\27\377~Z\17\377}Y\17\377~Z\20\377"
"}Y\17\377}Y\20\377|Y\17\377{X\17\377{X\17\377zX\17\377zW\17\377yW\17"
"\377F2\10\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U<\11\377`E\13\377kM\14"
"\377sS\14\377m^\20\377e^\20\377eO\16\377xV\15\377~Z\16\377~Z\16\377}"
"Y\16\377}Y\16\377~Z\17\377nP\20\377rR\17\377}Y\17\377}Y\17\377}Y\17\377"
"|Y\17\377{X\17\377{X\17\377{X\17\377zW\17\377zW\17\377yW\17\377xV\16"
"\377vT\16\377A/\7\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0+\40\5\377"
"0#\6\3778(\6\377\77.\7\377I5\10\377S<\11\377_D\12\377iK\13\377rQ\14\377"
"zW\16\377|X\16\377|X\16\377{X\16\377|X\16\377{X\16\377{X\16\377zW\16"
"\377zW\16\377zW\17\377yV\16\377yW\17\377yW\17\377yV\16\377wU\16\377w"
"U\16\377rR\15\377=,\7\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0+\37\5\377-!\5\3776'\6\377"
"=,\6\377H4\10\377R;\11\377]B\13\377gI\13\377pP\15\377wU\15\377zW\16\377"
"yV\16\377yV\16\377yV\16\377xV\16\377wU\16\377wU\16\377vT\16\377vT\15"
"\377oO\14\3779)\6\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0*\37\5\377+\40\5\3774%\6\377<+\7\377D1\10\377O9\11"
"\377Z@\12\377bF\13\377lM\14\377sR\15\377vT\16\377vT\16\377tS\15\377i"
"K\14\3774&\6\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\35"
"\4\377*\36\5\377/\"\5\3778)\6\377B0\10\377L7\11\377V>\12\377S<\12\377"
"2%\6\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(\35\5\377(\35\4\377+\40\5\377\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};

View File

@ -0,0 +1,8 @@
#include <glib/gtypes.h>
extern const guint8 mape_icon_c4d[];
extern const guint8 mape_icon_c4f[];
extern const guint8 mape_icon_c4g[];
extern const guint8 mape_icon_c4m[];
extern const guint8 mape_icon_c4s[];
extern const guint8 mape_icon_tex[];

159
src/mape/icon/tex.c 100644
View File

@ -0,0 +1,159 @@
/* GdkPixbuf RGB C-Source image dump */
#include <glib/gtypes.h>
#ifdef __SUNPRO_C
#pragma align 4 (mape_icon_tex)
#endif
#ifdef __GNUC__
const guint8 mape_icon_tex[] __attribute__ ((__aligned__ (4))) =
#else
const guint8 mape_icon_tex[] =
#endif
{ ""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (3072) */
"\0\0\14\30"
/* pixdata_type (0x1010001) */
"\1\1\0\1"
/* rowstride (96) */
"\0\0\0`"
/* width (32) */
"\0\0\0\40"
/* height (32) */
"\0\0\0\40"
/* pixel_data: */
"\211\211\211\210\210\210\203\203\203\222\222\222\231\231\230\177~~tt"
"tpoorrrtttpppiii\204\204\204\202\202\202sssxxx\213\213\213\221\221\221"
"\213\213\213rsr|||tttiii\\\\\\VVVuuu\212\212\212\207\207\207\203\203"
"\203\203\203\203\215\215\214\220\220\220\203\203\203\207\207\207\216"
"\215\215\200\200\200xxxnnnkkkkkksssrrrtttppp\216\216\216\244\244\244"
"\227\227\227\222\221\221\217\217\217\211\212\211\221\220\220\224\224"
"\224\221\221\221\210\210\207hhhkkk}}}jjjdddlll\203\203\203\200\200\200"
"\205\205\205\204\204\204nnniiimmmtttwwwwww\212\212\212\227\227\227\224"
"\223\223\224\224\224\200\200\200nnn\235\234\234\220\217\220\212\211\211"
"\216\216\216\216\216\216\203\203\202zzzjjjiiihhhZZZ\204\204\204\226\226"
"\226\225\225\225}}}]]]ooo\223\222\222\216\216\216}}}\210\207\207\215"
"\214\214\204\204\204\206\205\205\205\204\204\177\177\177~~~}}}\200\200"
"\200\214\214\213\207\207\207ggg~~~\206\206\206\206\206\206\206\206\206"
"\202\202\201~}}\225\225\225\202\202\202~}}\214\214\214rrrwww\214\214"
"\214\205\205\205\221\221\221\207\207\207ppp~~~\214\214\214zzz\211\211"
"\211\234\234\233\230\230\230\214\214\214\215\215\215\212\212\211}}|l"
"llkkk\205\205\205}}}iih}||\217\217\217\231\230\230\230\230\230\230\230"
"\230\222\222\222\202\202\202\201\201\201\205\205\205\200\177\177vvv\204"
"\204\204\204\204\204vvvtttvvv\211\211\211\223\223\223\204\204\204xxx"
"vvv\213\213\213\221\221\221\202\202\202tttppouuuvvvpppssseeebbb\214\214"
"\214\226\226\226\223\223\223\216\216\216\223\223\223\216\216\216\200"
"\200\200{{{\226\226\226\231\231\231\236\236\236\235\235\234\230\227\227"
"\177\177\177iiittt\200\200\177\202\202\202zzzzzz\224\224\224uuuooott"
"tpppzzz\206\206\205\227\227\227\224\224\224\237\240\240\223\223\222y"
"yy\200\200\200\217\216\216\205\205\205\203\203\203\204\204\203\206\206"
"\206\202\202\202\210\210\210\237\237\237\230\230\230\237\237\237\232"
"\231\231\232\232\232\236\236\236\210\207\207nnnpppooosss\202\202\201"
"\210\210\210\202\201\201yyyqqq\207\207\207\227\227\227\234\234\234\234"
"\233\233\225\225\225\224\224\224\230\230\230\215\214\214\201\201\201"
"\201\201\200\207\207\207~~~xxx}}}}}}\202\202\202\232\232\232\230\227"
"\227\215\214\214\211\211\211\205\205\205\217\220\217\203\202\202qqq]"
"]]\221\221\221\224\223\224\221\220\220qqqiiijjjuuu\234\234\234\235\235"
"\235\234\234\234\223\223\223\216\216\216\217\217\217\216\216\216\220"
"\217\217\200\200\200\202\202\202\216\216\216vvv\201\201\201\204\203\203"
"\212\212\212vvv\210\210\207\213\213\212\206\206\206~}}ssswwvqqqgggZZ"
"Zqqqrrrooo\223\223\223ooo\206\206\206www\177\177\177\202\202\202\207"
"\207\207\201\201\201\205\205\205\206\206\206\211\211\211\210\210\210"
"\213\212\212\225\224\224\203\203\203\202\202\202\205\205\205\207\207"
"\207\230\230\230\221\221\221\225\224\224\227\227\227\213\213\213\206"
"\206\206\202\202\202\236\236\236\223\223\223\226\226\226\224\224\224"
"ssswwv\213\213\213\207\206\206oop\210\210\207\207\207\207\215\215\215"
"\206\206\206xxxiiihhhnnnvvv\204\204\203\203\203\203\177\177\177\177~"
"~\232\232\232\226\226\226\217\216\216\220\220\220\221\221\221\213\213"
"\213~~~yyy}||xxx\232\232\232\216\216\216\204\204\204\203\203\203xxxu"
"uu\224\224\224}}}\201\201\201\224\224\224\232\232\232\230\230\230\232"
"\232\231\207\207\207rrr\212\212\212\207\207\207lllwvv}}}xxx\203\203\203"
"\227\227\226\224\223\223\221\221\221\222\222\222\234\234\233\216\216"
"\216\210\207\207\205\205\205vvvvvv\207\206\206~~~ppprrrwwwrqqxxxoooc"
"cclll|||\200\200\200vvvmmm\220\217\217\234\234\234\241\241\241\222\222"
"\222}}}ooottt\221\221\221\241\241\241\232\232\232\220\220\217\216\216"
"\216\215\215\215\216\216\216\177\177~ttt\224\224\224\225\224\224\243"
"\243\243\221\221\220\177\177~\221\221\221\203\203\203yyy{{{\207\207\207"
"dddqqqtttZZZ```uuu\224\224\224\235\235\234\224\224\224\226\226\226\236"
"\235\235\215\215\214ttt\210\210\210\227\226\226\230\230\227\220\220\220"
"\212\212\211\214\214\214\221\221\221}}}}}|\232\232\232\223\224\223\217"
"\217\217\203\203\203\210\210\210\202\202\202|||qqq~~~\204\204\204\232"
"\232\232\233\233\233\227\227\227\201\201\201aaasss\201\201\200\210\210"
"\210\221\220\220\222\222\222\223\223\223\231\230\230\202\202\202nnnz"
"zz\200\200\200\200\200\200}}|\210\210\210\210\207\207}}|\207\207\207"
"\203\203\203tttkkkfffoooqqqtttppo{{{\210\210\210\233\233\232\231\231"
"\231\234\234\234\236\235\235\232\232\232\212\212\212|||{{{vvuzzz|||\177"
"~~zzzjjjttt\217\217\217\226\226\226\215\215\215\213\213\212\206\206\206"
"}}}\200\200\200{zz~~~\221\221\221\221\221\221\221\221\221\221\221\221"
"\226\226\225\215\215\215~}}\231\231\231\231\231\231\226\225\225\225\225"
"\225\225\224\224\230\230\230\227\227\227\227\227\227\220\220\220\205"
"\205\205gggvvvppp\177\177\177\204\204\204zzzyxxzzzuuu|||}}}\206\206\206"
"}}}zzz\227\227\226\236\236\236\234\234\234\232\232\232\230\230\230\226"
"\226\226\210\210\210|||\206\206\206\222\222\222\222\222\222\226\226\226"
"\225\224\224\222\222\222\217\217\217\221\221\221\221\221\221\221\221"
"\220\216\216\216rrr\201\201\201\236\236\236\226\226\226\227\227\227\210"
"\207\207ppp\203\203\202\222\222\222\230\227\230\232\232\232\201\202\201"
"\216\215\215\226\226\226\226\226\226\225\225\224\221\221\221\222\222"
"\222\205\205\205vvv}||dddqqp~~~\177\177\177\201\201\201\207\207\207\203"
"\203\203\206\206\206\202\202\202\203\203\203\207\207\207kkk\217\217\217"
"\233\233\233\222\222\222\221\221\221\211\210\210|||\226\226\226\222\222"
"\222\234\234\233\217\217\217yyy\206\206\206\214\214\214\211\210\211\215"
"\215\214\212\212\211{{{xxxvvvkkk\177\177\177rrrmmmyyy\216\216\215\226"
"\226\226\223\223\223\227\227\227\233\233\233\220\220\220\200\200\200"
"zzz\225\225\225\221\221\220\207\206\206\202\202\202\202\202\202\203\203"
"\203\205\205\205\204\204\203\200\200\200yyyttt\220\220\220{{{fffxxx\214"
"\214\214\220\217\217\212\212\211\214\214\214\214\214\214\205\205\205"
"yyy\206\206\206\232\232\232\227\227\227\232\232\232\224\224\224\217\217"
"\217\217\217\217\221\221\221~~~\205\205\205\216\216\216\203\203\203\221"
"\221\221\234\233\233\233\233\233\225\225\225\204\204\204uuu|||\213\213"
"\213\230\230\227\225\225\225~~~|||vvvrrrxxx\205\204\204\205\205\205\212"
"\212\211yyyyyy\207\207\207\212\212\212\207\207\207\206\206\206\210\210"
"\210\212\211\211\215\215\215\216\216\216\211\211\211\203\203\203\205"
"\205\205\231\231\231\232\232\232\221\221\220\225\225\225\227\227\227"
"\216\216\216\204\204\204\225\225\224\235\235\235\224\224\224\214\214"
"\214{{{\214\214\214\227\227\227\217\217\217wwwuuuyyy|}|\222\222\222|"
"||\204\204\204\220\220\220\212\212\212{{{vvvyyy\177\177\177\201\201\201"
"|||\210\207\207\221\221\221\236\235\235\227\227\226\223\223\223\230\231"
"\230\227\227\227\225\224\225\226\225\225\213\213\213~~~wvviihono\200"
"\200\200\231\230\230\233\233\233\225\225\225\177\177\177nnn\213\213\213"
"\207\207\207www\220\220\220\223\223\223\232\232\232\231\231\231\230\227"
"\227\211\211\211|||uuu\215\215\215\231\231\231\226\226\226\230\230\230"
"\220\220\220\224\224\224\207\206\206\211\210\210\215\215\215\220\220"
"\220qqq\177\177\177\220\220\220\227\226\226\237\237\236\230\230\230\233"
"\233\233\231\231\230\213\213\213vvv\201\201\201\230\230\230}}}kkk\201"
"\201\201\220\220\220\211\210\210\210\210\210\204\204\204\204\204\204"
"}}}qqq\207\207\207\210\210\210\177\177\177|||yyy~~~}}}yyy\200\201\200"
"|||fff\205\205\205\232\232\232\217\217\217\205\205\205zzz}}}vvvyyxss"
"s\226\226\226\225\224\225vvvgggxxxvuuooottttttqqqwww\213\213\213\221"
"\221\220\220\220\220\223\223\223\232\232\232\230\230\230\233\233\233"
"\227\227\227\217\217\217\214\214\214\201\201\201sss\201\201\201~~~qq"
"qaaazzz\212\211\212\216\216\216\227\227\227\223\223\223\221\221\220\212"
"\212\212ttt\213\213\213\241\240\240\216\216\216xxxqqq\202\202\202\226"
"\226\226\232\232\232\224\224\224\231\231\231\231\231\231\232\232\232"
"\226\226\225\210\210\210~~~\200\200\200||{zzz\203\203\203\224\224\224"
"\236\235\235\224\223\223|||srr\225\225\225\237\237\237\241\241\241\235"
"\235\235\226\225\226\213\213\213|||\200\177\177\216\216\215|||nmm\177"
"\177\177\222\221\222\236\236\236\241\241\241\225\225\225\210\210\207"
"\200\200\200\207\207\207\210\210\210\207\207\207\203\203\203xxxrrr\177"
"\177\177{{{\212\211\211\226\226\226\226\226\226\204\204\204uttuuu\213"
"\213\213\233\233\234\225\225\226\223\223\223\220\217\217\224\224\223"
"\211\211\211\201\201\201uuurqqzzz\200\200\200\210\210\210\205\205\204"
"\202\202\202|||xxxvvvyyyzzz\200\200\200{{{\203\202\202\203\203\203\200"
"\200\200~~~eeexxxtttwvw\220\220\220vvv\202\202\201\227\227\227\206\207"
"\206\204\204\204\204\204\204\202\202\202\210\207\207nmmmllkkkvvvxxww"
"vvtttwwwzzz{{{vvvqqqssszzz\206\205\205\211\211\211\211\211\211\206\206"
"\206\225\225\225\203\203\203mmm\210\210\210\240\240\240\214\214\214\177"
"\177\177vvv\214\214\214\205\205\205}}}qqqiiipoo\205\205\205uuu\213\213"
"\213\231\231\231\231\230\230\227\227\227\230\230\230\234\233\233\233"
"\233\233\235\235\234\210\210\210vvv\204\204\204\222\222\222\234\233\233"
"\221\221\221\205\205\205\221\221\221\220\217\217\177\177\177{{{\216\216"
"\216\216\216\216}}}}}}\216\215\215\227\227\226\214\213\213\202\202\202"
"\205\205\205\226\226\226\222\222\222yxx\177\177\177\200\200\200\232\232"
"\232\240\237\240\217\217\217\212\212\212\206\206\206\205\205\205\204"
"\204\204}}}kkk\201\201\201\205\205\205\201\201\201\204\204\203\201\201"
"\201|||}}}mmmuuurrraaa```nnn\220\220\220\233\233\232\225\225\225\222"
"\222\222\206\206\206\200\200\200{{{"};

143
src/mape/iconview.c 100644
View File

@ -0,0 +1,143 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtkliststore.h>
#include <gtk/gtkiconview.h>
#include <gtk/gtkcellrendererpixbuf.h>
#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtkscrolledwindow.h>
#include <gtk/gtkcelllayout.h>
#include "iconview.h"
MapeIconView* mape_icon_view_new(GError** error)
{
MapeIconView* view;
view = malloc(sizeof(MapeIconView) );
view->list_store = GTK_TREE_MODEL(
gtk_list_store_new(
MAPE_ICON_VIEW_COLUMN_COUNT,
GDK_TYPE_PIXBUF,
G_TYPE_STRING
)
);
view->view = gtk_icon_view_new_with_model(view->list_store);
g_object_unref(view->list_store);
gtk_icon_view_set_orientation(
GTK_ICON_VIEW(view->view),
GTK_ORIENTATION_HORIZONTAL
);
view->renderer_icon = gtk_cell_renderer_pixbuf_new();
gtk_cell_layout_pack_start(
GTK_CELL_LAYOUT(view->view),
view->renderer_icon,
FALSE
);
gtk_cell_layout_set_attributes(
GTK_CELL_LAYOUT(view->view),
view->renderer_icon,
"pixbuf", MAPE_ICON_VIEW_COLUMN_ICON,
NULL
);
view->renderer_name = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(
GTK_CELL_LAYOUT(view->view),
view->renderer_name,
TRUE
);
gtk_cell_layout_set_attributes(
GTK_CELL_LAYOUT(view->view),
view->renderer_name,
"text", MAPE_ICON_VIEW_COLUMN_NAME,
NULL
);
gtk_icon_view_set_selection_mode(
GTK_ICON_VIEW(view->view),
GTK_SELECTION_NONE
);
gtk_tree_sortable_set_sort_column_id(
GTK_TREE_SORTABLE(view->list_store),
MAPE_ICON_VIEW_COLUMN_NAME,
GTK_SORT_ASCENDING
);
gtk_widget_show(view->view);
view->window = gtk_scrolled_window_new(NULL, NULL);
gtk_container_add(
GTK_CONTAINER(view->window),
view->view
);
gtk_scrolled_window_set_policy(
GTK_SCROLLED_WINDOW(view->window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC
);
gtk_scrolled_window_set_shadow_type(
GTK_SCROLLED_WINDOW(view->window),
GTK_SHADOW_IN
);
gtk_widget_show(view->window);
return view;
}
void mape_icon_view_destroy(MapeIconView* view)
{
/* TODO: unref cell renderers? */
free(view);
}
void mape_icon_view_clear(MapeIconView* view)
{
gtk_list_store_clear(GTK_LIST_STORE(view->list_store) );
}
void mape_icon_view_add(MapeIconView* view,
GdkPixbuf* icon,
const char* name)
{
GtkTreeIter iter;
gtk_list_store_append(
GTK_LIST_STORE(view->list_store),
&iter
);
gtk_list_store_set(
GTK_LIST_STORE(view->list_store),
&iter,
MAPE_ICON_VIEW_COLUMN_ICON,
icon,
MAPE_ICON_VIEW_COLUMN_NAME,
name,
-1
);
}

View File

@ -0,0 +1,52 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_ICONVIEW_H
#define INC_MAPE_ICONVIEW_H
#include <gtk/gtkwidget.h>
#include <gtk/gtktreemodel.h>
#include <gtk/gtkcellrenderer.h>
#include "forward.h"
typedef enum MapeIconViewColumns_ {
MAPE_ICON_VIEW_COLUMN_ICON,
MAPE_ICON_VIEW_COLUMN_NAME,
MAPE_ICON_VIEW_COLUMN_COUNT
} MapeIconViewColumns;
struct MapeIconView_ {
GtkWidget* window;
GtkWidget* view;
GtkTreeModel* list_store;
GtkCellRenderer* renderer_icon;
GtkCellRenderer* renderer_name;
};
MapeIconView* mape_icon_view_new(GError** error);
void mape_icon_view_destroy(MapeIconView* view);
void mape_icon_view_clear(MapeIconView* view);
void mape_icon_view_add(MapeIconView* view,
GdkPixbuf* icon,
const char* name);
#endif /* INC_MAPE_ICONVIEW_H */

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<language id="c4landscape" _name="C4Landscape" version="2.0" _section="Markup">
<metadata>
<property name="mimetypes">text/plain</property>
<property name="globs">Landscape.txt</property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata>
<styles>
<style id="comment" _name="Comment" />
<style id="number" _name="Number" />
<style id="object" _name="Object" />
<style id="operator" _name="Operator" />
<style id="attribute" _name="Attribute" />
<style id="algorithm" _name="Algorithm" />
</styles>
<definitions>
<context id="c4landscape">
<include>
<context id="comment" style-ref="comment" end-at-line-end="true">
<start>//</start>
<end>^</end>
</context>
<context id="comment-multiline" style-ref="comment">
<start>/\*</start>
<end>\*/</end>
</context>
<context id="number" style-ref="number">
<!-- TODO: Ranges -->
<match extended="true">
(?&lt;![\w\.]) ([-+]?[0-9]+\s*(%|px)?) (?![\w\.])
</match>
</context>
<context id="operators" style-ref="operator">
<match extended="true">
[&amp;^|]
</match>
</context>
<context id="objects" style-ref="object">
<keyword>map</keyword>
<keyword>overlay</keyword>
<keyword>point</keyword>
</context>
<context id="attributes" style-ref="attribute">
<keyword>mat</keyword>
<keyword>tex</keyword>
<keyword>x</keyword>
<keyword>y</keyword>
<keyword>wdt</keyword>
<keyword>hgt</keyword>
<keyword>algo</keyword>
<keyword>zoomX</keyword>
<keyword>zoomY</keyword>
<keyword>ox</keyword>
<keyword>oy</keyword>
<keyword>a</keyword>
<keyword>b</keyword>
<keyword>turbulence</keyword>
<keyword>rotate</keyword>
<keyword>invert</keyword>
<keyword>seed</keyword>
<keyword>loosebounds</keyword>
<keyword>mask</keyword>
<keyword>grp</keyword>
<keyword>sub</keyword>
<keyword>lambda</keyword>
</context>
<context id="algorithms" style-ref="algorithm">
<keyword>solid</keyword>
<keyword>random</keyword>
<keyword>checker</keyword>
<keyword>bozo</keyword>
<keyword>sin</keyword>
<keyword>boxes</keyword>
<keyword>rndchecker</keyword>
<keyword>lines</keyword>
<keyword>border</keyword>
<keyword>mandel</keyword>
<keyword>rndall</keyword>
<keyword>script</keyword>
</context>
</include>
</context>
</definitions>
</language>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="c4landscape" _name="C4Landscape" version="1.0">
<author>Armin Burgmeier</author>
<_description>C4Landscape color scheme</_description>
<!-- Bracket Matching -->
<style name="bracket-match" foreground="#white" background="#grey" bold="true"/>
<style name="bracket-mismatch" foreground="#white" background="#red" bold="true"/>
<style name="c4landscape:comment" foreground="#008000"/>
<style name="c4landscape:number" foreground="#c00080"/>
<style name="c4landscape:object" foreground="#c00000"/>
<style name="c4landscape:operator" foreground="#0080c0"/>
<style name="c4landscape:attribute" foreground="#0000ff"/>
<style name="c4landscape:algorithm" foreground="#000080"/>
</style-scheme>

View File

@ -0,0 +1,461 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
Copyright (C) 2005-2007 Emanuele Aina
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="language">
<choice>
<attribute name="name"/>
<attribute name="_name"/>
</choice>
<attribute name="id">
<data type="string">
<param name="pattern">([a-zA-Z0-9_]|-)+</param>
</data>
</attribute>
<attribute name="version"/>
<optional>
<choice>
<attribute name="section"/>
<attribute name="_section"/>
</choice>
</optional>
<optional>
<attribute name="hidden">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="translation-domain"/>
</optional>
<optional>
<oneOrMore>
<element name="author">
<text/>
</element>
</oneOrMore>
</optional>
<optional>
<ref name="metadata"/>
</optional>
<optional>
<ref name="styles" />
</optional>
<optional>
<element name="default-regex-options">
<ref name="regex-options"/>
</element>
</optional>
<optional>
<element name="keyword-char-class">
<text/>
</element>
</optional>
<ref name="definitions" />
</element>
</start>
<define name="id-type">
<data type="string">
<!-- FIXME: Why it doesn't work?
It seems that [a-z-] is unsupported -->
<!--
<param name="pattern">([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]+</param>
-->
<param name="pattern">(([a-zA-Z0-9_]|-)+:)?([a-zA-Z0-9_]|-)+</param>
</data>
</define>
<define name="ref-type">
<data type="string">
<!-- FIXME: Why it doesn't work?
It seems that [a-z-] is unsupported -->
<!--
<param name="pattern">([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]+(:\*)?</param>
-->
<param name="pattern">(([a-zA-Z0-9_]|-)+:)?([a-zA-Z0-9_]|-)+(:\*)?</param>
</data>
</define>
<define name="boolean-value">
<choice>
<value>true</value>
<value>false</value>
</choice>
</define>
<define name="regex-options">
<optional>
<attribute name="extended">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="case-sensitive">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="dupnames">
<ref name="boolean-value"/>
</attribute>
</optional>
</define>
<define name="property">
<element name="property">
<attribute name="name">
<!-- <data type="string">-->
<!-- <param name="pattern">([a-zA-Z0-9_]|-)+</param>-->
<!-- </data>-->
</attribute>
<text/>
<!-- <optional>
<attribute name="mimetypes"/>
</optional>-->
</element>
</define>
<define name="metadata">
<element name="metadata">
<zeroOrMore>
<ref name="property"/>
</zeroOrMore>
</element>
</define>
<define name="styles">
<element name="styles">
<oneOrMore>
<element name="style">
<attribute name="id">
<data type="string">
<param name="pattern">([a-zA-Z0-9_]|-)+</param>
</data>
</attribute>
<choice>
<attribute name="name"/>
<attribute name="_name"/>
</choice>
<optional>
<attribute name="map-to">
<ref name="id-type"/>
</attribute>
</optional>
</element>
</oneOrMore>
</element>
</define>
<define name="definitions">
<element name="definitions">
<interleave>
<oneOrMore>
<choice>
<ref name="context-to-be-included"/>
<ref name="context-container"/>
<ref name="context-simple"/>
<ref name="context-reference"/>
<ref name="context-placeholder"/>
</choice>
</oneOrMore>
<zeroOrMore>
<ref name="define-regex"/>
</zeroOrMore>
<zeroOrMore>
<ref name="replace-context"/>
</zeroOrMore>
</interleave>
</element>
</define>
<define name="context-simple">
<element name="context">
<optional>
<attribute name="id">
<ref name="id-type"/>
</attribute>
</optional>
<optional>
<attribute name="style-ref">
<ref name="id-type"/>
</attribute>
</optional>
<optional>
<attribute name="extend-parent">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="end-parent">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="first-line-only">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="once-only">
<ref name="boolean-value"/>
</attribute>
</optional>
<choice>
<element name="match">
<ref name="regex-options"/>
<text/>
</element>
<group>
<optional>
<element name="prefix"><text/></element>
</optional>
<optional>
<element name="suffix"><text/></element>
</optional>
<oneOrMore>
<element name="keyword"><text/></element>
</oneOrMore>
</group>
</choice>
<optional>
<element name="include">
<oneOrMore>
<ref name="context-subpattern-simple"/>
</oneOrMore>
</element>
</optional>
</element>
</define>
<define name="context-container">
<element name="context">
<optional>
<attribute name="id">
<ref name="id-type"/>
</attribute>
</optional>
<optional>
<attribute name="style-ref">
<ref name="id-type"/>
</attribute>
</optional>
<optional>
<attribute name="style-inside">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="extend-parent">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="end-parent">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="end-at-line-end">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="first-line-only">
<ref name="boolean-value"/>
</attribute>
</optional>
<optional>
<attribute name="once-only">
<ref name="boolean-value"/>
</attribute>
</optional>
<element name="start">
<ref name="regex-options"/>
<text/>
</element>
<optional>
<element name="end">
<ref name="regex-options"/>
<text/>
</element>
</optional>
<optional>
<element name="include">
<interleave>
<oneOrMore>
<choice>
<ref name="context-container"/>
<ref name="context-simple"/>
<ref name="context-to-be-included"/>
<ref name="context-subpattern-container"/>
<ref name="context-reference"/>
<ref name="context-placeholder"/>
</choice>
</oneOrMore>
<zeroOrMore>
<ref name="define-regex"/>
</zeroOrMore>
</interleave>
</element>
</optional>
</element>
</define>
<define name="context-to-be-included">
<element name="context">
<attribute name="id">
<ref name="id-type"/>
</attribute>
<element name="include">
<interleave>
<oneOrMore>
<choice>
<ref name="context-container"/>
<ref name="context-simple"/>
<ref name="context-to-be-included"/>
<ref name="context-reference"/>
<ref name="context-placeholder"/>
</choice>
</oneOrMore>
<zeroOrMore>
<ref name="define-regex"/>
</zeroOrMore>
</interleave>
</element>
</element>
</define>
<define name="context-subpattern-simple">
<element name="context">
<optional>
<attribute name="id">
<ref name="id-type"/>
</attribute>
</optional>
<optional>
<attribute name="style-ref">
<ref name="id-type"/>
</attribute>
</optional>
<attribute name="sub-pattern"/>
</element>
</define>
<define name="context-subpattern-container">
<element name="context">
<optional>
<attribute name="id">
<ref name="id-type"/>
</attribute>
</optional>
<optional>
<attribute name="style-ref">
<ref name="id-type"/>
</attribute>
</optional>
<attribute name="sub-pattern"/>
<attribute name="where">
<choice>
<value>start</value>
<value>end</value>
</choice>
</attribute>
</element>
</define>
<define name="context-reference">
<element name="context">
<attribute name="ref">
<ref name="ref-type"/>
</attribute>
<optional>
<choice>
<attribute name="style-ref">
<ref name="id-type"/>
</attribute>
<attribute name="ignore-style">
<ref name="boolean-value"/>
</attribute>
<attribute name="original">
<ref name="boolean-value"/>
</attribute>
</choice>
</optional>
</element>
</define>
<define name="context-placeholder">
<element name="context">
<attribute name="id">
<ref name="id-type"/>
</attribute>
</element>
</define>
<define name="define-regex">
<element name="define-regex">
<attribute name="id">
<ref name="id-type"/>
</attribute>
<ref name="regex-options"/>
<text/>
</element>
</define>
<define name="replace-context">
<element name="replace">
<attribute name="id">
<ref name="ref-type"/>
</attribute>
<attribute name="ref">
<ref name="ref-type"/>
</attribute>
</element>
</define>
</grammar>

185
src/mape/mape.c 100644
View File

@ -0,0 +1,185 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <signal.h>
#include <gtk/gtkmessagedialog.h>
#include <glib/gthread.h>
#include <gdk/gdk.h>
#include "editview.h"
#include "window.h"
static MapeWindow** _global_wnd = NULL;
static const gchar* SEGV_MSG =
"Mape saved the currently opened file to %s\n\n"
"If the crash is reproducible, I would like to fix it. Drop an email "
"with steps to reproduce and a possible file that caused the crash to "
"Armin Burgmeier <armin@arbur.net>";
static const gchar* SEGV_MSG_ERR =
"Mape failed to save the currently opened file to %s: %s\n\n"
"If the crash is reproducible, I would like to fix it. Drop an email "
"with steps to reproduce and a possible file that caused the crash to "
"Armin Burgmeier <armin@arbur.net>";
static void segv_handler()
{
GtkWidget* error_dialog;
gboolean result;
MapeWindow* wnd;
gchar* filename;
gchar* utf8_file;
gchar* current;
GError* error;
error = NULL;
if(_global_wnd == NULL)
return;
wnd = *_global_wnd;
if(wnd->edit_view->file_path)
{
filename = g_strdup(wnd->edit_view->file_path);
}
else
{
current = g_get_current_dir();
filename = g_build_filename(
current,
"Landscape_crash.txt",
NULL
);
g_free(current);
}
result = mape_edit_view_save(wnd->edit_view, filename, &error);
utf8_file = g_filename_to_utf8(
filename,
-1,
NULL,
NULL,
NULL
);
g_free(filename);
error_dialog = gtk_message_dialog_new(
NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"The application crashed!"
);
if(result == TRUE)
{
gtk_message_dialog_format_secondary_text(
GTK_MESSAGE_DIALOG(error_dialog),
SEGV_MSG,
utf8_file
);
}
else
{
gtk_message_dialog_format_secondary_text(
GTK_MESSAGE_DIALOG(error_dialog),
SEGV_MSG_ERR,
utf8_file,
error->message
);
g_error_free(error);
}
g_free(utf8_file);
gtk_dialog_run(GTK_DIALOG(error_dialog) );
gtk_widget_destroy(error_dialog);
exit(EXIT_FAILURE);
}
static void mape_main_window_destroy(GtkWidget* widget,
gpointer data)
{
gtk_main_quit();
}
int main(int argc,
char* argv[])
{
MapeWindow* window;
GError* error = NULL;
GtkWidget* error_dialog;
_global_wnd = &window;
signal(SIGSEGV, segv_handler);
g_thread_init(NULL);
gdk_threads_init();
gdk_threads_enter();
gtk_init(&argc, &argv);
/* TODO: Set global application icon */
window = mape_window_new(argc, argv, &error);
if(error != NULL)
{
error_dialog = gtk_message_dialog_new(
NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"Application initialization failed"
);
gtk_message_dialog_format_secondary_text(
GTK_MESSAGE_DIALOG(error_dialog),
"%s",
error->message
);
gtk_window_set_title(GTK_WINDOW(error_dialog), "Mape");
g_error_free(error);
gtk_dialog_run(GTK_DIALOG(error_dialog) );
gtk_widget_destroy(error_dialog);
return EXIT_FAILURE;
}
g_signal_connect(
G_OBJECT(window->window),
"destroy",
G_CALLBACK(mape_main_window_destroy),
(gpointer)window
);
gtk_main();
mape_window_destroy(window);
gdk_threads_leave();
return EXIT_SUCCESS;
}

185
src/mape/mapgen.cpp 100644
View File

@ -0,0 +1,185 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define MAPE_COMPILING_CPP
#include <Standard.h>
#include <C4Scenario.h>
#include <C4Texture.h>
#include <C4Material.h>
#include <C4MapCreatorS2.h>
#include "mapgen.h"
#define CPPTEXMAP(map) ((C4TextureMap*)map->handle)
#define CPPMATMAP(map) ((C4MaterialMap*)map->handle)
extern "C"
{
static void mape_mapgen_read_color(guint8* dest,
MapeMaterialMap* material_map,
unsigned int matnum)
{
MapeMaterial* mat;
GdkColor color;
if(matnum == 0)
{
dest[matnum * 4 + 1] = 100;
dest[matnum * 4 + 2] = 100;
dest[matnum * 4 + 3] = 255;
}
else
{
mat = mape_material_map_get_material(material_map, matnum - 1);
color = mape_material_get_color(mat);
dest[matnum * 4 + 1] = color.red * 0xff / 0xffff;
dest[matnum * 4 + 2] = color.green * 0xff / 0xffff;
dest[matnum * 4 + 3] = color.blue * 0xff / 0xffff;
}
}
GdkPixbuf* mape_mapgen_generate(const gchar* source,
MapeMaterialMap* material_map,
MapeTextureMap* texture_map,
GError** error,
unsigned int map_width,
unsigned int map_height)
{
int32_t width, height;
int32_t x, y;
guint8* pix;
BYTE* arry;
BYTE* index;
int aligned_width;
unsigned int rowstride;
unsigned int datawidth;
GdkPixbuf* pixbuf;
aligned_width = DWordAligned(map_width);
arry = NULL;
try
{
C4SLandscape landscape;
landscape.Default();
landscape.MapWdt = map_width;
landscape.MapHgt = map_height;
landscape.MapPlayerExtend = 0;
C4MapCreatorS2 mapgen(
&landscape,
CPPTEXMAP(texture_map),
CPPMATMAP(material_map),
1
);
mapgen.ReadScript(source);
arry = mapgen.RenderBuf(NULL, width, height);
if(arry == NULL)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_MAPGEN_ERROR"),
MAPE_MAPGEN_ERROR_MISSING_MAP,
"No map definition in source file"
);
return NULL;
}
pixbuf = gdk_pixbuf_new(
GDK_COLORSPACE_RGB,
FALSE,
8,
map_width,
map_height
);
if(pixbuf == NULL)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_MAPGEN_ERROR"),
MAPE_MAPGEN_ERROR_MEMORY,
"Insufficient memory is available"
);
delete[] arry;
return NULL;
}
pix = gdk_pixbuf_get_pixels(pixbuf);
rowstride = gdk_pixbuf_get_rowstride(pixbuf);
datawidth = gdk_pixbuf_get_width(pixbuf) * 3;
index = arry;
guint8 matclrs[128 * 4];
memset(matclrs, 0, sizeof(matclrs) );
for(x = 0; x < map_height; ++ x)
{
for(y = 0; y < map_width; ++ y)
{
BYTE matnum = *index & 0x7f;
if(matclrs[matnum * 4] == 0)
{
mape_mapgen_read_color(
matclrs,
material_map,
matnum
);
/* Color has been loaded */
matclrs[matnum * 4] = 1;
}
pix[0] = matclrs[matnum * 4 + 1];
pix[1] = matclrs[matnum * 4 + 2];
pix[2] = matclrs[matnum * 4 + 3];
++ index;
pix += 3;
}
index += aligned_width - map_width;
pix += rowstride - datawidth;
}
delete[] arry;
return pixbuf;
}
catch(C4MCParserErr& err)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_MAPGEN_ERROR"),
MAPE_MAPGEN_ERROR_COMPILE,
"%s",
err.Msg
);
delete[] arry;
return NULL;
}
}
} // extern "C"

49
src/mape/mapgen.h 100644
View File

@ -0,0 +1,49 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_MAPGEN_H
#define INC_MAPE_MAPGEN_H
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "material.h"
#include "texture.h"
#ifdef MAPE_COMPILING_CPP
extern "C" {
#endif
typedef enum MapeMapgenError_ {
MAPE_MAPGEN_ERROR_MEMORY,
MAPE_MAPGEN_ERROR_COMPILE,
MAPE_MAPGEN_ERROR_MISSING_MAP,
MAPE_MAPGEN_ERROR_FAILED
} MapeMapgenError;
GdkPixbuf* mape_mapgen_generate(const gchar* source,
MapeMaterialMap* material_map,
MapeTextureMap* texture_map,
GError** error,
unsigned int map_with,
unsigned int map_height);
#ifdef MAPE_COMPILING_CPP
} /* extern "C" */
#endif
#endif /* INC_MAPE_MAPGEN_H */

View File

@ -0,0 +1,124 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// TODO: Move this to an extra file:
#include <C4Application.h>
#include <C4Console.h>
#include <C4FullScreen.h>
#include <C4Game.h>
#include <C4Network2.h>
C4Application Application;
C4Console Console;
C4FullScreen FullScreen;
C4Game Game;
C4Network2 Network;
#define MAPE_COMPILING_CPP
#include <exception>
#include <C4Material.h>
#include "group.h"
#include "material.h"
#define CPPMAT(mat) ( (C4Material*)mat)
#define CPPMATMAP(map) ( (C4MaterialMap*)map->handle)
#define CPPGROUP(group) ((C4Group*)group->group_handle)
extern "C" {
MapeMaterialMap* mape_material_map_new(MapeGroup* base,
MapeGroup* overload_from,
GError** error)
{
MapeMaterialMap* map;
map = (MapeMaterialMap*)malloc(sizeof(MapeMaterialMap) );
try
{
// TODO: Make sure overloading works as expected...
map->handle = new C4MaterialMap;
CPPMATMAP(map)->Load(*CPPGROUP(base));
if(overload_from != NULL)
CPPMATMAP(map)->Load(*CPPGROUP(overload_from));
}
catch(std::exception& e)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_MATERIAL_ERROR"),
MAPE_MATERIAL_ERROR_FAILED,
"%s",
e.what()
);
free(map);
return NULL;
}
return map;
}
void mape_material_map_destroy(MapeMaterialMap* map)
{
delete CPPMATMAP(map);
free(map);
}
unsigned int mape_material_map_get_material_count(MapeMaterialMap* map)
{
return CPPMATMAP(map)->Num;
}
MapeMaterial* mape_material_map_get_material(MapeMaterialMap* map,
unsigned int index)
{
return (MapeMaterial*)&CPPMATMAP(map)->Map[index];
}
MapeMaterial* mape_material_map_get_material_by_string(MapeMaterialMap* map,
const char* mat_name)
{
unsigned int i;
for(i = 0; i < CPPMATMAP(map)->Num; ++ i)
if(stricmp(CPPMATMAP(map)->Map[i].Name, mat_name) == 0)
return (MapeMaterial*)&CPPMATMAP(map)->Map[i];
return NULL;
}
const char* mape_material_get_name(MapeMaterial* material)
{
return CPPMAT(material)->Name;
}
GdkColor mape_material_get_color(MapeMaterial* material)
{
// TODO: Color field in C4Material is gone. Read from texture?
GdkColor color = {
0,
/*CPPMAT(material)->Color[0]*/0xff * 0xffff / 0xff,
/*CPPMAT(material)->Color[1]*/0xff * 0xffff / 0xff,
/*CPPMAT(material)->Color[2]*/0xff * 0xffff / 0xff
};
return color;
}
} // extern "C"

View File

@ -0,0 +1,60 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_MATERIAL_H
#define INC_MAPE_MATERIAL_H
#include <glib/gerror.h>
#include <gdk/gdkcolor.h>
#include "forward.h"
/* Simple C-based interface to C4MaterialMap */
#ifdef MAPE_COMPILING_CPP
extern "C" {
#endif
typedef enum MapeMaterialError_ {
MAPE_MATERIAL_ERROR_FAILED
} MapeMaterialError;
typedef void MapeMaterial;
struct MapeMaterialMap_ {
void* handle;
};
MapeMaterialMap* mape_material_map_new(MapeGroup* base,
MapeGroup* overload_from,
GError** error);
void mape_material_map_destroy(MapeMaterialMap* map);
unsigned int mape_material_map_get_material_count(MapeMaterialMap* map);
MapeMaterial* mape_material_map_get_material(MapeMaterialMap* map,
unsigned int index);
MapeMaterial* mape_material_map_get_material_by_string(MapeMaterialMap* map,
const char* mat_name);
const char* mape_material_get_name(MapeMaterial* material);
GdkColor mape_material_get_color(MapeMaterial* material);
#ifdef MAPE_COMPILING_CPP
} /* extern "C" */
#endif
#endif /* INC_MAPE_MATERIAL_H */

View File

@ -0,0 +1,155 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtknotebook.h>
#include "material.h"
#include "texture.h"
#include "fileicon.h"
#include "iconview.h"
#include "mattexview.h"
MapeMatTexView* mape_mat_tex_view_new(MapeFileIconSet* icon_set,
GError** error)
{
MapeMatTexView* view;
view = malloc(sizeof(MapeMatTexView) );
view->mat_map = NULL;
view->tex_map = NULL;
view->icon_set = icon_set;
view->view_mat = mape_icon_view_new(error);
if(view->view_mat == NULL)
{
free(view);
return NULL;
}
view->view_tex = mape_icon_view_new(error);
if(view->view_tex == NULL)
{
mape_icon_view_destroy(view->view_mat);
free(view);
return NULL;
}
view->notebook = gtk_notebook_new();
gtk_notebook_append_page(
GTK_NOTEBOOK(view->notebook),
view->view_mat->window,
NULL
);
gtk_notebook_set_tab_label_text(
GTK_NOTEBOOK(view->notebook),
view->view_mat->window,
"Materials"
);
gtk_notebook_append_page(
GTK_NOTEBOOK(view->notebook),
view->view_tex->window,
NULL
);
gtk_notebook_set_tab_label_text(
GTK_NOTEBOOK(view->notebook),
view->view_tex->window,
"Textures"
);
gtk_widget_set_size_request(view->notebook, -1, 150);
gtk_widget_show(view->notebook);
return view;
}
void mape_mat_tex_view_destroy(MapeMatTexView* view)
{
if(view->mat_map != NULL)
mape_material_map_destroy(view->mat_map);
if(view->tex_map != NULL)
mape_texture_map_destroy(view->tex_map);
mape_icon_view_destroy(view->view_mat);
mape_icon_view_destroy(view->view_tex);
free(view);
}
gboolean mape_mat_tex_view_reload(MapeMatTexView* view,
MapeGroup* base_group,
MapeGroup* overload_from,
GError** error)
{
MapeMaterialMap* new_mat_map;
MapeTextureMap* new_tex_map;
MapeFileIcon* icon;
MapeMaterial* mat;
unsigned int i;
new_mat_map = mape_material_map_new(base_group, overload_from, error);
if(new_mat_map == NULL) return FALSE;
new_tex_map = mape_texture_map_new(base_group, overload_from, error);
if(new_tex_map == NULL)
{
mape_material_map_destroy(new_mat_map);
return FALSE;
}
if(view->mat_map != NULL) mape_material_map_destroy(view->mat_map);
if(view->tex_map != NULL) mape_texture_map_destroy(view->tex_map);
view->mat_map = new_mat_map; view->tex_map = new_tex_map;
mape_icon_view_clear(view->view_mat);
for(i = 0; i < mape_material_map_get_material_count(new_mat_map); ++ i)
{
mat = mape_material_map_get_material(new_mat_map, i);
icon = mape_file_icon_set_lookup(
view->icon_set,
MAPE_FILE_ICON_C4MATERIAL
);
mape_icon_view_add(
view->view_mat,
mape_file_icon_get(icon),
mape_material_get_name(mat)
);
}
mape_icon_view_clear(view->view_tex);
for(i = 0; i < mape_texture_map_get_texture_count(new_tex_map); ++ i)
{
icon = mape_file_icon_set_lookup(
view->icon_set,
MAPE_FILE_ICON_C4TEXTURE
);
mape_icon_view_add(
view->view_tex,
mape_file_icon_get(icon),
mape_texture_map_get_texture(new_tex_map, i)
);
}
return TRUE;
}

View File

@ -0,0 +1,46 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_MATTEXVIEW_H
#define INC_MAPE_MATTEXVIEW_H
#include <gtk/gtkwidget.h>
#include "forward.h"
struct MapeMatTexView_ {
GtkWidget* notebook;
MapeIconView* view_mat;
MapeIconView* view_tex;
MapeMaterialMap* mat_map;
MapeTextureMap* tex_map;
MapeFileIconSet* icon_set;
};
MapeMatTexView* mape_mat_tex_view_new(MapeFileIconSet* icon_set,
GError** error);
void mape_mat_tex_view_destroy(MapeMatTexView* view);
gboolean mape_mat_tex_view_reload(MapeMatTexView* view,
MapeGroup* base_group,
MapeGroup* overload_from,
GError** error);
#endif /* INC_MAPE_MATTEXVIEW_H */

View File

@ -0,0 +1,139 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include "configfile.h"
#include "preferences.h"
static gint mape_preferences_read_int(MapeConfigFile* file,
const gchar* key,
gint default_value)
{
MapeConfigFileEntry* entry;
entry = mape_config_file_get_entry_by_key(file, key );
if(entry == NULL) return default_value;
return strtol(mape_config_file_entry_get_value(entry), NULL, 0);
}
static gint mape_preferences_read_ranged_int(MapeConfigFile* file,
const gchar* key,
gint lower_bound,
gint upper_bound,
gint default_value)
{
gint value;
value = mape_preferences_read_int(file, key, default_value);
if(value < lower_bound) value = lower_bound;
if(value > upper_bound) value = upper_bound;
return value;
}
static gboolean mape_preferences_read_boolean(MapeConfigFile* file,
const gchar* key,
gboolean default_value)
{
const gchar* value;
MapeConfigFileEntry* entry;
entry = mape_config_file_get_entry_by_key(file, key);
if(entry == NULL) return default_value;
value = mape_config_file_entry_get_value(entry);
if(g_strcasecmp(value, "0") == 0 || g_strcasecmp(value, "off") == 0 ||
g_strcasecmp(value, "false") == 0) return FALSE;
return TRUE;
}
static void mape_preferences_write_int(MapeConfigFile* file,
const gchar* key,
gint value)
{
gchar buf[16];
sprintf(buf, "%d", value);
mape_config_file_set_entry(file, key, buf);
}
static void mape_preferences_write_boolean(MapeConfigFile* file,
const gchar* key,
gboolean value)
{
const gchar* text = "true";
if(value == FALSE) text = "false";
mape_config_file_set_entry(file, key, text);
}
void mape_preferences_from_config(MapePreferences* preferences,
MapeConfigFile* config)
{
preferences->tab_width = mape_preferences_read_ranged_int(
config, "tab_width", 1, 8, 2);
preferences->tab_to_spaces = mape_preferences_read_boolean(
config, "tab_to_spaces", TRUE);
preferences->auto_indentation = mape_preferences_read_boolean(
config, "auto_indentation", TRUE);
preferences->text_wrapping = mape_preferences_read_boolean(
config, "text_wrapping", TRUE);
preferences->line_numbers = mape_preferences_read_boolean(
config, "line_numbers", TRUE);
preferences->highlight_line = mape_preferences_read_boolean(
config, "highlight_line", TRUE);
preferences->bracket_matching = mape_preferences_read_boolean(
config, "bracket_matching", TRUE);
preferences->fixed_seed = mape_preferences_read_boolean(
config, "fixed_seed", FALSE);
preferences->random_seed = mape_preferences_read_ranged_int(
config, "random_seed", 0, (1u << 31u) - 1, rand() );
preferences->map_width = mape_preferences_read_ranged_int(
config, "map_width", 50, 500, 150);
preferences->map_height = mape_preferences_read_ranged_int(
config, "map_height", 50, 500, 150);
}
void mape_preferences_to_config(MapePreferences* preferences,
MapeConfigFile* config)
{
mape_preferences_write_int(
config, "tab_width", preferences->tab_width);
mape_preferences_write_boolean(
config, "tab_to_spaces", preferences->tab_to_spaces);
mape_preferences_write_boolean(
config, "auto_indentation", preferences->auto_indentation);
mape_preferences_write_boolean(
config, "text_wrapping", preferences->text_wrapping);
mape_preferences_write_boolean(
config, "line_numbers", preferences->line_numbers);
mape_preferences_write_boolean(
config, "highlight_line", preferences->highlight_line);
mape_preferences_write_boolean(
config, "bracket_matching", preferences->bracket_matching);
mape_preferences_write_boolean(
config, "fixed_seed", preferences->fixed_seed);
mape_preferences_write_int(
config, "random_seed", preferences->random_seed);
mape_preferences_write_int(
config, "map_width", preferences->map_width);
mape_preferences_write_int(
config, "map_height", preferences->map_height);
}

View File

@ -0,0 +1,44 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_PREFERENCES_H
#define INC_MAPE_PREFERENCES_H
#include <glib/gtypes.h>
#include "forward.h"
struct MapePreferences_ {
unsigned int tab_width;
gboolean tab_to_spaces;
gboolean auto_indentation;
gboolean text_wrapping;
gboolean line_numbers;
gboolean highlight_line;
gboolean bracket_matching;
gboolean fixed_seed;
unsigned int random_seed;
unsigned int map_width;
unsigned int map_height;
};
void mape_preferences_from_config(MapePreferences* preferences,
MapeConfigFile* config);
void mape_preferences_to_config(MapePreferences* preferences,
MapeConfigFile* config);
#endif /* INC_MAPE_PREFERENCES_H */

View File

@ -0,0 +1,437 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkcombobox.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
#include "preferences.h"
#include "preferencesdialog.h"
static void mape_preferences_dialog_cb_fixed_seed_toggled(GtkWidget* widget,
gpointer user_data)
/*MapePreferencesDialog* dialog)*/
{
MapePreferencesDialog* dialog;
dialog = (MapePreferencesDialog*)user_data;
gtk_widget_set_sensitive(
GTK_WIDGET(dialog->hbox_random_seed),
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_fixed_seed)
)
);
}
MapePreferencesDialog* mape_preferences_dialog_new(GtkWindow* parent,
MapePreferences* prefs)
{
MapePreferencesDialog* dialog;
dialog = malloc(sizeof(MapePreferencesDialog) );
dialog->lbl_tab_width = gtk_label_new("Tab width:");
gtk_widget_show(dialog->lbl_tab_width);
dialog->ent_tab_width = gtk_spin_button_new_with_range(1, 8, 1);
gtk_widget_show(dialog->ent_tab_width);
dialog->hbox_tab_width = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_tab_width),
dialog->lbl_tab_width,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_tab_width),
dialog->ent_tab_width,
TRUE,
TRUE,
0
);
gtk_widget_show(dialog->hbox_tab_width);
/* Map width */
dialog->lbl_map_width = gtk_label_new("Map width:");
gtk_widget_show(dialog->lbl_map_width);
dialog->ent_map_width = gtk_spin_button_new_with_range(50, 500, 5);
gtk_widget_show(dialog->ent_map_width);
dialog->hbox_map_width = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_map_width),
dialog->lbl_map_width,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_map_width),
dialog->ent_map_width,
TRUE,
TRUE,
0
);
gtk_widget_show(dialog->hbox_map_width);
/* Map height */
dialog->lbl_map_height = gtk_label_new("Map height:");
gtk_widget_show(dialog->lbl_map_height);
dialog->ent_map_height = gtk_spin_button_new_with_range(50, 500, 5);
gtk_widget_show(dialog->ent_map_height);
dialog->hbox_map_height = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_map_height),
dialog->lbl_map_height,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_map_height),
dialog->ent_map_height,
TRUE,
TRUE,
0
);
gtk_widget_show(dialog->hbox_map_height);
/* Checkboxes */
dialog->cbx_tab_to_spaces = gtk_check_button_new_with_label(
"Insert spaces instead of tabs"
);
gtk_widget_show(dialog->cbx_tab_to_spaces);
dialog->cbx_auto_indentation = gtk_check_button_new_with_label(
"Automatic indentation"
);
gtk_widget_show(dialog->cbx_auto_indentation);
dialog->cbx_text_wrapping = gtk_check_button_new_with_label(
"Text wrapping"
);
gtk_widget_show(dialog->cbx_text_wrapping);
dialog->cbx_line_numbers = gtk_check_button_new_with_label(
"Display line numbers"
);
gtk_widget_show(dialog->cbx_line_numbers);
dialog->cbx_highlight_line = gtk_check_button_new_with_label(
"Highlight current line"
);
gtk_widget_show(dialog->cbx_highlight_line);
dialog->cbx_bracket_matching = gtk_check_button_new_with_label(
"Highlight matching brackets"
);
gtk_widget_show(dialog->cbx_bracket_matching);
dialog->cbx_fixed_seed = gtk_check_button_new_with_label(
"Fixed random seed"
);
gtk_widget_show(dialog->cbx_fixed_seed);
dialog->lbl_random_seed = gtk_label_new("Random seed:");
gtk_widget_show(dialog->lbl_random_seed);
dialog->ent_random_seed = gtk_spin_button_new_with_range(
0,
(1u << 31u) - 1,
1
);
gtk_widget_show(dialog->ent_random_seed);
dialog->hbox_random_seed = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_random_seed),
dialog->lbl_random_seed,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(dialog->hbox_random_seed),
dialog->ent_random_seed,
TRUE,
TRUE,
0
);
gtk_widget_show(dialog->hbox_random_seed);
g_signal_connect(
G_OBJECT(dialog->cbx_fixed_seed),
"toggled",
G_CALLBACK(mape_preferences_dialog_cb_fixed_seed_toggled),
dialog
);
/* Read values from preferences */
gtk_spin_button_set_value(
GTK_SPIN_BUTTON(dialog->ent_tab_width),
prefs->tab_width
);
gtk_spin_button_set_value(
GTK_SPIN_BUTTON(dialog->ent_map_width),
prefs->map_width
);
gtk_spin_button_set_value(
GTK_SPIN_BUTTON(dialog->ent_map_height),
prefs->map_height
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_tab_to_spaces),
prefs->tab_to_spaces
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_auto_indentation),
prefs->auto_indentation
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_text_wrapping),
prefs->text_wrapping
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_line_numbers),
prefs->line_numbers
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_highlight_line),
prefs->highlight_line
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_bracket_matching),
prefs->bracket_matching
);
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(dialog->cbx_fixed_seed),
prefs->fixed_seed
);
/* Pseudo-emit toggled signal to hide the random seed entry if
* the fixed seed CheckButton is not active. */
mape_preferences_dialog_cb_fixed_seed_toggled(
dialog->cbx_fixed_seed,
dialog
);
gtk_spin_button_set_value(
GTK_SPIN_BUTTON(dialog->ent_random_seed),
prefs->random_seed
);
dialog->dialog = gtk_dialog_new_with_buttons(
"Preferences",
parent,
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
GTK_STOCK_OK,
GTK_RESPONSE_OK,
NULL
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->hbox_tab_width,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->hbox_map_width,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->hbox_map_height,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_tab_to_spaces,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_auto_indentation,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_text_wrapping,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_line_numbers,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_highlight_line,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_bracket_matching,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->cbx_fixed_seed,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox),
dialog->hbox_random_seed,
FALSE,
TRUE,
0
);
gtk_container_set_border_width(
GTK_CONTAINER(GTK_DIALOG(dialog->dialog)->vbox),
10
);
gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog->dialog)->vbox), 5);
gtk_window_set_transient_for(GTK_WINDOW(dialog->dialog), parent);
gtk_window_set_resizable(GTK_WINDOW(dialog->dialog), FALSE);
return dialog;
}
void mape_preferences_dialog_destroy(MapePreferencesDialog* dialog)
{
gtk_widget_destroy(dialog->dialog);
free(dialog);
}
MapePreferences mape_preferences_dialog_get(MapePreferencesDialog* dialog)
{
MapePreferences prefs;
prefs.tab_width = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON(dialog->ent_tab_width)
);
prefs.map_width = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON(dialog->ent_map_width)
);
prefs.map_height = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON(dialog->ent_map_height)
);
prefs.tab_to_spaces = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_tab_to_spaces)
);
prefs.auto_indentation = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_auto_indentation)
);
prefs.text_wrapping = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_text_wrapping)
);
prefs.line_numbers = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_line_numbers)
);
prefs.highlight_line = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_highlight_line)
);
prefs.bracket_matching = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_bracket_matching)
);
prefs.fixed_seed = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(dialog->cbx_fixed_seed)
);
prefs.random_seed = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON(dialog->ent_random_seed)
);
return prefs;
}

View File

@ -0,0 +1,60 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_PREFERENCESDIALOG_H
#define INC_MAPE_PREFERENCESDIALOG_H
#include <gtk/gtkwidget.h>
#include <gtk/gtkwindow.h>
#include "forward.h"
struct MapePreferencesDialog_ {
GtkWidget* dialog;
GtkWidget* hbox_tab_width;
GtkWidget* lbl_tab_width;
GtkWidget* ent_tab_width;
GtkWidget* cbx_tab_to_spaces;
GtkWidget* cbx_auto_indentation;
GtkWidget* cbx_text_wrapping;
GtkWidget* cbx_line_numbers;
GtkWidget* cbx_highlight_line;
GtkWidget* cbx_bracket_matching;
GtkWidget* cbx_fixed_seed;
GtkWidget* hbox_random_seed;
GtkWidget* lbl_random_seed;
GtkWidget* ent_random_seed;
GtkWidget* hbox_map_width;
GtkWidget* lbl_map_width;
GtkWidget* ent_map_width;
GtkWidget* hbox_map_height;
GtkWidget* lbl_map_height;
GtkWidget* ent_map_height;
};
MapePreferencesDialog* mape_preferences_dialog_new(GtkWindow* parent,
MapePreferences* prefs);
void mape_preferences_dialog_destroy(MapePreferencesDialog* dialog);
MapePreferences mape_preferences_dialog_get(MapePreferencesDialog* dialog);
#endif /* INC_MAPE_PREFERENCESDIALOG_H */

70
src/mape/preview.c 100644
View File

@ -0,0 +1,70 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkframe.h>
#include <gtk/gtkeventbox.h>
#include "preview.h"
#include "preferences.h"
MapePreView* mape_pre_view_new(MapeMatTexView* mat_tex,
GError** error)
{
MapePreView* view;
view = malloc(sizeof(MapePreView) );
view->mat_tex = mat_tex;
view->image = gtk_image_new();
gtk_widget_show(view->image);
view->event_box = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(view->event_box), view->image);
gtk_widget_add_events(view->event_box, GDK_BUTTON_PRESS_MASK);
gtk_widget_show(view->event_box);
view->frame = gtk_frame_new(NULL);/*"Landscape preview");*/
gtk_frame_set_shadow_type(GTK_FRAME(view->frame), GTK_SHADOW_IN);
gtk_container_add(GTK_CONTAINER(view->frame), view->event_box);
gtk_widget_show(view->frame);
/*gtk_widget_set_size_request(view->image, preferences->map_width, preferences->map_height);*/
return view;
}
void mape_pre_view_destroy(MapePreView* view)
{
free(view);
}
void mape_pre_view_update(MapePreView* view,
GdkPixbuf* pixbuf)
{
/* TODO: Unref old pixbuf */
/* TODO: ref new pixbuf? */
gtk_image_set_from_pixbuf(GTK_IMAGE(view->image), pixbuf);
}
void mape_pre_view_apply_preferences(MapePreView* view,
MapePreferences* preferences)
{
gtk_widget_set_size_request(view->image, preferences->map_width, preferences->map_height);
}

50
src/mape/preview.h 100644
View File

@ -0,0 +1,50 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_PREVIEW_H
#define INC_MAPE_PREVIEW_H
#include <gtk/gtkwidget.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "forward.h"
typedef enum MapePreViewError_ {
MAPE_PRE_VIEW_ERROR_MISSING_MAPS,
MAPE_PRE_VIEW_ERROR_FAILED
} MapePreViewError;
struct MapePreView_ {
GtkWidget* frame;
GtkWidget* event_box;
GtkWidget* image;
/*GdkPixbuf* pixbuf;*/
MapeMatTexView* mat_tex;
};
MapePreView* mape_pre_view_new(MapeMatTexView* mat_tex,
GError** error);
void mape_pre_view_destroy(MapePreView* view);
void mape_pre_view_update(MapePreView* view,
GdkPixbuf* pixbuf);
void mape_pre_view_apply_preferences(MapePreView* view,
MapePreferences* preferences);
#endif /* INC_MAPE_PREVIEW_H */

View File

@ -0,0 +1,33 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define MAPE_COMPILING_CPP
#include <stdlib.h>
#include <C4Include.h>
#include <C4Random.h>
#include "random.h"
extern "C" {
void mape_random_seed(unsigned int seed)
{
FixedRandom(seed);
}
} // extern "C"

36
src/mape/random.h 100644
View File

@ -0,0 +1,36 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_RANDOM_H
#define INC_MAPE_RANDOM_H
#include "forward.h"
/* Simple C-based interface to C4Random */
#ifdef MAPE_COMPILING_CPP
extern "C" {
#endif
void mape_random_seed(unsigned int seed);
#ifdef MAPE_COMPILING_CPP
} /* extern "C" */
#endif
#endif /* INC_MAPE_RANDOM_H */

View File

@ -0,0 +1,55 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtk/gtkstatusbar.h>
#include "statusbar.h"
MapeStatusbar* mape_statusbar_new(void)
{
MapeStatusbar* bar;
bar = malloc(sizeof(MapeStatusbar) );
bar->bar = gtk_statusbar_new();
bar->context_compile = gtk_statusbar_get_context_id(
GTK_STATUSBAR(bar->bar),
"Compiler report"
);
gtk_statusbar_push(
GTK_STATUSBAR(bar->bar),
bar->context_compile,
"Initialized"
);
gtk_widget_show(bar->bar);
return bar;
}
void mape_statusbar_destroy(MapeStatusbar* bar)
{
free(bar);
}
void mape_statusbar_set_compile(MapeStatusbar* bar,
const gchar* text)
{
gtk_statusbar_pop(GTK_STATUSBAR(bar->bar), bar->context_compile);
gtk_statusbar_push(GTK_STATUSBAR(bar->bar), bar->context_compile, text);
}

View File

@ -0,0 +1,37 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_STATUSBAR_H
#define INC_MAPE_STATUSBAR_H
#include <gtk/gtkwidget.h>
#include "forward.h"
struct MapeStatusbar_ {
GtkWidget* bar;
guint context_compile;
};
MapeStatusbar* mape_statusbar_new();
void mape_statusbar_destroy(MapeStatusbar* view);
void mape_statusbar_set_compile(MapeStatusbar* bar,
const gchar* text);
#endif /* INC_MAPE_STATUSBAR_H */

View File

@ -0,0 +1,91 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define MAPE_COMPILING_CPP
#include <exception>
#include <C4Texture.h>
#include "group.h"
#include "texture.h"
#define CPPTEXMAP(map) ( (C4TextureMap*)map->handle)
#define CPPGROUP(group) ((C4Group*)group->group_handle)
extern "C" {
MapeTextureMap* mape_texture_map_new(MapeGroup* base,
MapeGroup* overload_from,
GError** error)
{
MapeTextureMap* map;
map = (MapeTextureMap*)malloc(sizeof(MapeTextureMap) );
try
{
// TODO: Allow indefinite overloading... does Clonk do this?
map->handle = new C4TextureMap;
if(overload_from != NULL)
{
map->count = CPPTEXMAP(map)->LoadTextures(
*CPPGROUP(overload_from),
CPPGROUP(base)
);
}
else
{
map->count = CPPTEXMAP(map)->LoadTextures(
*CPPGROUP(base),
NULL
);
}
}
catch(std::exception& e)
{
g_set_error(
error,
g_quark_from_static_string("MAPE_TEXTURE_ERROR"),
MAPE_TEXTURE_ERROR_FAILED,
"%s",
e.what()
);
free(map);
return NULL;
}
return map;
}
void mape_texture_map_destroy(MapeTextureMap* map)
{
delete CPPTEXMAP(map);
free(map);
}
unsigned int mape_texture_map_get_texture_count(MapeTextureMap* map)
{
return map->count;//return CPPTEXMAP(map)->GetCount();
}
const char* mape_texture_map_get_texture(MapeTextureMap* map,
unsigned int index)
{
return CPPTEXMAP(map)->GetTexture(index);
}
} // extern "C"

53
src/mape/texture.h 100644
View File

@ -0,0 +1,53 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_TEXTURE_H
#define INC_MAPE_TEXTURE_H
#include <glib/gerror.h>
#include "forward.h"
/* Simple C-based interface to C4TextureMap */
#ifdef MAPE_COMPILING_CPP
extern "C" {
#endif
typedef enum MapeTextureError_ {
MAPE_TEXTURE_ERROR_FAILED
} MapeTextureError;
struct MapeTextureMap_ {
void* handle;
unsigned int count;
};
MapeTextureMap* mape_texture_map_new(MapeGroup* base,
MapeGroup* overload_from,
GError** error);
void mape_texture_map_destroy(MapeTextureMap* map);
unsigned int mape_texture_map_get_texture_count(MapeTextureMap* map);
const char* mape_texture_map_get_texture(MapeTextureMap* map,
unsigned int index);
#ifdef MAPE_COMPILING_CPP
} /* extern "C" */
#endif
#endif /* INC_MAPE_TEXTURE_H */

859
src/mape/window.c 100644
View File

@ -0,0 +1,859 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <gtksourceview/gtksourcebuffer.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkhpaned.h>
#include <gtk/gtktoolbar.h>
#include <gtk/gtkwindow.h>
#include "fileicon.h"
#include "configfile.h"
#include "preferencesdialog.h"
#include "header.h"
#include "statusbar.h"
#include "diskview.h"
#include "mattexview.h"
#include "editview.h"
#include "preview.h"
#include "window.h"
static gboolean mape_window_file_load(MapeWindow* wnd,
const gchar* filename)
{
GError* error = NULL;
GtkWidget* error_dialog;
gchar* title;
gboolean result;
result = mape_edit_view_open(wnd->edit_view, filename, &error);
if(result == FALSE)
{
error_dialog = gtk_message_dialog_new(
GTK_WINDOW(wnd->window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"%s",
error->message
);
gtk_dialog_run(GTK_DIALOG(error_dialog) );
gtk_widget_destroy(error_dialog);
g_error_free(error);
return FALSE;
}
else
{
title = g_strdup_printf("%s - Mape", filename);
gtk_window_set_title(GTK_WINDOW(wnd->window), title);
g_free(title);
return TRUE;
}
}
static gboolean mape_window_file_save(MapeWindow* wnd,
const gchar* filename)
{
GError* error = NULL;
GtkWidget* error_dialog;
gchar* title;
gboolean result;
result = mape_edit_view_save(wnd->edit_view, filename, &error);
if(result == FALSE)
{
error_dialog = gtk_message_dialog_new(
GTK_WINDOW(wnd->window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"%s",
error->message
);
gtk_dialog_run(GTK_DIALOG(error_dialog) );
gtk_widget_destroy(error_dialog);
g_error_free(error);
return FALSE;
}
else
{
title = g_strdup_printf("%s - Mape", wnd->edit_view->file_path);
gtk_window_set_title(GTK_WINDOW(wnd->window), title);
g_free(title);
return TRUE;
}
}
static GtkWidget* mape_window_create_file_chooser(MapeWindow* wnd,
GtkFileChooserAction action)
{
GtkWidget* dialog;
GtkFileFilter* filter_all;
GtkFileFilter* filter_landscape;
filter_all = gtk_file_filter_new();
gtk_file_filter_set_name(filter_all, "All files");
gtk_file_filter_add_pattern(filter_all, "*");
filter_landscape = gtk_file_filter_new();
gtk_file_filter_set_name(filter_landscape, "Landscape.txt files");
gtk_file_filter_add_pattern(filter_landscape, "[Ll]andscape.txt");
dialog = gtk_file_chooser_dialog_new(
action == GTK_FILE_CHOOSER_ACTION_OPEN ?
"Open landscape file..." : "Save landscape file...",
GTK_WINDOW(wnd->window),
action,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
action == GTK_FILE_CHOOSER_ACTION_OPEN ?
GTK_STOCK_OPEN : GTK_STOCK_SAVE,
GTK_RESPONSE_OK,
NULL
);
gtk_file_chooser_add_filter(
GTK_FILE_CHOOSER(dialog),
filter_landscape
);
gtk_file_chooser_add_filter(
GTK_FILE_CHOOSER(dialog),
filter_all
);
gtk_file_chooser_set_do_overwrite_confirmation(
GTK_FILE_CHOOSER(dialog),
TRUE
);
return dialog;
}
static void mape_window_cb_file_save_as(GtkWidget* widget,
gpointer user_data)
{
MapeWindow* wnd;
gint response;
gchar* filename;
GtkWidget* save_dialog;
wnd = (MapeWindow*)user_data;
save_dialog = mape_window_create_file_chooser(
wnd,
GTK_FILE_CHOOSER_ACTION_SAVE
);
if(wnd->edit_view->file_path != NULL)
{
gtk_file_chooser_set_filename(
GTK_FILE_CHOOSER(save_dialog),
wnd->edit_view->file_path
);
}
else if(wnd->last_path != NULL)
{
gtk_file_chooser_set_current_folder(
GTK_FILE_CHOOSER(save_dialog),
wnd->last_path
);
}
response = gtk_dialog_run(GTK_DIALOG(save_dialog) );
if(response == GTK_RESPONSE_OK)
{
filename = gtk_file_chooser_get_filename(
GTK_FILE_CHOOSER(save_dialog)
);
g_free(wnd->last_path);
wnd->last_path = gtk_file_chooser_get_current_folder(
GTK_FILE_CHOOSER(save_dialog)
);
mape_window_file_save(wnd, filename);
g_free(filename);
}
gtk_widget_destroy(save_dialog);
}
static void mape_window_cb_file_save(GtkWidget* widget,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
if(wnd->edit_view->file_path == NULL)
{
mape_window_cb_file_save_as(widget, user_data);
}
else
{
mape_window_file_save(wnd, wnd->edit_view->file_path);
}
}
static gboolean mape_window_confirm_close(MapeWindow* wnd)
{
GtkWidget* confirm_dialog;
gint response;
/* No need to confirm if the document has not been modified */
if(mape_edit_view_get_modified(wnd->edit_view) == FALSE)
return TRUE;
confirm_dialog = gtk_message_dialog_new(
GTK_WINDOW(wnd->window),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
"Save the changes to document before closing?"
);
gtk_message_dialog_format_secondary_text(
GTK_MESSAGE_DIALOG(confirm_dialog),
"Unsaved changes will be permanently lost."
);
gtk_dialog_add_buttons(
GTK_DIALOG(confirm_dialog),
"Close _without saving",
GTK_RESPONSE_REJECT,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE,
GTK_RESPONSE_ACCEPT,
NULL
);
response = gtk_dialog_run(GTK_DIALOG(confirm_dialog) );
gtk_widget_destroy(confirm_dialog);
switch(response)
{
case GTK_RESPONSE_DELETE_EVENT:
case GTK_RESPONSE_CANCEL:
return FALSE;
break;
case GTK_RESPONSE_REJECT:
/* Document may be closed */
return TRUE;
case GTK_RESPONSE_ACCEPT:
/* Save before closing */
mape_window_cb_file_save(wnd->window, wnd);
return TRUE;
default:
g_assert_not_reached();
return FALSE;
}
}
static void mape_window_cb_realize(GtkWidget* widget,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
gtk_paned_set_position(GTK_PANED(wnd->mid_paned), 200);
}
static void mape_window_cb_file_new(GtkWidget* widget,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
if(mape_window_confirm_close(wnd) == TRUE)
{
mape_edit_view_clear(wnd->edit_view);
gtk_window_set_title(GTK_WINDOW(wnd->window), "Mape");
}
}
static void mape_window_cb_file_open(GtkWidget* widget,
gpointer user_data)
{
MapeWindow* wnd;
gint response;
GtkWidget* open_dialog;
gchar* filename;
wnd = (MapeWindow*)user_data;
if(mape_window_confirm_close(wnd) == FALSE)
return;
open_dialog = mape_window_create_file_chooser(
wnd,
GTK_FILE_CHOOSER_ACTION_OPEN
);
if(wnd->last_path != NULL)
{
gtk_file_chooser_set_current_folder(
GTK_FILE_CHOOSER(open_dialog),
wnd->last_path
);
}
response = gtk_dialog_run(GTK_DIALOG(open_dialog) );
if(response == GTK_RESPONSE_OK)
{
filename = gtk_file_chooser_get_filename(
GTK_FILE_CHOOSER(open_dialog)
);
g_free(wnd->last_path);
wnd->last_path = gtk_file_chooser_get_current_folder(
GTK_FILE_CHOOSER(open_dialog)
);
mape_window_file_load(wnd, filename);
g_free(filename);
}
gtk_widget_destroy(open_dialog);
}
static void mape_window_cb_file_quit(GtkWidget* widget,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
if(mape_window_confirm_close(wnd) == TRUE)
gtk_widget_destroy(wnd->window);
}
static gboolean mape_window_cb_delete_event(GtkWidget* widget,
GdkEvent* event,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
if(mape_window_confirm_close(wnd) == TRUE)
return FALSE;
else
return TRUE;
}
static void mape_window_cb_edit_undo(GtkAction* action,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
mape_edit_view_undo(wnd->edit_view);
}
static void mape_window_cb_edit_redo(GtkAction* action,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
mape_edit_view_redo(wnd->edit_view);
}
static void mape_window_cb_edit_can_undo(GObject* object,
GParamSpec* pspec,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
gtk_action_set_sensitive(
wnd->header->edit_undo,
gtk_source_buffer_can_undo(GTK_SOURCE_BUFFER(object))
);
}
static void mape_window_cb_edit_can_redo(GObject* object,
GParamSpec* pspec,
gpointer user_data)
{
MapeWindow* wnd;
wnd = (MapeWindow*)user_data;
gtk_action_set_sensitive(
wnd->header->edit_redo,
gtk_source_buffer_can_redo(GTK_SOURCE_BUFFER(object))
);
}
static void mape_window_cb_edit_preferences(GtkAction* action,
gpointer user_data)
{
MapeWindow* wnd;
MapePreferencesDialog* dialog;
gint result;
wnd = (MapeWindow*)user_data;
dialog = mape_preferences_dialog_new(
GTK_WINDOW(wnd->window),
&wnd->preferences
);
result = gtk_dialog_run(GTK_DIALOG(dialog->dialog) );
if(result == GTK_RESPONSE_OK)
{
wnd->preferences = mape_preferences_dialog_get(dialog);
mape_preferences_to_config(&wnd->preferences, wnd->config);
mape_edit_view_apply_preferences(
wnd->edit_view,
&wnd->preferences
);
mape_pre_view_apply_preferences(wnd->pre_view, &wnd->preferences);
}
mape_preferences_dialog_destroy(dialog);
}
static void mape_window_cb_help_about(GtkAction* action,
gpointer user_data)
{
MapeWindow* wnd;
GtkWidget* about_dialog;
const gchar* authors[] = {
"Developers:",
" Armin Burgmeier <armin@arbur.net>",
"",
"Contributors:",
" Tyron Madlener <tm@tyron.at>",
NULL
};
const gchar* artists[] = {
"Stefan \"KaZoiTeZ\" Ryll",
NULL
};
wnd = (MapeWindow*)user_data;
about_dialog = gtk_about_dialog_new();
gtk_about_dialog_set_name(
GTK_ABOUT_DIALOG(about_dialog),
"Mape"
);
gtk_about_dialog_set_version(
GTK_ABOUT_DIALOG(about_dialog),
"1.3.3"
);
gtk_about_dialog_set_copyright(
GTK_ABOUT_DIALOG(about_dialog),
"Copyright \xc2\xa9 2005, 2006, 2007 Armin Burgmeier"
);
gtk_about_dialog_set_comments(
GTK_ABOUT_DIALOG(about_dialog),
"A Clonk Landscape.txt editor"
);
gtk_about_dialog_set_authors(
GTK_ABOUT_DIALOG(about_dialog),
authors
);
gtk_about_dialog_set_artists(
GTK_ABOUT_DIALOG(about_dialog),
artists
);
gtk_dialog_run(GTK_DIALOG(about_dialog) );
gtk_widget_destroy(about_dialog);
}
MapeWindow* mape_window_new(int argc,
char* argv[],
GError** error)
{
MapeWindow* wnd;
gchar* config_path;
gchar* material_path;
gchar* current_dir;
gchar* landscape_path;
gchar* basename;
int i;
wnd = malloc(sizeof(MapeWindow) );
/* Load preferences */
config_path = g_build_filename(g_get_home_dir(), ".mape", NULL);
wnd->config = mape_config_file_new(config_path);
g_free(config_path);
current_dir = g_get_current_dir();
landscape_path = NULL;
for(i = 1; i < argc; ++ i)
{
basename = g_path_get_basename(argv[i]);
if(g_strcasecmp(basename, "Material.c4g") == 0)
{
if(!g_path_is_absolute(argv[i]))
{
material_path = g_build_filename(
current_dir,
argv[i],
NULL
);
}
else
{
material_path = g_strdup(argv[i]);
}
mape_config_file_set_entry(
wnd->config,
"material_path",
material_path
);
g_free(material_path);
}
else
{
g_free(landscape_path);
if(!g_path_is_absolute(argv[i]))
{
landscape_path = g_build_filename(
current_dir,
argv[i],
NULL
);
}
else
{
landscape_path = g_strdup(argv[i]);
}
}
g_free(basename);
}
g_free(current_dir);
mape_preferences_from_config(&wnd->preferences, wnd->config);
wnd->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
wnd->icon_set = mape_file_icon_set_new(wnd->window);
wnd->last_path = NULL;
wnd->header = mape_header_new();
wnd->statusbar = mape_statusbar_new();
wnd->mat_tex_view = mape_mat_tex_view_new(wnd->icon_set, error);
if(wnd->mat_tex_view == NULL)
goto mat_tex_error;
wnd->pre_view = mape_pre_view_new(wnd->mat_tex_view, error);
if(wnd->pre_view == NULL)
goto pre_view_error;
wnd->edit_view = mape_edit_view_new(
wnd->pre_view,
wnd->statusbar,
error
);
if(wnd->edit_view == NULL)
goto edit_view_error;
wnd->disk_view = mape_disk_view_new(
wnd->icon_set,
wnd->mat_tex_view,
wnd->edit_view,
wnd->config,
error
);
if(wnd->disk_view == NULL)
goto disk_view_error;
wnd->menubar = wnd->header->menubar;
gtk_widget_show(wnd->menubar);
wnd->toolbar = wnd->header->toolbar;
gtk_toolbar_set_style(GTK_TOOLBAR(wnd->toolbar), GTK_TOOLBAR_ICONS);
gtk_widget_show(wnd->toolbar);
wnd->mid_paned = gtk_hpaned_new();
gtk_paned_pack1(
GTK_PANED(wnd->mid_paned),
wnd->disk_view->window,
TRUE,
FALSE
);
gtk_paned_pack2(
GTK_PANED(wnd->mid_paned),
wnd->edit_view->window,
TRUE,
FALSE
);
gtk_widget_show(wnd->mid_paned);
wnd->bottom_hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(
GTK_BOX(wnd->bottom_hbox),
wnd->mat_tex_view->notebook,
TRUE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(wnd->bottom_hbox),
wnd->pre_view->frame,
FALSE,
FALSE,
0
);
gtk_widget_show(wnd->bottom_hbox);
wnd->topbox = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(
GTK_BOX(wnd->topbox),
wnd->menubar,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(wnd->topbox),
wnd->toolbar,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(wnd->topbox),
wnd->mid_paned,
TRUE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(wnd->topbox),
wnd->bottom_hbox,
FALSE,
TRUE,
0
);
gtk_box_pack_start(
GTK_BOX(wnd->topbox),
wnd->statusbar->bar,
FALSE,
TRUE,
0
);
gtk_widget_show(wnd->topbox);
gtk_container_add(
GTK_CONTAINER(wnd->window),
wnd->topbox
);
gtk_window_add_accel_group(
GTK_WINDOW(wnd->window),
wnd->header->accel_group
);
g_signal_connect(
G_OBJECT(wnd->window),
"realize",
G_CALLBACK(mape_window_cb_realize),
wnd
);
g_signal_connect(
G_OBJECT(wnd->window),
"delete-event",
G_CALLBACK(mape_window_cb_delete_event),
wnd
);
gtk_widget_grab_focus(wnd->edit_view->view);
g_signal_connect(
G_OBJECT(wnd->header->file_new),
"activate",
G_CALLBACK(mape_window_cb_file_new),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->file_open),
"activate",
G_CALLBACK(mape_window_cb_file_open),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->file_save),
"activate",
G_CALLBACK(mape_window_cb_file_save),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->file_save_as),
"activate",
G_CALLBACK(mape_window_cb_file_save_as),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->file_quit),
"activate",
G_CALLBACK(mape_window_cb_file_quit),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->edit_undo),
"activate",
G_CALLBACK(mape_window_cb_edit_undo),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->edit_redo),
"activate",
G_CALLBACK(mape_window_cb_edit_redo),
wnd
);
g_signal_connect(
G_OBJECT(
gtk_text_view_get_buffer(
GTK_TEXT_VIEW(wnd->edit_view->view)
)
),
"notify::can-undo",
G_CALLBACK(mape_window_cb_edit_can_undo),
wnd
);
g_signal_connect(
G_OBJECT(
gtk_text_view_get_buffer(
GTK_TEXT_VIEW(wnd->edit_view->view)
)
),
"notify::can-redo",
G_CALLBACK(mape_window_cb_edit_can_redo),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->edit_preferences),
"activate",
G_CALLBACK(mape_window_cb_edit_preferences),
wnd
);
g_signal_connect(
G_OBJECT(wnd->header->help_about),
"activate",
G_CALLBACK(mape_window_cb_help_about),
wnd
);
gtk_action_set_sensitive(wnd->header->edit_undo, FALSE);
gtk_action_set_sensitive(wnd->header->edit_redo, FALSE);
mape_edit_view_apply_preferences(wnd->edit_view, &wnd->preferences);
mape_pre_view_apply_preferences(wnd->pre_view, &wnd->preferences);
gtk_window_set_title(GTK_WINDOW(wnd->window), "Mape");
gtk_window_set_default_size(GTK_WINDOW(wnd->window), 640, 480);
/* Load initial landscape */
if(landscape_path != NULL)
{
mape_window_file_load(wnd, landscape_path);
g_free(landscape_path);
}
gtk_widget_show(wnd->window);
return wnd;
disk_view_error:
mape_edit_view_destroy(wnd->edit_view);
edit_view_error:
mape_pre_view_destroy(wnd->pre_view);
pre_view_error:
mape_mat_tex_view_destroy(wnd->mat_tex_view);
mat_tex_error:
g_free(landscape_path);
mape_header_destroy(wnd->header);
mape_statusbar_destroy(wnd->statusbar);
mape_file_icon_set_destroy(wnd->icon_set);
gtk_widget_destroy(wnd->window);
mape_config_file_destroy(wnd->config);
free(wnd);
return NULL;
}
void mape_window_destroy(MapeWindow* wnd)
{
mape_pre_view_destroy(wnd->pre_view);
mape_edit_view_destroy(wnd->edit_view);
mape_disk_view_destroy(wnd->disk_view);
mape_mat_tex_view_destroy(wnd->mat_tex_view);
mape_header_destroy(wnd->header);
mape_file_icon_set_destroy(wnd->icon_set);
mape_config_file_serialise(wnd->config, NULL);
mape_config_file_destroy(wnd->config);
g_free(wnd->last_path);
free(wnd);
}

57
src/mape/window.h 100644
View File

@ -0,0 +1,57 @@
/* mape - C4 Landscape.txt editor
* Copyright (C) 2005 Armin Burgmeier
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef INC_MAPE_WINDOW_H
#define INC_MAPE_WINDOW_H
#include <gtk/gtkwidget.h>
#include "forward.h"
#include "preferences.h"
struct MapeWindow_ {
MapeFileIconSet* icon_set;
gchar* last_path;
GtkWidget* window;
GtkWidget* topbox;
GtkWidget* mid_paned;
GtkWidget* bottom_hbox;
GtkWidget* menubar;
GtkWidget* toolbar;
MapeHeader* header;
MapeStatusbar* statusbar;
MapeDiskView* disk_view;
MapeMatTexView* mat_tex_view;
MapeEditView* edit_view;
MapePreView* pre_view;
MapeConfigFile* config;
MapePreferences preferences;
};
MapeWindow* mape_window_new(int argc,
char* argv[],
GError** error);
void mape_window_destroy(MapeWindow* wnd);
#endif /* INC_MAPE_WINDOW_H */