From 2ef403728e6d52a1c6c55723bf63a06a4fa7d179 Mon Sep 17 00:00:00 2001 From: Armin Burgmeier Date: Mon, 21 Sep 2009 00:04:52 -0400 Subject: [PATCH] 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 --- CMakeLists.txt | 121 ++- src/mape/configfile.c | 180 ++++ src/mape/configfile.h | 56 ++ src/mape/diskview.c | 1116 +++++++++++++++++++++++++ src/mape/diskview.h | 71 ++ src/mape/editview.c | 644 ++++++++++++++ src/mape/editview.h | 78 ++ src/mape/fileicon.c | 170 ++++ src/mape/fileicon.h | 56 ++ src/mape/forward.h | 40 + src/mape/group.cpp | 263 ++++++ src/mape/group.h | 67 ++ src/mape/header.c | 281 +++++++ src/mape/header.h | 54 ++ src/mape/icon/c4d.c | 149 ++++ src/mape/icon/c4f.c | 162 ++++ src/mape/icon/c4g.c | 194 +++++ src/mape/icon/c4m.c | 197 +++++ src/mape/icon/c4s.c | 194 +++++ src/mape/icon/icons.h | 8 + src/mape/icon/tex.c | 159 ++++ src/mape/iconview.c | 143 ++++ src/mape/iconview.h | 52 ++ src/mape/mape-syntax/c4landscape.lang | 95 +++ src/mape/mape-syntax/c4landscape.xml | 17 + src/mape/mape-syntax/language2.rng | 461 ++++++++++ src/mape/mape.c | 185 ++++ src/mape/mapgen.cpp | 185 ++++ src/mape/mapgen.h | 49 ++ src/mape/material.cpp | 124 +++ src/mape/material.h | 60 ++ src/mape/mattexview.c | 155 ++++ src/mape/mattexview.h | 46 + src/mape/preferences.c | 139 +++ src/mape/preferences.h | 44 + src/mape/preferencesdialog.c | 437 ++++++++++ src/mape/preferencesdialog.h | 60 ++ src/mape/preview.c | 70 ++ src/mape/preview.h | 50 ++ src/mape/random.cpp | 33 + src/mape/random.h | 36 + src/mape/statusbar.c | 55 ++ src/mape/statusbar.h | 37 + src/mape/texture.cpp | 91 ++ src/mape/texture.h | 53 ++ src/mape/window.c | 859 +++++++++++++++++++ src/mape/window.h | 57 ++ 47 files changed, 7824 insertions(+), 29 deletions(-) create mode 100644 src/mape/configfile.c create mode 100644 src/mape/configfile.h create mode 100644 src/mape/diskview.c create mode 100644 src/mape/diskview.h create mode 100644 src/mape/editview.c create mode 100644 src/mape/editview.h create mode 100644 src/mape/fileicon.c create mode 100644 src/mape/fileicon.h create mode 100644 src/mape/forward.h create mode 100644 src/mape/group.cpp create mode 100644 src/mape/group.h create mode 100644 src/mape/header.c create mode 100644 src/mape/header.h create mode 100644 src/mape/icon/c4d.c create mode 100644 src/mape/icon/c4f.c create mode 100644 src/mape/icon/c4g.c create mode 100644 src/mape/icon/c4m.c create mode 100644 src/mape/icon/c4s.c create mode 100644 src/mape/icon/icons.h create mode 100644 src/mape/icon/tex.c create mode 100644 src/mape/iconview.c create mode 100644 src/mape/iconview.h create mode 100644 src/mape/mape-syntax/c4landscape.lang create mode 100644 src/mape/mape-syntax/c4landscape.xml create mode 100644 src/mape/mape-syntax/language2.rng create mode 100644 src/mape/mape.c create mode 100644 src/mape/mapgen.cpp create mode 100644 src/mape/mapgen.h create mode 100644 src/mape/material.cpp create mode 100644 src/mape/material.h create mode 100644 src/mape/mattexview.c create mode 100644 src/mape/mattexview.h create mode 100644 src/mape/preferences.c create mode 100644 src/mape/preferences.h create mode 100644 src/mape/preferencesdialog.c create mode 100644 src/mape/preferencesdialog.h create mode 100644 src/mape/preview.c create mode 100644 src/mape/preview.h create mode 100644 src/mape/random.cpp create mode 100644 src/mape/random.h create mode 100644 src/mape/statusbar.c create mode 100644 src/mape/statusbar.h create mode 100644 src/mape/texture.cpp create mode 100644 src/mape/texture.h create mode 100644 src/mape/window.c create mode 100644 src/mape/window.h diff --git a/CMakeLists.txt b/CMakeLists.txt index cca2c47d1..eb972427a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/mape/configfile.c b/src/mape/configfile.c new file mode 100644 index 000000000..31e905e03 --- /dev/null +++ b/src/mape/configfile.c @@ -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 +#include +#include +#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; +} diff --git a/src/mape/configfile.h b/src/mape/configfile.h new file mode 100644 index 000000000..87f822531 --- /dev/null +++ b/src/mape/configfile.h @@ -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 +#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 */ diff --git a/src/mape/diskview.c b/src/mape/diskview.c new file mode 100644 index 000000000..7b8f5f347 --- /dev/null +++ b/src/mape/diskview.c @@ -0,0 +1,1116 @@ +/* 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "group.h" +#include "fileicon.h" +#include "configfile.h" +#include "mattexview.h" +#include "editview.h" +#include "diskview.h" + +static gboolean mape_disk_view_find_iter(MapeDiskView* disk_view, + GtkTreeIter* child, + GtkTreeIter* parent, + const gchar* file) +{ + gboolean result; + gchar* filename; + + result = gtk_tree_model_iter_children( + disk_view->tree_store, + child, + parent + ); + + while(result == TRUE) + { + gtk_tree_model_get( + disk_view->tree_store, + child, + MAPE_DISK_VIEW_COLUMN_FILE, + &filename, + -1 + ); + + if(g_strcasecmp(filename, file) == 0) + { + g_free(filename); + return TRUE; + } + + g_free(filename); + result = gtk_tree_model_iter_next(disk_view->tree_store, child); + } + + return FALSE; +} + +static gchar* mape_disk_view_get_file_path(MapeDiskView* disk_view, + GtkTreeIter* file) +{ + gboolean result; + GtkTreeIter parent; + GtkTreeIter child; + gchar* cur_path; + gchar* component; + gchar* temp_path; + + child = *file; + + gtk_tree_model_get( + disk_view->tree_store, + file, + MAPE_DISK_VIEW_COLUMN_FILE, + &cur_path, + -1 + ); + + for(;;) + { + result = gtk_tree_model_iter_parent( + disk_view->tree_store, + &parent, + &child + ); + + if(result == FALSE) + break; + + gtk_tree_model_get( + disk_view->tree_store, + &parent, + MAPE_DISK_VIEW_COLUMN_FILE, + &component, + -1 + ); + +#ifdef G_OS_WIN32 + temp_path = g_build_filename(component, cur_path, NULL); +#else + /* Add leading "/" to filename for absolute path */ + temp_path = g_build_filename("/", component, cur_path, NULL); +#endif + g_free(component); g_free(cur_path); + cur_path = temp_path; + + child = parent; + } + + return cur_path; +} + +static gboolean mape_disk_view_load_materials(MapeDiskView* disk_view, + GtkTreeIter* material_iter, + GError** error) +{ + GtkTreeIter parent_iter; + GtkTreeIter new_parent; + gboolean has_parent; + gboolean result; + gchar* mat_path; + + MapeGroup* group; + MapeGroup* parent_group; + MapeGroup* overloaded_group; + + /* Open Material.c4g group */ + gtk_tree_model_get( + disk_view->tree_store, + material_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &group, + -1 + ); + + /* TODO: Examine TexMap, check for infinite overloaded Mats/Texs */ + + if(group == NULL) + { + has_parent = gtk_tree_model_iter_parent( + disk_view->tree_store, + &parent_iter, + material_iter + ); + + if(has_parent == TRUE) + { + gtk_tree_model_get( + disk_view->tree_store, + &parent_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &parent_group, + -1 + ); + + g_assert(parent_group != NULL); + } + else + { + parent_group = disk_view->group_top; + } + + group = mape_group_new_from_parent( + parent_group, + "Material.c4g", + error + ); + + if(group == NULL) return FALSE; + + gtk_tree_store_set( + GTK_TREE_STORE(disk_view->tree_store), + material_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + group, + -1 + ); + } + + /* Look for overloaded Material.c4g */ + has_parent = gtk_tree_model_iter_parent( + disk_view->tree_store, + &parent_iter, + material_iter + ); + + for(;;) + { + overloaded_group = NULL; + + has_parent = gtk_tree_model_iter_parent( + disk_view->tree_store, + &new_parent, + &parent_iter + ); + + if(has_parent == FALSE) + break; + + parent_iter = new_parent; + + gtk_tree_model_get( + disk_view->tree_store, + &parent_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &overloaded_group, + -1 + ); + + if(mape_group_has_entry(overloaded_group, "Material.c4g") == + TRUE) + { + /* TODO: Check if the group is already open! + (mape_disk_view_find_iter). */ + overloaded_group = mape_group_new_from_parent( + overloaded_group, + "Material.c4g", + error + ); + + if(overloaded_group == NULL) + return FALSE; + + break; + } + } + + mat_path = mape_disk_view_get_file_path(disk_view, material_iter); + mape_config_file_set_entry( + disk_view->config, + "material_path", + mat_path + ); + g_free(mat_path); + + result = mape_mat_tex_view_reload( + disk_view->mat_tex, + group, + overloaded_group, + error + ); + +#if 0 + if(overloaded_group != NULL) + mape_group_destroy(overloaded_group); +#endif + + mape_edit_view_reload(disk_view->edit_view); + + return result; +} + +static gboolean mape_disk_view_load(MapeDiskView* disk_view, + GtkTreeIter* parent_iter, + GError** error) +{ + GtkTreeIter child_iter; + GtkTreeIter group_iter; + GtkTreeIter temp_iter; + + MapeGroup* child_group; + MapeGroup* parent_group; + + MapeFileIcon* icon; + MapeFileIconType icon_type; + const char* fileext; + char* filename; + char* utf8_file; + gboolean deplevel; + + if(parent_iter != NULL) + { + gtk_tree_model_get( + disk_view->tree_store, + parent_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &parent_group, + -1 + ); + + /* Group is already open */ + if(parent_group != NULL) + return TRUE; + + /* Get parent group */ + deplevel = gtk_tree_model_iter_parent( + disk_view->tree_store, + &group_iter, + parent_iter + ); + + if(deplevel == TRUE) + { + gtk_tree_model_get( + disk_view->tree_store, + &group_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &parent_group, + -1 + ); + + g_assert(parent_group != NULL); + } + else + { + /* Parent is at top-level */ + parent_group = disk_view->group_top; + } + } + else + { + parent_group = NULL; + } + + if(parent_group != NULL) + { + gtk_tree_model_get( + disk_view->tree_store, + parent_iter, + MAPE_DISK_VIEW_COLUMN_FILE, + &utf8_file, + -1 + ); + +#ifdef G_OS_WIN32 + filename = g_convert( + utf8_file, + -1, + "LATIN1", + "UTF-8", + NULL, + NULL, + NULL + ); +#else + filename = g_filename_from_utf8( + utf8_file, + -1, + NULL, + NULL, + NULL + ); +#endif + + g_free(utf8_file); + + child_group = mape_group_new_from_parent( + parent_group, + filename, + error + ); + + g_free(filename); + + if(child_group == NULL) + return FALSE; + + /* Store child group in parent */ + gtk_tree_store_set( + GTK_TREE_STORE(disk_view->tree_store), + parent_iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + (gpointer)child_group, + -1 + ); + } + else + { + /* Group is already open */ + if(disk_view->group_top != NULL) + return TRUE; + + disk_view->group_top = mape_group_new("/", error); + if(disk_view->group_top == NULL) return FALSE; + + child_group = disk_view->group_top; + } + + while( (filename = mape_group_get_next_entry(child_group)) != NULL) + { + /* Check if this entry is a directory (we are hiding files). */ + if(mape_group_is_child_folder(child_group, filename) == FALSE) + { + free(filename); + continue; + } + +#ifdef G_OS_WIN32 + utf8_file = g_convert( + filename, + -1, + "UTF-8", + "LATIN1", + NULL, + NULL, + NULL + ); +#else + utf8_file = g_filename_to_utf8( + filename, + -1, + NULL, + NULL, + NULL + ); +#endif + + g_free(filename); + filename = utf8_file; + + /* Invalid file name */ + if(filename == NULL) + continue; + + gtk_tree_store_append( + GTK_TREE_STORE(disk_view->tree_store), + &child_iter, + parent_iter + ); + + /* Create temporary entry to show the expander arrow */ + if(g_strcasecmp(filename, "Material.c4g") != 0) + { + gtk_tree_store_append( + GTK_TREE_STORE(disk_view->tree_store), + &temp_iter, + &child_iter + ); + } + + fileext = strrchr(filename, '.'); + icon_type = MAPE_FILE_ICON_FOLDER; + + if(fileext != NULL) + { + if(g_strcasecmp(fileext, ".c4d") == 0) + icon_type = MAPE_FILE_ICON_C4OBJECT; + else if(g_strcasecmp(fileext, ".c4f") == 0) + icon_type = MAPE_FILE_ICON_C4FOLDER; + else if(g_strcasecmp(fileext, ".c4g") == 0) + icon_type = MAPE_FILE_ICON_C4GROUP; + else if(g_strcasecmp(fileext, ".c4s") == 0) + icon_type = MAPE_FILE_ICON_C4SCENARIO; + } + + if(child_group->group_handle == NULL) + icon_type = MAPE_FILE_ICON_DRIVE; + + icon = mape_file_icon_set_lookup( + disk_view->icon_set, + icon_type + ); + + gtk_tree_store_set( + GTK_TREE_STORE(disk_view->tree_store), + &child_iter, + MAPE_DISK_VIEW_COLUMN_ICON, + mape_file_icon_get(icon), + MAPE_DISK_VIEW_COLUMN_FILE, + filename, + MAPE_DISK_VIEW_COLUMN_GROUP, + NULL,/*(gpointer)child_group,*/ + -1 + ); + + gtk_tree_model_ref_node( + disk_view->tree_store, + &child_iter + ); + + free(filename); + /*free(utf8_file);*/ + } + + /* TODO: Close group if no content */ + + return TRUE; +} + +static gboolean mape_disk_view_cb_key_press_event(GtkWidget* widget, + GdkEventKey* event, + gpointer user_data) +{ + MapeDiskView* disk_view; + GtkTreePath* path; + gboolean result; + + disk_view = (MapeDiskView*)user_data; + + if(event->keyval != GDK_Left && event->keyval != GDK_Right) + return FALSE; + + gtk_tree_view_get_cursor( + GTK_TREE_VIEW(disk_view->view), + &path, + NULL + ); + + if(path == NULL) return FALSE; + + switch(event->keyval) + { + case GDK_Left: + result = gtk_tree_view_row_expanded( + GTK_TREE_VIEW(disk_view->view), + path + ); + + if(result == TRUE) + { + gtk_tree_view_collapse_row( + GTK_TREE_VIEW(disk_view->view), + path + ); + } + else + { + if(gtk_tree_path_get_depth(path) > 1) + { + result = gtk_tree_path_up(path); + g_assert(result == TRUE); + + gtk_tree_view_set_cursor( + GTK_TREE_VIEW(disk_view->view), + path, + NULL, + FALSE + ); + } + } + + break; + case GDK_Right: + result = gtk_tree_view_row_expanded( + GTK_TREE_VIEW(disk_view->view), + path + ); + + if(result == TRUE) + { + gtk_tree_path_down(path); + + gtk_tree_view_set_cursor( + GTK_TREE_VIEW(disk_view->view), + path, + NULL, + FALSE + ); + } + else + { + gtk_tree_view_expand_row( + GTK_TREE_VIEW(disk_view->view), + path, + FALSE + ); + } + + break; + default: + g_assert_not_reached(); + break; + } + + gtk_tree_path_free(path); + return TRUE; +} + +static gboolean mape_disk_view_cb_button_press_event(GtkWidget* widget, + GdkEventButton* event, + gpointer user_data) +{ + MapeDiskView* disk_view; + GtkTreePath* path; + GtkTreeIter iter; + gboolean result; + gchar* filename; + GError* error = NULL; + GtkWidget* error_dialog; + + disk_view = (MapeDiskView*)user_data; + + if(event->type == GDK_2BUTTON_PRESS) + { + gtk_tree_view_get_cursor( + GTK_TREE_VIEW(disk_view->view), + &path, + NULL + ); + + if(path == NULL) return FALSE; + + gtk_tree_model_get_iter( + disk_view->tree_store, + &iter, + path + ); + + gtk_tree_model_get( + disk_view->tree_store, + &iter, + MAPE_DISK_VIEW_COLUMN_FILE, + &filename, + -1 + ); + + /* Load Material.c4g */ + if(g_strcasecmp(filename, "Material.c4g") == 0) + { + result = mape_disk_view_load_materials( + disk_view, + &iter, + &error + ); + + if(result == FALSE) + { + error_dialog = gtk_message_dialog_new( + NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", + error->message + ); + + g_error_free(error); + gtk_dialog_run(GTK_DIALOG(error_dialog) ); + gtk_widget_destroy(error_dialog); + } + } + else + { + result = gtk_tree_view_row_expanded( + GTK_TREE_VIEW(disk_view->view), + path + ); + + if(result == TRUE) + { + gtk_tree_view_collapse_row( + GTK_TREE_VIEW(disk_view->view), + path + ); + } + else + { + gtk_tree_view_expand_row( + GTK_TREE_VIEW(disk_view->view), + path, + FALSE + ); + } + } + + g_free(filename); + gtk_tree_path_free(path); + return TRUE; + } + + return FALSE; +} + +static void mape_disk_view_cb_row_expanded(GtkTreeView* treeview, + GtkTreeIter* row, + GtkTreePath* path, + gpointer user_data) +{ + MapeDiskView* disk_view; + MapeGroup* group; + GtkTreeIter iter; + GtkTreeIter temp_iter; + gboolean result; + GError* error = NULL; + GtkWidget* error_dialog; + + disk_view = (MapeDiskView*)user_data; + result = gtk_tree_model_get_iter( + disk_view->tree_store, + &iter, + path + ); + + g_assert(result == TRUE); + + /* Remove temporary entry if group is not already loaded */ + gtk_tree_model_get( + disk_view->tree_store, + &iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &group, + -1 + ); + + if(group == NULL) + { + g_assert( + gtk_tree_model_iter_n_children( + disk_view->tree_store, + &iter + ) == 1 + ); + + result = gtk_tree_model_iter_children( + disk_view->tree_store, + &temp_iter, + &iter + ); + + g_assert(result == TRUE); + + result = gtk_tree_store_remove( + GTK_TREE_STORE(disk_view->tree_store), + &temp_iter + ); + + g_assert(result == FALSE); + } + + if(mape_disk_view_load(disk_view, &iter, &error) == FALSE) + { + error_dialog = gtk_message_dialog_new( + NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", + error->message + ); + + g_error_free(error); + gtk_dialog_run(GTK_DIALOG(error_dialog) ); + gtk_widget_destroy(error_dialog); + + return; + } + + if(group == NULL) + { + gtk_tree_view_expand_row( + GTK_TREE_VIEW(disk_view->view), + path, + FALSE + ); + } +} + +static void mape_disk_view_close_groups(MapeDiskView* disk_view, + GtkTreeIter* iter) +{ + MapeGroup* group; + GtkTreeIter child; + gboolean has_child, has_next; + + gtk_tree_model_get( + disk_view->tree_store, + iter, + MAPE_DISK_VIEW_COLUMN_GROUP, + &group, + -1 + ); + + has_child = gtk_tree_model_iter_children( + disk_view->tree_store, + &child, + iter + ); + + has_next = gtk_tree_model_iter_next( + disk_view->tree_store, + iter + ); + + if(has_child == TRUE) + mape_disk_view_close_groups(disk_view, &child); + + if(group != NULL) + mape_group_destroy(group); + + if(has_next == TRUE) + mape_disk_view_close_groups(disk_view, iter); +} + + +MapeDiskView* mape_disk_view_new(MapeFileIconSet* icon_set, + MapeMatTexView* mat_tex, + MapeEditView* edit_view, + MapeConfigFile* config, + GError** error) +{ + MapeDiskView* view; + MapeConfigFileEntry* entry; + + view = malloc(sizeof(MapeDiskView) ); + + view->group_top = NULL; + view->icon_set = icon_set; + view->mat_tex = mat_tex; + view->edit_view = edit_view; + view->config = config; + + view->tree_store = GTK_TREE_MODEL( + gtk_tree_store_new( + MAPE_DISK_VIEW_COLUMN_COUNT, + GDK_TYPE_PIXBUF, + G_TYPE_STRING, + G_TYPE_POINTER + ) + ); + + view->renderer_icon = gtk_cell_renderer_pixbuf_new(); + view->renderer_file = gtk_cell_renderer_text_new(); + + /*view->col_icon = gtk_tree_view_column_new_with_attributes( + "Icon", + view->renderer_icon, + "pixbuf", MAPE_DISK_VIEW_COLUMN_ICON, + NULL + );*/ + + view->col_file = gtk_tree_view_column_new(); + +/* view->col_file = gtk_tree_view_column_new_with_attributes( + "Filename", + view->renderer_file, + "text", MAPE_DISK_VIEW_COLUMN_FILE, + "pixbuf", MAPE_DISK_VIEW_COLUMN_ICON, + NULL + );*/ + + gtk_tree_view_column_pack_start( + view->col_file, + view->renderer_icon, + FALSE + ); + + gtk_tree_view_column_pack_start( + view->col_file, + view->renderer_file, + TRUE + ); + + gtk_tree_view_column_set_attributes( + view->col_file, + view->renderer_icon, + "pixbuf", MAPE_DISK_VIEW_COLUMN_ICON, + NULL + ); + + gtk_tree_view_column_set_attributes( + view->col_file, + view->renderer_file, + "text", MAPE_DISK_VIEW_COLUMN_FILE, + NULL + ); + + gtk_tree_view_column_set_spacing( + view->col_file, + 5 + ); + + view->view = gtk_tree_view_new_with_model( + GTK_TREE_MODEL(view->tree_store) + ); + + gtk_widget_add_events( + view->view, + GDK_BUTTON_PRESS_MASK | + GDK_KEY_PRESS_MASK + ); + + gtk_tree_view_append_column(GTK_TREE_VIEW(view->view), view->col_file); + + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view->view), FALSE); + gtk_tree_sortable_set_sort_column_id( + GTK_TREE_SORTABLE(view->tree_store), + MAPE_DISK_VIEW_COLUMN_FILE, + GTK_SORT_ASCENDING + ); + + g_signal_connect( + G_OBJECT(view->view), + "row-expanded", + G_CALLBACK(mape_disk_view_cb_row_expanded), + view + ); + + g_signal_connect( + G_OBJECT(view->view), + "button-press-event", + G_CALLBACK(mape_disk_view_cb_button_press_event), + view + ); + + g_signal_connect( + G_OBJECT(view->view), + "key-press-event", + G_CALLBACK(mape_disk_view_cb_key_press_event), + view + ); + + if(mape_disk_view_load(view, NULL, error) == FALSE) + { + /* TODO: Free cell renderers? */ + gtk_widget_destroy(view->view); + g_object_unref(G_OBJECT(view->tree_store) ); + + free(view); + return NULL; + } + + 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 + ); + + /* Load initial path, if any */ + entry = mape_config_file_get_entry_by_key( + view->config, + "material_path" + ); + + if(entry != NULL) + { + mape_disk_view_extend_to_path( + view, + mape_config_file_entry_get_value(entry), + NULL + ); + } + + gtk_widget_set_size_request(view->window, 150, -1); + gtk_widget_show(view->window); + + return view; +} + +void mape_disk_view_destroy(MapeDiskView* disk_view) +{ + /* Close open groups */ + GtkTreeIter iter; + gtk_tree_model_get_iter_first(disk_view->tree_store, &iter); + mape_disk_view_close_groups(disk_view, &iter); + + /* TODO: unref cell renderers? */ + /*mape_file_icon_set_destroy(disk_view->icon_set);*/ + mape_group_destroy(disk_view->group_top); + + g_object_unref(G_OBJECT(disk_view->tree_store) ); + free(disk_view); +} + +gboolean mape_disk_view_extend_to_path(MapeDiskView* disk_view, + const gchar* filepath, + GError** error) +{ + gchar** path_components; + gchar** cur_component; + gchar* file; + GtkTreeIter parent; + GtkTreeIter child; + gboolean result; + GtkTreePath* path; + gboolean got_parent; + + path_components = g_strsplit_set(filepath, "/\\", 0); + + /* Begin at top-level: no parent */ + got_parent = FALSE; + + for(cur_component = path_components; + *cur_component != NULL; + ++ cur_component) + { + file = *cur_component; + if(*file == '\0') continue; + if(strcmp(file, ".") == 0) continue; + + if(strcmp(file, "..") == 0) + { + if(got_parent == FALSE) + { + g_set_error( + error, + g_quark_from_static_string( + "MAPE_DISK_VIEW_ERROR" + ), + MAPE_DISK_VIEW_ERROR_NOENT, + "%s: Invalid path", + filepath + ); + + g_strfreev(path_components); + return FALSE; + } + else + { + child = parent; + + got_parent = gtk_tree_model_iter_parent( + GTK_TREE_MODEL(disk_view->tree_store), + &parent, + &child + ); + } + } + else + { + if(got_parent == FALSE) + { + result = mape_disk_view_find_iter( + disk_view, + &child, + NULL, + file + ); + } + else + { + result = mape_disk_view_find_iter( + disk_view, + &child, + &parent, + file + ); + } + + /* File is not reachable in file system */ + if(result == FALSE) + { + g_set_error( + error, + g_quark_from_static_string( + "MAPE_DISK_VIEW_ERROR" + ), + MAPE_DISK_VIEW_ERROR_NOENT, + "%s: No such file or directory", + filepath + ); + + g_strfreev(path_components); + return FALSE; + } + + if(g_ascii_strcasecmp(file, "Material.c4g") == 0) + { + /* Assume end of path */ + result = mape_disk_view_load_materials( + disk_view, + &child, + error + ); + + g_strfreev(path_components); + return result; + } + else + { + /* Convert child to path to preserve + position while expanding */ + path = gtk_tree_model_get_path( + disk_view->tree_store, + &child + ); + + gtk_tree_view_expand_row( + GTK_TREE_VIEW(disk_view->view), + path, + FALSE + ); + + /* Child is new parent for next iteration */ + gtk_tree_model_get_iter( + disk_view->tree_store, + &parent, + path + ); + got_parent = TRUE; + + gtk_tree_path_free(path); + } + } + } + + /* All nodes expanded without opening Material.c4g */ + g_strfreev(path_components); + return TRUE; +} diff --git a/src/mape/diskview.h b/src/mape/diskview.h new file mode 100644 index 000000000..e37fc1bc9 --- /dev/null +++ b/src/mape/diskview.h @@ -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 +#include +#include +#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 */ diff --git a/src/mape/editview.c b/src/mape/editview.c new file mode 100644 index 000000000..53328adc5 --- /dev/null +++ b/src/mape/editview.c @@ -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 +#include +#include +#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(""); + + 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; + } +} + diff --git a/src/mape/editview.h b/src/mape/editview.h new file mode 100644 index 000000000..bc680d2cc --- /dev/null +++ b/src/mape/editview.h @@ -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 +#include +#include +#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 */ diff --git a/src/mape/fileicon.c b/src/mape/fileicon.c new file mode 100644 index 000000000..064b9654f --- /dev/null +++ b/src/mape/fileicon.c @@ -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 +#include +#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; +} diff --git a/src/mape/fileicon.h b/src/mape/fileicon.h new file mode 100644 index 000000000..53fa1c1dd --- /dev/null +++ b/src/mape/fileicon.h @@ -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 +#include +#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 */ diff --git a/src/mape/forward.h b/src/mape/forward.h new file mode 100644 index 000000000..44de40393 --- /dev/null +++ b/src/mape/forward.h @@ -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 */ diff --git a/src/mape/group.cpp b/src/mape/group.cpp new file mode 100644 index 000000000..2211e47b1 --- /dev/null +++ b/src/mape/group.cpp @@ -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 +#include + +#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; +} + +} diff --git a/src/mape/group.h b/src/mape/group.h new file mode 100644 index 000000000..669992494 --- /dev/null +++ b/src/mape/group.h @@ -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 +#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 */ diff --git a/src/mape/header.c b/src/mape/header.c new file mode 100644 index 000000000..961e80f81 --- /dev/null +++ b/src/mape/header.c @@ -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 +#include +#include "header.h" + +static const GtkActionEntry mape_header_file_entries[] = { + { + "File", + NULL, + "_File", + NULL, + NULL, + NULL + }, { + "FileNew", + GTK_STOCK_NEW, + "_New", + "N", + "Opens a new document", + NULL + }, { + "FileOpen", + GTK_STOCK_OPEN, + "_Open", + "O", + "Opens an already existing document from disk", + NULL + }, { + "FileSave", + GTK_STOCK_SAVE, + "_Save", + "S", + "Saves the current document to disk", + NULL + }, { + "FileSaveAs", + GTK_STOCK_SAVE_AS, + "Save as", + "S", + "Save the current map to another path on disk", + NULL + }, { + "FileQuit", + GTK_STOCK_QUIT, + "_Quit", + "F4", + "Exit the program", + NULL + } +}; + +static const GtkActionEntry mape_header_edit_entries[] = { + { + "Edit", + NULL, + "_Edit", + NULL, + NULL, + NULL + }, { + "EditUndo", + GTK_STOCK_UNDO, + "_Undo", + "Z", + "Undo the last action", + NULL + }, { + "EditRedo", + GTK_STOCK_REDO, + "_Redo", + "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 = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + ""; + +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); +} diff --git a/src/mape/header.h b/src/mape/header.h new file mode 100644 index 000000000..4680700e2 --- /dev/null +++ b/src/mape/header.h @@ -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 +#include +#include +#include +#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 */ diff --git a/src/mape/icon/c4d.c b/src/mape/icon/c4d.c new file mode 100644 index 000000000..dbc7112b1 --- /dev/null +++ b/src/mape/icon/c4d.c @@ -0,0 +1,149 @@ +/* GdkPixbuf RGBA C-Source image dump */ + +#include + +#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"}; + + diff --git a/src/mape/icon/c4f.c b/src/mape/icon/c4f.c new file mode 100644 index 000000000..644e5f3f9 --- /dev/null +++ b/src/mape/icon/c4f.c @@ -0,0 +1,162 @@ +/* GdkPixbuf RGBA C-Source image dump */ + +#include + +#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=\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"}; + + diff --git a/src/mape/icon/c4g.c b/src/mape/icon/c4g.c new file mode 100644 index 000000000..d2c36805e --- /dev/null +++ b/src/mape/icon/c4g.c @@ -0,0 +1,194 @@ +/* GdkPixbuf RGBA C-Source image dump */ + +#include + +#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$\377A8e\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"}; + + diff --git a/src/mape/icon/c4m.c b/src/mape/icon/c4m.c new file mode 100644 index 000000000..eae6a0ce5 --- /dev/null +++ b/src/mape/icon/c4m.c @@ -0,0 +1,197 @@ +/* GdkPixbuf RGBA C-Source image dump */ + +#include + +#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=\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"}; + + diff --git a/src/mape/icon/c4s.c b/src/mape/icon/c4s.c new file mode 100644 index 000000000..85dccc1da --- /dev/null +++ b/src/mape/icon/c4s.c @@ -0,0 +1,194 @@ +/* GdkPixbuf RGBA C-Source image dump */ + +#include + +#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"}; + + diff --git a/src/mape/icon/icons.h b/src/mape/icon/icons.h new file mode 100644 index 000000000..94f9ea187 --- /dev/null +++ b/src/mape/icon/icons.h @@ -0,0 +1,8 @@ +#include + +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[]; diff --git a/src/mape/icon/tex.c b/src/mape/icon/tex.c new file mode 100644 index 000000000..c3236371f --- /dev/null +++ b/src/mape/icon/tex.c @@ -0,0 +1,159 @@ +/* GdkPixbuf RGB C-Source image dump */ + +#include + +#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{{{"}; + + diff --git a/src/mape/iconview.c b/src/mape/iconview.c new file mode 100644 index 000000000..8059a04e1 --- /dev/null +++ b/src/mape/iconview.c @@ -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 +#include +#include +#include +#include +#include +#include +#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 + ); +} + diff --git a/src/mape/iconview.h b/src/mape/iconview.h new file mode 100644 index 000000000..7c76ccbdf --- /dev/null +++ b/src/mape/iconview.h @@ -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 +#include +#include +#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 */ diff --git a/src/mape/mape-syntax/c4landscape.lang b/src/mape/mape-syntax/c4landscape.lang new file mode 100644 index 000000000..237b81656 --- /dev/null +++ b/src/mape/mape-syntax/c4landscape.lang @@ -0,0 +1,95 @@ + + + + text/plain + Landscape.txt + // + /* + */ + + + +