Exemplo n.º 1
0
/**
 * @internal
 * @brief Gets the type of an Etk_Menu_Item
 * @return Returns the type of an Etk_Menu_Item
 */
Etk_Type *etk_menu_item_type_get(void)
{
   static Etk_Type *menu_item_type = NULL;

   if (!menu_item_type)
   {
      const Etk_Signal_Description signals[] = {
         ETK_SIGNAL_DESC_HANDLER(ETK_MENU_ITEM_SELECTED_SIGNAL,
            "selected", Etk_Menu_Item, selected_handler,
            etk_marshaller_VOID),
         ETK_SIGNAL_DESC_HANDLER(ETK_MENU_ITEM_UNSELECTED_SIGNAL,
            "unselected", Etk_Menu_Item, unselected_handler,
            etk_marshaller_VOID),
         ETK_SIGNAL_DESC_HANDLER(ETK_MENU_ITEM_ACTIVATED_SIGNAL,
            "activated", Etk_Menu_Item, activated_handler,
            etk_marshaller_VOID),
         ETK_SIGNAL_DESCRIPTION_SENTINEL
      };

      menu_item_type = etk_type_new("Etk_Menu_Item", ETK_WIDGET_TYPE,
         sizeof(Etk_Menu_Item), ETK_CONSTRUCTOR(_etk_menu_item_constructor),
         ETK_DESTRUCTOR(_etk_menu_item_destructor), signals);

      etk_type_property_add(menu_item_type, "label", ETK_MENU_ITEM_LABEL_PROPERTY,
         ETK_PROPERTY_STRING, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_string(NULL));
      etk_type_property_add(menu_item_type, "submenu", ETK_MENU_ITEM_SUBMENU_PROPERTY,
         ETK_PROPERTY_OBJECT, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_object(NULL));

      menu_item_type->property_set = _etk_menu_item_property_set;
      menu_item_type->property_get = _etk_menu_item_property_get;
   }

   return menu_item_type;
}
Exemplo n.º 2
0
/**
 * @internal
 * @brief Gets the type of an Etk_String
 * @return Returns the type of an Etk_String
 */
Etk_Type *etk_string_type_get(void)
{
   static Etk_Type *string_type = NULL;

   if (!string_type)
   {
      string_type = etk_type_new("Etk_String", ETK_OBJECT_TYPE, sizeof(Etk_String),
            ETK_CONSTRUCTOR(_etk_string_constructor), ETK_DESTRUCTOR(_etk_string_destructor), NULL);
      etk_type_property_add(string_type, "string", ETK_STRING_STRING_PROPERTY,
            ETK_PROPERTY_STRING, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_string(NULL));
      
      string_type->property_set = _etk_string_property_set;
      string_type->property_get = _etk_string_property_get;
   }

   return string_type;
}
Exemplo n.º 3
0
/**
 * @internal
 * @brief Gets the type of an Etk_Frame
 * @return Returns the type of an Etk_Frame
 */
Etk_Type *etk_frame_type_get(void)
{
   static Etk_Type *frame_type = NULL;

   if (!frame_type)
   {
      frame_type = etk_type_new("Etk_Frame", ETK_BIN_TYPE, sizeof(Etk_Frame),
         ETK_CONSTRUCTOR(_etk_frame_constructor),
         ETK_DESTRUCTOR(_etk_frame_destructor), NULL);

      etk_type_property_add(frame_type, "label", ETK_FRAME_LABEL_PROPERTY,
         ETK_PROPERTY_STRING, ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_string(NULL));

      frame_type->property_set = _etk_frame_property_set;
      frame_type->property_get = _etk_frame_property_get;
   }

   return frame_type;
}