XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
window.h File Reference
#include <stdint.h>
#include "../chitralekha.h"
#include "../color.h"
#include "../draw.h"
#include "base.h"
#include "list.h"
#include <setjmp.h>
Include dependency graph for window.h:

Go to the source code of this file.

Classes

struct  _ChSharedWin_
 
struct  _chwin_
 
struct  _ChWidget_
 
struct  _global_ctrl_
 
struct  _popup_sh_win_
 
struct  _popup_win_
 

Macros

#define CHITRALEKHA_DEFAULT_WIN_WIDTH   400
 
#define CHITRALEKHA_DEFAULT_WIN_HEIGHT   300
 
#define CHITRALEKHA_WINDOW_DEFAULT_PAD_Y   26
 
#define CHITRALEKHA_WINDOW_DEFAULT_PAD_X   1
 
#define WINDOW_GLOBAL_CONTROL_CLOSE   1
 
#define WINDOW_GLOBAL_CONTROL_MAXIMIZE   2
 
#define WINDOW_GLOBAL_CONTROL_MINIMIZE   3
 
#define WINDOW_GLOBAL_CONTROL_CUSTOM   4
 
#define WINDOW_FLAG_MOVABLE   (1 << 0)
 
#define WINDOW_FLAG_STATIC   (1 << 1)
 
#define WINDOW_FLAG_ALWAYS_ON_TOP   (1 << 2)
 
#define WINDOW_FLAG_NON_RESIZABLE   (1 << 3)
 
#define WINDOW_FLAG_BROADCAST_LISTENER   (1 << 4)
 
#define WINDOW_FLAG_ANIMATED   (1 << 5)
 
#define WINDOW_FLAG_BLOCKED   (1 << 6)
 
#define WINDOW_FLAG_MESSAGEBOX   (1 << 7)
 
#define WINDOW_FLAG_DIALOGBOX   (1 << 8)
 
#define WINDOW_FLAG_ANIMATION_FADE_IN   (1 << 9)
 
#define WINDOW_FLAG_ANIMATION_FADE_OUT   (1 << 10)
 
#define WINDOW_FLAG_POPUP   (1 << 11)
 
#define WINDOW_FLAG_GLASS   (1 << 12)
 
#define CHITRALEKHA_WIDGET_TYPE_CONTROL   (1 << 1)
 
#define CHITRALEKHA_WIDGET_TYPE_POPUP   (1 << 2)
 
#define CHITRALEKHA_WIDGET_SCROLL_HORIZONTAL   0
 
#define CHITRALEKHA_WIDGET_SCROLL_VERTICAL   1
 
#define WINDOW_HANDLE_TYPE_NORMAL   1
 
#define WINDOW_HANDLE_TYPE_POPUP   2
 

Typedefs

typedef struct _ChSharedWin_ ChSharedWinInfo
 
typedef struct _chwin_ ChWindow
 
typedef struct _ChWidget_ ChWidget
 
typedef struct _global_ctrl_ ChWinGlobalControl
 
typedef struct _popup_sh_win_ ChPopupSharedWin
 
typedef struct _popup_win_ ChPopupWindow
 

Functions

XE_LIB ChWindow * ChCreateWindow (ChitralekhaApp *app, uint16_t attrib, char *title, int x, int y, int w, int h)
 
XE_LIB void ChWindowAddSubWindow (ChWindow *parent, ChWindow *win)
 
XE_LIB void ChWindowBroadcastIcon (ChitralekhaApp *app, char *iconfile)
 
XE_LIB void ChWindowPaint (ChWindow *win)
 
XE_LIB void ChWindowUpdate (ChWindow *win, int x, int y, int w, int h, bool updateEntireWin, bool dirty)
 
XE_LIB void ChWindowHide (ChWindow *win)
 
XE_LIB uint32_t ChGetWindowHandle (ChitralekhaApp *app, char *title)
 
XE_LIB void ChWindowHandleMouse (ChWindow *win, int x, int y, int button)
 
XE_LIB void ChWindowHandleTouch (ChWindow *win, int x, int y, int button)
 
XE_LIB void ChWindowSetFocused (ChWindow *win)
 
XE_LIB void ChWindowHandleFocus (ChWindow *win, bool focus_val, uint32_t handle)
 
XE_LIB uint32_t ChWindowGetBackgroundColor (ChWindow *win)
 
XE_LIB void ChWindowAddWidget (ChWindow *win, ChWidget *wid)
 
XE_LIB ChWindow * ChGetWindowByHandle (ChWindow *mainWin, int handle)
 
XE_LIB ChWindow * ChGetPopupWindowByHandle (ChWindow *mainWin, int handle)
 
XE_LIB void ChPopupWindowHandleMouse (ChWindow *win, int x, int y, int button)
 
XE_LIB void ChWindowSetFlags (ChWindow *win, uint16_t flags)
 
XE_LIB void ChWindowSetGlassMorphism (ChWindow *win, uint8_t alpha)
 
XE_LIB void ChWindowMove (ChWindow *win, int newX, int newY)
 
XE_LIB void ChWindowRegisterJump (ChWindow *win)
 
XE_LIB void ChWindowCloseWindow (ChWindow *win)
 
XE_LIB ChWindow * ChCreatePopupWindow (ChWindow *win, int x, int y, int w, int h, uint16_t flags, char *title)
 
XE_LIB void ChPopupWindowUpdate (ChPopupWindow *pw, int x, int y, int w, int h)
 
XE_LIB void ChPopupWindowShow (ChWindow *pw, ChWindow *win)
 
XE_LIB void ChPopupWindowUpdateLocation (ChWindow *pwin, ChWindow *win, int x, int y)
 
XE_LIB void ChPopupWindowHide (ChWindow *pw, ChWindow *parent)
 
XE_LIB void ChWindowHandleDestroyBuffer (ChWindow *win)
 
XE_LIB void ChWindowHandleReinitBuffer (ChWindow *win, int bufferkey)
 ChWindowHandleReinitBuffer – reinitialize back buffer with requested size.
 

Macro Definition Documentation

◆ CHITRALEKHA_DEFAULT_WIN_HEIGHT

#define CHITRALEKHA_DEFAULT_WIN_HEIGHT   300

◆ CHITRALEKHA_DEFAULT_WIN_WIDTH

#define CHITRALEKHA_DEFAULT_WIN_WIDTH   400

BSD 2-Clause License

Copyright (c) 2022-2023, 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.

◆ CHITRALEKHA_WIDGET_SCROLL_HORIZONTAL

#define CHITRALEKHA_WIDGET_SCROLL_HORIZONTAL   0

◆ CHITRALEKHA_WIDGET_SCROLL_VERTICAL

#define CHITRALEKHA_WIDGET_SCROLL_VERTICAL   1

◆ CHITRALEKHA_WIDGET_TYPE_CONTROL

#define CHITRALEKHA_WIDGET_TYPE_CONTROL   (1 << 1)

◆ CHITRALEKHA_WIDGET_TYPE_POPUP

#define CHITRALEKHA_WIDGET_TYPE_POPUP   (1 << 2)

◆ CHITRALEKHA_WINDOW_DEFAULT_PAD_X

#define CHITRALEKHA_WINDOW_DEFAULT_PAD_X   1

◆ CHITRALEKHA_WINDOW_DEFAULT_PAD_Y

#define CHITRALEKHA_WINDOW_DEFAULT_PAD_Y   26

◆ WINDOW_FLAG_ALWAYS_ON_TOP

#define WINDOW_FLAG_ALWAYS_ON_TOP   (1 << 2)

◆ WINDOW_FLAG_ANIMATED

#define WINDOW_FLAG_ANIMATED   (1 << 5)

◆ WINDOW_FLAG_ANIMATION_FADE_IN

#define WINDOW_FLAG_ANIMATION_FADE_IN   (1 << 9)

◆ WINDOW_FLAG_ANIMATION_FADE_OUT

#define WINDOW_FLAG_ANIMATION_FADE_OUT   (1 << 10)

◆ WINDOW_FLAG_BLOCKED

#define WINDOW_FLAG_BLOCKED   (1 << 6)

◆ WINDOW_FLAG_BROADCAST_LISTENER

#define WINDOW_FLAG_BROADCAST_LISTENER   (1 << 4)

◆ WINDOW_FLAG_DIALOGBOX

#define WINDOW_FLAG_DIALOGBOX   (1 << 8)

◆ WINDOW_FLAG_GLASS

#define WINDOW_FLAG_GLASS   (1 << 12)

◆ WINDOW_FLAG_MESSAGEBOX

#define WINDOW_FLAG_MESSAGEBOX   (1 << 7)

◆ WINDOW_FLAG_MOVABLE

#define WINDOW_FLAG_MOVABLE   (1 << 0)

◆ WINDOW_FLAG_NON_RESIZABLE

#define WINDOW_FLAG_NON_RESIZABLE   (1 << 3)

◆ WINDOW_FLAG_POPUP

#define WINDOW_FLAG_POPUP   (1 << 11)

◆ WINDOW_FLAG_STATIC

#define WINDOW_FLAG_STATIC   (1 << 1)

◆ WINDOW_GLOBAL_CONTROL_CLOSE

#define WINDOW_GLOBAL_CONTROL_CLOSE   1

◆ WINDOW_GLOBAL_CONTROL_CUSTOM

#define WINDOW_GLOBAL_CONTROL_CUSTOM   4

◆ WINDOW_GLOBAL_CONTROL_MAXIMIZE

#define WINDOW_GLOBAL_CONTROL_MAXIMIZE   2

◆ WINDOW_GLOBAL_CONTROL_MINIMIZE

#define WINDOW_GLOBAL_CONTROL_MINIMIZE   3

◆ WINDOW_HANDLE_TYPE_NORMAL

#define WINDOW_HANDLE_TYPE_NORMAL   1

◆ WINDOW_HANDLE_TYPE_POPUP

#define WINDOW_HANDLE_TYPE_POPUP   2

Typedef Documentation

◆ ChPopupSharedWin

◆ ChPopupWindow

typedef struct _popup_win_ ChPopupWindow

◆ ChSharedWinInfo

◆ ChWidget

typedef struct _ChWidget_ ChWidget

◆ ChWindow

typedef struct _chwin_ ChWindow

◆ ChWinGlobalControl

Function Documentation

◆ ChCreatePopupWindow()

XE_LIB ChWindow * ChCreatePopupWindow ( ChWindow *  win,
int  x,
int  y,
int  w,
int  h,
uint16_t  flags,
char *  title 
)

◆ ChCreateWindow()

XE_LIB ChWindow * ChCreateWindow ( ChitralekhaApp *  app,
uint16_t  attrib,
char *  title,
int  x,
int  y,
int  w,
int  h 
)

◆ ChGetPopupWindowByHandle()

XE_LIB ChWindow * ChGetPopupWindowByHandle ( ChWindow *  mainWin,
int  handle 
)

◆ ChGetWindowByHandle()

XE_LIB ChWindow * ChGetWindowByHandle ( ChWindow *  mainWin,
int  handle 
)

◆ ChGetWindowHandle()

XE_LIB uint32_t ChGetWindowHandle ( ChitralekhaApp *  app,
char *  title 
)

◆ ChPopupWindowHandleMouse()

XE_LIB void ChPopupWindowHandleMouse ( ChWindow *  win,
int  x,
int  y,
int  button 
)

◆ ChPopupWindowHide()

XE_LIB void ChPopupWindowHide ( ChWindow *  pw,
ChWindow *  parent 
)

◆ ChPopupWindowShow()

XE_LIB void ChPopupWindowShow ( ChWindow *  pw,
ChWindow *  win 
)

◆ ChPopupWindowUpdate()

XE_LIB void ChPopupWindowUpdate ( ChPopupWindow *  pw,
int  x,
int  y,
int  w,
int  h 
)

◆ ChPopupWindowUpdateLocation()

XE_LIB void ChPopupWindowUpdateLocation ( ChWindow *  pwin,
ChWindow *  win,
int  x,
int  y 
)

◆ ChWindowAddSubWindow()

XE_LIB void ChWindowAddSubWindow ( ChWindow *  parent,
ChWindow *  win 
)

◆ ChWindowAddWidget()

XE_LIB void ChWindowAddWidget ( ChWindow *  win,
ChWidget *  wid 
)

◆ ChWindowBroadcastIcon()

XE_LIB void ChWindowBroadcastIcon ( ChitralekhaApp *  app,
char *  iconfile 
)

◆ ChWindowCloseWindow()

XE_LIB void ChWindowCloseWindow ( ChWindow *  win)

◆ ChWindowGetBackgroundColor()

XE_LIB uint32_t ChWindowGetBackgroundColor ( ChWindow *  win)

◆ ChWindowHandleDestroyBuffer()

XE_LIB void ChWindowHandleDestroyBuffer ( ChWindow *  win)

◆ ChWindowHandleFocus()

XE_LIB void ChWindowHandleFocus ( ChWindow *  win,
bool  focus_val,
uint32_t  handle 
)

◆ ChWindowHandleMouse()

XE_LIB void ChWindowHandleMouse ( ChWindow *  win,
int  x,
int  y,
int  button 
)

◆ ChWindowHandleReinitBuffer()

XE_LIB void ChWindowHandleReinitBuffer ( ChWindow *  win,
int  bufferkey 
)

ChWindowHandleReinitBuffer – reinitialize back buffer with requested size.

Parameters
win– Pointer to window
bufferKey– shared memory key

◆ ChWindowHandleTouch()

XE_LIB void ChWindowHandleTouch ( ChWindow *  win,
int  x,
int  y,
int  button 
)

◆ ChWindowHide()

XE_LIB void ChWindowHide ( ChWindow *  win)

◆ ChWindowMove()

XE_LIB void ChWindowMove ( ChWindow *  win,
int  newX,
int  newY 
)

◆ ChWindowPaint()

XE_LIB void ChWindowPaint ( ChWindow *  win)

◆ ChWindowRegisterJump()

XE_LIB void ChWindowRegisterJump ( ChWindow *  win)

◆ ChWindowSetFlags()

XE_LIB void ChWindowSetFlags ( ChWindow *  win,
uint16_t  flags 
)

◆ ChWindowSetFocused()

XE_LIB void ChWindowSetFocused ( ChWindow *  win)

◆ ChWindowSetGlassMorphism()

XE_LIB void ChWindowSetGlassMorphism ( ChWindow *  win,
uint8_t  alpha 
)

◆ ChWindowUpdate()

XE_LIB void ChWindowUpdate ( ChWindow *  win,
int  x,
int  y,
int  w,
int  h,
bool  updateEntireWin,
bool  dirty 
)