mirror of
https://github.com/moparisthebest/hexchat
synced 2024-12-22 07:38:51 -05:00
Build with gtk-mac-integration
- Use HexChat logo for dock icon - Use appmenu (not finished)
This commit is contained in:
parent
4319f8009c
commit
7b0acb2b44
14
configure.ac
14
configure.ac
@ -41,6 +41,7 @@ AH_VERBATIM([SOCKS],[#undef SOCKS])
|
||||
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
|
||||
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
|
||||
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
|
||||
AH_VERBATIM([HAVE_GTK_MAC],[#undef HAVE_GTK_MAC])
|
||||
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
|
||||
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
|
||||
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
|
||||
@ -206,6 +207,19 @@ fi
|
||||
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** MAC_INTEGRATION **************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
|
||||
if test "x$_gdk_tgt" = xquartz; then
|
||||
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration, [
|
||||
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
|
||||
AC_DEFINE(HAVE_GTK_MAC)
|
||||
])
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PERL *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
@ -765,6 +765,9 @@ load_default_config(void)
|
||||
prefs.hex_gui_autoopen_dialog = 1;
|
||||
prefs.hex_gui_autoopen_recv = 1;
|
||||
prefs.hex_gui_autoopen_send = 1;
|
||||
#ifdef HAVE_GTK_MAC
|
||||
prefs.hex_gui_hide_menu = 1;
|
||||
#endif
|
||||
prefs.hex_gui_input_attr = 1;
|
||||
prefs.hex_gui_input_icon = 1;
|
||||
prefs.hex_gui_input_nick = 1;
|
||||
|
@ -63,6 +63,10 @@ GdkPixmap *channelwin_pix;
|
||||
static ca_context *ca_con;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
GtkosxApplication *osx_app;
|
||||
#endif
|
||||
|
||||
/* === command-line parameter parsing : requires glib 2.6 === */
|
||||
|
||||
static char *arg_cfgdir = NULL;
|
||||
@ -235,6 +239,10 @@ fe_args (int argc, char *argv[])
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
osx_app = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
|
||||
#endif
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -285,6 +293,9 @@ fe_init (void)
|
||||
key_init ();
|
||||
pixmaps_init ();
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
gtkosx_application_set_dock_icon_pixbuf (osx_app, pix_hexchat);
|
||||
#endif
|
||||
channelwin_pix = pixmap_load_from_file (prefs.hex_text_background);
|
||||
input_style = create_input_style (gtk_style_new ());
|
||||
}
|
||||
@ -292,6 +303,10 @@ fe_init (void)
|
||||
void
|
||||
fe_main (void)
|
||||
{
|
||||
#ifdef HAVE_GTK_MAC
|
||||
gtkosx_application_ready(osx_app);
|
||||
#endif
|
||||
|
||||
gtk_main ();
|
||||
|
||||
/* sleep for 2 seconds so any QUIT messages are not lost. The */
|
||||
|
@ -49,6 +49,11 @@
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
#include <gtkosxapplication.h>
|
||||
#endif
|
||||
|
||||
#include "banlist.h"
|
||||
|
||||
#undef gtk_signal_connect
|
||||
@ -65,6 +70,10 @@
|
||||
#define flag_b flag_wid[8]
|
||||
#define NUM_FLAG_WIDS 9
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
extern GtkosxApplication *osx_app;
|
||||
#endif
|
||||
|
||||
struct server_gui
|
||||
{
|
||||
GtkWidget *rawlog_window;
|
||||
|
@ -3099,6 +3099,10 @@ mg_create_menu (session_gui *gui, GtkWidget *table, int away_state)
|
||||
gui->menu_item);
|
||||
gtk_table_attach (GTK_TABLE (table), gui->menu, 0, 3, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
gtkosx_application_set_menu_bar(osx_app, GTK_MENU_SHELL(gui->menu));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user