[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs haiku.cpp
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs haiku.cpp |
Date: |
Thu, 19 Dec 2013 00:41:22 +0000 |
CVSROOT: /sources/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 13/12/19 00:41:22
Modified files:
. : haiku.cpp
Log message:
Haiku patch from Francois Revol
* remove unused variables/functions
* remove commented out debug output
* make haiku_dpy static; no need to memcpy() it
* Fix calling [un]init_appplication()
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/haiku.cpp?cvsroot=qemacs&r1=1.3&r2=1.4
Patches:
Index: haiku.cpp
===================================================================
RCS file: /sources/qemacs/qemacs/haiku.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- haiku.cpp 17 Dec 2013 16:08:56 -0000 1.3
+++ haiku.cpp 19 Dec 2013 00:41:22 -0000 1.4
@@ -33,8 +33,6 @@
#include <View.h>
#include <Window.h>
-extern QEDisplay haiku_dpy;
-
static int force_tty = 0;
static int font_xsize;
@@ -185,9 +183,7 @@
void QEView::KeyUp(const char *bytes, int32 numBytes)
{
- uint32 mods;
BMessage *message = Window()->DetachCurrentMessage();
- //message->PrintToStream();
bmessage_input(NULL, this, message);
}
@@ -214,13 +210,6 @@
return 2;
}
-static int32 bapp_quit_thread(void *arg)
-{
- be_app->Lock();
- be_app->Quit();
- return 0;
-}
-
static int32 bapp_thread(void *arg)
{
be_app->Lock();
@@ -269,11 +258,8 @@
int xsize, ysize, font_ysize;
WindowState *ctx;
- if (!be_app)
init_application();
- memcpy(&s->dpy, &haiku_dpy, sizeof(QEDisplay));
-
ctx = (WindowState *)malloc(sizeof(WindowState));
if (ctx == NULL)
return -1;
@@ -344,6 +330,7 @@
ctx->w->Lock();
ctx->w->Quit();
free(s->priv_data);
+ uninit_application();
}
static void haiku_flush(QEditScreen *s)
@@ -370,19 +357,14 @@
{
QEditScreen *s = (QEditScreen *)opaque;
WindowState *ctx = (WindowState *)s->priv_data;
- unsigned char buf[16];
bigtime_t timestamp_ms;
BMessage *event;
//fprintf(stderr, "%s()\n", __FUNCTION__);
- /*
- KeySym keysym;
- */
- int shift, ctrl, meta, len, key = 0;
+ int shift, ctrl, meta, key = 0;
QEEvent ev1, *ev = &ev1;
- if (read(ctx->events_rd, &event, sizeof(BMessage *)) < sizeof(BMessage *))
+ if (read(ctx->events_rd, &event, sizeof(event)) < (signed)sizeof(event))
return;
- //event->PrintToStream();
switch(event->what) {
case B_QUIT_REQUESTED:
@@ -411,14 +393,7 @@
case B_VIEW_RESIZED:
{
int32 width, height;
- int columns, rows;
- //event->PrintToStream();
-/*
- if (event->FindInt32("width", &width) < B_OK)
- break;
- if (event->FindInt32("height", &height) < B_OK)
- break;
-*/
+
ctx->v->LockLooper();
width = ctx->v->Bounds().IntegerWidth() + 1;
@@ -504,7 +479,6 @@
case B_KEY_DOWN:
{
- unsigned int mods = 0;
uint32 state;
//event->PrintToStream();
uint32 scancode;
@@ -643,7 +617,7 @@
key = utf8_decode(&p);
}
- got_key:
+ //got_key:
if (key) {
ev->key_event.type = QE_KEY_EVENT;
ev->key_event.key = key;
@@ -829,7 +803,7 @@
b->priv_data = NULL;
}
-extern QEDisplay haiku_dpy = {
+static QEDisplay haiku_dpy = {
"haiku",
haiku_probe,
haiku_init,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-commit] qemacs haiku.cpp,
Charlie Gordon <=