From: <kr_...@us...> - 2004-05-12 20:42:44
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5356/port/src/include Modified Files: HsPort.h Menu.h ToolBar.h Types.h Added Files: Action.h Log Message: This is a major rewrite of menu and toolbar support. The main feature is that the new API provides action based menu and toolbar. The another advantage is that now the code is more simpler and shorter. The low lever API is implemented only under Linux for now. --- NEW FILE: Action.h --- #ifndef ACTION_H #define ACTION_H #include "Types.h" ActionHandle osCreateAction(); ActionHandle osCreateCheckAction(); ActionHandle osCreateRadioAction(); ActionHandle osCreateDropDownAction(MenuHandle menu); void osSetActionRadioGroup(ActionHandle *handles); void osSetActionBitmap(ActionHandle action, BitmapHandle bitmap); void osSetActionEnabled(ActionHandle action, BOOL enabled); BOOL osGetActionEnabled(ActionHandle toolButton); void osSetActionTip(ActionHandle action, char *text); char *osGetActionTip(ActionHandle action); void osSetActionText(ActionHandle action, char *text); char *osGetActionText(ActionHandle action); void osSetActionShortText(ActionHandle action, char *text); char *osGetActionShortText(ActionHandle action); void osSetActionChecked(ActionHandle action, BOOL checked); BOOL osGetActionChecked(ActionHandle action); void osSetActionAccel(ActionHandle action, int key, unsigned int mods); void osGetActionAccel(ActionHandle action, int *key, unsigned int *mods); void osDestroyAction(ActionHandle action); #endif Index: HsPort.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/HsPort.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** HsPort.h 24 Nov 2003 23:22:39 -0000 1.11 --- HsPort.h 12 May 2004 20:42:34 -0000 1.12 *************** *** 26,27 **** --- 26,29 ---- #include "port/Notebook.h" #include "port/GroupBox.h" + #include "port/Action.h" + Index: Menu.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Menu.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Menu.h 15 Nov 2003 10:31:50 -0000 1.9 --- Menu.h 12 May 2004 20:42:34 -0000 1.10 *************** *** 1,38 **** ! #ifndef MENU_H ! #define MENU_H ! ! #include "Types.h" ! ! MenuHandle osCreatePopupMenu(); ! void osTrackPopupMenu(MenuHandle handle, WindowHandle hwnd, int x, int y); ! ! MenuHandle osInsertMenu(MenuHandle parent, int pos); ! MenuHandle osInsertMenuItem(MenuHandle parent, int pos); ! MenuHandle osInsertMenuCheckItem(MenuHandle parent, int pos); ! MenuHandle osInsertMenuSeparatorItem(MenuHandle parent, int pos); ! MenuHandle osInsertMenuRadioItem(MenuHandle parent, int pos); ! ! void osSetMenuRadioGroup(MenuHandle *handles); ! ! void osDestroyMenu(MenuHandle handle); ! ! int osGetMenuItemCount(MenuHandle handle); ! ! void osSetMenuItemEnabled(MenuHandle item, BOOL bState); ! BOOL osGetMenuItemEnabled(MenuHandle item); ! void osSetMenuItemChecked(MenuHandle item, BOOL bState); ! BOOL osGetMenuItemChecked(MenuHandle item); ! ! void osSetMenuLabel(MenuHandle item, char* title); ! char *osGetMenuLabel(MenuHandle item); ! void osSetMenuTip(MenuHandle item, char* tip); ! char *osGetMenuTip(MenuHandle item); ! ! void osSetMenuItemAccel(MenuHandle item, int key, unsigned int mods); ! void osGetMenuItemAccel(MenuHandle item, int *key, unsigned int *mods); ! ! void osSetMenuItemBitmap(MenuHandle handle, BitmapHandle bitmap); ! ! int osGetMenuItemPos(MenuHandle handle); ! ! #endif --- 1,25 ---- ! #ifndef MENU_H ! #define MENU_H ! ! #include "Types.h" ! ! MenuHandle osCreatePopupMenu(); ! void osTrackPopupMenu(MenuHandle handle, WindowHandle hwnd, int x, int y); ! ! MenuHandle osInsertMenu(MenuHandle parent, int pos); ! MenuHandle osInsertMenuItem(ActionHandle haction, MenuHandle hmenu, int pos); ! MenuHandle osInsertMenuSeparatorItem(MenuHandle parent, int pos); ! ! void osDestroyMenu(MenuHandle handle); ! ! int osGetMenuItemCount(MenuHandle handle); ! ! void osSetMenuItemEnabled(MenuHandle item, BOOL bState); ! BOOL osGetMenuItemEnabled(MenuHandle item); ! ! void osSetMenuLabel(MenuHandle item, char* title); ! char *osGetMenuLabel(MenuHandle item); ! ! int osGetMenuItemPos(MenuHandle handle); ! ! #endif Index: ToolBar.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/ToolBar.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ToolBar.h 31 Aug 2003 12:56:26 -0000 1.8 --- ToolBar.h 12 May 2004 20:42:34 -0000 1.9 *************** *** 8,28 **** int osGetToolBarButtonCount(WindowHandle toolbar); ! ToolHandle osInsertToolButton(WindowHandle toolbar, int pos); ! ToolHandle osInsertToolCheckButton(WindowHandle toolbar, int pos); ! ToolHandle osInsertToolRadioButton(WindowHandle toolBar, int pos); ! ToolHandle osInsertToolDropDownButton(WindowHandle toolBar, MenuHandle hmenu, int pos); ToolHandle osInsertToolLine(WindowHandle toolbar, int pos); - void osSetToolRadioGroup(ToolHandle *handles); - void osSetToolButtonBitmap(ToolHandle toolButton, BitmapHandle bitmap); - void osSetToolButtonEnabled(ToolHandle toolButton, BOOL bEnabled); - BOOL osGetToolButtonEnabled(ToolHandle toolButton); - void osSetToolButtonTip(ToolHandle toolButton, char *text); - char *osGetToolButtonTip(ToolHandle toolButton); - void osSetToolButtonText(ToolHandle toolButton, char *text); - char *osGetToolButtonText(ToolHandle toolButton); void osDestroyToolItem(ToolHandle toolItem); int osGetToolItemPos(ToolHandle toolItem); - void osSetToolButtonChecked(ToolHandle toolButton, BOOL bState); - BOOL osGetToolButtonChecked(ToolHandle toolButton); #endif --- 8,15 ---- int osGetToolBarButtonCount(WindowHandle toolbar); ! ToolHandle osInsertToolButton(ActionHandle action, WindowHandle toolbar, int pos); ToolHandle osInsertToolLine(WindowHandle toolbar, int pos); void osDestroyToolItem(ToolHandle toolItem); int osGetToolItemPos(ToolHandle toolItem); #endif Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Types.h 8 May 2004 09:21:10 -0000 1.22 --- Types.h 12 May 2004 20:42:34 -0000 1.23 *************** *** 49,52 **** --- 49,54 ---- typedef struct ToolHandle *ToolHandle; + typedef struct ActionHandle *ActionHandle; + typedef struct IndicatorHandle { *************** *** 114,121 **** typedef GtkWidget *MenuHandle; - typedef GtkWidget *MenuItemHandle; typedef GtkWidget *ToolHandle; typedef GtkWidget *IndicatorHandle; --- 116,124 ---- typedef GtkWidget *MenuHandle; typedef GtkWidget *ToolHandle; + typedef struct ActionHandle *ActionHandle; + typedef GtkWidget *IndicatorHandle; |