• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • superkaramba
 

superkaramba

  • superkaramba
  • src
taskbartest.cpp
1 /*
2  * Copyright (C) 2003 Hans Karlsson <karlsson.h@home.se>
3  * Copyright (C) 2003-2004 Adam Geitgey <adam@rootnode.org>
4  * Copyright (c) 2005 Ryan Nickell <p0z3r@earthlink.net>
5  *
6  * This file is part of SuperKaramba.
7  *
8  * SuperKaramba is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * SuperKaramba is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with SuperKaramba; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  ****************************************************************************/
22 
23 #include <tdeapplication.h>
24 #include <tdefiledialog.h>
25 #include <tdeaboutdata.h>
26 #include <tdecmdlineargs.h>
27 #include <tdelocale.h>
28 #include <tdeconfig.h>
29 
30 #include <tqfileinfo.h>
31 #include <tqstringlist.h>
32 
33 #include <iostream.h>
34 
35 #include "taskbartest.h"
36 
37 static const char *description =
38  I18N_NOOP("A TDE Eye-candy Application");
39 
40 static const char *version = "0.17";
41 
42 static TDECmdLineOptions options[] =
43  {
44  // { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
45  { "+file", I18N_NOOP("A required argument 'file'"), 0 },
46  { 0, 0, 0 }
47 
48  };
49 
50 
51 int main(int argc, char **argv)
52 {
53  TDEAboutData about("karamba", I18N_NOOP("karamba"), version, description,
54  TDEAboutData::License_GPL, "(C) 2003 Hans Karlsson", 0, 0, "karlsson.h@home.se");
55  about.addAuthor( "Hans Karlsson", 0, "karlsson.h@home.se" );
56  TDECmdLineArgs::init(argc, argv, &about);
57  TDECmdLineArgs::addCmdLineOptions( options );
58 
59  TDEApplication app;
60 // karamba *mainWin = 0;
61 
62  TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
63 
64 // //KSGRD::SensorManager *f32 = new KSGRD::SensorManager();
65 // //f32->engage("localhost");
66 // // KSGRD::SensorMgr foo ;// p->engage( "" );
67 
68 
69 // //TDEConfig *tdeconfig = TDEGlobal::config();
70 // //tdeconfig->setGroup("karamba");
71 // //tdeconfig->writeEntry("test", "/home/hk/foofoo");
72 // //tdeconfig->sync();
73 
74 
75 // bool OK = false;
76 
77 // // initialize Python
78 // Py_Initialize();
79 
80 // // initialize thread support
81 // PyEval_InitThreads();
82 
83 // mainThreadState = NULL;
84 
85 // // save a pointer to the main PyThreadState object
86 // mainThreadState = PyThreadState_Get();
87 
88 // // release the lock
89 // PyEval_ReleaseLock();
90 
91 
92 // if(args->count() > 0)
93 // {
94 // for (int i = 0; i < (args->count()); i++)
95 // {
96 // if( args->arg(i) != "" )
97 // {
98 // TQFileInfo file( args->arg(i) );
99 // //tqDebug( file.dirPath(true) );
100 // if( file.exists() && !file.isDir() )
101 // {
102 // //tqDebug( "File exists" );
103 // mainWin = new karamba( ( args->arg(i) ));
104 // mainWin->show();
105 // OK = true;
106 // }
107 // }
108 // }
109 
110 // //app.setMainWidget( mainWin );
111 // int ret = 0;
112 // if( OK )
113 // ret = app.exec();
114 
115 // // shut down the interpreter
116 // PyInterpreterState * mainInterpreterState = mainThreadState->interp;
117 // // create a thread state object for this thread
118 // PyThreadState * myThreadState = PyThreadState_New(mainInterpreterState);
119 // PyThreadState_Swap(myThreadState);
120 
121 // PyEval_AcquireLock();
122 // Py_Finalize();
123 
124 // return ret;
125 // }
126 // else
127 // {
128 // TQStringList fileNames;
129 // fileNames = KFileDialog::getOpenFileNames(TQString(), "*.theme", 0, "Open configurations");
130 // for ( TQStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it )
131 // {
132 // TQFileInfo file( *it );
133 // if( file.exists() && !file.isDir() )
134 // {
135 // mainWin = new karamba( *it );
136 // mainWin->show();
137 // OK = true;
138 // }
139 // }
140 // int ret = 0;
141 // if( OK )
142 // ret = app.exec();
143 
144 // // shut down the interpreter
145 // PyInterpreterState * mainInterpreterState = mainThreadState->interp;
146 // // create a thread state object for this thread
147 // PyThreadState * myThreadState = PyThreadState_New(mainInterpreterState);
148 // PyThreadState_Swap(myThreadState);
149 // PyEval_AcquireLock();
150 // Py_Finalize();
151 // return ret;
152 // }
153 
154 // args->clear();
155 
156 // // shut down the interpreter
157 
158 // PyInterpreterState * mainInterpreterState = mainThreadState->interp;
159 // // create a thread state object for this thread
160 // PyThreadState * myThreadState = PyThreadState_New(mainInterpreterState);
161 // PyThreadState_Swap(myThreadState);
162 // PyEval_AcquireLock();
163 // Py_Finalize();
164 
165 
166  TaskManager t;
167 
168  printf("%d %d", t.numberOfDesktops(), t.currentDesktop());
169 
170  TaskList list = t.tasks();
171 
172  Task *task;
173  for ( task = list.first(); task; task = list.next() ) {
174  cout << task->name().latin1() << endl;
175  task->restore();
176  }
177  cout << endl;
178 
179  return 0;
180 
181 
182 
183 }
TaskManager::currentDesktop
int currentDesktop() const
Returns the number of the current desktop.
Definition: taskmanager.cpp:822
TaskManager
A generic API for task managers.
Definition: taskmanager.h:432
TaskManager::tasks
TaskList tasks() const
Returns a list of all current tasks.
Definition: taskmanager.h:447
TaskManager::numberOfDesktops
int numberOfDesktops() const
Returns the number of virtual desktops.
Definition: taskmanager.cpp:306
Task::restore
void restore()
Restore the main window of the task (if it was iconified).
Definition: taskmanager.cpp:634
Task
A dynamic interface to a task (main window).
Definition: taskmanager.h:49

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

superkaramba

Skip menu "superkaramba"
  • kcalc
  •   knumber
  • superkaramba
Generated for superkaramba by doxygen 1.8.13
This website is maintained by Timothy Pearson.