Exemplo n.º 1
0
void		ModuleOpenGL::display(map_t const & map)
{
    uint		x;
    uint		y = 0;

    glClear(GL_COLOR_BUFFER_BIT);
    glViewport(0, 0, this->width, this->height);
    xglBegin(GL_QUADS);
    glColor3ub(51, 51, 51);
    glVertex2d(-1,-1);
    glVertex2d(-1,1);
    glColor3ub(30, 30, 30);
    glVertex2d(1,1);
    glVertex2d(1,-1);
    xglEnd();
    for (std::vector<std::vector<slot_t> >::const_iterator it_y = map.begin(); it_y != map.end(); ++it_y)
    {
        x = 0;
        for (std::vector<slot_t>::const_iterator it_x = (*it_y).begin(); it_x != (*it_y).end(); ++it_x)
        {
            display_slot(x, y, (*it_x));
            ++x;
        }
        ++y;
    }
    xglFlush();
    SDL_GL_SwapBuffers();
}
Exemplo n.º 2
0
char display_slot(
dtslot_t        *slot,
int8            index,
int32           isleaf,
int32           *changed)
{
        char    result;

        printf("[1] next\t%d\n", slot[index].next);
        printf("[2] cnt\t\t%d\n", slot[index].cnt);
#ifdef  _JFS_UNICODE
        printf("[3] name\t%.15ls\n", slot[index].name);
#else
        printf("[3] name\t%.30s\n", slot[index].name);
#endif

        if (isleaf)
                result = prompt("dtree: press enter for next or [u]p or e[x]it > ");
        else
                result = prompt("dtree: press enter for next or [u]p, [d]own or e[x]it > ");

        if (result == 'u' || result == 'd' || result == 'x')
                return result;

        if (slot[index].next >= 0)
                return display_slot(slot, slot[index].next, isleaf, changed);
        else
                return result;
}
Exemplo n.º 3
0
void		ModuleNcurses::display(map_t const & map)
{
  uint		x;

  if (werase(this->win) == ERR)
    throw Exception(strerror(errno));
  for (uint y = 0; y != map.size() ; ++y)
    {
      for (x = 0; x != map.size() ; ++x)
	display_slot(x, y, map[y][x]);
    }
  if (wrefresh(this->win) == ERR)
    throw Exception(strerror(errno));
}
Exemplo n.º 4
0
char display_internal_slots(
dtslot_t        *slot,
int8            *stbl,
int8            nextindex,
int32           *changed)
{
        int32           i;
        idtentry_t      *entry;
        int64           node_address;
        char            result;
        int32           slot_number;

        for (i = 0; i < nextindex; i++) {
                slot_number = stbl[i];
                entry = (idtentry_t *)&(slot[slot_number]);
                node_address = addressPXD(&(entry->xd));

                printf("stbl[%d] = %d\n", i, slot_number);
                printf("[1] xd.len\t    0x%06x\t\t", entry->xd.len);
                printf("[4] next\t%d\n", entry->next);
                printf("[2] xd.addr1\t  0x%02x\t\t\t", entry->xd.addr1);
                printf("[5] namlen\t%d\n", entry->namlen);
                printf("[3] xd.addr2\t  0x%08x\t\t", entry->xd.addr2);
                printf("     xd.addr\t%lld\n", node_address);
#ifdef  _JFS_UNICODE
                printf("[6] name\t%.11ls\n", entry->name);
#else
                printf("[6] name\t%.22s\n", entry->name);
#endif
                printf("addressPXD(xd)\t%lld\n", node_address);

                result = prompt("dtree: press enter for next or [u]p, [d]own or e[x]it > ");
                if (result == 'x' || result == 'u' )
                        return result;
                else if (result != 'd' && entry->next >= 0) {
                        result = display_slot(slot, entry->next, 0, changed);
                        if (result == 'x' || result == 'u' )
                                return result;
                }
                if (result == 'd')
                        /* descend to the child node */
                        return(display_extent_page(node_address));
        }
        return result;
}
Exemplo n.º 5
0
void		ModuleSDL::display(map_t const & map)
{
  uint		x, y;
  int		r;

  y = 0;
  r = SDL_FillRect(this->s_ecran, NULL, SDL_MapRGB(this->s_ecran->format, 0, 0, 0));
  if (r == -1)
    throw Exception(SDL_GetError());
  for (std::vector<std::vector<slot_t> >::const_iterator it_y = map.begin(); it_y != map.end(); ++it_y)
    {
      x = 0;
      for (std::vector<slot_t>::const_iterator it_x = (*it_y).begin(); it_x != (*it_y).end(); ++it_x)
	{
	  display_slot(x, y, (*it_x));
	  ++x;
	}
      ++y;
    }
  r = SDL_Flip(this->s_ecran);
  if (r == -1)
    throw Exception(SDL_GetError());
}
Exemplo n.º 6
0
char display_leaf_slots(
dtslot_t        *slot,
int8            *stbl,
int8            nextindex,
int32           *changed)
{
        char            cmd_line[512];
        int32           i;
        int32           field;
        ldtentry_t      *leaf;
        char            result = 'u'; /* default returned if no leaf->next */
        int32           slot_number;
        char            *token;

        for (i = 0; i < nextindex; i++) {
                slot_number = stbl[i];
                leaf = (ldtentry_t *) &(slot[slot_number]);

redisplay2:
                printf("stbl[%d] = %d\n", i, slot_number);
                printf("[1] inumber\t%d\n", leaf->inumber);
                printf("[2] next\t%d\n", leaf->next);
                printf("[3] namlen\t%d\n", leaf->namlen);
#ifdef _JFS_UNICODE
                printf("[4] name\t%.13ls\n", leaf->name);
#else
                printf("[4] name\t%.26s\n", leaf->name);
#endif

retry2:
                fputs("dtree: Press enter for next, [m]odify, [u]p, or e[x]it > ",
                        stdout);
                gets(cmd_line);
                token = strtok(cmd_line, "      ");
                if (token) {
                        if (*token == 'u' || *token == 'x' )
                                return *token;
                        if (*token == 'm') {
                                field = m_parse(cmd_line, 4, &token);
                                if (field == 0)
                                        goto retry2;

                                switch (field)
                                {
                                case 1:
                                        leaf->inumber = strtoul(token,0,0);
                                        break;
                                case 2:
                                        leaf->next = strtoul(token,0,0);
                                        break;
                                case 3:
                                        leaf->namlen = strtoul(token,0,0);
                                        break;
                                case 4:
                                        strToUcs(leaf->name, token,
                                                 DTLHDRDATALEN);
                                        break;
                                }
                                *changed = 1;
                                goto redisplay2;
                        }
                }

                if (leaf->next >= 0) {
                        result = display_slot(slot, leaf->next, 1, changed);
                        if (result == 'u' || result == 'x')
                                return result;
                }
        }
        return result;
}