XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
listview.h File Reference
#include "base.h"
#include "../chitralekha.h"
#include "window.h"
#include "scrollbar.h"
#include <_xeneva.h>
#include "icon.h"
Include dependency graph for listview.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _list_column_
 
struct  _ListItem_
 
struct  _List_View_
 

Macros

#define LIST_VIEW_MAX_TEXT   64
 
#define LIST_VIEW_MAX_COMUMNS   8
 
#define LIST_VIEW_ICON_COLUMN_DEFAULT_W   20
 
#define LIST_VIEW_ICON_PADDING   4
 

Typedefs

typedef struct _list_column_ ListColumn
 
typedef struct _ListItem_ ListItem
 
typedef struct _List_View_ ListView
 

Functions

XE_EXPORT ListViewChListViewCreate (int x, int y, int w, int h, int itemHeight)
 ChListViewCreate – create a new list view.
 
XE_EXPORT ListItemListViewAddItem (ListView *lv, const char **cell_texts, int cell_count, void *user_data)
 ListViewAddItem – add a new item to the listview.
 
XE_EXPORT void ListViewSetItemIcon (ListView *lv, int index, ChIcon *icon, int iconW, int iconH)
 ListViewSetItemIcon – add a icon to the item.
 
XE_EXPORT void ListViewAddColumn (ListView *lv, const char *header, int width, int minWidth)
 
XE_EXPORT void ListViewRemoveItem (ListView *lv, int index)
 
XE_EXPORT void ListViewClear (ListView *lv)
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ LIST_VIEW_ICON_COLUMN_DEFAULT_W

#define LIST_VIEW_ICON_COLUMN_DEFAULT_W   20

◆ LIST_VIEW_ICON_PADDING

#define LIST_VIEW_ICON_PADDING   4

◆ LIST_VIEW_MAX_COMUMNS

#define LIST_VIEW_MAX_COMUMNS   8

◆ LIST_VIEW_MAX_TEXT

#define LIST_VIEW_MAX_TEXT   64

Typedef Documentation

◆ ListColumn

typedef struct _list_column_ ListColumn

◆ ListItem

typedef struct _ListItem_ ListItem

◆ ListView

typedef struct _List_View_ ListView

Function Documentation

◆ ChListViewCreate()

XE_EXPORT ListView * ChListViewCreate ( int  x,
int  y,
int  w,
int  h,
int  itemHeight 
)

ChListViewCreate – create a new list view.

Parameters
x– X location within the window
y– Y location within the window
w– Width of the view
h– Height of the view
itemHeight– each row item height

◆ ListViewAddColumn()

XE_EXPORT void ListViewAddColumn ( ListView lv,
const char *  header,
int  width,
int  minWidth 
)

◆ ListViewAddItem()

XE_EXPORT ListItem * ListViewAddItem ( ListView lv,
const char **  cell_texts,
int  cell_count,
void *  user_data 
)

ListViewAddItem – add a new item to the listview.

Parameters
lv– pointer to the list view
cell_texts– item text with each column details
cell_count– number of cells
user_data– any data that this item holds

◆ ListViewClear()

XE_EXPORT void ListViewClear ( ListView lv)

◆ ListViewRemoveItem()

XE_EXPORT void ListViewRemoveItem ( ListView lv,
int  index 
)

◆ ListViewSetItemIcon()

XE_EXPORT void ListViewSetItemIcon ( ListView lv,
int  index,
ChIcon icon,
int  iconW,
int  iconH 
)

ListViewSetItemIcon – add a icon to the item.

Parameters
lv– pointer to the list view
index– item index number
icon– icon to add
iconW– icon width
iconH– icon height