timer_callback=g_hash_table_new(NULL, NULL);
watches=g_hash_table_new(NULL, NULL);
#ifndef QT_QPAINTER_NO_WIDGET
+#if QT_VERSION >= 0x040000
+ setAttribute(Qt::WA_OpaquePaintEvent, true);
+#else
setBackgroundMode(QWidget::NoBackground);
#endif
#endif
+#endif
}
//##############################################################################################################
event->accept();
}
+#define CASE(x) case x:
+
void RenderArea::keyPressEvent(QKeyEvent *event)
{
-#if QT_VERSION < 0x040000
QString str=event->text();
+#if QT_VERSION < 0x040000
QCString cstr=str.utf8();
const char *text=cstr;
+#else
+ const char *text=str.toUtf8().constData();
+#endif
dbg(0,"enter text='%s' 0x%x (%d) key=%d\n", text, text[0], strlen(text), event->key());
if (!text || !text[0] || text[0] == 0x7f) {
dbg(0,"special key\n");
}
break;
case 4101:
+#ifdef QT_QPAINTER_CUSTOM_RETURN
+ QT_QPAINTER_CUSTOM_RETURN
+#endif
{
text=(char []){NAVIT_KEY_RETURN,'\0'};
}
break;
case 4114:
+#ifdef QT_QPAINTER_CUSTOM_LEFT
+ QT_QPAINTER_CUSTOM_LEFT
+#endif
{
text=(char []){NAVIT_KEY_LEFT,'\0'};
}
break;
case 4115:
+#ifdef QT_QPAINTER_CUSTOM_UP
+ QT_QPAINTER_CUSTOM_UP
+#endif
{
text=(char []){NAVIT_KEY_UP,'\0'};
}
break;
case 4116:
+#ifdef QT_QPAINTER_CUSTOM_RIGHT
+ QT_QPAINTER_CUSTOM_RIGHT
+#endif
{
text=(char []){NAVIT_KEY_RIGHT,'\0'};
}
break;
case 4117:
+#ifdef QT_QPAINTER_CUSTOM_DOWN
+ QT_QPAINTER_CUSTOM_DOWN
+#endif
{
text=(char []){NAVIT_KEY_DOWN,'\0'};
}
}
callback_list_call_attr_1(this->cbl, attr_keypress, (void *)text);
event->accept();
-#endif
}
void RenderArea::watchEvent(int fd)
exit(0);
}
-struct event_watch {
- QSocketNotifier *sn;
- struct callback *cb;
- void *fd;
-};
-
static struct event_watch *
event_qt_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
{
return (struct event_timeout *)id;
}
-static void
+void
event_qt_remove_timeout(struct event_timeout *ev)
{
event_gr->widget->killTimer((int)(long)ev);
#endif
#if QT_QPAINTER_USE_FREETYPE
font_freetype_new=(struct font_priv *(*)(void *))plugin_get_font_type("freetype");
- if (!font_freetype_new)
+ if (!font_freetype_new) {
+ dbg(0,"no freetype\n");
return NULL;
+ }
#endif
ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;