/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
*/
/*
* Porting to KDE(2) was done by
*
* (C) 2000 by Thomas Capricelli <orzel@freehackers.org>
*
* Please visit http://freehackers.org/kvim for other vim- or
* kde-related coding.
*
* $Id$
*
*/
#include <qscrollbar.h>
#include <qcstring.h>
#include <qdatetime.h>
#include <qcursor.h>
#include <qfontmetrics.h>
#include <qpaintdevice.h>
#include <qclipboard.h>
#include <qregexp.h>
#include <kaboutkde.h>
#include <kiconloader.h>
#include <kfontdialog.h>
#include <kmessagebox.h>
#include <dcopclient.h>
#include <kwin.h>
#include <kmenubar.h>
#include <kconfig.h>
#if (QT_VERSION>=300)
#include <qnamespace.h>
#include <ktip.h>
#endif
#include <qpopupmenu.h>
#include <qpainter.h>
#include <qtextcodec.h>
#include <qfontmetrics.h>
#include <qfont.h>
#include "gui_kde_wid.h"
extern "C" {
#include "vim.h"
#include "version.h"
}
#include <stdio.h>
/*
* global variable for KDE, we can't put them in Gui, cause there are C++ types
*/
VimMainWindow *vmw=0;
SBPool *sbpool=0;
QString *argServerName=0;
#ifdef FEAT_MOUSESHAPE
/* The last set mouse pointer shape is remembered, to be used when it goes
* from hidden to not hidden. */
static int last_shape = 0;
#endif
/*
* Arguments handled by KDE internally.
*/
#if QT_VERSION>=300
static int tip=0; // 1 no dialog, 0 use it if enabled in conf, 2 force the tip
#endif
static int reverse=0; // 0 bg : white, 1 : bg : black
QString *startfont;
QSize *startsize;
static int gui_argc = 0;
static char **gui_argv = NULL;
/*
* Parse the GUI related command-line arguments. Any arguments used are
* deleted from argv, and *argc is decremented accordingly. This is called
* when vim is started, whether or not the GUI has been started.
*/
void
gui_mch_prepare(int *argc, char **argv)// {{{
{
//copy args for KDE/Qt
gui_argc = 0;
//this one is not really good as all options are not for KDE/Qt ...
gui_argv = (char **)lalloc((long_u)(*argc * sizeof(char *)), FALSE);
if (gui_argv == NULL)
return;
gui_argv[gui_argc++] = argv[0];
int found = 0;
for (int i = 1; i < *argc ; i++)
{
if (found!=2)
found = 0;
else {
found=0;
//remove from the list of argv
if (--*argc>i) {
mch_memmove(&argv