Fixme

Discover which code snippets in open source project is need to be fixed.

Search Snippets

Upload Tips

We have provided a tool to collect code snippets with FIXME comments and upload them here.

See more

Languages

lc-soft
so difficult (1 ratings)  •  Last indexed on
redesign the input method engine

The current design used is not robust and needs to be redesigned with reference to other complete input method engine frameworks.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <LCUI_Build.h>
#include <LCUI/LCUI.h>
#include <LCUI/input.h>
#include <LCUI/ime.h>

typedef struct LCUI_IMERec_ {
	int id;
	char *name;
	LCUI_IMEHandlerRec handler;
	LinkedListNode node;
} LCUI_IMERec, *LCUI_IME;
lc-soft
difficult (1 ratings)  •  Last indexed on
imrpove alpha blending method

Existing alpha blending methods are inefficient and need to be optimized

421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
static void Graph_MixARGBWithAlpha(LCUI_Graph *dst, LCUI_Rect des_rect,
				   const LCUI_Graph *src, int src_x, int src_y)
{
	int x, y;
	LCUI_ARGB *px_src, *px_dst;
	LCUI_ARGB *px_row_src, *px_row_des;
	double a, out_a, out_r, out_g, out_b, src_a;
	px_row_src = src->argb + src_y*src->width + src_x;
	px_row_des = dst->argb + des_rect.y*dst->width + des_rect.x;
	if (src->opacity < 1.0) {
		goto mix_with_opacity;
	}
	for (y = 0; y < des_rect.height; ++y) {
		px_src = px_row_src;
		px_dst = px_row_des;
		for (x = 0; x < des_rect.width; ++x) {
lc-soft
difficult (1 ratings)  •  Last indexed on
improve the seamless display mode

the seamless display mode has not been updated for a long time, we not sure if it can work.

348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
static int LCUIDisplay_Seamless(void)
{
	LinkedListNode *node;
	LCUI_Widget root = LCUIWidget_GetRoot();
	DEBUG_MSG("display.mode: %d\n", display.mode);
	switch (display.mode) {
	case LCUI_DMODE_SEAMLESS:
		return 0;
	case LCUI_DMODE_FULLSCREEN:
	case LCUI_DMODE_WINDOWED:
	default:
		LCUIDisplay_CleanSurfaces();
		break;
	}
	for (LinkedList_Each(node, &root->children)) {
		LCUIDisplay_BindSurface(node->data);
lc-soft
difficult (1 ratings)  •  Last indexed on
remove LCUI_StyleValue

These values do not need to put in LCUI_StyleValue, because they are not strongly related and should be defined separately where they are needed.

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/** 样式值枚举,用于代替使用字符串 */
typedef enum LCUI_StyleValue {
	SV_NONE,
	SV_AUTO,
	SV_CONTAIN,
	SV_COVER,
	SV_LEFT,
	SV_CENTER,
	SV_RIGHT,
	SV_TOP,
	SV_TOP_LEFT,
	SV_TOP_CENTER,
	SV_TOP_RIGHT,
	SV_MIDDLE,
	SV_CENTER_LEFT,
	SV_CENTER_CENTER,