소스 검색

Merge 5818ae0f52 into f42aa68fc7

pull/14/merge
alexpwf GitHub 3 년 전
부모
커밋
2b78cb92bf
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
2개의 변경된 파일57개의 추가작업 그리고 0개의 파일을 삭제
  1. +47
    -0
      cxx/caca++.cpp
  2. +10
    -0
      cxx/caca++.h

+ 47
- 0
cxx/caca++.cpp 파일 보기

@@ -22,6 +22,7 @@
#include <iostream>

#include <stdio.h> // BUFSIZ
#include <string.h> // memcpy
#include <stdarg.h> // va_*

#include "caca++.h"
@@ -484,6 +485,52 @@ int Caca::getEvent(unsigned int g, Event *n, int aa)
return caca_get_event(dp, g, n ? &n->e : NULL, aa);
}

int Event::caca_get_event_key_ch()
{
return ((caca_privevent_t *)&e)->data.key.ch;
}

enum Event::caca_event_type Event::caca_get_event_type()
{
return (Event::caca_event_type)(((caca_privevent_t *)&e)->type);
}

uint32_t Event::caca_get_event_key_utf32()
{
return ((caca_privevent_t *)&e)->data.key.utf32;
}

int Event::caca_get_event_key_utf8(char *utf8)
{
memcpy(utf8, ((caca_privevent_t *)&e)->data.key.utf8, 8);
return 0;
}

int Event::caca_get_event_mouse_button()
{
return ((caca_privevent_t *)&e)->data.mouse.button;
}

int Event::caca_get_event_mouse_x()
{
return ((caca_privevent_t *)&e)->data.mouse.x;
}

int Event::caca_get_event_mouse_y()
{
return ((caca_privevent_t *)&e)->data.mouse.y;
}

int Event::caca_get_event_resize_width()
{
return ((caca_privevent_t *)&e)->data.resize.w;
}

int Event::caca_get_event_resize_height()
{
return ((caca_privevent_t *)&e)->data.resize.h;
}

unsigned int Caca::getMouseX()
{
return caca_get_mouse_x(dp);


+ 10
- 0
cxx/caca++.h 파일 보기

@@ -22,6 +22,7 @@
#define _CACA_PP_H

#include <caca.h>
#include <caca_internals.h>

#undef __class
#if defined(_WIN32) && defined(__LIBCACA_PP__)
@@ -170,6 +171,15 @@ __class Event

CACA_EVENT_ANY = 0xffff /**< Bitmask for any event. */
} type;
int caca_get_event_key_ch();
enum caca_event_type caca_get_event_type();
uint32_t caca_get_event_key_utf32();
int caca_get_event_key_utf8(char *utf8);
int caca_get_event_mouse_button();
int caca_get_event_mouse_x();
int caca_get_event_mouse_y();
int caca_get_event_resize_width();
int caca_get_event_resize_height();

protected:
caca_event_t e;


불러오는 중...
취소
저장