CocoaMainWindow.h
Go to the documentation of this file.
00001 // ****************************************************************************
00002 // Filename:  CocoaMainWindow.h
00003 // Author:    Florian Hecht
00004 // Date:      2008
00005 // ****************************************************************************
00006 
00007 
00008 #ifndef _COCOA_MAIN_WINDOW_H_
00009 #define _COCOA_MAIN_WINDOW_H_
00010 
00011 
00012 // ****************************************************************************
00013 // Includes
00014 // ****************************************************************************
00015 
00016 #include "Interfaces/MainWindowInterface.h"
00017 #include <vector>
00018 
00019 
00020 // ****************************************************************************
00021 // Forward declarations
00022 // ****************************************************************************
00023 
00024 struct CCocoaMainWindowWidget;
00025 
00026 
00027 
00028 // ****************************************************************************
00029 // CCocoaMainWindow
00030 // ****************************************************************************
00031 
00032 class CCocoaMainWindow : public CMainWindowInterface
00033 {
00034 public:
00035         CCocoaMainWindow(int x, int y, int width, int height, const char *title);
00036         ~CCocoaMainWindow();
00037 
00038         // create widgets
00039         WIDGET_HANDLE AddImage(int x, int y, int width, int height, WIDGET_HANDLE parent = 0);
00040         WIDGET_HANDLE AddButton(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
00041         WIDGET_HANDLE AddLabel(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
00042         WIDGET_HANDLE AddCheckBox(int x, int y, int width, int height, const char *text, bool checked, WIDGET_HANDLE parent = 0);
00043         WIDGET_HANDLE AddTextEdit(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
00044         WIDGET_HANDLE AddSlider(int x, int y, int width, int height, int min_value, int max_value, int step, int value, WIDGET_HANDLE parent = 0);
00045         WIDGET_HANDLE AddComboBox(int x, int y, int width, int height, int num_entries, const char **entries, int current_entry, WIDGET_HANDLE parent = 0);
00046         WIDGET_HANDLE AddGLWidget(int x, int y, int width, int height, WIDGET_HANDLE parent = 0);
00047 
00048         // access to widget attributes
00049         bool GetText(WIDGET_HANDLE widget, char *text, int len);
00050         bool SetText(WIDGET_HANDLE widget, const char *text);
00051 
00052         bool SetImage(WIDGET_HANDLE widget, const CByteImage *pImage);
00053 
00054         bool GetValue(WIDGET_HANDLE widget, int &value);
00055         bool SetValue(WIDGET_HANDLE widget, int value);
00056         
00057         bool SwapBuffersGLWidget(WIDGET_HANDLE widget);
00058         bool MakeCurrentGLWidget(WIDGET_HANDLE widget);
00059 
00060         // window control
00061         void Show(WIDGET_HANDLE widget = 0);
00062         void Hide(WIDGET_HANDLE widget = 0);
00063 
00064         int GetModifierKeyState();
00065 
00066         void SetEventCallback(CMainWindowEventInterface *callback) {m_event_callback = callback;}
00067         
00068         void EventCallback(void* widget, int type, int *params);
00069 private:
00070         void FixPosition(int &x, int &y, int &width, int &height);
00071         
00072         void *m_cocoa_main_window;
00073         int m_width;
00074         int m_height;
00075         CMainWindowEventInterface *m_event_callback;
00076 
00077         std::vector<CCocoaMainWindowWidget*> m_widgets;
00078 };
00079 
00080 
00081 
00082 #endif /* _COCOA_MAIN_WINDOW_H_ */


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Thu Jun 6 2019 21:46:57