win_factory.c
Go to the documentation of this file.
00001 
00023 #include "win_button.h"
00024 
00025 /* Not an error, see comments in generated file. */
00026 #include "gen/win_factory_gen.c"
00027 
00028 /* Don't need a definition since we don't use it */
00029 //typedef struct win_factory_data_st_ *win_factory_data_handle;
00030 
00038 static button_handle
00039 win_factory_gui_factory_create_button (gui_factory_handle gui_factory_h)
00040 {
00041     win_button_handle win_button_h;
00042     button_handle button_h = NULL;
00043 
00044     if (NULL == gui_factory_h) {
00045         return (NULL);
00046     }
00047 
00048     win_button_h = win_button_new1();
00049     if (NULL != win_button_h) {
00050         button_h = win_button_cast_to_button(win_button_h);
00051     }
00052 
00053     return (button_h);
00054 }
00055 
00064 static void
00065 win_factory_data_delete (win_factory_data_handle *win_factory_data_h)
00066 {
00067     if ((NULL == win_factory_data_h) || (NULL == *win_factory_data_h)) {
00068         return;
00069     }
00070 
00071     free(*win_factory_data_h);
00072     *win_factory_data_h = NULL;
00073 }
00074 
00083 static bool
00084 win_factory_data_create (win_factory_data_handle *win_factory_data_h,
00085                          void *context)
00086 {
00087     if (NULL == win_factory_data_h) {
00088         return (false);
00089     }
00090 
00091     /* No data is stored for this class */
00092     *win_factory_data_h = NULL;
00093 
00094     return (true);
00095 }
00096 
00102 win_factory_handle
00103 win_factory_new1 (void)
00104 {
00105     win_factory_st *win_factory = NULL;
00106     bool rc;
00107 
00108     win_factory = calloc(1, sizeof(*win_factory));
00109     if (NULL != win_factory) {
00110         rc = win_factory_init(win_factory, NULL);
00111         if (!rc) {
00112             goto err_exit;
00113         }
00114     }
00115 
00116     return (win_factory);
00117 
00118 err_exit:
00119 
00120     win_factory_delete(win_factory);
00121 
00122     return (NULL);
00123 }
 All Classes Files Functions Variables Typedefs