#include <string.h>
#include <gtk/gtk.h>
-#ifdef ENABLE_NLS
+#if ENABLE_NLS
#include <libintl.h>
#endif
gchar* homepage;
MidoriWebList* search_engines;
- #ifdef ENABLE_NLS
+ #if ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, MIDORI_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#ifdef HAVE_UNIQUE
+#if HAVE_UNIQUE
#include <unique/unique.h>
#endif
type, n_construct_properties, construct_properties);
}
-#ifdef HAVE_UNIQUE
+#if HAVE_UNIQUE
static UniqueResponse
midori_browser_message_received_cb (UniqueApp* instance,
UniqueCommand command,
static void
midori_app_init (MidoriApp* app)
{
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
gchar* display_name;
gchar* instance_name;
guint i, n;
app->trash = midori_web_list_new ();
app->search_engines = midori_web_list_new ();
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
display_name = g_strdup (gdk_display_get_name (gdk_display_get_default ()));
n = strlen (display_name);
for (i = 0; i < n; i++)
{
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
return unique_app_is_running (app->instance);
#else
return FALSE;
gboolean
midori_app_instance_send_activate (MidoriApp* app)
{
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
UniqueResponse response;
#endif
g_return_val_if_fail (MIDORI_IS_APP (app), FALSE);
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
response = unique_app_send_message (app->instance, UNIQUE_ACTIVATE, NULL);
if (response == UNIQUE_RESPONSE_OK)
return TRUE;
midori_app_instance_send_uris (MidoriApp* app,
gchar** uris)
{
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
UniqueMessageData* message;
UniqueResponse response;
#endif
g_return_val_if_fail (midori_app_instance_is_running (app), FALSE);
g_return_val_if_fail (uris != NULL, FALSE);
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
message = unique_message_data_new ();
unique_message_data_set_uris (message, uris);
response = unique_app_send_message (app->instance, UNIQUE_OPEN, message);
app->browsers = g_list_prepend (app->browsers, browser);
- #ifdef HAVE_UNIQUE
+ #if HAVE_UNIQUE
if (app->instance)
unique_app_watch_window (app->instance, GTK_WINDOW (browser));
#endif
#include "compat.h"
#include "gjs.h"
-#ifdef HAVE_GIO
+#if HAVE_GIO
#include <gio/gio.h>
#endif
#include <glib/gi18n.h>
#if HAVE_GIO
GFile* file;
gchar* tag;
- #ifdef HAVE_GTKSOURCEVIEW
+ #if HAVE_GTKSOURCEVIEW
GFileInfo* info;
const gchar* content_type;
#endif
#endif
gchar* contents;
gchar* contents_utf8;
- #ifdef HAVE_GTKSOURCEVIEW
+ #if HAVE_GTKSOURCEVIEW
GtkSourceBuffer* buffer;
#if HAVE_GIO
GtkSourceLanguageManager* language_manager;
#if HAVE_GIO
file = g_file_new_for_uri (uri);
tag = NULL;
- #ifdef HAVE_GTKSOURCEVIEW
+ #if HAVE_GTKSOURCEVIEW
content_type = NULL;
#endif
if (g_file_load_contents (file, NULL, &contents, NULL, &tag, NULL))
{
- #ifdef HAVE_GTKSOURCEVIEW
+ #if HAVE_GTKSOURCEVIEW
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
G_FILE_QUERY_INFO_NONE, NULL, NULL);
content_type = g_file_info_get_content_type (info);
#endif
contents_utf8 = contents;
- #ifdef HAVE_GTKSOURCEVIEW
+ #if HAVE_GTKSOURCEVIEW
buffer = gtk_source_buffer_new (NULL);
gtk_source_buffer_set_highlight_syntax (buffer, TRUE);
- #ifdef HAVE_GIO
+ #if HAVE_GIO
if (content_type)
{
language_manager = gtk_source_language_manager_get_default ();
#endif
if (contents_utf8)
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), contents_utf8, -1);
- #ifdef HAVE_GTKSOURCEVIEW
+ #if HAVE_GTKSOURCEVIEW
text_view = gtk_source_view_new_with_buffer (buffer);
gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (text_view), TRUE);
#else
#include "sokoke.h"
#include "compat.h"
-#ifdef HAVE_GIO
+#if HAVE_GIO
#include <gio/gio.h>
#endif
#include <webkit/webkit.h>
web_view->window_object_cleared = TRUE;
}
-#ifdef HAVE_GIO
+#if HAVE_GIO
void
loadable_icon_finish_cb (GdkPixbuf* icon,
GAsyncResult* res,
static void
_midori_web_view_load_icon (MidoriWebView* web_view)
{
- #ifdef HAVE_GIO
+ #if HAVE_GIO
GFile* file;
GFile* icon_file;
#endif
gint icon_width, icon_height;
GdkPixbuf* pixbuf_scaled;
- #ifdef HAVE_GIO
+ #if HAVE_GIO
if (web_view->uri)
{
file = g_file_new_for_uri (web_view->uri);
{
const gchar* type;
const gchar* rel;
-#ifdef HAVE_GIO
+#if HAVE_GIO
GFile* icon_file;
GIcon* icon;
#endif
? gjs_value_get_attribute_string (link, "title") : NULL);
}
}
-#ifdef HAVE_GIO
+#if HAVE_GIO
if (gjs_value_has_attribute (link, "rel"))
{
rel = gjs_value_get_attribute_string (link, "rel");
#include "sokoke.h"
#include "main.h"
-#ifdef HAVE_UNISTD_H
+#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
{
/* Create a horizontal bar with a security warning
This returns NULL if the user is no superuser */
- #ifdef HAVE_UNISTD_H
+ #if HAVE_UNISTD_H
if (G_UNLIKELY (!geteuid ())) /* effective superuser? */
{
GtkWidget* hbox = gtk_event_box_new ();