Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/build-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export LIBS_PATH=${LIBAROMA_PATH}/libs
## ARCH dependent sources
##
export LIBEXTERNALS_ADD_SRC="
${LIBS_PATH}/jpeg-turbo/jsimd_none.c
"

export LIBAROMA_ARCH_FLAGS="
Expand Down
21 changes: 0 additions & 21 deletions include/aroma/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,4 @@ typedef void * voidp;
typedef uint32_t uchar;
typedef uchar * ucharp;

/* MIN / MAX */
static inline int __MAX(int a, int b){
return (a>b)?a:b;
}
static inline int __MIN(int a, int b){
return (a<b)?a:b;
}
static inline float __FMAX(float a, float b){
return (a>b)?a:b;
}
static inline float __FMIN(float a, float b){
return (a<b)?a:b;
}
static inline double __DMAX(double a, double b){
return (a>b)?a:b;
}
static inline double __DMIN(double a, double b){
return (a<b)?a:b;
}


#endif /* __libaroma_types_h__ */
4 changes: 2 additions & 2 deletions src/aroma/controls/ctl_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,13 @@ void _libaroma_ctl_bar_draw(
if (me->tools){
if (switch_id<me->tools->n){
float outstate = 1.0-libaroma_cubic_bezier_swiftout(
__FMIN(__FMAX(0,(
MIN(MAX(0,(
libaroma_ripple_current(&me->ripple,release_state)-0.5)
*2),1)
);
if (me->touched_switch>=2){
float xstate = libaroma_cubic_bezier_swiftout(
__FMIN(libaroma_ripple_current(&me->ripple,release_state)*2,1)
MIN(libaroma_ripple_current(&me->ripple,release_state)*2,1)
);
_libaroma_ctl_bar_draw_switch(
ctl, c, switch_id, 1, xstate, 0xff * outstate
Expand Down
2 changes: 1 addition & 1 deletion src/aroma/controls/ctl_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct __LIBAROMA_CTL_FRAGMENT _LIBAROMA_CTL_FRAGMENT;
typedef struct __LIBAROMA_CTL_FRAGMENT * _LIBAROMA_CTL_FRAGMENTP;
struct __LIBAROMA_CTL_FRAGMENT{
LIBAROMA_WINDOWP * wins;
int win_n;
unsigned int win_n;
int win_pos;
int win_pos_out;
byte win_cleanup;
Expand Down
2 changes: 1 addition & 1 deletion src/aroma/controls/ctl_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ byte __libaroma_ctl_list_item_reg_thread(
*/

LIBAROMA_CTL_LISTP mi = (LIBAROMA_CTL_LISTP) client->internal;
if (mi->threadn==0){
if (mi->threadn < 1){
mi->threads = (LIBAROMA_CTL_LIST_ITEMP *)
malloc(sizeof(LIBAROMA_CTL_LIST_ITEMP));
mi->threads[0] = item;
Expand Down
2 changes: 1 addition & 1 deletion src/aroma/controls/ctl_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ byte libaroma_ctl_pager_set_active_page(
if (dx!=0) {
int width = ctl->w;
int halfWidth = width / 2;
float distanceRatio = __FMIN(1.0, 1.0 * abs(dx) / width);
float distanceRatio = MIN(1.0, 1.0 * abs(dx) / width);
distanceRatio -= 0.5;
distanceRatio *= 0.3;
distanceRatio = sin(distanceRatio);
Expand Down
4 changes: 2 additions & 2 deletions src/aroma/controls/listitem/listitem_option.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ void _libaroma_listitem_option_draw(
relstate=1;
}
else{
relstate=__FMAX(__FMIN((curelstate-0.25) * 2,1),0);
relstate=MAX(MIN((curelstate-0.25) * 2,1),0);
relstate=libaroma_cubic_bezier_swiftout(relstate);
relstate=__FMAX(__FMIN(1,relstate),0);
relstate=MAX(MIN(1,relstate),0);
}
}
}
Expand Down
35 changes: 21 additions & 14 deletions src/aroma/debug/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,22 @@ char * libaroma_debug_tag();

/* Error Logs */
#if LIBAROMA_CONFIG_DEBUG >= 1
#define ALOGE(...) \
#define ALOGE(...) { \
fprintf(libaroma_debug_output(), "E/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "%s\n",LIBAROMA_DEBUG_SOURCE);
fprintf(libaroma_debug_output(), "%s\n",LIBAROMA_DEBUG_SOURCE); \
}
#else
#define ALOGE(...)
#endif

/* Process/Info Logs */
#if LIBAROMA_CONFIG_DEBUG >= 2
#define ALOGI(...) \
#define ALOGI(...) { \
fprintf(libaroma_debug_output(), "I/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "\n");
fprintf(libaroma_debug_output(), "\n"); \
}
#define ALOGI_IF(x, ...) if(x){ ALOGI(__VA_ARGS__) }
#else
#define ALOGI(...)
Expand All @@ -118,10 +120,11 @@ char * libaroma_debug_tag();

/* Important String Information Logs */
#if LIBAROMA_CONFIG_DEBUG >= 3
#define ALOGS(...) \
#define ALOGS(...) { \
fprintf(libaroma_debug_output(), "N/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "\n");
fprintf(libaroma_debug_output(), "\n"); \
}
#define ALOGS_IF(x, ...) if(x){ ALOGS(__VA_ARGS__) }
#else
#define ALOGS(...)
Expand All @@ -132,10 +135,11 @@ char * libaroma_debug_tag();

/* Warning Logs */
#if LIBAROMA_CONFIG_DEBUG >= 4
#define ALOGW(...) \
#define ALOGW(...) { \
fprintf(libaroma_debug_output(), "W/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "%s\n",LIBAROMA_DEBUG_SOURCE);
fprintf(libaroma_debug_output(), "%s\n",LIBAROMA_DEBUG_SOURCE); \
}
#define ALOGW_IF(x, ...) if(x){ ALOGW(__VA_ARGS__) }
#else
#define ALOGW(...)
Expand All @@ -144,10 +148,11 @@ char * libaroma_debug_tag();

/* Verbose Logs */
#if LIBAROMA_CONFIG_DEBUG >= 5
#define ALOGV(...) \
#define ALOGV(...) { \
fprintf(libaroma_debug_output(), "D/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "\n");
fprintf(libaroma_debug_output(), "\n"); \
}
#define ALOGV_IF(x, ...) if(x){ ALOGV(__VA_ARGS__) }
#else
#define ALOGV(...)
Expand All @@ -159,10 +164,11 @@ char * libaroma_debug_tag();

/* Event Logs */
#if LIBAROMA_CONFIG_DEBUG >= 6
#define ALOGT(...) \
#define ALOGT(...) { \
fprintf(libaroma_debug_output(), "V/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "\n");
fprintf(libaroma_debug_output(), "\n"); \
}
#define ALOGT_IF(x, ...) if(x){ ALOGT(__VA_ARGS__) }
#else
#define ALOGT(...)
Expand All @@ -171,10 +177,11 @@ char * libaroma_debug_tag();

/* Event Logs */
#if LIBAROMA_CONFIG_DEBUG >= 7
#define ALOGRT(...) \
#define ALOGRT(...) { \
fprintf(libaroma_debug_output(), "V/%s: ",libaroma_debug_tag()); \
fprintf(libaroma_debug_output(), __VA_ARGS__); \
fprintf(libaroma_debug_output(), "\n");
fprintf(libaroma_debug_output(), "\n"); \
}
#define ALOGRT_IF(x, ...) if(x){ ALOGRT(__VA_ARGS__) }
#else
#define ALOGRT(...)
Expand Down
8 changes: 4 additions & 4 deletions src/aroma/graph/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ void libaroma_canvas_blank(
memset(c->data, 0, c->s*2);

if (c->alpha != NULL) {
memset(c->alpha, 0xff, c->s);
if (c->hicolor != NULL) {
memset(c->alpha, 0x00, c->s);
}
else memset(c->alpha, 0xff, c->s);
}

if (c->hicolor != NULL) {
memset(c->alpha, 0x00, c->s);
}
}
else {
/* Unaligned Canvas */
Expand Down
8 changes: 4 additions & 4 deletions src/aroma/graph/draw/commondraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ byte libaroma_draw_subpixel(
int pos = y * dest->l;
for (x=floor(dx-ht);x<=ceil(dx+ht);x++){
if ((x>=0)&&(x<dest->w)){
px = abs((dx<x)?dx-x:x-dx)/ht;
py = abs((dy<y)?dy-y:y-dy)/ht;
px = fabs((dx<x)?dx-x:x-dx)/ht;
py = fabs((dy<y)?dy-y:y-dy)/ht;
int alp = MIN(0xff,MAX((1-(px+py)) * 0xff,0));
wordp d = dest->data + pos + x;
word cl = libaroma_alpha(*d, color, alp);
Expand Down Expand Up @@ -729,7 +729,7 @@ byte _libaroma_draw_arc_findpoint(
}
float xt = dx + radius_w*cos(radian);
float yt = dy + radius_h*sin(radian);
if ((abs(xt-xt0)>=2)||(abs(yt-yt0)>=2)) {
if ((fabs(xt-xt0)>=2)||(fabs(yt-yt0)>=2)) {
_libaroma_draw_arc_findpoint(
path, dx, dy, radius_w, radius_h,
xt0, yt0, xt, yt,
Expand All @@ -738,7 +738,7 @@ byte _libaroma_draw_arc_findpoint(
}
libaroma_path_add(path, xt, yt);

if ((abs(xt-xt1)>=2)||(abs(yt-yt1)>=2)) {
if ((fabs(xt-xt1)>=2)||(fabs(yt-yt1)>=2)) {
_libaroma_draw_arc_findpoint(
path, dx, dy, radius_w, radius_h,
xt, yt, xt1, yt1,
Expand Down
4 changes: 2 additions & 2 deletions src/aroma/graph/draw/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ byte _libaroma_path_curve_findpoint(
float xt, yt;
libaroma_path_curve_calc(thalf, &xt, &yt,x0,y0,x1,y1,x2,y2,x3,y3);

if ((abs(xt-xt0)>=2)||(abs(yt-yt0)>=2)) {
if ((fabs(xt-xt0)>=2)||(fabs(yt-yt0)>=2)) {
_libaroma_path_curve_findpoint(
path,t0,thalf,x0,y0,x1,y1,x2,y2,x3,y3,xt0,yt0,xt,yt);
}
libaroma_path_add(path, xt, yt);

if ((abs(xt-xt1)>=2)||(abs(yt-yt1)>=2)) {
if ((fabs(xt-xt1)>=2)||(fabs(yt-yt1)>=2)) {
_libaroma_path_curve_findpoint(
path,thalf,t1,x0,y0,x1,y1,x2,y2,x3,y3,xt,yt,xt1,yt1);
}
Expand Down
4 changes: 2 additions & 2 deletions src/aroma/graph/engine/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ int libaroma_color_hue(word color, int * saturation, int * luminance){
red/=255;
green/=255;
blue/=255;
float mn = __FMIN(__FMIN(red, green), blue);
float mx = __FMAX(__FMAX(red, green), blue);
float mn = MIN(MIN(red, green), blue);
float mx = MAX(MAX(red, green), blue);

float hue = 0.0;
if (mx == red) {
Expand Down
4 changes: 3 additions & 1 deletion src/aroma/graph/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ int libaroma_png_save_buffer(
png_write_end(png_ptr, NULL);
result = adapter->p;
finalize:

if (adapter != NULL) {
free(adapter);
}
if (info_ptr != NULL) {
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
}
Expand Down
4 changes: 2 additions & 2 deletions src/aroma/graph/text/text_line.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ _LIBAROMA_TEXTLINEP libaroma_textline(
/* return hr now */
align = chunk->curr_state.flags &
_LIBAROMA_TEXTCHUNK_ALIGN_BITWISE;
indent_size = (int) chunk->pending_data->param;
indent_size = (int) chunk->pending_data->dparam;
limit_width -= indent_size;
/* set line height */
line->h = libaroma_font_size_px(
Expand Down Expand Up @@ -839,7 +839,7 @@ _LIBAROMA_TEXTLINEP libaroma_textline(
chunk->pending_data =
(_LIBAROMA_TEXTPENDINGP) malloc(sizeof(_LIBAROMA_TEXTPENDING));
chunk->pending_data->type = _LIBAROMA_TEXTSPAN_HR;
chunk->pending_data->param = (voidp) indent_size;
chunk->pending_data->dparam = (dword) indent_size;
/* new line first */
return libaroma_textline_align(
line, chunk, align, x, indent_size, limit_width);
Expand Down
1 change: 1 addition & 0 deletions src/aroma/graph/text/text_structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ typedef struct __LIBAROMA_TEXTPENDING * _LIBAROMA_TEXTPENDINGP;
struct __LIBAROMA_TEXTPENDING{
byte type;
voidp param;
dword dparam;
};

/*
Expand Down
6 changes: 5 additions & 1 deletion src/aroma/hid/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,17 @@ byte libaroma_hid_get(LIBAROMA_HID_EVENTP e) {
}
/* clean destination variable */
memset(e, 0, sizeof(LIBAROMA_HID_EVENT));
ALOGI("libaroma_hid_get got LIBAROMA_HID_EV_TYPE_EXIT");
ALOGI("libaroma_hid_get got LIBAROMA_HID_EV_RET_EXIT");
/* set type in order to post it */
e->type=LIBAROMA_HID_EV_RET_EXIT;
return ret;
break;
case LIBAROMA_HID_EV_RET_ERROR:
/* clean destination variable */
memset(e, 0, sizeof(LIBAROMA_HID_EVENT));
ALOGE("libaroma_hid_get got LIBAROMA_HID_EV_RET_ERROR");
/* set type in order to post it */
e->type=LIBAROMA_HID_EV_RET_ERROR;
return ret;
break;
case LIBAROMA_HID_EV_RET_TOUCH: {
Expand Down
3 changes: 1 addition & 2 deletions src/aroma/hid/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ static void* _libaroma_msgqueue_hid_thread(void* cookie) {
break;
case LIBAROMA_HID_EV_TYPE_KEY:
/* post key message */
libaroma_msg_post_hid(LIBAROMA_MSG_KEY(ret), e.state, e.key, e.x,
e.y);
libaroma_msg_post_hid(LIBAROMA_MSG_KEY(ret), e.state, e.key, e.x, e.y);
break;
case LIBAROMA_HID_EV_RET_EXIT:
libaroma_msg_post_hid(LIBAROMA_MSG_EXIT, 0, 0, 0, 0);
Expand Down
7 changes: 4 additions & 3 deletions src/aroma/utils/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,18 @@ static const char * parse_string(cJSON * item, const char * str) {
case 4:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;

break;
case 3:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;

break;
case 2:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;

break;
case 1:
*--ptr2 = (uc | firstByteMark[len]);
break;
}

ptr2 += len;
Expand Down
2 changes: 1 addition & 1 deletion src/aroma/utils/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ LIBAROMA_STREAMP libaroma_stream(
#endif
else if (strcmp(kwd, "mem://") == 0) {
unsigned int mem;
int mem_sz;
unsigned int mem_sz;
int rc;

rc = sscanf(uri+6, "0x%x-0x%x", &mem, &mem_sz);
Expand Down
3 changes: 2 additions & 1 deletion src/contrib/platform/sdl/fb_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ byte SDLFBDR_init(LIBAROMA_FBP me) {
}

if(SDL_Init(SDL_INIT_VIDEO) < 0) {
ALOGE("Couldn't init SDL: %s", SDL_GetError());
ALOGE("Couldn't init SDL: %s", SDL_GetError());
free(mi);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/contrib/platform/sdl/fb_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include "SDL.h"
#include <SDL/SDL.h>

#include <aroma_internal.h>
#ifdef LIBAROMA_CONFIG_OPENMP
Expand Down
4 changes: 2 additions & 2 deletions src/contrib/platform/sdl/hid_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <unistd.h>
#include "SDL.h"
#include <SDL/SDL.h>

/*
* structure : internal driver data
Expand Down Expand Up @@ -113,7 +113,7 @@ byte LINUXHIDRV_getinput(

/* polling loop */
do {
if(SDL_PollEvent(&event)) {
if(SDL_WaitEvent(&event)) {
switch(event.type) {
case SDL_QUIT:
return LIBAROMA_HID_EV_RET_EXIT;
Expand Down
Loading