Enlightenment CVS committal

Author  : moom16
Project : e17
Module  : proto

Dir     : e17/proto/etk/src/lib


Modified Files:
        etk_notebook.c etk_notebook.h 


Log Message:
* More notebook work


===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_notebook.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- etk_notebook.c      24 Dec 2005 18:13:06 -0000      1.3
+++ etk_notebook.c      25 Dec 2005 23:48:10 -0000      1.4
@@ -10,7 +10,13 @@
  * @addtogroup Etk_Notebook
  * @{
  */
- 
+
+enum _Etk_Notebook_Signal_Id
+{
+   ETK_NOTEBOOK_CURRENT_PAGE_CHANGED_SIGNAL,
+   ETK_NOTEBOOK_NUM_SIGNALS
+};
+
 static void _etk_notebook_constructor(Etk_Notebook *notebook);
 static void _etk_notebook_destructor(Etk_Notebook *notebook);
 static void _etk_notebook_child_add(Etk_Container *container, Etk_Widget 
*widget);
@@ -21,6 +27,8 @@
 static Etk_Notebook_Page *_etk_notebook_page_create(Etk_Notebook *notebook, 
const char *tab_label, Etk_Widget *page_widget);
 static void _etk_notebook_current_page_show(Etk_Notebook *notebook);
 
+static Etk_Signal *_etk_notebook_signals[ETK_NOTEBOOK_NUM_SIGNALS];
+
 /**************************
  *
  * Implementation
@@ -38,6 +46,8 @@
    if (!notebook_type)
    {
       notebook_type = etk_type_new("Etk_Notebook", ETK_CONTAINER_TYPE, 
sizeof(Etk_Notebook), ETK_CONSTRUCTOR(_etk_notebook_constructor), 
ETK_DESTRUCTOR(_etk_notebook_destructor));
+   
+      _etk_notebook_signals[ETK_NOTEBOOK_CURRENT_PAGE_CHANGED_SIGNAL] = 
etk_signal_new("current_page_changed", notebook_type, -1, 
etk_marshaller_VOID__VOID, NULL, NULL);
    }
 
    return notebook_type;
@@ -67,6 +77,20 @@
 }
 
 /* TODO */
+int etk_notebook_page_prepend(Etk_Notebook *notebook, const char *tab_label, 
Etk_Widget *page_widget)
+{
+   Etk_Notebook_Page *new_page;
+   
+   if (!notebook)
+      return -1;
+   
+   if (!(new_page = _etk_notebook_page_create(notebook, tab_label, 
page_widget)))
+      return -1;
+   notebook->pages = evas_list_prepend(notebook->pages, new_page);
+   return 0;
+}
+
+/* TODO */
 void etk_notebook_current_page_set(Etk_Notebook *notebook, int page_num)
 {
    Etk_Notebook_Page *page;
@@ -76,6 +100,23 @@
    etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(page->tab), 1);
 }
 
+/* TODO */
+int etk_notebook_current_page_get(Etk_Notebook *notebook)
+{
+   int i;
+   Evas_List *l;
+   
+   if (!notebook || !notebook->current_page)
+      return -1;
+   
+   for (l = notebook->pages, i = 0; l; l = l->next, i++)
+   {
+      if (notebook->current_page == (Etk_Notebook_Page *)l->data)
+         return i;
+   }
+   return -1;
+}
+
 /**************************
  *
  * Etk specific functions
@@ -249,6 +290,7 @@
          if (notebook->current_page)
             etk_widget_hide(notebook->current_page->page_frame);
          notebook->current_page = page;
+         
etk_signal_emit(_etk_notebook_signals[ETK_NOTEBOOK_CURRENT_PAGE_CHANGED_SIGNAL],
 ETK_OBJECT(notebook), NULL);
          _etk_notebook_current_page_show(notebook);
       }
    }
@@ -290,6 +332,7 @@
    if (!notebook->current_page)
    {
       notebook->current_page = new_page;
+      
etk_signal_emit(_etk_notebook_signals[ETK_NOTEBOOK_CURRENT_PAGE_CHANGED_SIGNAL],
 ETK_OBJECT(notebook), NULL);
       _etk_notebook_current_page_show(notebook);
    }
    etk_widget_size_recalc_queue(ETK_WIDGET(notebook));
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_notebook.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_notebook.h      23 Dec 2005 23:01:06 -0000      1.2
+++ etk_notebook.h      25 Dec 2005 23:48:10 -0000      1.3
@@ -43,9 +43,11 @@
 Etk_Type *etk_notebook_type_get();
 Etk_Widget *etk_notebook_new();
 
+int etk_notebook_page_prepend(Etk_Notebook *notebook, const char *tab_label, 
Etk_Widget *page_widget);
 int etk_notebook_page_append(Etk_Notebook *notebook, const char *tab_label, 
Etk_Widget *page_widget);
 
 void etk_notebook_current_page_set(Etk_Notebook *notebook, int page_num);
+int etk_notebook_current_page_get(Etk_Notebook *notebook);
 
 /** @} */
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to