From: <st...@us...> - 2003-07-11 17:40:29
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv23556 Modified Files: wx.cc Log Message: Raise main window when a call is ringing. (diff is kinda large, because I needed to move the method after the declaration of IAXFrame.. -- the real change is just 4 lines). Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- wx.cc 7 Jul 2003 19:18:19 -0000 1.40 +++ wx.cc 11 Jul 2003 17:40:26 -0000 1.41 @@ -198,12 +198,78 @@ AutoSize(); } + +void IAXCalls::OnSelect(wxListEvent &evt) { + int selected = evt.m_itemIndex; //GetSelection(); + iaxc_select_call(selected); +} + + +class IAXFrame : public wxFrame +{ +public: + IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height); + + ~IAXFrame(); + + void IAXFrame::OnDTMF(wxEvent &evt); + void IAXFrame::OnDial(wxEvent &evt); + void IAXFrame::OnHangup(wxEvent &evt); + void IAXFrame::OnQuit(wxEvent &evt); + void IAXFrame::OnPTTChange(wxCommandEvent &evt); + void IAXFrame::OnSilenceChange(wxCommandEvent &evt); + void IAXFrame::OnNotify(void); + void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); + + // utility method + void IAXFrame::RegisterFromString(wxString value); + + // Handlers for library-initiated events + void IAXFrame::HandleEvent(wxCommandEvent &evt); + int IAXFrame::HandleIAXEvent(iaxc_event *e); + int IAXFrame::HandleStatusEvent(char *msg); + int IAXFrame::HandleLevelEvent(float input, float output); + + bool IAXFrame::GetPTTState(); + void IAXFrame::CheckPTT(); + void IAXFrame::SetPTT(bool state); + + wxGauge *input; + wxGauge *output; + IAXTimer *timer; + wxStaticText *iaxServLabel; + wxComboBox *iaxServ; + wxStaticText *iaxDestLabel; + wxComboBox *iaxDest; + wxStaticText *muteState; + + IAXCalls *calls; + + bool pttMode; // are we in PTT mode? + bool pttState; // is the PTT button pressed? + bool silenceMode; // are we in silence suppression mode? + + +protected: + DECLARE_EVENT_TABLE() + +#ifdef __WXGTK__ + GdkWindow *keyStateWindow; +#endif +}; + +static IAXFrame *theFrame; + int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c) { wxListItem stateItem; // for all the state color stateItem.m_itemId = c.callNo; + if(c.state & IAXC_CALL_STATE_RINGING) { + theFrame->Raise(); + } + // first, handle inactive calls if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { //fprintf(stderr, "state for item %d is free\n", c.callNo); @@ -260,67 +326,6 @@ return 0; } - -void IAXCalls::OnSelect(wxListEvent &evt) { - int selected = evt.m_itemIndex; //GetSelection(); - iaxc_select_call(selected); -} - - -class IAXFrame : public wxFrame -{ -public: - IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height); - - ~IAXFrame(); - - void IAXFrame::OnDTMF(wxEvent &evt); - void IAXFrame::OnDial(wxEvent &evt); - void IAXFrame::OnHangup(wxEvent &evt); - void IAXFrame::OnQuit(wxEvent &evt); - void IAXFrame::OnPTTChange(wxCommandEvent &evt); - void IAXFrame::OnSilenceChange(wxCommandEvent &evt); - void IAXFrame::OnNotify(void); - void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); - - // utility method - void IAXFrame::RegisterFromString(wxString value); - - // Handlers for library-initiated events - void IAXFrame::HandleEvent(wxCommandEvent &evt); - int IAXFrame::HandleIAXEvent(iaxc_event *e); - int IAXFrame::HandleStatusEvent(char *msg); - int IAXFrame::HandleLevelEvent(float input, float output); - - bool IAXFrame::GetPTTState(); - void IAXFrame::CheckPTT(); - void IAXFrame::SetPTT(bool state); - - wxGauge *input; - wxGauge *output; - IAXTimer *timer; - wxStaticText *iaxServLabel; - wxComboBox *iaxServ; - wxStaticText *iaxDestLabel; - wxComboBox *iaxDest; - wxStaticText *muteState; - - IAXCalls *calls; - - bool pttMode; // are we in PTT mode? - bool pttState; // is the PTT button pressed? - bool silenceMode; // are we in silence suppression mode? - - -protected: - DECLARE_EVENT_TABLE() - -#ifdef __WXGTK__ - GdkWindow *keyStateWindow; -#endif -}; - -static IAXFrame *theFrame; void IAXFrame::OnNotify() { |