mGUtils API Reference  v1.2.0
A component of MiniGUI providing users with a number of common dialog templates
Data Structures | Macros | Typedefs | Functions
mgutils.h File Reference

This file includes interfaces of mGUtils. More...

#include "mgutilsconfig.h"
#include <sys/types.h>
#include <dirent.h>

Go to the source code of this file.

Data Structures

struct  _myWinButton
 
struct  _myWinEntry
 
struct  _CHILDINFO
 
struct  _NEWFILEDLGDATA
 
struct  _COLORDATA
 
struct  skin_item_s
 
struct  skin_item_ops_s
 
struct  sie_slider_s
 
struct  si_nrmlabel_s
 
struct  si_bmplabel_s
 
struct  si_nrmslider_s
 
struct  si_rotslider_s
 
struct  skin_head_s
 

Macros

#define FILE_ERROR_OK   0
 Open file success. More...
 
#define FILE_ERROR_PARAMERR   -1
 Wrong parameters. More...
 
#define MAX_FILTER_LEN   255
 The maximum length of filter string. More...
 
#define MY_NAMEMAX   127
 The maximum length of name. More...
 
#define MY_PATHMAX   255
 The maximum length of path. More...
 
#define SI_TYPE_NRMLABEL   0x10000000
 
#define SI_TYPE_BMPLABEL   0x20000000
 
#define SI_TYPE_CMDBUTTON   0x30000000
 
#define SI_TYPE_CHKBUTTON   0x40000000
 
#define SI_TYPE_NRMSLIDER   0x50000000
 
#define SI_TYPE_ROTSLIDER   0x60000000
 
#define SI_TYPE_CONTROL   0x70000000
 The item is a control. More...
 
#define SI_TYPE_MASK   0xF0000000
 The item type mask. More...
 
#define SI_TEST_SHAPE_RECT   0x01000000
 
#define SI_TEST_SHAPE_ELLIPSE   0x02000000
 
#define SI_TEST_SHAPE_LOZENGE   0x03000000
 
#define SI_TEST_SHAPE_LTRIANGLE   0x04000000
 
#define SI_TEST_SHAPE_RTRIANGLE   0x05000000
 
#define SI_TEST_SHAPE_UTRIANGLE   0x06000000
 
#define SI_TEST_SHAPE_DTRIANGLE   0x07000000
 
#define SI_STATUS_OK   0x00000001
 
#define SI_STATUS_VISIBLE   0x00000002
 
#define SI_STATUS_DISABLED   0x00000004
 
#define SI_STATUS_HILIGHTED   0x00000008
 
#define SI_BTNSTATUS_CLICKED   0x00000010
 
#define SI_BTNSTATUS_CHECKED   SI_BTNSTATUS_CLICKED
 
#define SI_CMDBUTTON_2STATE   0x00000100
 
#define SI_NRMSLIDER_HORZ   0x00000100
 
#define SI_NRMSLIDER_VERT   0x00000200
 
#define SI_NRMSLIDER_STATIC   0x00000400
 
#define SI_ROTSLIDER_CW   0x00000100
 
#define SI_ROTSLIDER_ANTICW   0x00000200
 
#define SI_ROTSLIDER_STATIC   0x00000400
 
#define CTRL_SKIN   "skin"
 The class name of skin control. More...
 
#define SIE_BUTTON_CLICKED   0x00000001
 
#define SIE_SLIDER_CHANGED   0x00000002
 
#define SIE_GAIN_FOCUS   0x00010000
 
#define SIE_LOST_FOCUS   0x00020000
 
#define MSG_CB_GOON   0
 
#define MSG_CB_DEF_GOON   1
 
#define MSG_CB_STOP   2
 
#define SKIN_STYLE_NONE   0x00000000
 The style of the skin is none. More...
 
#define SKIN_STYLE_TOOLTIP   0x00000001
 
#define SKIN_STYLE_MODAL   0x00000002
 The skin has modal window. More...
 
#define create_skin_main_window(skin, hosting, lx, ty, rx, by, modal)   create_skin_main_window_ex (skin, hosting, lx, ty, rx, by, 0, modal)
 

Typedefs

typedef struct _myWinButton myWINBUTTON
 
typedef struct _myWinEntry myWINENTRY
 
typedef struct _CHILDINFO CHILDINFO
 
typedef CHILDINFOPCHILDINFO
 
typedef struct _NEWFILEDLGDATA NEWFILEDLGDATA
 
typedef NEWFILEDLGDATAPNEWFILEDLGDATA
 
typedef struct _COLORDATA COLORDATA
 
typedef struct skin_item_ops_s skin_item_ops_t
 
typedef struct skin_head_s skin_head_t
 
typedef struct skin_item_s skin_item_t
 
typedef struct sie_slider_s sie_slider_t
 
typedef struct si_nrmlabel_s si_nrmlabel_t
 
typedef struct si_bmplabel_s si_bmplabel_t
 
typedef struct si_nrmslider_s si_nrmslider_t
 
typedef struct si_rotslider_s si_rotslider_t
 
typedef int(* skin_event_cb_t) (HWND hwnd, skin_item_t *item, int event, void *data)
 
typedef int(* skin_msg_cb_t) (HWND hwnd, int message, WPARAM wparam, LPARAM lparam, int *result)
 

Functions

MGUTILS_EXPORT int myMessageBox (HWND hwnd, DWORD dwStyle, const char *title, const char *text,...)
 Creates a message box. More...
 
MGUTILS_EXPORT int myWinMessage (HWND hwnd, const char *title, const char *button1, const char *text,...)
 Creates a message box within only one button. More...
 
MGUTILS_EXPORT int myWinChoice (HWND hwnd, const char *title, const char *button1, const char *button2, const char *text,...)
 Creates a message box within two buttons. More...
 
MGUTILS_EXPORT int myWinTernary (HWND hwnd, const char *title, const char *button1, const char *button2, const char *button3, const char *text,...)
 Creates a message box within three buttons. More...
 
MGUTILS_EXPORT void errorWindow (HWND hwnd, const char *str, const char *title)
 A MiniGUI edition of perror. More...
 
MGUTILS_EXPORT HWND createStatusWin (HWND hParentWnd, int width, int height, const char *title, const char *text,...)
 Creates a status main window. More...
 
MGUTILS_EXPORT void destroyStatusWin (HWND hwnd)
 Destroies a status window. More...
 
MGUTILS_EXPORT HWND createProgressWin (HWND hParentWnd, const char *title, const char *label, int id, int range)
 Creates a main window within a progress bar. More...
 
MGUTILS_EXPORT void destroyProgressWin (HWND hwnd)
 Destroies progress window. More...
 
MGUTILS_EXPORT int myWinMenu (HWND hParentWnd, const char *title, const char *label, int width, int listboxheight, char **items, int *listItem, myWINBUTTON *buttons)
 Creates a menu main window for the user to select an item. More...
 
MGUTILS_EXPORT int myWinEntries (HWND hParentWnd, const char *title, const char *label, int width, int editboxwidth, BOOL fIME, myWINENTRY *items, myWINBUTTON *buttons)
 Creates a entry main window for the user to enter something. More...
 
MGUTILS_EXPORT int myWinHelpMessage (HWND hwnd, int width, int height, const char *help_title, const char *help_msg)
 Creates a help message window. More...
 
void * VCOnMiniGUI (void *data)
 Creates a vcongui main window. More...
 
MGUTILS_EXPORT BOOL ShowCommonDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, void *private_data)
 
MGUTILS_EXPORT BOOL FileOpenSaveDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PFILEDLGDATA pfdd)
 
MGUTILS_EXPORT LRESULT DefFileDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
MGUTILS_EXPORT int ShowOpenDialog (HWND hWnd, int lx, int ty, int w, int h, PNEWFILEDLGDATA pnfdd)
 Creates an Open File Dialog Box. More...
 
void RGB2HSV (Uint8 r, Uint8 g, Uint8 b, Uint16 *hout, Uint8 *sout, Uint8 *vout)
 Converts r/g/b values of a color in RGB color space to h/s/v of the color in HSV color space. More...
 
void HSV2RGB (Uint16 hin, Uint8 sin, Uint8 vin, Uint8 *rout, Uint8 *gout, Uint8 *bout)
 Converts h/s/v values of a color to r/g/b values of the color. More...
 
void YUV2RGB (int y, int u, int v, Uint8 *r, Uint8 *g, Uint8 *b)
 Converts y/u/v values of a color in YUV color space to to r/g/b values of the color in RGB color space. More...
 
MG_EXPORT void RGB2YUV (Uint8 r, Uint8 g, Uint8 b, int *y, int *u, int *v)
 Converts r/g/b values of a color in RGB color space to y/u/v values of the color in YUV color space. More...
 
MGUTILS_EXPORT BOOL ColorSelectDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PCOLORDLGDATA pcdd)
 
MGUTILS_EXPORT LRESULT DefColorDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
MGUTILS_EXPORT int ColorSelDialog (HWND hWnd, int x, int y, int w, int h, PCOLORDATA pClrData)
 Creates a Color Selection Dialog Box. More...
 
MGUTILS_EXPORT BOOL FontSelectDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PFONTDLGDATA pfsd)
 
MGUTILS_EXPORT LRESULT DefFontDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
MGUTILS_EXPORT BOOL InfoShowDialog (PDLGTEMPLATE dlg_template, HWND hwnd, WNDPROC proc, PINFODLGDATA pidd)
 
MGUTILS_EXPORT LRESULT DefInfoDialogProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
MGUTILS_EXPORT BOOL skin_init (skin_head_t *skin, skin_event_cb_t event_cb, skin_msg_cb_t msg_cb)
 Initializes a skin. More...
 
MGUTILS_EXPORT void skin_deinit (skin_head_t *skin)
 Deinitializes an initialized skin. More...
 
MGUTILS_EXPORT HWND create_skin_main_window_ex (skin_head_t *skin, HWND hosting, int lx, int ty, int rx, int by, DWORD dwExStyle, BOOL modal)
 Creates a main window for a skin. More...
 
MGUTILS_EXPORT HWND create_skin_control (skin_head_t *skin, HWND parent, int id, int x, int y, int w, int h)
 Creates a control for a skin. More...
 
MGUTILS_EXPORT BOOL is_skin_main_window (HWND hwnd)
 Determines whether a window is a skin main window or not. More...
 
MGUTILS_EXPORT void destroy_skin_window (HWND hwnd)
 Destroys a skin window. More...
 
MGUTILS_EXPORT skin_head_tset_window_skin (HWND hwnd, skin_head_t *new_skin)
 Sets new skin. More...
 
MGUTILS_EXPORT skin_head_tget_window_skin (HWND hwnd)
 Gets new skin. More...
 
static skin_event_cb_t skin_set_event_cb (skin_head_t *skin, skin_event_cb_t event_cb)
 Sets new event callback of a skin. More...
 
static skin_msg_cb_t skin_set_msg_cb (skin_head_t *skin, skin_msg_cb_t msg_cb)
 Sets new message callback of a skin window. More...
 
MGUTILS_EXPORT skin_item_tskin_get_item (skin_head_t *skin, int id)
 Retrives a skin item through its identifier. More...
 
MGUTILS_EXPORT DWORD skin_get_item_status (skin_head_t *skin, int id)
 Retrives the common status of a skin item. More...
 
MGUTILS_EXPORT DWORD skin_set_item_status (skin_head_t *skin, int id, DWORD status)
 Set the common status of a skin item. More...
 
MGUTILS_EXPORT skin_item_tskin_get_hilited_item (skin_head_t *skin)
 Gets the current highlighted skin item. More...
 
MGUTILS_EXPORT DWORD skin_show_item (skin_head_t *skin, int id, BOOL show)
 Showes or hides a skin item. More...
 
MGUTILS_EXPORT DWORD skin_enable_item (skin_head_t *skin, int id, BOOL enable)
 Enables or disables a skin item. More...
 
MGUTILS_EXPORT skin_item_tskin_set_hilited_item (skin_head_t *skin, int id)
 Sets the current highlighted skin item. More...
 
MGUTILS_EXPORT BOOL skin_get_check_status (skin_head_t *skin, int id)
 Gets the check status of a check button item. More...
 
MGUTILS_EXPORT DWORD skin_set_check_status (skin_head_t *skin, int id, BOOL check)
 Sets the check status of a check button item. More...
 
MGUTILS_EXPORT const char * skin_get_item_label (skin_head_t *skin, int id)
 Gets the label string of a label item. More...
 
MGUTILS_EXPORT BOOL skin_set_item_label (skin_head_t *skin, int id, const char *label)
 Sets the label string of a label item. More...
 
MGUTILS_EXPORT HWND skin_get_control_hwnd (skin_head_t *skin, int id)
 Gets the handle to a skin control item in the skin. More...
 
MGUTILS_EXPORT int skin_get_thumb_pos (skin_head_t *skin, int id)
 Gets the thumb position of a slider item. More...
 
MGUTILS_EXPORT BOOL skin_set_thumb_pos (skin_head_t *skin, int id, int pos)
 Sets the thumb position of a slider item. More...
 
MGUTILS_EXPORT BOOL skin_get_slider_info (skin_head_t *skin, int id, sie_slider_t *sie)
 Retrives the sliding information of a slider item. More...
 
MGUTILS_EXPORT BOOL skin_set_slider_info (skin_head_t *skin, int id, const sie_slider_t *sie)
 Sets the sliding information of a slider item. More...
 
MGUTILS_EXPORT int skin_scale_slider_pos (const sie_slider_t *org, int new_min, int new_max)
 Scales the sliding position. More...
 

Detailed Description

This file includes interfaces of mGUtils.

Date
2007/12/26
   This file is part of mGUtils, a component for MiniGUI.

   Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
   Copyright (C) 1998~2002, WEI Yongming

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

   Or,

   As this program is a library, any link to this program must follow
   GNU General Public License version 3 (GPLv3). If you cannot accept
   GPLv3, you need to be licensed from FMSoft.

   If you have got a commercial license of this program, please use it
   under the terms and conditions of the commercial license.

   For more information about the commercial license, please refer to
   <http://www.minigui.com/en/about/licensing-policy/>.

Definition in file mgutils.h.