Changeset 2532 for trunk/jons-gtk-gui

Show
Ignore:
Timestamp:
05/20/01 08:22:36 (8 years ago)
Author:
emojon
Message:

Changed all every instance of NULL to 0.
Due to some compilers not liking it.

Fixed bug with a crash when viewing history.

Location:
trunk/jons-gtk-gui/src
Files:
29 modified

Legend:

Unmodified
Added
Removed
  • trunk/jons-gtk-gui/src/about_window.cpp

    r2363 r2532  
    3333{ 
    3434    // Only one about window 
    35     if(about_window != NULL) 
     35    if(about_window != 0) 
    3636    { 
    3737        gdk_window_raise(about_window->window); 
     
    4646    // Window delete event 
    4747    gtk_signal_connect(GTK_OBJECT(about_window), "destroy", 
    48         GTK_SIGNAL_FUNC(close_about_window), NULL); 
     48        GTK_SIGNAL_FUNC(close_about_window), 0); 
    4949 
    5050    // A vertical box for the label and ok button 
     
    7979    GtkWidget *ok = gtk_button_new_with_label("OK"); 
    8080    gtk_signal_connect(GTK_OBJECT(ok), "clicked", 
    81         GTK_SIGNAL_FUNC(close_about_window), NULL); 
     81        GTK_SIGNAL_FUNC(close_about_window), 0); 
    8282    gtk_box_pack_start(GTK_BOX(v_box), ok, true, true, 0); 
    8383 
     
    8888{ 
    8989    gtk_widget_destroy(about_window); 
    90     about_window = NULL; 
     90    about_window = 0; 
    9191} 
  • trunk/jons-gtk-gui/src/add_user_window.cpp

    r2092 r2532  
    5252    /* Accept only numbers in the a->entry */ 
    5353    gtk_signal_connect(GTK_OBJECT(a->entry), "insert-text", 
    54                GTK_SIGNAL_FUNC(verify_numbers), NULL); 
     54               GTK_SIGNAL_FUNC(verify_numbers), 0); 
    5555     
    5656    /* Add the first hbox to the top of the vbox */ 
  • trunk/jons-gtk-gui/src/auth_user_window.cpp

    r2092 r2532  
    5252    /* Accept only numbers in au->entry */ 
    5353    gtk_signal_connect(GTK_OBJECT(au->entry), "insert-text", 
    54                GTK_SIGNAL_FUNC(verify_numbers), NULL); 
     54               GTK_SIGNAL_FUNC(verify_numbers), 0); 
    5555 
    5656    /* Make the scrolled text box */ 
    57     au->text = gtk_text_new(NULL, NULL); 
     57    au->text = gtk_text_new(0, 0); 
    5858    gtk_text_set_editable(GTK_TEXT(au->text), TRUE); 
    5959    gtk_text_set_word_wrap(GTK_TEXT(au->text), TRUE); 
    6060    gtk_text_set_line_wrap(GTK_TEXT(au->text), TRUE); 
    6161 
    62     scroll = gtk_scrolled_window_new(NULL, NULL); 
     62    scroll = gtk_scrolled_window_new(0, 0); 
    6363    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), 
    6464                       GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); 
  • trunk/jons-gtk-gui/src/away_window.cpp

    r2363 r2532  
    4444 
    4545    /* The text box */ 
    46     away_d->text = gtk_text_new(NULL, NULL); 
     46    away_d->text = gtk_text_new(0, 0); 
    4747    gtk_text_set_editable(GTK_TEXT(away_d->text), TRUE); 
    4848    gtk_widget_set_usize(GTK_WIDGET(away_d->text), 300, 100); 
     
    9999    struct user_away_window *uaw = uaw_find(user->Uin()); 
    100100     
    101     if(uaw != NULL) 
     101    if(uaw != 0) 
    102102        return; 
    103103 
     
    129129 
    130130    /* The scrolling window */ 
    131     scroll = gtk_scrolled_window_new(NULL, NULL); 
     131    scroll = gtk_scrolled_window_new(0, 0); 
    132132    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), 
    133133                       GTK_POLICY_NEVER, 
     
    135135 
    136136    /* The text box */ 
    137     uaw->text_box = gtk_text_new(NULL, NULL); 
     137    uaw->text_box = gtk_text_new(0, 0); 
    138138    gtk_widget_set_usize(uaw->text_box, 235, 60); 
    139139    gtk_text_set_editable(GTK_TEXT(uaw->text_box), FALSE); 
     
    195195    uaw_list = g_slist_remove(uaw_list, uaw); 
    196196    catcher = g_slist_remove(catcher, uaw->etag); 
    197     dialog_close(NULL, uaw->window); 
     197    dialog_close(0, uaw->window); 
    198198} 
    199199 
     
    210210 
    211211    /* If it does, return it, if not, make one */ 
    212     if(uaw != NULL)  
     212    if(uaw != 0)  
    213213        return uaw; 
    214214 
     
    219219    uaw_list = g_slist_append(uaw_list, uaw); 
    220220 
    221 //  list_read_message(NULL, uaw->user); 
     221//  list_read_message(0, uaw->user); 
    222222 
    223223    return uaw; 
     
    239239 
    240240    /* It wasn't found, return null */ 
    241     return NULL; 
    242 } 
     241    return 0; 
     242} 
  • trunk/jons-gtk-gui/src/chat_window.cpp

    r2321 r2532  
    3737 
    3838    // No get outta here, bitch! 
    39     if(rc != NULL) 
     39    if(rc != 0) 
    4040        return; 
    4141 
     
    7171 
    7272    /*Create the scrolled window with text and attach it to the window */ 
    73     scroll = gtk_scrolled_window_new(NULL, NULL); 
     73    scroll = gtk_scrolled_window_new(0, 0); 
    7474    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), 
    7575                       GTK_POLICY_NEVER, 
    7676                       GTK_POLICY_AUTOMATIC); 
    77     rc->text_box = gtk_text_new(NULL, NULL); 
     77    rc->text_box = gtk_text_new(0, 0); 
    7878    gtk_text_set_editable(GTK_TEXT(rc->text_box), TRUE); 
    7979    gtk_text_set_word_wrap(GTK_TEXT(rc->text_box), TRUE); 
     
    8787 
    8888    /* The send as buttons */ 
    89     rc->send_norm = gtk_radio_button_new_with_label(NULL, "Send Normal"); 
     89    rc->send_norm = gtk_radio_button_new_with_label(0, "Send Normal"); 
    9090    rc->send_urg = gtk_radio_button_new_with_label_from_widget( 
    9191            GTK_RADIO_BUTTON(rc->send_norm), "Send Urgent"); 
     
    163163 
    164164    /* Don't make it if it's already there, return it */ 
    165     if(rc != NULL) 
     165    if(rc != 0) 
    166166        return rc; 
    167167 
     
    188188 
    189189    /* It wasn't found, return null */ 
    190     return NULL; 
     190    return 0; 
    191191} 
    192192 
     
    200200 
    201201    // Make a GList with the current chats in it 
    202     GList *items = NULL; 
     202    GList *items = 0; 
    203203 
    204204    ChatDlgList::iterator iter; 
     
    207207 
    208208    // Make sure there are chats to show 
    209     if(items == NULL) 
     209    if(items == 0) 
    210210        return; 
    211211         
     
    327327    if(auto_accept) 
    328328    { 
    329         chat_accept(NULL, (gpointer)r_cr); 
     329        chat_accept(0, (gpointer)r_cr); 
    330330        return; 
    331331    } 
     
    422422    CExtendedAck *ea = event->ExtendedAck(); 
    423423     
    424     if(ea == NULL) 
     424    if(ea == 0) 
    425425    { 
    426426        gLog.Error("%sInternal error: chat_start_as_client(): chat request acknowledgement without extended result.\n", L_ERRORxSTR); 
     
    515515    /* Create the remote frame with the remote scrolled text window */ 
    516516    cw->frame_remote = gtk_frame_new("Remote"); 
    517     cw->text_remote = gtk_text_new(NULL, NULL); 
     517    cw->text_remote = gtk_text_new(0, 0); 
    518518    gtk_text_set_editable(GTK_TEXT(cw->text_remote), FALSE); 
    519519    gtk_text_set_word_wrap(GTK_TEXT(cw->text_remote), TRUE); 
    520520    gtk_text_set_line_wrap(GTK_TEXT(cw->text_remote), TRUE); 
    521     scroll1 = gtk_scrolled_window_new(NULL, 
     521    scroll1 = gtk_scrolled_window_new(0, 
    522522                      GTK_TEXT(cw->text_remote)->vadj); 
    523523    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll1), 
     
    540540    gUserManager.DropUser(o); 
    541541 
    542     cw->text_local = gtk_text_new(NULL, NULL); 
     542    cw->text_local = gtk_text_new(0, 0); 
    543543    gtk_text_set_editable(GTK_TEXT(cw->text_local), TRUE); 
    544544    gtk_text_set_word_wrap(GTK_TEXT(cw->text_local), TRUE); 
    545545    gtk_text_set_line_wrap(GTK_TEXT(cw->text_local), TRUE); 
    546     scroll2 = gtk_scrolled_window_new(NULL, 
     546    scroll2 = gtk_scrolled_window_new(0, 
    547547                      GTK_TEXT(cw->text_local)->vadj); 
    548548    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll2), 
     
    563563 
    564564    /* Create the main text box in a scrolled window */ 
    565     cw->text_irc = gtk_text_new(NULL, NULL); 
     565    cw->text_irc = gtk_text_new(0, 0); 
    566566    gtk_text_set_editable(GTK_TEXT(cw->text_irc), FALSE); 
    567567    gtk_text_set_word_wrap(GTK_TEXT(cw->text_irc), TRUE); 
    568568    gtk_text_set_line_wrap(GTK_TEXT(cw->text_irc), TRUE); 
    569     scroll1 = gtk_scrolled_window_new(NULL, 
     569    scroll1 = gtk_scrolled_window_new(0, 
    570570                      GTK_TEXT(cw->text_irc)->vadj); 
    571571    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll1), 
     
    616616    GtkItemFactoryEntry menu_items[] = 
    617617    { 
    618             { "/_Chat",        NULL,         NULL, 0, "<Branch>" }, 
     618            { "/_Chat",        0,         0, 0, "<Branch>" }, 
    619619            { "/Chat/_Audio", "<control>A", 
    620620          GtkItemFactoryCallback(chat_audio), 0, "<ToggleItem>" }, 
    621621//      { "/Chat/_Kick", "<control>K", 
    622 //        GtkItemFactoryCallback(chat_kick), 0, NULL}, 
     622//        GtkItemFactoryCallback(chat_kick), 0, 0}, 
    623623//      { "/Chat/Kick _No Vote", "<control>N", 
    624 //        GtkItemFactoryCallback(chat_kick_no_vote), 0, NULL}, 
     624//        GtkItemFactoryCallback(chat_kick_no_vote), 0, 0}, 
    625625        { "/Chat/_Save", "<control>S", 
    626           GtkItemFactoryCallback(chat_save), 0, NULL}, 
    627             { "/Chat/sep1",    NULL,     NULL, 0, "<Separator>" }, 
     626          GtkItemFactoryCallback(chat_save), 0, 0}, 
     627            { "/Chat/sep1",    0,    0, 0, "<Separator>" }, 
    628628            { "/Chat/_Close",  "<control>C", 
    629           GtkItemFactoryCallback(chat_close), 0, NULL}, 
    630         { "/_More",    NULL,     NULL, 0, "<Branch>" }, 
     629          GtkItemFactoryCallback(chat_close), 0, 0}, 
     630        { "/_More",    0,   0, 0, "<Branch>" }, 
    631631        { "/More/_Beep",   "<control>B", 
    632           GtkItemFactoryCallback(chat_beep_users), 0, NULL}, 
    633 //      { "/More/Change Font", NULL, 
    634 //         GtkItemFactoryCallback(chat_change_font), 0, NULL}, 
     632          GtkItemFactoryCallback(chat_beep_users), 0, 0}, 
     633//      { "/More/Change Font", 0, 
     634//         GtkItemFactoryCallback(chat_change_font), 0, 0}, 
    635635    }; 
    636636 
     
    671671 
    672672    cw->kw->cmbUsers = gtk_combo_new(); 
    673     GList *users = NULL; 
     673    GList *users = 0; 
    674674 
    675675    list<CChatUser *>::iterator iter; 
     
    798798        GTK_OBJECT(GTK_FILE_SELECTION(dlg_save_chat)->cancel_button), 
    799799        "clicked", GTK_SIGNAL_FUNC(save_chat_cancel), 
    800         NULL); 
     800        0); 
    801801    gtk_signal_connect(GTK_OBJECT(dlg_save_chat), "delete_event", 
    802         GTK_SIGNAL_FUNC(save_chat_cancel), NULL); 
     802        GTK_SIGNAL_FUNC(save_chat_cancel), 0); 
    803803 
    804804    gtk_widget_show_all(dlg_save_chat); 
     
    819819    struct chat_window *cw = (struct chat_window *)temp_cw; 
    820820 
    821     if(cw->hold_cuser == NULL) 
     821    if(cw->hold_cuser == 0) 
    822822    { 
    823         cw->chat_user = NULL; 
     823        cw->chat_user = 0; 
    824824        gdk_input_remove(cw->input_tag); 
    825825        cw->chatman->CloseChat(); 
     
    830830    { 
    831831        if(cw->chat_user == cw->hold_cuser) 
    832             cw->chat_user = NULL; 
     832            cw->chat_user = 0; 
    833833    } 
    834834 
     
    854854    read(pipe, buf, 32); 
    855855 
    856     CChatEvent *e = NULL; 
    857     while((e = cw->chatman->PopChatEvent()) != NULL) 
     856    CChatEvent *e = 0; 
     857    while((e = cw->chatman->PopChatEvent()) != 0) 
    858858    { 
    859859        CChatUser *user = e->Client(); 
     
    877877                g_free(temp); 
    878878 
    879                 chat_close((gpointer)cw, 0, NULL); 
     879                chat_close((gpointer)cw, 0, 0); 
    880880                break; 
    881881            } 
     
    896896                g_free(temp); 
    897897 
    898                 chat_close((gpointer)cw, 0, NULL); 
     898                chat_close((gpointer)cw, 0, 0); 
    899899                break; 
    900900            } 
     
    919919                         filler); 
    920920 
    921                 if(cw->chat_user == NULL) 
     921                if(cw->chat_user == 0) 
    922922                { 
    923923                    cw->chat_user = user; 
     
    12101210        } 
    12111211 
    1212         cw->hold_cuser = NULL; 
     1212        cw->hold_cuser = 0; 
    12131213        delete e; 
    12141214    } 
     
    13461346    char *tmp = gtk_font_selection_dialog_get_font_name( 
    13471347        GTK_FONT_SELECTION_DIALOG(cw->font_sel_dlg)); 
    1348     if(tmp != NULL) 
     1348    if(tmp != 0) 
    13491349    { 
    13501350        int len = 0; 
     
    13811381    GdkFont *font_tmp = gtk_font_selection_dialog_get_font( 
    13821382        GTK_FONT_SELECTION_DIALOG(cw->font_sel_dlg)); 
    1383     if(font_tmp != NULL) 
     1383    if(font_tmp != 0) 
    13841384        cw->l_font = font_tmp; 
    13851385 
  • trunk/jons-gtk-gui/src/contact_list.cpp

    r2364 r2532  
    6161    /* A double click on a user name */ 
    6262    gtk_signal_connect(GTK_OBJECT(_contact_l), "button_press_event", 
    63                GTK_SIGNAL_FUNC(contact_list_click), NULL); 
     63               GTK_SIGNAL_FUNC(contact_list_click), 0); 
    6464 
    6565    gtk_clist_set_button_actions(GTK_CLIST(_contact_l), 0, GTK_BUTTON_IGNORED); 
     
    309309    AutoSecureList.clear(); 
    310310 
    311     gtk_clist_set_compare_func(GTK_CLIST(contact_list), NULL); 
     311    gtk_clist_set_compare_func(GTK_CLIST(contact_list), 0); 
    312312    gtk_clist_set_sort_column(GTK_CLIST(contact_list), 0); 
    313313    gtk_clist_sort(GTK_CLIST(contact_list)); 
     
    337337    gchar str_status[30]; 
    338338    ICQUser *user; 
    339     struct conversation *c = NULL; 
     339    struct conversation *c = 0; 
    340340    struct timeval check_timer; 
    341341 
     
    351351 
    352352    /* No user was clicked on */ 
    353     if(user == NULL) 
     353    if(user == 0) 
    354354        return; 
    355355 
     
    358358    { 
    359359        /* Fix the stupid contact list double click problem */ 
    360         gettimeofday(&check_timer, NULL); 
     360        gettimeofday(&check_timer, 0); 
    361361 
    362362        if(!((check_timer.tv_sec == timer.tv_sec) && 
     
    373373        c = convo_find(user->Uin()); 
    374374         
    375         if(c != NULL) 
     375        if(c != 0) 
    376376            gdk_window_raise(c->window->window); 
    377377        else 
     
    463463                 GTK_SIGNAL_FUNC(list_delete_user), user); 
    464464     
    465         gtk_menu_popup(GTK_MENU(_menu), NULL, NULL, NULL, NULL,  
     465        gtk_menu_popup(GTK_MENU(_menu), 0, 0, 0, 0,  
    466466                   event->button, event->time); 
    467467     
  • trunk/jons-gtk-gui/src/convo.cpp

    r2495 r2532  
    4040        c = convo_find(u->Uin()); 
    4141 
    42         if(c != NULL) 
     42        if(c != 0) 
    4343        { 
    4444            if(u->Status() == ICQ_STATUS_OFFLINE) 
     
    9191    } 
    9292 
    93     return NULL; 
     93    return 0; 
    9494} 
    9595 
     
    124124 
    125125    /* The entry box */ 
    126     c->entry = gtk_text_new(NULL, NULL); 
     126    c->entry = gtk_text_new(0, 0); 
    127127    gtk_text_set_editable(GTK_TEXT(c->entry), TRUE); 
    128128    gtk_signal_connect(GTK_OBJECT(c->entry), "key_press_event", 
     
    132132 
    133133    /* The viewing messages box area */ 
    134     c->text = gtk_text_new(NULL, NULL); 
     134    c->text = gtk_text_new(0, 0); 
    135135    gtk_text_set_editable(GTK_TEXT(c->text), FALSE); 
    136136    gtk_text_set_word_wrap(GTK_TEXT(c->text), TRUE); 
     
    138138 
    139139    /* Scroll bar for the messages that are being viewed */ 
    140     scroll = gtk_scrolled_window_new(NULL, GTK_TEXT(c->text)->vadj); 
     140    scroll = gtk_scrolled_window_new(0, GTK_TEXT(c->text)->vadj); 
    141141    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), 
    142142                       GTK_POLICY_NEVER, 
     
    168168 
    169169    /* Send the message normal */ 
    170     c->send_normal = gtk_radio_button_new_with_label(NULL, "Normal"); 
     170    c->send_normal = gtk_radio_button_new_with_label(0, "Normal"); 
    171171 
    172172    /* Send the message urgently */ 
     
    271271        if(enter_sends && !(eventkey->state & GDK_SHIFT_MASK)) 
    272272        { 
    273             convo_send(NULL, (gpointer)c); 
     273            convo_send(0, (gpointer)c); 
    274274        } 
    275275        else if(enter_sends) 
     
    391391 
    392392    /* If the window doesn't exist, don't show anything */ 
    393     if(c == NULL) 
     393    if(c == 0) 
    394394    { 
    395395        system_status_refresh(); 
     
    400400 
    401401    /* Make sure we really have an event */ 
    402     if(u_event == NULL) 
     402    if(u_event == 0) 
    403403    { 
    404404        return; 
  • trunk/jons-gtk-gui/src/extras.cpp

    r2358 r2532  
    8585struct status_icon *make_pixmap(struct status_icon *icon, gchar **file) 
    8686{ 
    87     if(icon == NULL) 
     87    if(icon == 0) 
    8888        icon = g_new0(struct status_icon, 1); 
    8989         
    9090    icon->pm = gdk_pixmap_create_from_xpm_d(main_window->window, 
    9191                        &icon->bm, 
    92                         NULL, 
     92                        0, 
    9393                        file); 
    9494    return icon; 
     
    167167            main_window_show(); 
    168168            system_status_refresh(); 
    169             dialog_close(NULL, register_window); 
     169            dialog_close(0, register_window); 
    170170        } 
    171171        else 
     
    202202{ 
    203203    /* Make sure we have the right event and event tag */ 
    204     if( (etd->e_tag == 0 && event != NULL) || 
     204    if( (etd->e_tag == 0 && event != 0) || 
    205205        (etd->e_tag != 0 && !event->Equals(etd->e_tag)) ) 
    206206            return; 
     
    219219    strcpy(temp, etd->buf); 
    220220     
    221     if(event == NULL) 
     221    if(event == 0) 
    222222    { 
    223223        strcat(temp, "error"); 
     
    307307 
    308308    /* If the window isn't open, there isn't anything left to do */ 
    309     if(c == NULL) 
     309    if(c == 0) 
    310310        return; 
    311311