You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
450 lines
13 KiB
450 lines
13 KiB
13 years ago
|
//
|
||
|
// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
|
||
|
// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
|
||
|
// may also apply
|
||
|
|
||
|
|
||
|
// Generated by preSip
|
||
13 years ago
|
// module tdecore version KDE 3.5.3
|
||
13 years ago
|
|
||
|
|
||
|
// This software 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 software 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 library; see the file COPYING.
|
||
|
// If not, write to the Free Software Foundation, Inc.,
|
||
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
|
||
|
|
||
12 years ago
|
class TDEApplication : TQApplication, TDEInstance
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
|
#include <tdecmdlineargs.h>
|
||
13 years ago
|
extern char **pyArgvToC(PyObject *argvlist,int *argcp);
|
||
|
extern void updatePyArgv(PyObject *argvlist,int argc,char **argv);
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
enum CaptionLayout
|
||
|
{
|
||
|
CaptionAppLast,
|
||
|
CaptionAppFirst,
|
||
|
CaptionNoApp
|
||
|
};
|
||
|
|
||
12 years ago
|
TDEApplication (bool = 1, bool = 1);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
12 years ago
|
//ig TDEApplication (Display*, TQt::HANDLE = 0, TQt::HANDLE = 0, bool = 1);
|
||
13 years ago
|
%End
|
||
|
|
||
12 years ago
|
//ig TDEApplication (Display*, int&, char**, const TQCString&, bool = 1, bool = 1);
|
||
|
TDEApplication (SIP_PYLIST, TQCString&, bool = 1, bool = 1) [(int&, char**, const TQCString&, bool = 1, bool = 1)];
|
||
13 years ago
|
%MethodCode
|
||
|
//takes argv | (a Python list of strings) | rAppName | (Python string) | allowStyles | (bool = 1) | GUIenabled | (bool = 1)
|
||
|
|
||
|
int argc, nargc;
|
||
|
char **argv;
|
||
|
|
||
|
// Convert the list.
|
||
|
|
||
|
if ((argv = pyArgvToC(a0, &argc)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Create it now the arguments are right.
|
||
|
|
||
|
nargc = argc;
|
||
|
|
||
|
Py_BEGIN_ALLOW_THREADS
|
||
|
|
||
|
// The following two lines simulate the actual ctor call
|
||
|
// which is commented out below
|
||
12 years ago
|
TDECmdLineArgs::init (nargc, argv, (char *)"unknown", (char *)"KDE Application", NULL, false);
|
||
12 years ago
|
sipCpp = new sipTDEApplication((bool)a1,(bool)a2);
|
||
13 years ago
|
|
||
12 years ago
|
// This method calls TDECmdLineArgs::initIgnore, which is a private method
|
||
12 years ago
|
// sipCpp = new sipTDEApplication (nargc,argv, qc, a1, a2);
|
||
13 years ago
|
|
||
|
Py_END_ALLOW_THREADS
|
||
|
|
||
|
// Now modify the original list.
|
||
|
|
||
|
updatePyArgv(a0, argc, argv);
|
||
|
%End
|
||
|
|
||
|
static void addCmdLineOptions ();
|
||
12 years ago
|
static TDEApplication* kApplication ();
|
||
12 years ago
|
TDEConfig* sessionConfig ();
|
||
13 years ago
|
bool isRestored () const;
|
||
|
void disableSessionManagement ();
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
void enableSessionManagement ();
|
||
|
%End
|
||
|
|
||
|
|
||
|
enum ShutdownConfirm
|
||
|
{
|
||
|
ShutdownConfirmDefault,
|
||
|
ShutdownConfirmNo,
|
||
|
ShutdownConfirmYes
|
||
|
};
|
||
|
|
||
|
|
||
|
enum ShutdownType
|
||
|
{
|
||
|
ShutdownTypeDefault,
|
||
|
ShutdownTypeNone,
|
||
|
ShutdownTypeReboot,
|
||
|
ShutdownTypeHalt
|
||
|
};
|
||
|
|
||
|
|
||
|
enum ShutdownMode
|
||
|
{
|
||
|
ShutdownModeDefault,
|
||
|
ShutdownModeSchedule,
|
||
|
ShutdownModeTryNow,
|
||
|
ShutdownModeForceNow,
|
||
|
ShutdownModeInteractive
|
||
|
};
|
||
|
|
||
12 years ago
|
bool requestShutDown (TDEApplication::ShutdownConfirm = ShutdownConfirmDefault , TDEApplication::ShutdownType = ShutdownTypeDefault , TDEApplication::ShutdownMode = ShutdownModeDefault );
|
||
13 years ago
|
void propagateSessionManager ();
|
||
13 years ago
|
void commitData (TQSessionManager&);
|
||
|
void saveState (TQSessionManager&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_1 - )
|
||
|
bool sessionSaving () const;
|
||
|
%End
|
||
|
|
||
|
static DCOPClient* dcopClient ();
|
||
|
static void disableAutoDcopRegistration ();
|
||
13 years ago
|
TQPixmap icon () const;
|
||
|
TQString iconName () const;
|
||
|
TQPixmap miniIcon () const;
|
||
|
TQString miniIconName () const;
|
||
|
void setTopWidget (TQWidget*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void invokeHelp (const TQString&, const TQString&, const TQCString&) const;
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
void invokeHelp (const TQString& = TQString ::null , const TQString& = TQString ::null ) const;
|
||
|
void invokeHTMLHelp (const TQString&, const TQString& = TQString ::null ) const;
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void invokeMailer (const TQString&, const TQString&, const TQCString&);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
void invokeMailer (const TQString&, const TQString&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
13 years ago
|
void invokeMailer (const KURL&, const TQCString&, bool);
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void invokeMailer (const KURL&, const TQCString&);
|
||
13 years ago
|
%End
|
||
|
|
||
|
void invokeMailer (const KURL&);
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void invokeMailer (const TQString&, const TQString&, const TQString&, const TQString&, const TQString&, const TQString&, const TQStringList&, const TQCString&);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
void invokeMailer (const TQString&, const TQString&, const TQString&, const TQString&, const TQString&, const TQString& = TQString ::null , const TQStringList& = TQStringList ());
|
||
13 years ago
|
|
||
|
public slots:
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void invokeBrowser (const TQString&, const TQCString&);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
void invokeBrowser (const TQString&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
void cut ();
|
||
|
void copy ();
|
||
|
void paste ();
|
||
|
void clear ();
|
||
|
void selectAll ();
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
static TQCString launcher ();
|
||
|
static int startServiceByName (const TQString&, const TQString&, TQString* /Out/, TQCString* /Out/, int*, const TQCString& = TQCString ("" ), bool = 0);
|
||
|
static int startServiceByName (const TQString&, const TQStringList&, TQString* /Out/, TQCString* /Out/, int*, const TQCString& = TQCString ("" ), bool = 0);
|
||
|
static int startServiceByDesktopPath (const TQString&, const TQString&, TQString* /Out/, TQCString* /Out/, int*, const TQCString& = TQCString ("" ), bool = 0);
|
||
|
static int startServiceByDesktopPath (const TQString&, const TQStringList&, TQString* /Out/, TQCString* /Out/, int*, const TQCString& = TQCString ("" ), bool = 0);
|
||
|
static int startServiceByDesktopName (const TQString&, const TQString&, TQString* /Out/, TQCString* /Out/, int*, const TQCString& = TQCString ("" ), bool = 0);
|
||
|
static int startServiceByDesktopName (const TQString&, const TQStringList&, TQString* /Out/, TQCString* /Out/, int*, const TQCString& = TQCString ("" ), bool = 0);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
static int tdeinitExec (const TQString&, const TQStringList&, TQString* /Out/, int*, TQCString&);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
static int tdeinitExec (const TQString&, const TQStringList&, TQString* /Out/, int*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
static int tdeinitExecWait (const TQString&, const TQStringList&, TQString* /Out/, int*, TQCString&);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
static int tdeinitExecWait (const TQString&, const TQStringList&, TQString* /Out/, int*);
|
||
|
TQString caption () const;
|
||
12 years ago
|
//ig TDEStyle* kstyle () const;
|
||
13 years ago
|
TQString makeStdCaption (const TQString&, bool = 1, bool = 0) const;
|
||
|
TQString tempSaveName (const TQString&) const;
|
||
|
TQString checkRecoverFile (const TQString&, bool&) const;
|
||
13 years ago
|
Display* getDisplay ();
|
||
|
void enableStyles ();
|
||
|
void disableStyles ();
|
||
13 years ago
|
void installX11EventFilter (TQWidget*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void removeX11EventFilter (const TQWidget*);
|
||
13 years ago
|
%End
|
||
|
|
||
|
static int random ();
|
||
13 years ago
|
static TQString randomString (int);
|
||
13 years ago
|
void addKipcEventMask (int);
|
||
|
void removeKipcEventMask (int);
|
||
13 years ago
|
TQCString startupId () const;
|
||
|
void setStartupId (const TQCString&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
void updateUserTimestamp (ulong = 0);
|
||
|
|
||
|
%If ( KDE_3_2_3 - )
|
||
|
ulong userTimestamp () const;
|
||
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
13 years ago
|
void updateRemoteUserTimestamp (const TQCString&, ulong = 0);
|
||
13 years ago
|
%End
|
||
|
|
||
|
%End
|
||
|
|
||
|
%End
|
||
|
|
||
13 years ago
|
TQString geometryArgument () const;
|
||
13 years ago
|
void installKDEPropertyMap ();
|
||
13 years ago
|
bool authorize (const TQString&);
|
||
12 years ago
|
bool authorizeTDEAction (const char*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
13 years ago
|
bool authorizeURLAction (const TQString&, const KURL&, const KURL&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void allowURLAction (const TQString&, const KURL&, const KURL&);
|
||
|
bool authorizeControlModule (const TQString&);
|
||
|
TQStringList authorizeControlModules (const TQStringList&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_4_0 - )
|
||
|
static ButtonState keyboardMouseState ();
|
||
|
%End
|
||
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
enum
|
||
|
{
|
||
|
ShiftModifier,
|
||
|
LockModifier,
|
||
|
ControlModifier,
|
||
|
Modifier1,
|
||
|
Modifier2,
|
||
|
Modifier3,
|
||
|
Modifier4,
|
||
|
Modifier5
|
||
|
};
|
||
|
|
||
|
static uint keyboardModifiers ();
|
||
|
|
||
|
enum
|
||
|
{
|
||
|
Button1Pressed,
|
||
|
Button2Pressed,
|
||
|
Button3Pressed,
|
||
|
Button4Pressed,
|
||
|
Button5Pressed
|
||
|
};
|
||
|
|
||
|
static uint mouseState ();
|
||
|
%End
|
||
|
|
||
|
|
||
|
public slots:
|
||
|
void ref ();
|
||
|
void deref ();
|
||
|
|
||
|
protected:
|
||
12 years ago
|
TDEApplication (bool, bool, TDEInstance*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
12 years ago
|
//ig TDEApplication (Display*, TQt::HANDLE, TQt::HANDLE, bool, TDEInstance*);
|
||
13 years ago
|
%End
|
||
|
|
||
|
//ig bool x11EventFilter (XEvent*);
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
void invokeEditSlot (const char*);
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
bool notify (TQObject*, TQEvent*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
//ig int xErrhandler (Display*, void*);
|
||
|
//ig int xioErrhandler (Display*);
|
||
|
%End
|
||
|
|
||
|
|
||
|
%If ( KDE_3_0_1 - )
|
||
|
//ig void iceIOErrorHandler (_IceConn*);
|
||
|
%End
|
||
|
|
||
|
bool loadedByKdeinit;
|
||
|
static void startKdeinit ();
|
||
|
|
||
|
enum SettingsCategory
|
||
|
{
|
||
|
SETTINGS_MOUSE,
|
||
|
SETTINGS_COMPLETION,
|
||
|
SETTINGS_PATHS,
|
||
|
SETTINGS_POPUPMENU,
|
||
|
SETTINGS_QT,
|
||
|
SETTINGS_SHORTCUTS
|
||
|
};
|
||
|
|
||
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
13 years ago
|
static TQPalette createApplicationPalette ();
|
||
12 years ago
|
static TQPalette createApplicationPalette (TDEConfig*, int);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
static void installSigpipeHandler ();
|
||
|
static bool guiEnabled ();
|
||
|
%End
|
||
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
signals:
|
||
12 years ago
|
void tdedisplayPaletteChanged ();
|
||
|
void tdedisplayStyleChanged ();
|
||
|
void tdedisplayFontChanged ();
|
||
13 years ago
|
void appearanceChanged ();
|
||
|
void toolbarAppearanceChanged (int);
|
||
|
void backgroundChanged (int);
|
||
|
void settingsChanged (int);
|
||
|
void iconChanged (int);
|
||
|
void kipcMessage (int, int);
|
||
|
void saveYourself ();
|
||
|
void shutDown ();
|
||
|
|
||
|
private:
|
||
12 years ago
|
TDEApplication (const TDEApplication&);
|
||
13 years ago
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
public:
|
||
|
|
||
|
%If ( - KDE_3_2_0 )
|
||
|
int xioErrhandler ();
|
||
|
%End
|
||
|
|
||
|
|
||
12 years ago
|
}; // class TDEApplication
|
||
13 years ago
|
|
||
|
|
||
|
class KSessionManaged
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
KSessionManaged ();
|
||
13 years ago
|
virtual bool saveState (TQSessionManager&);
|
||
|
virtual bool commitData (TQSessionManager&);
|
||
13 years ago
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
}; // class KSessionManaged
|
||
|
|
||
|
typedef ulong Atom;
|
||
|
//ig typedef void Display;
|
||
13 years ago
|
//ig bool checkAccess (const TQString&, int);
|
||
13 years ago
|
|
||
|
|
||
|
%ModuleCode
|
||
|
#include <string.h>
|
||
|
|
||
|
// Convert a Python argv list to a conventional C argc count and argv array.
|
||
|
char **pyArgvToC(PyObject *argvlist,int *argcp)
|
||
|
{
|
||
|
int argc;
|
||
|
char **argv;
|
||
|
|
||
|
argc = PyList_Size(argvlist);
|
||
|
|
||
|
// Allocate space for two copies of the argument pointers, plus the
|
||
|
// terminating NULL.
|
||
|
if ((argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Convert the list.
|
||
|
for (int a = 0; a < argc; ++a)
|
||
|
{
|
||
|
char *arg;
|
||
|
|
||
|
// Get the argument and allocate memory for it.
|
||
|
if ((arg = PyString_AsString(PyList_GetItem(argvlist,a))) == NULL ||
|
||
|
(argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Copy the argument and save a pointer to it.
|
||
|
strcpy(argv[a],arg);
|
||
|
argv[a + argc + 1] = argv[a];
|
||
|
}
|
||
|
|
||
|
argv[argc + argc + 1] = argv[argc] = NULL;
|
||
|
|
||
|
*argcp = argc;
|
||
|
|
||
|
return argv;
|
||
|
}
|
||
|
|
||
|
|
||
|
// Remove arguments from the Python argv list that have been removed from the
|
||
|
// C argv array.
|
||
|
void updatePyArgv(PyObject *argvlist,int argc,char **argv)
|
||
|
{
|
||
|
for (int a = 0, na = 0; a < argc; ++a)
|
||
|
{
|
||
|
// See if it was removed.
|
||
|
if (argv[na] == argv[a + argc + 1])
|
||
|
++na;
|
||
|
else
|
||
|
PyList_SetSlice(argvlist,na,na + 1,NULL);
|
||
|
}
|
||
|
}
|
||
|
%End
|