Name: Johan Thelin
Member since: 2004-05-06 12:14:55
Last Login: 2007-07-11 12:38:34
Homepage: http://www.digitalfanatics.org/e8johan
Notes: Has a formal education in electronics and computer sience and several years of experience from both open source development and software consulting.
This person is:
Qt as GTK, again


void gtk_container_set_border_width(QObject *o_w, int spacing)
{
QT_WIDGET_ASSERT(w)
w->setContentsMargins(spacing,spacing,spacing,spacing);
}
GTK+ made Qt
Disclaimer! First of all - this is not an attack on any toolkit, nor critique. Rather, it is a hacker sitting down and trying out an idea.
#define G_OBJECT(obj) ((QObject*)(obj))
#define G_CALLBACK(func) ((void*)(func))
typedef void* gpointer;
typedef bool gboolean;
typedef char gchar;
#define g_print qDebug
...
#define GtkWidget QWidget
void gtk_widget_show(QWidget *w) { w->show(); }
#define GTK_WINDOW_TOPLEVEL (0)
QWidget *gtk_window_new(int) { return new QWidget(); }
void gtk_window_set_title(GtkWindow *w, const char *t) { w->setWindowTitle(QString(t)); }
...
#define GTK_BOX(obj) (obj->layout())
void gtk_box_pack_start(QLayout *l, QWidget *w, bool expand, bool fill, int padding) { l->addWidget(w); }
void g_signal_connect(QObject *src, const char *cstrEventName, void *f, void *data)
{
QString eventName = QString(cstrEventName);
if (eventName.endsWith("_event"))
{ // This is an event, f is an eventFuncPtr
QObject *o = QGtkEventFilter::createFilter(eventName, eventFuncPtr(f), data);
if(o)
src->installEventFilter(o);
else
qWarning("Failed to match GTK event '%s' to a Qt event filter.", cstrEventName);
}
else
{ // This is a callback, f is an callbackFuncPtr
QObject *o = new QGtkCallbackBridge(src, callbackFuncPtr(f), data);
const char *signalName = 0;
if(eventName == "clicked")
signalName = SIGNAL(clicked());
if (signalName)
QObject::connect(src, signalName, o, SLOT(trigger()));
else
qWarning("Failed to match GTK signal '%s' to a Qt signal.", cstrEventName);
}
}
The wether forcast mentioned snow on Wednesday. We had some yesterday and today it is really snowing away. Looks like I'll have to buy a sledge for Lisa! Will be great fun.One month of flying
It has been a month since I started working in my own business. My former employer has been very kind and let me explore this while on a leave of absense, i.e. I have somewhere to return to.e8johan certified others as follows:
Others have certified e8johan as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!