Changeset 438
- Timestamp:
- 12/20/06 11:36:51 (6 years ago)
- Location:
- trunk/src/target/OM-2007/applications/openmoko-dialer/src
- Files:
-
- 2 added
- 12 edited
-
Makefile.am (modified) (1 diff)
-
contacts.c (modified) (1 diff)
-
contacts.h (modified) (1 diff)
-
moko-dialer-autolist.c (modified) (11 diffs)
-
moko-dialer-autolist.h (modified) (2 diffs)
-
moko-dialer-declares.h (modified) (1 diff)
-
moko-dialer-includes.h (modified) (1 diff)
-
moko-dialer-textview.c (modified) (11 diffs)
-
moko-dialer-textview.h (modified) (1 diff)
-
moko-digit-button.c (modified) (1 diff)
-
openmoko-dialer-main.c (modified) (3 diffs)
-
openmoko-dialer-main.h (modified) (1 diff)
-
openmoko-dialer-window-dialer.c (added)
-
openmoko-dialer-window-dialer.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007/applications/openmoko-dialer/src/Makefile.am
r430 r438 10 10 moko-dialer-autolist.c\ 11 11 contacts.c\ 12 common.c 12 common.c\ 13 openmoko-dialer-window-dialer.c 13 14 14 15 openmoko_dialer_LDADD = @OPENMOKO_LIBS@ -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/contacts.c
r430 r438 376 376 { 377 377 int i; 378 g_printf("hassensentive:%s,%s\n",content,string);378 // g_printf("hassensentive:%s,%s\n",content,string); 379 379 if(content==0) 380 380 return 0; -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/contacts.h
r430 r438 87 87 int contact_init_contact_data(DIALER_CONTACTS_LIST_HEAD *p_contactlist); 88 88 int contact_print_contact_list(DIALER_CONTACTS_LIST_HEAD * head); 89 //int contact_string_has_sensentive(gchar* content,gchar *string); 90 91 89 int contact_string_has_sensentive (char * content, char *string); 92 90 #ifdef __cplusplus 93 91 } -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-autolist.c
r430 r438 97 97 moko_dialer_autolist->g_alternatecount=0; 98 98 moko_dialer_autolist->imagePerson=0; 99 99 gtk_widget_set_size_request (GTK_WIDGET(moko_dialer_autolist), 480, 40); 100 100 101 } 101 102 /** … … 115 116 return TRUE; 116 117 } 117 /** 118 * @brief initiate the font for widget of textviewCodes 119 * 120 * 121 * 122 * @param text_view GtkWidget*, any widget which can help to lookup for labelcontactN 123 * @param count gint, the count of the alternative, max set to MAXDISPNAMENUM. 124 * @retval 125 */ 126 127 int moko_dialer_autolist_fill_alternative(MokoDialerAutolist *moko_dialer_autolist,gint count) 128 { 129 gint i; 130 //DBG_ENTER(); 131 132 133 moko_dialer_autolist->g_alternatecount=count; 134 135 if(count>0) 136 { 137 //init the labels. 138 for(i=0;i<count&&i<MOKO_DIALER_MAX_TIPS;i++) 139 { 140 moko_dialer_tip_set_label(moko_dialer_autolist->tips[i],moko_dialer_autolist->readycontacts[i].p_contact->name); 141 moko_dialer_tip_set_index(moko_dialer_autolist->tips[i],i); 142 moko_dialer_tip_set_selected(moko_dialer_autolist->tips[i],FALSE); 143 gtk_widget_show(moko_dialer_autolist->tips[i]); 144 } 145 146 for(;i<MOKO_DIALER_MAX_TIPS;i++) 147 { 148 moko_dialer_tip_set_index(moko_dialer_autolist->tips[i],-1); 149 moko_dialer_tip_set_label(moko_dialer_autolist->tips[i],""); 150 gtk_widget_hide(moko_dialer_autolist->tips[i]); 151 moko_dialer_tip_set_selected(moko_dialer_autolist->tips[i],FALSE); 152 } 153 154 //we set the first one as defaultly selected 155 moko_dialer_autolist_set_select(moko_dialer_autolist, 0); 156 } 157 else 158 { 159 118 119 gint moko_dialer_autolist_hide_all_tips(MokoDialerAutolist *moko_dialer_autolist) 120 { 121 122 if(moko_dialer_autolist->tipscreated) 123 { 124 moko_dialer_autolist->selected=FALSE; 160 125 //no alternative, hide all 3 labels. 161 for( i=0;i<MOKO_DIALER_MAX_TIPS;i++)126 for(gint i=0;i<MOKO_DIALER_MAX_TIPS;i++) 162 127 { 163 128 moko_dialer_tip_set_selected(moko_dialer_autolist->tips[i],FALSE); … … 166 131 //hide the imagePerson 167 132 gtk_widget_hide(moko_dialer_autolist->imagePerson); 133 } 134 return 1; 135 136 } 137 138 /** 139 * @brief initiate the font for widget of textviewCodes 140 * 141 * 142 * 143 * @param text_view GtkWidget*, any widget which can help to lookup for labelcontactN 144 * @param count gint, the count of the alternative, max set to MAXDISPNAMENUM. 145 * @param selectdefault if selectdefault, then we will automatically emit the message to fill the sensed string, 146 * else, we only refresh our tip list. 147 * @retval 148 */ 149 150 int moko_dialer_autolist_fill_alternative(MokoDialerAutolist *moko_dialer_autolist,gint count,gboolean selectdefault) 151 { 152 gint i; 153 //DBG_ENTER(); 154 moko_dialer_autolist->selected=FALSE; 155 156 moko_dialer_autolist->g_alternatecount=count; 157 158 if(count>0) 159 { 160 //init the labels. 161 for(i=0;i<count&&i<MOKO_DIALER_MAX_TIPS;i++) 162 { 163 moko_dialer_tip_set_label(moko_dialer_autolist->tips[i],moko_dialer_autolist->readycontacts[i].p_contact->name); 164 moko_dialer_tip_set_index(moko_dialer_autolist->tips[i],i); 165 moko_dialer_tip_set_selected(moko_dialer_autolist->tips[i],FALSE); 166 gtk_widget_show(moko_dialer_autolist->tips[i]); 167 } 168 169 for(;i<MOKO_DIALER_MAX_TIPS;i++) 170 { 171 moko_dialer_tip_set_index(moko_dialer_autolist->tips[i],-1); 172 moko_dialer_tip_set_label(moko_dialer_autolist->tips[i],""); 173 gtk_widget_hide(moko_dialer_autolist->tips[i]); 174 moko_dialer_tip_set_selected(moko_dialer_autolist->tips[i],FALSE); 175 } 176 177 if(selectdefault) 178 { 179 //we set the first one as defaultly selected 180 moko_dialer_autolist_set_select(moko_dialer_autolist, 0); 181 } 182 } 183 else 184 { 185 moko_dialer_autolist_hide_all_tips(moko_dialer_autolist); 168 186 //notify the client that no match has been foudn 169 187 // autolist_nomatch … … 173 191 } 174 192 175 176 gint moko_dialer_autolist_refresh_by_string (MokoDialerAutolist *moko_dialer_autolist,gchar * string) 193 //if selectdefault, then we will automatically emit the message to fill the sensed string 194 //else, we only refresh our tip list. 195 gint moko_dialer_autolist_refresh_by_string (MokoDialerAutolist *moko_dialer_autolist,gchar * string,gboolean selectdefault) 177 196 { 178 197 //first, we fill the ready list … … 191 210 else 192 211 len=0; 193 DBG_TRACE();212 // DBG_TRACE(); 194 213 195 214 //insert the tips here to avoid the _show_all show it from the start. … … 208 227 imagePerson=gtk_image_new_from_stock("gtk-yes",GTK_ICON_SIZE_DND); 209 228 } 210 gtk_widget_hide (imagePerson); 211 gtk_box_pack_start (GTK_CONTAINER(moko_dialer_autolist), imagePerson, TRUE, TRUE, 0); 212 moko_dialer_autolist->imagePerson=imagePerson; 229 gtk_widget_hide (imagePerson); 230 gtk_widget_set_size_request (imagePerson, 40, 40); 231 // gtk_box_pack_start (GTK_CONTAINER(moko_dialer_autolist), imagePerson, TRUE, TRUE, 0); 232 //gtk_box_pack_start (GTK_CONTAINER(moko_dialer_autolist), imagePerson, TRUE, FALSE, 0); 233 gtk_box_pack_start (GTK_CONTAINER(moko_dialer_autolist), imagePerson, FALSE, FALSE, 0); 234 235 moko_dialer_autolist->imagePerson=imagePerson; 213 236 214 237 for(int i=0;i<MOKO_DIALER_MAX_TIPS;i++) … … 223 246 224 247 gtk_box_pack_start(GTK_CONTAINER(moko_dialer_autolist), tip, TRUE, TRUE, 0); 225 248 // gtk_box_pack_start(GTK_CONTAINER(moko_dialer_autolist), tip, FALSE,FALSE, 0); 249 // gtk_box_pack_start(GTK_CONTAINER(moko_dialer_autolist), tip, FALSE,TRUE, 0); 250 // gtk_box_pack_start(GTK_CONTAINER(moko_dialer_autolist), tip, TRUE, FALSE,0); 251 226 252 g_signal_connect ((gpointer) tip, "button_press_event",G_CALLBACK (on_tip_press_event),moko_dialer_autolist); 227 253 228 gtk_widget_set_size_request (tip, 20, 20);254 // gtk_widget_set_size_request (tip, 20, 20); 229 255 230 256 gtk_widget_hide(tip); … … 265 291 266 292 //DBG_MESSAGE("inserted=%d",inserted); 267 moko_dialer_autolist_fill_alternative(moko_dialer_autolist,inserted );268 269 DBG_LEAVE();293 moko_dialer_autolist_fill_alternative(moko_dialer_autolist,inserted,selectdefault); 294 295 //DBG_LEAVE(); 270 296 return inserted; 271 297 } … … 296 322 297 323 } 324 325 gboolean moko_dialer_autolist_has_selected(MokoDialerAutolist *moko_dialer_autolist) 326 { 327 return moko_dialer_autolist->selected; 328 } 329 330 // selected ==-1 means there are no selected tips 298 331 gboolean moko_dialer_autolist_set_select(MokoDialerAutolist *moko_dialer_autolist,gint selected) 299 332 { 300 333 301 if(selected!=-1&&selected<MOKO_DIALER_MAX_TIPS&&moko_dialer_autolist->g_alternatecount) 334 if(selected==-1) 335 { 336 337 //set the selected status to be false 338 for(gint i=0;i<moko_dialer_autolist->g_alternatecount;i++) 339 { 340 moko_dialer_tip_set_selected( moko_dialer_autolist->tips[i], FALSE); 341 } 342 //set 343 gtk_widget_hide(moko_dialer_autolist->imagePerson); 344 moko_dialer_autolist->selected=FALSE; 345 return TRUE; 346 } 347 348 349 if(selected<MOKO_DIALER_MAX_TIPS&&moko_dialer_autolist->g_alternatecount) 302 350 { 303 351 //first of all, determin if this tip is already selected previously. … … 313 361 } 314 362 } 363 moko_dialer_autolist->selected=FALSE; 315 364 //emit confirm message; 316 DBG_MESSAGE("we confirm %s is right.",moko_dialer_autolist->readycontacts[selected].p_contact->name);365 // DBG_MESSAGE("we confirm %s is right.",moko_dialer_autolist->readycontacts[selected].p_contact->name); 317 366 g_signal_emit (moko_dialer_autolist, moko_dialer_autolist_signals[CONFIRMED_SIGNAL],0,&(moko_dialer_autolist->readycontacts[selected])); 318 367 … … 334 383 moko_dialer_tip_set_selected( moko_dialer_autolist->tips[i], TRUE); 335 384 } 385 moko_dialer_autolist->selected=TRUE; 336 386 //emit selected message 337 DBG_MESSAGE(" %s is selectd.",moko_dialer_autolist->readycontacts[selected].p_contact->name);387 // DBG_MESSAGE(" %s is selectd.",moko_dialer_autolist->readycontacts[selected].p_contact->name); 338 388 g_signal_emit (moko_dialer_autolist, moko_dialer_autolist_signals[SELECTED_SIGNAL],0,&(moko_dialer_autolist->readycontacts[selected])); 339 389 } -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-autolist.h
r430 r438 63 63 DIALER_READY_CONTACT readycontacts[MOKO_DIALER_MAX_TIPS]; ///<the prepared contact list which will display to the user when he/she inputs part of the digits he/she wants to dial out 64 64 65 g int g_selected;///<indicates the offset of the selected ready contacts list65 gboolean selected;///<indicates wether some tip is currently selected. 66 66 67 67 gint g_alternatecount;///<indicates how many alternative is ready in the ready list array. … … 89 89 gboolean moko_dialer_autolist_set_select(MokoDialerAutolist *moko_dialer_autolist,gint selected); 90 90 91 gboolean moko_dialer_autolist_has_selected(MokoDialerAutolist *moko_dialer_autolist); 91 92 93 gint moko_dialer_autolist_refresh_by_string (MokoDialerAutolist *moko_dialer_autolist,gchar * string,gboolean selectdefault); 92 94 95 gint moko_dialer_autolist_hide_all_tips(MokoDialerAutolist *moko_dialer_autolist); 93 96 G_END_DECLS 94 97 -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-declares.h
r410 r438 24 24 //MAXDISPNAMENUM MUST >=1 & <=9! 25 25 //only when user inputs at least MINSENSATIVELEN, should we start to search. 26 #define MOKO_DIALER_MIN_SENSATIVE_LEN ( 1)26 #define MOKO_DIALER_MIN_SENSATIVE_LEN (3) 27 27 #define MOKO_DIALER_DEFAULT_PERSON_IMAGE_PATH ("./default.png") 28 28 #define MOKO_DIALER_MAX_TIPS (3) -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-includes.h
r425 r438 99 99 }; 100 100 101 typedef struct _dialer_data102 {103 //the global data area begins here104 105 106 MokoDialerTextview *moko_dialer_text_view;107 108 MokoDialerAutolist *moko_dialer_autolist;109 110 DIALER_CONTACTS_LIST_HEAD g_contactlist; ///< the whole list of the contacts from the contact book.111 112 HISTORY_LIST_HEAD g_historylist; ///< the whole list of the talk history113 114 GLOBAL_STATE g_state; ///< the global states holder. we count on it a lot.115 116 gint g_ptimeout; ///< the timer hanle117 118 TIMER_DATA g_timer_data;///< the data used by the timers119 120 // GtkListStore *g_list_store_filter;///<the list store used by the gtktreeview, for displaying the history list dynamically.121 122 // HISTORY_TYPE g_historyfiltertype;///<indicates the current history filter type, the gtktreeview will be filtered on the value.123 124 // GdkPixbuf * g_iconReceived,*g_iconMissed,*g_iconDialed;///<the global pixbuf for the 3 icons displayed in the history window.}DIALER_APP_DATA;125 }MOKO_DIALER_APP_DATA;126 101 127 102 #endif -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-textview.c
r430 r438 15 15 * 16 16 * Current Version: $Rev$ ($Date) [$Author: Tony Guan $] 17 17 18 */ 18 19 … … 50 51 { 51 52 52 GtkTextView *textview=0;53 GtkTextBuffer *buffer;53 GtkTextView *textview=0; 54 GtkTextBuffer *buffer; 54 55 55 56 textview=&moko_dialer_textview->textview; … … 89 90 moko_dialer_textview->tag_for_cursor= gtk_text_buffer_create_tag (buffer, "tag_cursor","weight","PANGO_WEIGHT_BOLD", NULL); 90 91 moko_dialer_textview->tag_for_autofilled= gtk_text_buffer_create_tag (buffer, "tag_filled","foreground", "#FFFF00", NULL); 91 92 moko_dialer_textview->sensed=FALSE; 92 93 93 94 } … … 262 263 GtkTextMark *insertmark; 263 264 264 DBG_ENTER();265 //DBG_ENTER(); 265 266 266 267 /* Obtaining the buffer associated with the widget. */ … … 279 280 return 0; 280 281 } 281 DBG_TRACE();282 // DBG_TRACE(); 282 283 if(ALL) 283 284 /* Get the entire buffer text. */ … … 285 286 else 286 287 codestring = gtk_text_buffer_get_text (buffer, &start, &insertiter, FALSE); 287 DBG_MESSAGE("%s",codestring);288 //DBG_MESSAGE("%s",codestring); 288 289 strcpy(input,codestring); 289 DBG_TRACE();290 // DBG_TRACE(); 290 291 g_free(codestring); 291 292 return 1; 293 } 294 295 ///delete the selection or one character. 296 int moko_dialer_textview_delete(MokoDialerTextview *moko_dialer_textview) 297 { 298 GtkTextBuffer *buffer; 299 GtkTextIter selectioniter,insertiter; 300 GtkTextMark *selectmark,*insertmark; 301 gint len; 302 303 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (moko_dialer_textview)); 304 305 selectmark=gtk_text_buffer_get_selection_bound(buffer); 306 insertmark= gtk_text_buffer_get_insert(buffer); 307 //get current cursor iterator 308 gtk_text_buffer_get_iter_at_mark(buffer,&insertiter,insertmark); 309 gtk_text_buffer_get_iter_at_mark(buffer,&selectioniter,selectmark); 310 //to see whether there is a selection range. 311 if(gtk_text_iter_get_offset(&insertiter)!=gtk_text_iter_get_offset(&selectioniter)) 312 { 313 //yes, first delete the range. 314 gtk_text_buffer_delete(buffer,&selectioniter,&insertiter); 315 } 316 else 317 { 318 //no selection, then just perform backspace. 319 gtk_text_buffer_backspace(buffer,&insertiter,TRUE,TRUE); 320 } 321 322 //now we get the inputed string length. 323 insertmark= gtk_text_buffer_get_insert(buffer); 324 //get current cursor iterator 325 gtk_text_buffer_get_iter_at_mark(buffer,&insertiter,insertmark); 326 len=gtk_text_iter_get_offset(&insertiter); 327 328 return 1; 329 292 330 } 293 331 … … 307 345 gint offsetstart; 308 346 309 DBG_ENTER();310 DBG_MESSAGE("Sensative string:%s",string);347 //DBG_ENTER(); 348 //DBG_MESSAGE("Sensative string:%s",string); 311 349 312 350 /* Obtaining the buffer associated with the widget. */ … … 333 371 gtk_text_buffer_place_cursor(buffer,&start); 334 372 moko_dialer_textview_set_color(moko_dialer_textview); 335 373 moko_dialer_textview->sensed=TRUE; 336 374 //gtk_widget_grab_focus(text_view); 337 375 return 1; … … 362 400 gtk_text_buffer_get_iter_at_mark(buffer,&insertiter,insertmark); 363 401 gtk_text_iter_set_offset(&insertiter,offset); 402 //set the private data of sensed. 364 403 } 365 404 } … … 373 412 //g_free (codestring ); 374 413 375 DBG_LEAVE();414 //DBG_LEAVE(); 376 415 return 1; 377 416 } … … 392 431 //set the cursor to the end of the buffer 393 432 gtk_text_buffer_place_cursor(buffer,&end); 433 434 moko_dialer_textview_set_color(moko_dialer_textview); 435 // 394 436 395 437 return 1; -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-dialer-textview.h
r430 r438 52 52 GtkTextTag* tag_for_cursor; ///<the formatting tag for the right digit user just inputed. 53 53 GtkTextTag* tag_for_autofilled;///<the formatting tag for the autofilled digits if any. 54 gboolean sensed; 54 55 }; 55 56 -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/moko-digit-button.c
r410 r438 71 71 gtk_widget_set_size_request (digitbutton, 64, 64); 72 72 73 GtkWidget * hbox = gtk_hbox_new (TRUE, 0); 73 // GtkWidget * hbox = gtk_hbox_new (TRUE, 0); 74 GtkWidget * hbox = gtk_hbox_new (FALSE, 0); 74 75 gtk_widget_show (hbox); 75 76 gtk_container_add (GTK_CONTAINER (digitbutton), hbox); -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-main.c
r430 r438 31 31 #include "contacts.h" 32 32 #include "openmoko-dialer-main.h" 33 34 void 35 on_dialer_autolist_user_selected(GtkWidget * widget,gpointer para_pointer, 36 gpointer user_data) 37 { 38 gchar codesinput[MOKO_DIALER_MAX_NUMBER_LEN]; 39 gint lenstring=0; 40 gint leninput=0; 41 MOKO_DIALER_APP_DATA * appdata=(MOKO_DIALER_APP_DATA*)user_data; 42 MokoDialerTextview *moko_dialer_text_view=appdata->moko_dialer_text_view; 43 DIALER_READY_CONTACT * ready_contact=(DIALER_READY_CONTACT * )para_pointer; 44 DBG_MESSAGE("GOT THE MESSAGE OF SELECTED:%s",ready_contact->p_entry->content); 45 moko_dialer_textview_get_input(moko_dialer_text_view,codesinput, 0); 46 lenstring=strlen(ready_contact->p_entry->content); 47 leninput=strlen(codesinput); 48 if(lenstring>=leninput) 49 { 50 51 moko_dialer_textview_fill_it(moko_dialer_text_view,&(ready_contact->p_entry->content[leninput])); 52 53 } 54 55 } 56 57 void 58 on_dialer_autolist_user_confirmed(GtkWidget * widget,gpointer para_pointer, 59 gpointer user_data) 60 { 61 62 MOKO_DIALER_APP_DATA * appdata=(MOKO_DIALER_APP_DATA*)user_data; 63 MokoDialerTextview *moko_dialer_text_view=appdata->moko_dialer_text_view; 64 DIALER_READY_CONTACT * ready_contact=(DIALER_READY_CONTACT * )para_pointer; 65 DBG_MESSAGE("GOT THE MESSAGE OF confirmed:%s",ready_contact->p_entry->content); 66 moko_dialer_textview_confirm_it(moko_dialer_text_view,ready_contact->p_entry->content); 67 DBG_MESSAGE("And here we are supposed to call out directly"); 68 69 } 70 void 71 on_dialer_autolist_nomatch(GtkWidget * widget,gpointer user_data) 72 { 73 74 MOKO_DIALER_APP_DATA * appdata=(MOKO_DIALER_APP_DATA*)user_data; 75 MokoDialerTextview *moko_dialer_text_view=appdata->moko_dialer_text_view; 76 77 DBG_MESSAGE("GOT THE MESSAGE OF no match"); 78 moko_dialer_textview_fill_it(moko_dialer_text_view,""); 79 80 } 81 82 83 void 84 on_dialer_panel_user_input(GtkWidget * widget,gchar parac, 85 gpointer user_data) 86 { 87 char input[2]; 88 input[0]=parac; 89 input[1]=0; 90 char codesinput[MOKO_DIALER_MAX_NUMBER_LEN]; 91 92 93 MOKO_DIALER_APP_DATA * appdata=(MOKO_DIALER_APP_DATA*)user_data; 94 MokoDialerTextview *moko_dialer_text_view=appdata->moko_dialer_text_view; 95 96 moko_dialer_textview_insert(moko_dialer_text_view, input); 97 98 moko_dialer_textview_get_input(moko_dialer_text_view,codesinput, 0); 99 100 moko_dialer_autolist_refresh_by_string(appdata->moko_dialer_autolist,codesinput); 101 102 } 103 void 104 on_dialer_panel_user_hold(GtkWidget * widget,gchar parac, 105 gpointer user_data) 106 { 107 108 g_print("on_dialer_panel_user_hold:%c\n", parac); 109 } 110 111 33 #include "openmoko-dialer-window-dialer.h" 112 34 int main( int argc, char** argv ) 113 35 { … … 115 37 MOKO_DIALER_APP_DATA* p_dialer_data; 116 38 p_dialer_data=calloc(1,sizeof(MOKO_DIALER_APP_DATA)); 117 GtkVBox* vbox = NULL;118 static MokoFingerToolBox* tools = NULL;119 39 /* Initialize GTK+ */ 120 40 gtk_init( &argc, &argv ); … … 128 48 g_set_application_name( "OpenMoko Dialer" ); 129 49 130 /* main window */ 131 MokoFingerWindow* window = MOKO_FINGER_WINDOW(moko_finger_window_new()); 132 133 /* application menu */ 134 GtkMenu* appmenu = GTK_MENU(gtk_menu_new()); 135 136 GtkMenuItem* closeitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label( "Close" )); 137 g_signal_connect( G_OBJECT(closeitem), "activate", G_CALLBACK(gtk_main_quit), NULL ); 138 139 gtk_menu_shell_append( appmenu, closeitem ); 140 moko_finger_window_set_application_menu( window, appmenu ); 141 142 /* connect close event */ 143 g_signal_connect( G_OBJECT(window), "delete_event", G_CALLBACK( gtk_main_quit ), NULL ); 144 145 146 /* contents */ 147 vbox = gtk_vbox_new( FALSE, 0 ); 148 149 150 GtkHBox* hbox = gtk_hbox_new( TRUE, 10 ); 151 152 153 MokoDialerAutolist* autolist=moko_dialer_autolist_new(); 154 moko_dialer_autolist_set_data (autolist,&(p_dialer_data->g_contactlist)); 155 p_dialer_data->moko_dialer_autolist=autolist; 156 gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(autolist), FALSE, FALSE, 5 ); 157 158 159 g_signal_connect (GTK_OBJECT (autolist), "user_selected", 160 G_CALLBACK (on_dialer_autolist_user_selected),p_dialer_data); 161 162 163 g_signal_connect (GTK_OBJECT (autolist), "user_confirmed", 164 G_CALLBACK ( on_dialer_autolist_user_confirmed),p_dialer_data); 165 166 g_signal_connect (GTK_OBJECT (autolist), "autolist_nomatch", 167 G_CALLBACK ( on_dialer_autolist_nomatch),p_dialer_data); 168 169 170 MokoDialerTextview * mokotextview=moko_dialer_textview_new(); 171 p_dialer_data->moko_dialer_text_view=mokotextview; 172 173 gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(mokotextview), FALSE,FALSE, 5 ); 174 175 176 MokoDialerPanel* mokodialerpanel=moko_dialer_panel_new(); 177 178 179 180 g_signal_connect (GTK_OBJECT (mokodialerpanel), "user_input", 181 G_CALLBACK (on_dialer_panel_user_input),p_dialer_data); 182 183 184 g_signal_connect (GTK_OBJECT (mokodialerpanel), "user_hold", 185 G_CALLBACK ( on_dialer_panel_user_hold),p_dialer_data); 186 187 gtk_box_pack_start( GTK_BOX(hbox), GTK_WIDGET(mokodialerpanel), TRUE, TRUE, 5 ); 188 189 190 191 gtk_box_pack_start( GTK_BOX(vbox), GTK_WIDGET(hbox), TRUE, TRUE, 5 ); 192 193 194 195 196 197 198 199 moko_finger_window_set_contents( window, GTK_WIDGET(vbox) ); 200 201 /* show everything and run main loop */ 202 gtk_widget_show_all( GTK_WIDGET(window) ); 203 50 //init the dialer window 51 window_dialer_init(p_dialer_data); 204 52 205 53 gtk_main(); -
trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-main.h
r410 r438 17 17 */ 18 18 #include "moko-dialer-includes.h" 19 20 typedef struct _dialer_data 21 { 22 //the global data area begins here 23 24 25 MokoDialerTextview *moko_dialer_text_view; 26 27 MokoDialerAutolist *moko_dialer_autolist; 28 29 DIALER_CONTACTS_LIST_HEAD g_contactlist; ///< the whole list of the contacts from the contact book. 30 31 HISTORY_LIST_HEAD g_historylist; ///< the whole list of the talk history 32 33 GLOBAL_STATE g_state; ///< the global states holder. we count on it a lot. 34 35 gint g_ptimeout; ///< the timer hanle 36 37 TIMER_DATA g_timer_data;///< the data used by the timers 38 39 GtkWidget * window_dialer; 40 41 // GtkListStore *g_list_store_filter;///<the list store used by the gtktreeview, for displaying the history list dynamically. 42 43 // HISTORY_TYPE g_historyfiltertype;///<indicates the current history filter type, the gtktreeview will be filtered on the value. 44 45 // GdkPixbuf * g_iconReceived,*g_iconMissed,*g_iconDialed;///<the global pixbuf for the 3 icons displayed in the history window.}DIALER_APP_DATA; 46 }MOKO_DIALER_APP_DATA; 47
Note: See TracChangeset
for help on using the changeset viewer.
