geany/src/win32.h

79 lines
2.6 KiB
C
Raw Normal View History

/*
* win32.h - this file is part of Geany, a fast and lightweight IDE
*
2012-06-18 01:13:05 +02:00
* Copyright 2005-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* Copyright 2006-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
*
* 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.
*
2012-08-24 19:25:57 +02:00
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GEANY_WIN32_H
#define GEANY_WIN32_H 1
#include "document.h"
Include what you use This is a mega-commit - because most of it had to be done in one go otherwise some commits would fail to compile - that attempts to fix a few problems with Geany's includes as well as various other related cleanups. After this change it's easier to use includes and there's little worry about which order things are included in or who includes what. Overview of changes: * Include config.h at the start of each source file if HAVE_CONFIG_H is defined (and never in headers). * Go through each source file and make the includes section generally like this: - Always config.h first as above - Then if the file has a header with the same name, include that - Then include in alphabetical order each other internal/geany header. - Then include standard headers - Then include non-standard system headers - Then include GLib/GTK+ related stuff * Doing as above makes it easier to find implicit header include dependencies and it exposed quite a few weird problems with includes or forward declarations, fix those. * Make geany.h contain not much besides some defines. - Add a little header file "app.h" for GeanyApp and move it there - Move "app" global to new "app.h" file - Move "ignore_callback" global to "callbacks.h" - Move "geany_object" global to "geanyobject.h" * Add an include in "geany.h" for "app.h" since GeanyApp used to be defined there and some plugins included this header to access GeanyApp. * Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that everywhere sees the same definitions (not a problem in practice AFAIK so this could be changed back if better that way. * Remove forward declarations from previous commits as some people apparently consider this bad style, despite that it reduces inter- header dependencies. TODO: * As always, to test on win32 * As always, to test with not Autotools * Test plugins better, both builtin and geany-plugins, likely API/ABI bump * Test with various defines/flags that may change what is included * win32.[ch] not really touched since I couldn't test
2014-05-18 17:31:51 -07:00
#include "gtkcompat.h"
#ifdef G_OS_WIN32
G_BEGIN_DECLS
void win32_show_pref_file_dialog(GtkEntry *item);
gchar *win32_show_file_dialog(GtkWindow *parent, const gchar *title, const gchar *initial_dir);
gboolean win32_show_document_open_dialog(GtkWindow *parent, const gchar *title, const gchar *initial_dir);
gchar *win32_show_document_save_as_dialog(GtkWindow *parent, const gchar *title,
GeanyDocument *doc);
void win32_show_font_dialog(void);
void win32_show_color_dialog(const gchar *colour);
gboolean win32_message_dialog(GtkWidget *parent, GtkMessageType type, const gchar *msg);
void win32_open_browser(const gchar *uri);
gchar *win32_show_project_open_dialog(GtkWidget *parent, const gchar *title,
const gchar *initial_dir, gboolean allow_new_file,
gboolean project_file_filter);
gchar *win32_show_folder_dialog(GtkWidget *parent, const gchar *title, const gchar *initial_dir);
gint win32_check_write_permission(const gchar *dir);
void win32_init_debug_code(void);
void win32_set_working_directory(const gchar *dir);
gboolean win32_get_exit_status(GPid child_pid);
gboolean win32_spawn(const gchar *dir, gchar **argv, gchar **env, GSpawnFlags flags,
gchar **std_out, gchar **std_err, gint *exit_status, GError **error);
gchar *win32_get_shortcut_target(const gchar *file_name);
gchar *win32_get_installation_dir(void);
gchar *win32_expand_environment_variables(const gchar *str);
G_END_DECLS
#endif /* G_OS_WIN32 */
#endif /* GEANY_WIN32_H */