/* X-Chat
* Copyright (C) 1998 Peter Zelezny.
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "fe-gtk.h"
#ifdef WIN32
#include <gdk/gdkwin32.h>
#include <windows.h>
#else
#include <unistd.h>
#endif
#include "../common/hexchat.h"
#include "../common/fe.h"
#include "../common/util.h"
#include "../common/text.h"
#include "../common/cfgfiles.h"
#include "../common/hexchatc.h"
#include "../common/plugin.h"
#include "../common/server.h"
#include "../common/url.h"
#include "gtkutil.h"
#include "maingui.h"
#include "pixmaps.h"
#include "joind.h"
#include "xtext.h"
#include "palette.h"
#include "menu.h"
#include "notifygui.h"
#include "textgui.h"
#include "fkeys.h"
#include "plugin-tray.h"
#include "urlgrab.h"
#include "setup.h"
#ifdef USE_XLIB
#include <gdk/gdkx.h>
#endif
#ifdef USE_LIBCANBERRA
#include <canberra.h>
#endif
GdkPixmap *channelwin_pix;
#ifdef USE_LIBCANBERRA
static ca_context *ca_con;
#endif
#ifdef USE_XLIB
static void
redraw_trans_xtexts (void)
{
GSList *list = sess_list;
session *sess;
int done_main = FALSE;
while (list)
{
sess = list->data;
if (GTK_XTEXT (sess->gui->xtext)->transparent)
{
if (!sess->gui->is_tab || !done_main)
gtk_xtext_refresh (GTK_XTEXT (sess->gui->xtext), 1);
if (sess->gui->is_tab)
done_main = TRUE;
}
list = list->next;
}
}
static GdkFilterReturn
root_event_cb (GdkXEvent *xev, GdkEventProperty *event, gpointer data)
{
static Atom at = None;
XEvent *xevent = (XEvent *)xev;
if (xevent->type == PropertyNotify)
{
if (at == None)
at = XInternAtom (xevent->xproperty.display, "_XROOTPMAP_ID", True);
if (at == xevent->xproperty.atom)
redraw_trans_xtexts ();
}
return GDK_FILTER_CONTINUE;
}
#endif
/* === command-line parameter parsing : requires glib 2.6 === */
static char *arg_cfgdir = NULL;
static gint arg_show_autoload = 0;
static gint arg_show_config = 0;
static gint arg_show_version = 0;
static gint arg_minimize = 0;
static const GOptionEntry gopt_entries[] =
{
{"no-auto", 'a', 0, G_OPTION_ARG_NONE, &arg_dont_autoconnect, N_("Don't auto connect to servers"), NULL},
{"cfgdir",