AC_MSG_ERROR([msgfmt not found. Please install the gettext package.])
fi
-
# Here we tell the configure script which files to *create*
AC_CONFIG_FILES([
Makefile \
INCLUDES = \
$(UNIQUE_CFLAGS) \
+ $(LIBXML_CFLAGS) \
$(SQLITE3_CFLAGS) \
$(GTK_CFLAGS) \
$(WEBKIT_CFLAGS) \
-I../katze
-AM_CFLAGS = -DMIDORI_LOCALEDIR=\""$(localedir)"\"
+AM_CFLAGS = -DLOCALEDIR=\""$(localedir)"\" -DDATADIR=\""$(datadir)"\"
LDADD = \
$(UNIQUE_LIBS) \
+ $(LIBXML_LIBS) \
$(SQLITE3_LIBS) \
$(GTK_LIBS) \
$(WEBKIT_LIBS) \
#endif
#if ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, MIDORI_LOCALEDIR);
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif
static void
midori_browser_class_init (MidoriBrowserClass* class)
{
+ GObjectClass* gobject_class;
+ GParamFlags flags;
+
signals[WINDOW_OBJECT_CLEARED] = g_signal_new (
"window-object-cleared",
G_TYPE_FROM_CLASS (class),
class->activate_action = _midori_browser_activate_action;
class->quit = _midori_browser_quit;
- GObjectClass* gobject_class = G_OBJECT_CLASS (class);
+ gobject_class = G_OBJECT_CLASS (class);
gobject_class->dispose = midori_browser_dispose;
gobject_class->finalize = midori_browser_finalize;
gobject_class->set_property = midori_browser_set_property;
gobject_class->get_property = midori_browser_get_property;
- GParamFlags flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
+ flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT;
g_object_class_install_property (gobject_class,
PROP_MENUBAR,
static const gchar* credits_authors[] = {
"Christian Dywan <christian@twotoasts.de>", NULL };
static const gchar* credits_documenters[] = {
- "Christian Dywan <christian@twotoasts.de>" };
+ "Christian Dywan <christian@twotoasts.de>", NULL };
static const gchar* credits_artists[] = {
"Nancy Runge <nancy@twotoasts.de>", NULL };
}
-
static void
_action_panel_activate (GtkToggleAction* action,
MidoriBrowser* browser)
midori_view_set_uri (MIDORI_VIEW (browser->panel_pageholder), uri);
}
-
static void
midori_panel_notify_position_cb (GObject* object,
GParamSpec* arg1,
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem), _("Close Findbar"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_browser_find_button_close_clicked_cb), browser);
+ #ifdef HAVE_OSX
+ gtk_toolbar_insert (GTK_TOOLBAR (browser->find), toolitem, 0);
+ #else
gtk_toolbar_insert (GTK_TOOLBAR (browser->find), toolitem, -1);
+ #endif
sokoke_container_show_children (GTK_CONTAINER (browser->find));
gtk_box_pack_start (GTK_BOX (vbox), browser->find, FALSE, FALSE, 0);
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (toolitem), _("Close panel"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_panel_button_close_clicked_cb), panel);
+ #if HAVE_OSX
+ gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, 0);
+ #else
gtk_toolbar_insert (GTK_TOOLBAR (labelbar), toolitem, -1);
+ #endif
gtk_box_pack_start (GTK_BOX (vbox), labelbar, FALSE, FALSE, 0);
gtk_widget_show_all (vbox);
#include "midori-preferences.h"
+#if HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
#include "sokoke.h"
#include <glib/gi18n.h>
gtk_widget_destroy (GTK_WIDGET (preferences));
}
-#ifdef GDK_WINDOWING_QUARTZ
- #define USE_OSX_STYLE
-#endif
-
static void
midori_preferences_init (MidoriPreferences* preferences)
{
"title", dialog_title,
"has-separator", FALSE,
NULL);
- #ifndef USE_OSX_STYLE
+ #ifndef HAVE_OSX
gtk_dialog_add_buttons (GTK_DIALOG (preferences),
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
return FALSE;
}
-#ifdef USE_OSX_STYLE
+#ifdef HAVE_OSX
static void
midori_preferences_help_clicked_cb (GtkWidget* button,
GtkDialog* dialog)
const gchar* label,
GtkWidget* page)
{
-#ifdef USE_OSX_STYLE
+#ifdef HAVE_OSX
*toolbutton = GTK_WIDGET (*toolbutton ? gtk_radio_tool_button_new_from_widget (
GTK_RADIO_TOOL_BUTTON (*toolbutton)) : gtk_radio_tool_button_new (NULL));
gtk_tool_button_set_label (GTK_TOOL_BUTTON (*toolbutton), label);
preferences->notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (preferences->notebook), 6);
- #ifdef USE_OSX_STYLE
+ #ifdef HAVE_OSX
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (preferences->notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (preferences->notebook), FALSE);
toolbar = gtk_toolbar_new ();
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
toolbar, FALSE, FALSE, 0);
- #endif
+ #else
toolbar = NULL;
+ #endif
toolbutton = NULL;
sizegroup = NULL;
g_object_unref (sizegroup);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
preferences->notebook, FALSE, FALSE, 4);
- #ifdef USE_OSX_STYLE
+ #ifdef HAVE_OSX
GtkWidget* icon;
hbox = gtk_hbox_new (FALSE, 0);
button = gtk_button_new ();
dialog = gtk_dialog_new_with_buttons (dialog_title,
toplevel ? GTK_WINDOW (toplevel) : NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+ #ifndef HAVE_OSX
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+ #endif
NULL);
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), &search_action->dialog);
button = gtk_button_new_from_stock (GTK_STOCK_GO_UP);
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+
+ #ifdef HAVE_OSX
+ GtkWidget* icon;
+ hbox = gtk_hbox_new (FALSE, 0);
+ button = gtk_button_new ();
+ icon = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (button), icon);
+ /* TODO: Implement some kind of help function */
+ gtk_widget_set_sensitive (button, FALSE);
+ /* g_signal_connect (button, "clicked",
+ G_CALLBACK (midori_search_action_dialog_help_clicked_cb), dialog); */
+ gtk_box_pack_end (GTK_BOX (hbox),
+ button, FALSE, FALSE, 4);
+ gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ hbox, FALSE, FALSE, 0);
+ #endif
gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
g_object_connect (search_action->search_engines,
gtk_container_border_width (GTK_CONTAINER (hbox), 2);
gtk_container_add (GTK_CONTAINER (event_box), GTK_WIDGET (hbox));
gtk_misc_set_alignment (GTK_MISC (view->tab_icon), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (view->tab_title), 0.0, 0.5);
/* TODO: make the tab initially look "unvisited" until it's focused */
- gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
_update_label_size (view->tab_title, 10);
view->tab_close = gtk_button_new ();
GTK_STOCK_CLOSE);
gtk_button_set_image (GTK_BUTTON (view->tab_close), image);
gtk_misc_set_alignment (GTK_MISC (image), 0.0, 0.0);
+
+ #if HAVE_OSX
+ gtk_box_pack_end (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (hbox), view->tab_close, FALSE, FALSE, 0);
+ #else
+ gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), view->tab_close, FALSE, FALSE, 0);
+ #endif
gtk_widget_show_all (GTK_WIDGET (event_box));
if (!view->close_buttons_on_tabs)
See the file COPYING for the full license text.
*/
+#include "sokoke.h"
+
#if HAVE_CONFIG_H
#include <config.h>
#endif
-#include "sokoke.h"
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
gchar** argv;
GError* error;
+ g_return_val_if_fail (command != NULL, FALSE);
+ g_return_val_if_fail (argument != NULL, FALSE);
+
argument_escaped = g_shell_quote (argument);
if (strstr (command, "%s"))
command_ready = g_strdup_printf (command, argument_escaped);
{
SOKOKE_DESKTOP_UNTESTED,
SOKOKE_DESKTOP_XFCE,
+ SOKOKE_DESKTOP_OSX,
SOKOKE_DESKTOP_UNKNOWN
} SokokeDesktop;
static SokokeDesktop
sokoke_get_desktop (void)
{
- #ifdef GDK_WINDOWING_X11
+ #ifdef HAVE_OSX
+ return SOKOKE_DESKTOP_OSX;
+ #else
static SokokeDesktop desktop = SOKOKE_DESKTOP_UNTESTED;
if (G_UNLIKELY (desktop == SOKOKE_DESKTOP_UNTESTED))
{
}
return desktop;
- #else
- return SOKOKE_DESKTOP_UNKNOWN;
#endif
}
import Params
import pproc as subprocess
import Common
-import platform
+import sys
import os
APPNAME = 'midori'
conf.check_pkg ('libxml-2.0', destvar='LIBXML', vnum='2.6', mandatory=True)
conf.check_header ('unistd.h', 'HAVE_UNISTD_H')
+ if sys.platform == 'darwin':
+ conf.define ('HAVE_OSX', 1)
if conf.find_program ('rsvg-convert', var='RSVG_CONVERT'):
icons = 'yes'
bld.add_subdirs ('katze midori icons')
- install_files ('DOCDIR', '/midori/', 'AUTHORS ChangeLog COPYING EXPAT README')
+ install_files ('DOCDIR', '/' + APPNAME + '/', 'AUTHORS ChangeLog COPYING EXPAT README')
if bld.env ()['RST2HTML']:
# FIXME: Build only if needed
if bld.env ()['INTLTOOL']:
obj = bld.create_obj ('intltool_in')
- obj.source = 'midori.desktop.in'
+ obj.source = APPNAME + '.desktop.in'
obj.inst_var = 'DATADIR'
obj.inst_dir = 'applications'
obj.flags = '-d'
else:
# FIXME: process desktop.in without intltool
- Params.pprint ('BLUE', "File midori.desktop not generated")
+ Params.pprint ('BLUE', "File " + APPNAME + ".desktop not generated")
if bld.env ()['INTLTOOL']:
- install_files ('DATADIR', 'applications', 'midori.desktop')
+ install_files ('DATADIR', 'applications', APPNAME + '.desktop')
if bld.env ()['RSVG_CONVERT']:
mkdir (blddir + '/data')