Replaced XXX to TODO

This commit is contained in:
David Capello 2007-12-04 21:50:31 +00:00
parent b3ebf94a9b
commit 29887ac39d
16 changed files with 92 additions and 72 deletions

View File

@ -206,7 +206,7 @@ static void proc_one_word(JAccel accel, char *word)
else if (ustricmp (tok, "Down") == 0)
scancode = KEY_DOWN;
/* XXX all "Pad" stuff and "PrtScr" and "Pause" */
/* TODO all "Pad" stuff and "PrtScr" and "Pause" */
else if (ustricmp (tok, "Enter Pad") == 0)
scancode = KEY_ENTER_PAD;
}

View File

@ -284,7 +284,7 @@ static bool button_msg_proc(JWidget widget, JMessage msg)
jwidget_deselect(widget);
}
/* XXX theme specific stuff */
/* TODO theme specific stuff */
jwidget_dirty(widget);
}
break;
@ -454,7 +454,7 @@ static bool button_msg_proc(JWidget widget, JMessage msg)
jwidget_signal_on(widget);
}
/* XXX theme stuff */
/* TODO theme stuff */
if (jwidget_is_enabled(widget))
jwidget_dirty(widget);
break;

View File

@ -275,22 +275,24 @@ static bool combobox_msg_proc(JWidget widget, JMessage msg)
static bool combobox_entry_msg_proc(JWidget widget, JMessage msg)
{
JWidget combo_widget = widget->user_data[0];
switch (msg->type) {
case JM_CHAR:
if (jwidget_has_focus (widget)) {
if (!jcombobox_is_editable (widget->user_data[0])) {
if (jwidget_has_focus(widget)) {
if (!jcombobox_is_editable(combo_widget)) {
if (msg->key.scancode == KEY_SPACE ||
msg->key.scancode == KEY_ENTER ||
msg->key.scancode == KEY_ENTER_PAD) {
combobox_switch_window (widget->user_data[0]);
combobox_switch_window(combo_widget);
return TRUE;
}
}
else {
if (msg->key.scancode == KEY_ENTER ||
msg->key.scancode == KEY_ENTER_PAD) {
combobox_switch_window (widget->user_data[0]);
combobox_switch_window(combo_widget);
return TRUE;
}
}
@ -298,11 +300,13 @@ static bool combobox_entry_msg_proc(JWidget widget, JMessage msg)
break;
case JM_BUTTONPRESSED:
if (jcombobox_is_clickopen (widget->user_data[0]))
combobox_open_window (widget->user_data[0]);
if (jcombobox_is_clickopen(combo_widget)) {
combobox_switch_window(combo_widget);
/* combobox_open_window(combo_widget); */
}
if (jcombobox_is_editable (widget->user_data[0])) {
jmanager_set_focus (widget);
if (jcombobox_is_editable(combo_widget)) {
jmanager_set_focus(widget);
}
else
return TRUE;
@ -314,37 +318,54 @@ static bool combobox_entry_msg_proc(JWidget widget, JMessage msg)
static bool combobox_listbox_msg_proc(JWidget widget, JMessage msg)
{
JWidget combo_widget = widget->user_data[0];
switch (msg->type) {
case JM_SIGNAL:
if (msg->signal.num == JI_SIGNAL_LISTBOX_CHANGE) {
int index = jlistbox_get_selected_index(widget);
if (IS_VALID_ITEM(widget->user_data[0], index)) {
jcombobox_select_index(widget->user_data[0], index);
if (IS_VALID_ITEM(combo_widget, index)) {
jcombobox_select_index(combo_widget, index);
jwidget_emit_signal(widget->user_data[0], JI_SIGNAL_COMBOBOX_CHANGE);
jwidget_emit_signal(combo_widget, JI_SIGNAL_COMBOBOX_CHANGE);
}
}
break;
case JM_BUTTONRELEASED:
{
int index = jcombobox_get_selected_index(widget->user_data[0]);
int index = jcombobox_get_selected_index(combo_widget);
if (IS_VALID_ITEM(widget->user_data[0], index))
jwidget_emit_signal(widget->user_data[0], JI_SIGNAL_COMBOBOX_SELECT);
if (IS_VALID_ITEM(combo_widget, index))
jwidget_emit_signal(combo_widget, JI_SIGNAL_COMBOBOX_SELECT);
combobox_close_window(widget->user_data[0]);
combobox_close_window(combo_widget);
}
return TRUE;
/* case JM_IDLE: { */
/* /\* if the user clicks outside the listbox *\/ */
/* if (!jmouse_b(1) && jmouse_b(0) && !jwidget_has_mouse(widget)) { */
/* ComboBox *combobox = jwidget_get_data(combo_widget, JI_COMBOBOX); */
/* if (combobox->entry && !jwidget_has_mouse(combobox->entry) && */
/* combobox->button && !jwidget_has_mouse(combobox->button) && */
/* combobox->window && !jwidget_has_mouse(combobox->window)) { */
/* combobox_close_window(combo_widget); */
/* return TRUE; */
/* } */
/* } */
/* break; */
/* } */
case JM_CHAR:
if (jwidget_has_focus (widget)) {
if (jwidget_has_focus(widget)) {
if (msg->key.scancode == KEY_SPACE ||
msg->key.scancode == KEY_ENTER ||
msg->key.scancode == KEY_ENTER_PAD) {
combobox_close_window (widget->user_data[0]);
combobox_close_window(combo_widget);
return TRUE;
}
}
@ -356,52 +377,52 @@ static bool combobox_listbox_msg_proc(JWidget widget, JMessage msg)
static void combobox_button_cmd(JWidget widget, void *data)
{
combobox_switch_window ((JWidget)data);
combobox_switch_window((JWidget)data);
}
static void combobox_open_window(JWidget widget)
{
ComboBox *combobox = jwidget_get_data (widget, JI_COMBOBOX);
ComboBox *combobox = jwidget_get_data(widget, JI_COMBOBOX);
if (!combobox->window) {
JWidget view, listbox;
JLink link;
int size;
JRect rc;
combobox->window = jwindow_new (NULL);
view = jview_new ();
listbox = jlistbox_new ();
combobox->window = jwindow_new(NULL);
view = jview_new();
listbox = jlistbox_new();
listbox->user_data[0] = widget;
jwidget_add_hook (listbox, JI_WIDGET, combobox_listbox_msg_proc, NULL);
jwidget_add_hook(listbox, JI_WIDGET, combobox_listbox_msg_proc, NULL);
JI_LIST_FOR_EACH(combobox->items, link)
jwidget_add_child (listbox, jlistitem_new(link->data));
jwidget_add_child(listbox, jlistitem_new(link->data));
jwindow_ontop (combobox->window, TRUE);
jwidget_noborders (combobox->window);
jwindow_ontop(combobox->window, TRUE);
jwidget_noborders(combobox->window);
size = jlist_length (combobox->items);
size = jlist_length(combobox->items);
jwidget_set_static_size
(view,
jrect_w(combobox->entry->rc),
2+(2+jwidget_get_text_height (listbox))*MID(1, size, 10)+2);
2+(2+jwidget_get_text_height(listbox))*MID(1, size, 10)+2);
jwidget_add_child (combobox->window, view);
jview_attach (view, listbox);
jwidget_add_child(combobox->window, view);
jview_attach(view, listbox);
jwidget_signal_off (listbox);
jlistbox_select_index (listbox, combobox->selected);
jwidget_signal_on (listbox);
jwidget_signal_off(listbox);
jlistbox_select_index(listbox, combobox->selected);
jwidget_signal_on(listbox);
jwindow_remap (combobox->window);
jwindow_remap(combobox->window);
rc = combobox_get_windowpos(combobox);
jwindow_position(combobox->window, rc->x1, rc->y1);
jrect_free(rc);
jwindow_open_bg (combobox->window);
jmanager_set_focus (listbox);
jwindow_open_bg(combobox->window);
jmanager_set_focus(listbox);
}
}
@ -409,7 +430,7 @@ static void combobox_close_window(JWidget widget)
{
ComboBox *combobox = jwidget_get_data(widget, JI_COMBOBOX);
if (combobox->window) {
jwindow_close (combobox->window, widget);
jwindow_close(combobox->window, widget);
combobox->window = NULL;
jmanager_set_focus(combobox->entry);
@ -436,4 +457,3 @@ static JRect combobox_get_windowpos(ComboBox *combobox)
jrect_displace(rc, 0, -(jrect_h(rc)+jrect_h(combobox->entry->rc)));
return rc;
}

View File

@ -96,7 +96,7 @@ JWidget jentry_new (int maxsize, const char *format, ...)
entry->readonly = FALSE;
entry->recent_focused = FALSE;
/* XXX support for text alignment and multi-line */
/* TODO support for text alignment and multi-line */
/* widget->align = JI_LEFT | JI_MIDDLE; */
widget->text_size = maxsize+1;
widget->text = jmalloc (widget->text_size);
@ -537,7 +537,7 @@ static bool entry_msg_proc (JWidget widget, JMessage msg)
case JM_MOUSEENTER:
case JM_MOUSELEAVE:
/* XXX theme stuff */
/* TODO theme stuff */
if (jwidget_is_enabled(widget))
jwidget_dirty(widget);
break;

View File

@ -268,7 +268,7 @@ static JWidget convert_tag_to_widget(Tag *tag)
else if (strcmp(tag->name, "textbox") == 0) {
Attr *wordwrap = tag_get_attr(tag, "wordwrap");
/* XXX add translatable support */
/* TODO add translatable support */
widget = jtextbox_new(tag->text, wordwrap ? JI_WORDWRAP: 0);
}
/* view */
@ -438,7 +438,7 @@ static JList read_tags(FILE *f)
jlist_remove(parent_stack, jlist_first(parent_stack)->data);
}
else {
/* XXX error msg */
/* TODO error msg */
/* printf ("you must open the tag before close it\n"); */
}

View File

@ -563,7 +563,7 @@ const int *ji_font_get_available_fixed_sizes (FONT *f, int *n)
return af->fixed_sizes;
}
else
return NULL; /* XXXX return text_height (...) size */
return NULL; /* TODO return text_height (...) size */
}
int ji_font_get_char_extra_spacing (FONT *f)
@ -648,7 +648,7 @@ static CACHED_GLYPH *_aa_find_glyph (AL_CONST FONT *f, int ch)
*/
static int aa_font_height (AL_CONST FONT *f)
{
/* XXXX */
/* TODO */
/* return f->height; */
FONT_AA_DATA *af = f->data;
@ -1004,7 +1004,7 @@ bool ji_font_is_scalable (FONT *f)
const int *ji_font_get_available_fixed_sizes (FONT *f, int *n)
{
return NULL; /* XXXX return text_height (...) size */
return NULL; /* TODO return text_height (...) size */
}
int ji_font_get_char_extra_spacing (FONT *f)

View File

@ -828,8 +828,8 @@ static bool menuitem_msg_proc(JWidget widget, JMessage msg)
case JM_MOUSEENTER:
case JM_MOUSELEAVE:
/* XXX theme specific!! */
jwidget_dirty (widget);
/* TODO theme specific!! */
jwidget_dirty(widget);
break;
}
@ -934,7 +934,7 @@ static void open_menuitem(JWidget menuitem, bool select_first)
MITEM(menuitem)->opened = TRUE; /* activate "opened" flag in the
menuitem */
/* XXXX */
/* TODO */
/* jwidget_flush_redraw (menuitem); /\* redraw the menuitem (the */
/* highlight could be change) *\/ */
@ -1008,7 +1008,7 @@ static void open_menuitem(JWidget menuitem, bool select_first)
/* setup the highlight of the new menubox */
if (select_first)
/* XXXX */
/* TODO */
/* set_highlight(menubox, */
set_highlight(MBOX(menubox)->menu,
jlist_first(MBOX(menubox)->menu->children)->data);
@ -1032,7 +1032,7 @@ static void open_menuitem(JWidget menuitem, bool select_first)
if (internal_msg & DO_GOTOBAR) {
/* final */
if (first_one) {
/* XXXX this isn't necessary */
/* TODO this isn't necessary */
/* internal_msg ^= DO_GOTOBAR; */
was_clicked = FALSE;
}

View File

@ -225,7 +225,7 @@ static bool panel_msg_proc(JWidget widget, JMessage msg)
/* case JM_MOUSEENTER: */
/* case JM_MOUSELEAVE: */
/* XXX theme stuff */
/* TODO theme stuff */
/* if (jwidget_is_enabled(widget)) */
/* jwidget_dirty(widget); */
/* break; */
@ -296,7 +296,7 @@ static void panel_set_position(JWidget widget, JRect rect)
pos->x##1 = widget->rc->x##1; \
pos->y##1 = widget->rc->y##1; \
pos->x##2 = pos->x##1 + avail*panel->pos/100; \
/* XXXX uncomment this to make a restricted panel */ \
/* TODO uncomment this to make a restricted panel */ \
/* pos->w = MID (req1_##w, pos->w, avail-req2_##w); */ \
pos->y##2 = pos->y##1 + jrect_##h(widget->rc); \
\

View File

@ -206,7 +206,7 @@ static bool slider_msg_proc(JWidget widget, JMessage msg)
/* else */
/* jwidget_select(widget); */
/* /\* XXX switch slider signal *\/ */
/* /\* TODO switch slider signal *\/ */
/* } */
/* TODO theme stuff */

View File

@ -190,7 +190,7 @@ static bool textbox_msg_proc(JWidget widget, JMessage msg)
static void textbox_request_size(JWidget widget, int *w, int *h)
{
/* XXX */
/* TODO */
/* *w = widget->border_width.l + widget->border_width.r; */
/* *h = widget->border_width.t + widget->border_width.b; */
*w = 0;

View File

@ -136,7 +136,7 @@ void ji_set_theme(JTheme theme)
if (ji_current_theme) {
ji_regen_theme();
/* XXX any better idea? */
/* TODO any better idea? */
if (manager && jwidget_get_theme(manager) == NULL)
jwidget_set_theme(manager, theme);
}
@ -343,7 +343,7 @@ void _ji_theme_textbox_draw(BITMAP *bmp, JWidget widget, int *w, int *h)
*w = 0;
}
else {
/* XXX modificable option? I don't think so, this is very internal stuff */
/* TODO modificable option? I don't think so, this is very internal stuff */
#if 0
/* shows more information in x-scroll 0 */
width = viewport_w;

View File

@ -106,7 +106,7 @@ void jview_attach(JWidget widget, JWidget viewable_widget)
View *view = jwidget_get_data(widget, JI_VIEW);
jwidget_add_child(view->viewport, viewable_widget);
/* XXX */
/* TODO */
/* jwidget_emit_signal(widget, JI_SIGNAL_VIEW_ATTACH); */
}
@ -374,7 +374,7 @@ static bool view_msg_proc(JWidget widget, JMessage msg)
case JM_FOCUSENTER:
case JM_FOCUSLEAVE:
/* XXX add something to avoid this (theme specific stuff) */
/* TODO add something to avoid this (theme specific stuff) */
{
JRegion reg1 = jwidget_get_drawable_region(widget,
JI_GDR_CUTTOPWINDOWS);
@ -594,7 +594,7 @@ static bool scrollbar_msg_proc(JWidget widget, JMessage msg)
case JM_MOUSEENTER:
case JM_MOUSELEAVE:
/* XXX add something to avoid this (theme specific stuff) */
/* TODO add something to avoid this (theme specific stuff) */
jwidget_invalidate (widget);
break;
}

View File

@ -123,7 +123,7 @@ void jwidget_free(JWidget widget)
/* remove children */
JI_LIST_FOR_EACH_SAFE(widget->children, link, next) {
/* XXXX the autodestroy flag is only useful for windows */
/* TODO the autodestroy flag is only useful for windows */
/* if (jwidget_is_autodestroy (link->data)) */
jwidget_free(link->data);
}
@ -984,7 +984,7 @@ void jwidget_set_bg_color(JWidget widget, int color)
void jwidget_set_theme(JWidget widget, JTheme theme)
{
widget->theme = theme;
/* XXX mmhhh... maybe some JStyle in JWidget should be great */
/* TODO mmhhh... maybe some JStyle in JWidget should be great */
widget->text_font = widget->theme ? widget->theme->default_font: NULL;
}

View File

@ -496,7 +496,7 @@ static JList read_nodes(JStream stream)
jlist_remove(parent_stack, jlist_first_data(parent_stack));
}
else {
/* XXX error msg */
/* TODO error msg */
/* printf ("you must open the tag before close it\n"); */
}

View File

@ -1,7 +1,7 @@
/* $XFree86: xc/programs/Xserver/mi/miregion.c,v 1.9 2003/04/23 21:51:53 tsi Exp $ */
/***********************************************************
Copyright 1987, 1988, 1989, 1998 The Open Group
Copyright 1987, 1988, 1989, 1998, 2007 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
@ -443,7 +443,7 @@ miRectAlloc(
if (n == 1)
{
n = pRgn->data->numRects;
if (n > 500) /* XXX pick numbers out of a hat */
if (n > 500) /* TODO pick numbers out of a hat */
n = 250;
}
n += pRgn->data->numRects;
@ -1303,7 +1303,7 @@ miRegionAppend(dstrgn, rgn)
size = numRects;
dnumRects = REGION_NUM_RECTS(dstrgn);
if (!dnumRects && (size < 200))
size = 200; /* XXX pick numbers out of a hat */
size = 200; /* TODO pick numbers out of a hat */
RECTALLOC(dstrgn, size);
old = REGION_RECTS(rgn);
if (!dnumRects)

View File

@ -732,7 +732,7 @@ static void theme_draw_menuitem (JWidget widget)
int x1, y1, x2, y2;
JRect pos;
/* XXXX assert? */
/* TODO assert? */
if (!widget->parent->parent)
return;
@ -975,7 +975,7 @@ static void theme_draw_separator (JWidget widget)
}
#if 1
/* XXXX when Allegro 4.1 will be officially released, replace this
/* TODO when Allegro 4.1 will be officially released, replace this
with the get_clip_rect, add_clip_rect, set_clip_rect functions */
static int my_add_clip_rect (BITMAP *bitmap, int x1, int y1, int x2, int y2)
{
@ -1072,7 +1072,7 @@ static void theme_draw_slider (JWidget widget)
r = jrect_new(x1, y1, x2+1, y2+1);
/* XXXX when Allegro 4.1 will be officially released, replace this
/* TODO when Allegro 4.1 will be officially released, replace this
with the get_clip_rect, add_clip_rect, set_clip_rect functions */
cx1 = ji_screen->cl;
@ -1447,7 +1447,7 @@ static void draw_textstring (const char *t, int fg_color, int bg_color,
/* text */
if (jwidget_is_disabled (widget)) {
/* XXXX avoid this */
/* TODO avoid this */
if (fill_bg) /* only to draw the background */
jdraw_text(widget->text_font, t, x, y, 0, bg_color, fill_bg);