00001
00015 #ifndef INC_MI32_XTARGS_H
00016 #define INC_MI32_XTARGS_H
00017
00018 #ifndef _XtIntrinsic_H_
00019 #include <X11/Intrinsic.h>
00020 #endif
00021
00022
00023
00025 class XTARGS {
00026 public:
00027
00029 XTARGS (
00030 ): m_num(0) { }
00031
00033 XTARGS (
00034 const Arg *arg,
00035 int count
00036 ): m_num(count) { memcpy(m_arg,arg,count*sizeof(arg[0])); }
00037
00039 operator const Arg*(
00040 ) const { return (m_arg); }
00041
00043 operator Arg*(
00044 ) { return (m_arg); }
00045
00048 const Arg& operator[] (
00049 int index
00050 ) const { return (m_arg[index]); }
00051 #ifndef GENERATING_DOXYGEN_OUTPUT
00052
00054
00055
00056
00057
00058
00059 #endif
00060
00061 void Append (
00062 const char *name,
00063 void *value
00064 ) { m_arg[m_num].name = const_cast<char*>(name); m_arg[m_num++].value = (XtArgVal)value; }
00065
00067 void Append (
00068 const char *name,
00069 int value
00070 ) { m_arg[m_num].name = const_cast<char*>(name); m_arg[m_num++].value = (XtArgVal)value; }
00071
00073 void Append (
00074 const Arg& arg
00075 ) { m_arg[m_num++] = arg; }
00076
00078 void Assign (
00079 const Arg *arg,
00080 int count
00081 ) { m_num = count; memcpy(m_arg,arg,count*sizeof(arg[0])); }
00082
00084 void Clear (
00085 ) { m_num = 0; }
00086
00088 void DeleteItem (
00089 int idx
00090 );
00091
00094 int FindItem (
00095 const char *name
00096 ) const;
00097
00099 void FormAttachBottom (
00100 Widget widget = 0,
00101 int offset = -1,
00102 bool opposite = false
00103 );
00104
00106 void FormAttachBottomPosition (
00107 int position,
00108 int offset = -1
00109 );
00110
00112 void FormAttachLeft (
00113 Widget widget = 0,
00114 int offset = -1,
00115 bool opposite = false
00116 );
00117
00119 void FormAttachLeftPosition (
00120 int position,
00121 int offset = -1
00122 );
00123
00125 void FormAttachRight (
00126 Widget widget = 0,
00127 int offset = -1,
00128 bool opposite = false
00129 );
00130
00132 void FormAttachRightPosition (
00133 int position,
00134 int offset = -1
00135 );
00136
00138 void FormAttachTop (
00139 Widget widget = 0,
00140 int offset = -1,
00141 bool opposite = false
00142 );
00143
00145 void FormAttachTopPosition (
00146 int position,
00147 int offset = -1
00148 );
00149
00151 const Arg* GetArray (
00152 ) const { return (m_arg); }
00153
00155 Arg* GetArray (
00156 ) { return (m_arg); }
00157
00159 int GetCount (
00160 ) const { return (m_num); }
00161
00163 const Arg& GetItem (
00164 int idx
00165 ) const { return (m_arg[idx]); }
00166
00168 void GetWidgetValues (
00169 Widget widget
00170 ) { XtGetValues(widget,m_arg,m_num); }
00171
00173 void SetWidgetValues (
00174 Widget widget
00175 ) { XtSetValues(widget,m_arg,m_num); }
00176
00177 private:
00178 #ifndef GENERATING_DOXYGEN_OUTPUT
00179 Arg m_arg[30];
00180 int m_num;
00181 #endif // GENERATING_DOXYGEN_OUTPUT
00182
00183 };
00184
00185
00186
00187 #endif // INC_MI32_XTARGS_H