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

Go to the source code of this file.

Classes

struct  _toolbar_item_
 
struct  _toolbar_
 

Macros

#define TOOLBAR_STATE_NORMAL   0
 
#define TOOLBAR_STATE_HOVER   1
 
#define TOOLBAR_STATE_PRESSED   2
 
#define TOOLBAR_STATE_ACTIVE   3
 
#define TOOLBAR_STATE_DISABLED   4
 
#define TOOLBAR_MAX_ITEMS   64
 
#define TOOLBAR_BTN_PADDING   6
 
#define TOOLBAR_SEP_THICKNESS   1
 
#define TOOLBAR_SEP_MARGIN   4
 
#define TOOLBAR_OVERFLOW_BTN_SZ   14
 

Typedefs

typedef enum _titemType_ ToolBarItemType
 
typedef enum _toolbar_orientation_ ChToolbarOrientation
 
typedef struct _toolbar_item_ ChToolBarItem
 
typedef struct _toolbar_ ChToolbar
 

Enumerations

enum  _titemType_ {
  TOOLBAR_ITEM_BUTTON , TOOLBAR_ITEM_TOGGLE , TOOLBAR_ITEM_RADIO , TOOLBAR_ITEM_SEPARATOR ,
  TOOLBAR_ITEM_WIDGET
}
 
enum  _toolbar_orientation_ { TOOLBAR_HORIZONTAL , TOOLBAR_VERTICAL }
 

Functions

XE_EXPORT ChToolbarChToolbarCreate (int x, int y, int w, int h, uint8_t orientation)
 
XE_EXPORT int ChToolbarAddButton (ChToolbar *tb, ChIcon *icon, int iw, int ih, const char *tooltip, void *ud)
 
XE_EXPORT int ChToolbarAddToggle (ChToolbar *tb, ChIcon *icon, int iw, int ih, const char *tooltip, void *ud)
 
XE_EXPORT int ChToolbarAddRadio (ChToolbar *tb, ChIcon *icon, int iw, int ih, const char *tooltip, uint8_t groupID, void *ud)
 
XE_EXPORT int ChToolbarAddSeparator (ChToolbar *tb)
 
XE_EXPORT int ChToolbarAddWidget (ChToolbar *tb, ChWidget *child, int childW, int childH)
 
XE_EXPORT void ChToolbarSetEnabled (ChToolbar *tb, int index, int enabled)
 
XE_EXPORT void ChToolbarSetActive (ChToolbar *tb, int index, int active)
 

Macro Definition Documentation

◆ TOOLBAR_BTN_PADDING

#define TOOLBAR_BTN_PADDING   6

◆ TOOLBAR_MAX_ITEMS

#define TOOLBAR_MAX_ITEMS   64

◆ TOOLBAR_OVERFLOW_BTN_SZ

#define TOOLBAR_OVERFLOW_BTN_SZ   14

◆ TOOLBAR_SEP_MARGIN

#define TOOLBAR_SEP_MARGIN   4

◆ TOOLBAR_SEP_THICKNESS

#define TOOLBAR_SEP_THICKNESS   1

◆ TOOLBAR_STATE_ACTIVE

#define TOOLBAR_STATE_ACTIVE   3

◆ TOOLBAR_STATE_DISABLED

#define TOOLBAR_STATE_DISABLED   4

◆ TOOLBAR_STATE_HOVER

#define TOOLBAR_STATE_HOVER   1

◆ TOOLBAR_STATE_NORMAL

#define TOOLBAR_STATE_NORMAL   0

◆ TOOLBAR_STATE_PRESSED

#define TOOLBAR_STATE_PRESSED   2

Typedef Documentation

◆ ChToolbar

typedef struct _toolbar_ ChToolbar

◆ ChToolBarItem

typedef struct _toolbar_item_ ChToolBarItem

◆ ChToolbarOrientation

◆ ToolBarItemType

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.

Enumeration Type Documentation

◆ _titemType_

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.

Enumerator
TOOLBAR_ITEM_BUTTON 
TOOLBAR_ITEM_TOGGLE 
TOOLBAR_ITEM_RADIO 
TOOLBAR_ITEM_SEPARATOR 
TOOLBAR_ITEM_WIDGET 

◆ _toolbar_orientation_

Enumerator
TOOLBAR_HORIZONTAL 
TOOLBAR_VERTICAL 

Function Documentation

◆ ChToolbarAddButton()

XE_EXPORT int ChToolbarAddButton ( ChToolbar tb,
ChIcon icon,
int  iw,
int  ih,
const char *  tooltip,
void *  ud 
)

◆ ChToolbarAddRadio()

XE_EXPORT int ChToolbarAddRadio ( ChToolbar tb,
ChIcon icon,
int  iw,
int  ih,
const char *  tooltip,
uint8_t  groupID,
void *  ud 
)

◆ ChToolbarAddSeparator()

XE_EXPORT int ChToolbarAddSeparator ( ChToolbar tb)

◆ ChToolbarAddToggle()

XE_EXPORT int ChToolbarAddToggle ( ChToolbar tb,
ChIcon icon,
int  iw,
int  ih,
const char *  tooltip,
void *  ud 
)

◆ ChToolbarAddWidget()

XE_EXPORT int ChToolbarAddWidget ( ChToolbar tb,
ChWidget child,
int  childW,
int  childH 
)

◆ ChToolbarCreate()

XE_EXPORT ChToolbar * ChToolbarCreate ( int  x,
int  y,
int  w,
int  h,
uint8_t  orientation 
)

◆ ChToolbarSetActive()

XE_EXPORT void ChToolbarSetActive ( ChToolbar tb,
int  index,
int  active 
)

◆ ChToolbarSetEnabled()

XE_EXPORT void ChToolbarSetEnabled ( ChToolbar tb,
int  index,
int  enabled 
)