📄 abookcontactviewsim.c
字号:
/* addressbook - Address book *abookcontactviewsim.c - * *Authors: YE Nan <nan.ye@orange-ftgroup.com> * ZHAO Liangjing <liangjing.zhao@orange-ftgroup.com> * *This software and associated documentation files (the "Software") *are copyright (C) 2005 LiPS Linux Phone Standards Forum [FranceTelecom] *All Rights Reserved. * *A copyright license is hereby granted for redistribution and use of *the Software in source and binary forms, with or without modification, *provided that the following conditions are met: *- Redistributions of source code must retain the above copyright notice, *this copyright license and the following disclaimer. *- Redistributions in binary form must reproduce the above copyright *notice, this copyright license and the following disclaimer in the *documentation and/or other materials provided with the distribution. *- Neither the name of LiPS nor the names of its Members may be used *to endorse or promote products derived from the Software without *specific prior written permission. * *A patent license for any Necessary Claims owned by Members of LiPS Forum *to make, have made, use, import, offer to sell, lease and sell or otherwise *distribute any implementation compliant with the any specification adopted *by the LiPS Forumcan be obtained from the respective Members on reasonable *and non-discriminatory terms and conditions and under reciprocity, as *regulated in more detail in the Internal Policy of the LiPS Forum. * *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER, ITS MEMBERS AND CONTRIBUTORS *"AS IS", AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, *THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE *AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, *ITS MEMBERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) *ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *POSSIBILITY OF SUCH DAMAGE. */#include <gtk/gtk.h>#include "abookviewcell.h"#include "abookviewcellstd.h"#include "abookviewcellimg.h"#include "abookcontactviewsim.h"static void abook_contact_view_sim_class_init (ABookContactViewSimClass * klass);static void abook_contact_view_sim_init (ABookContactViewSim *view);static void abook_contact_view_sim_destroy (GtkObject *object);static ABItemsView *parent_class = NULL;GTypeabook_contact_view_sim_get_type (void){ static GType view_type = 0; if (!view_type) { static const GTypeInfo view_info = { sizeof (ABookContactViewSimClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) abook_contact_view_sim_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (ABookContactViewSim), 0, /* n_preallocs */ (GInstanceInitFunc) abook_contact_view_sim_init, NULL, }; view_type = g_type_register_static (AB_TYPE_ITEMS_VIEW, "ABookContactViewSim", &view_info, 0); } return view_type;}static voidabook_contact_view_sim_class_init (ABookContactViewSimClass *klass){ GtkObjectClass *object_class; object_class = (GtkObjectClass *) klass; parent_class = g_type_class_peek_parent (klass); object_class->destroy = abook_contact_view_sim_destroy; return;}static voidabook_contact_view_sim_destroy (GtkObject *object){ (*GTK_OBJECT_CLASS (parent_class)->destroy) (object); return;}static voidabook_contact_view_sim_init (ABookContactViewSim *view){ ABItemsView *base = AB_ITEMS_VIEW (view); GtkWidget *cell = NULL; GtkWidget *seperator = NULL; GtkWidget *image = NULL; /* Name Cell */ cell = abook_view_cell_std_new ("<span color=\"Blue\">Name</span>");// g_print("%s(): cell = 0x%08x\n", __FUNCTION__, (guint32)cell); ab_items_view_set_item (AB_ITEMS_VIEW (view), AB_IV_LAST_NAME, ABOOK_VIEW_CELL (cell)); gtk_widget_set_size_request (abook_view_cell_std_get_entry (ABOOK_VIEW_CELL_STD (cell)), 120, -1); /* Image */ image = gtk_image_new (); if (TRUE) { GtkWidget *hbox = NULL; hbox = gtk_hbox_new (FALSE, 0); gtk_widget_set_size_request (hbox, -1, 70); gtk_box_pack_start (GTK_BOX (hbox), cell, FALSE, FALSE, 10); gtk_box_pack_end (GTK_BOX (hbox), image, FALSE, FALSE, 10); gtk_box_pack_start (GTK_BOX (base->layout), hbox, FALSE, FALSE, 10); } /* Seperator */ seperator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (base->layout), seperator, FALSE, FALSE, 0); /* Number Cell */ cell = abook_view_cell_std_new ("<span color=\"Blue\">Number</span>");// g_print("%s(): cell = 0x%08x\n", __FUNCTION__, (guint32)cell);// abook_view_cell_set_value(ABOOK_VIEW_CELL(cell), "13810630352"); ab_items_view_set_item (AB_ITEMS_VIEW (view), AB_IV_MOBILE_NUM, ABOOK_VIEW_CELL (cell)); gtk_box_pack_start (GTK_BOX (base->layout), cell, FALSE, FALSE, 5); /* Image Cell */ cell = abook_view_cell_image_new ("<span color=\"Blue\">Picture</span>"); abook_view_cell_set_visualizable (ABOOK_VIEW_CELL (cell), FALSE); abook_view_cell_image_set_buddy (ABOOK_VIEW_CELL_IMAGE (cell), image); abook_view_cell_set_value (ABOOK_VIEW_CELL (cell), "iconsim.png"); ab_items_view_set_item (AB_ITEMS_VIEW (view), AB_IV_PICTURE, ABOOK_VIEW_CELL (cell)); gtk_box_pack_start (GTK_BOX (base->layout), cell, FALSE, FALSE, 5); return;}GtkWidget *abook_contact_view_sim_new (void){ return gtk_widget_new (ABOOK_TYPE_CONTACT_VIEW_SIM, NULL);}/* vi:ts=2:nowrap:ai:expandtab*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -