Enlightenment CVS committal
Author : codewarrior
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_argument.c etk_dnd.c etk_notebook.c
Log Message:
- formatting
- patch from ezek for etk_notebook_page_remove's implementation
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_argument.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_argument.c 2 Mar 2006 00:48:00 -0000 1.2
+++ etk_argument.c 2 Mar 2006 14:37:50 -0000 1.3
@@ -53,178 +53,178 @@
/* no arguments */
if(argc < 2)
- {
- /* check for required arguments */
- i = 0;
- arg = args;
- while(arg->short_name != -1)
- {
- if(arg->flags & ETK_ARGUMENT_FLAG_REQUIRED)
- {
- printf(_("Argument %d '-%c | --%s' is required\n"), i,
arg->short_name, arg->long_name);
- return ETK_ARGUMENT_RETURN_REQUIRED_NOT_FOUND;
- }
- ++i; ++arg;
- }
- return ETK_ARGUMENT_RETURN_OK;
- }
+ {
+ /* check for required arguments */
+ i = 0;
+ arg = args;
+ while(arg->short_name != -1)
+ {
+ if(arg->flags & ETK_ARGUMENT_FLAG_REQUIRED)
+ {
+ printf(_("Argument %d '-%c | --%s' is required\n"), i,
arg->short_name, arg->long_name);
+ return ETK_ARGUMENT_RETURN_REQUIRED_NOT_FOUND;
+ }
+ ++i; ++arg;
+ }
+ return ETK_ARGUMENT_RETURN_OK;
+ }
for(i = 1; i < argc; i++)
- {
- char *cur;
-
- cur = argv[i];
- if(!cur) continue;
-
- /* min length is 2, anything less is invalid */
- if(strlen(cur) < 2)
- {
- printf(_("Argument %d '%s' is too short\n"), i, argv[i]);
- return ETK_ARGUMENT_RETURN_MALFORMED;
- }
-
- /* short (single char) argument of the form -d val or -dval */
- if(cur[0] == '-' && cur[1] != '-')
- {
- arg = args;
-
- while(arg->short_name != -1)
+ {
+ char *cur;
+
+ cur = argv[i];
+ if(!cur) continue;
+
+ /* min length is 2, anything less is invalid */
+ if(strlen(cur) < 2)
+ {
+ printf(_("Argument %d '%s' is too short\n"), i, argv[i]);
+ return ETK_ARGUMENT_RETURN_MALFORMED;
+ }
+
+ /* short (single char) argument of the form -d val or -dval */
+ if(cur[0] == '-' && cur[1] != '-')
+ {
+ arg = args;
+
+ while(arg->short_name != -1)
+ {
+ /* match found for short arg */
+ if(arg->short_name == cur[1])
+ {
+ /* check to see if arg needs value */
+ if((arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED) &&
+ i + 1 < argc)
+ {
+ char *val = argv[i + 1];
+
+ /* if no value is present, report error */
+ if(val[0] == '-')
+ {
+ printf(_("Argument %d '%s' requires a value\n"), i, cur);
+ return ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
+ }
+
+ if(arg->data)
+ *(arg->data) = *val;
+ else
+ arg->data = val;
+ arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
+ ++i;
+ }
+ else if (arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED
+ && i + 1 >= argc)
{
- /* match found for short arg */
- if(arg->short_name == cur[1])
- {
- /* check to see if arg needs value */
- if((arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED) &&
- i + 1 < argc)
- {
- char *val = argv[i + 1];
-
- /* if no value is present, report error */
- if(val[0] == '-')
- {
- printf(_("Argument %d '%s' requires a
value\n"), i, cur);
- return
ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
- }
-
- if(arg->data)
- *(arg->data) = *val;
- else
- arg->data = val;
- arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
- ++i;
- }
- else if (arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED
- && i + 1 >= argc)
- {
- /* if no value is present, report error */
- printf(_("Argument %d '%s' requires a value\n"), i,
cur);
- return ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
- }
- else if(!(arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED))
- arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
- }
- ++arg;
+ /* if no value is present, report error */
+ printf(_("Argument %d '%s' requires a value\n"), i, cur);
+ return ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
}
- }
- /* long argument of the form --debug or --debug=something */
- else if(cur[0] == '-' && cur[1] == '-' && strlen(cur) > 2)
- {
- arg = args;
-
- while(arg->short_name != -1)
+ else if(!(arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED))
+ arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
+ }
+ ++arg;
+ }
+ }
+ /* long argument of the form --debug or --debug=something */
+ else if(cur[0] == '-' && cur[1] == '-' && strlen(cur) > 2)
+ {
+ arg = args;
+
+ while(arg->short_name != -1)
+ {
+ char *tmp = NULL;
+ char *tmp2;
+
+ if(!arg->long_name)
+ continue;
+
+ /* check if arg if of the form --foo=bar */
+ tmp = strchr(cur, '=');
+ if(tmp)
+ {
+ tmp2 = cur;
+ cur = calloc(tmp - tmp2 + 1, sizeof(char));
+ snprintf(cur, (tmp - tmp2 + 1) * sizeof(char), "%s", tmp2);
+ }
+ else
+ tmp = NULL;
+
+ /* match found for long arg */
+ if(!strcmp(arg->long_name, cur + 2))
+ {
+ /* check to see if arg needs value */
+ if((arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED) &&
+ ((i + 1 < argc) || (tmp != NULL)))
{
- char *tmp = NULL;
- char *tmp2;
+ char *val;
- if(!arg->long_name)
- continue;
+ if(!tmp)
+ val = argv[i + 1];
+ else
+ val = tmp + 1;
- /* check if arg if of the form --foo=bar */
- tmp = strchr(cur, '=');
- if(tmp )
- {
- tmp2 = cur;
- cur = calloc(tmp - tmp2 + 1, sizeof(char));
- snprintf(cur, (tmp - tmp2 + 1) * sizeof(char), "%s",
tmp2);
- }
- else
- tmp = NULL;
-
- /* match found for long arg */
- if(!strcmp(arg->long_name, cur + 2))
- {
- /* check to see if arg needs value */
- if((arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED) &&
- ((i + 1 < argc) || (tmp != NULL)))
- {
- char *val;
-
- if(!tmp)
- val = argv[i + 1];
- else
- val = tmp + 1;
-
- /* if no value is present, report error */
- if(val[0] == '-')
- {
- printf(_("Argument %d '%s' requires a
value\n"), i, cur);
- return
ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
- }
-
- if(arg->data)
- *(arg->data) = *val;
- else
- arg->data = val;
- arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
-
- if(!tmp)
- ++i;
- }
- else if (arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED
- && i + 1 >= argc)
- {
- /* if no value is present, report error */
- printf(_("Argument %d '%s' requires a value\n"), i,
cur);
- return ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
- }
- else if(!(arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED))
- arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
- }
-
- if(tmp)
- {
- free(cur);
- cur = argv[i];
- }
+ /* if no value is present, report error */
+ if(val[0] == '-')
+ {
+ printf(_("Argument %d '%s' requires a value\n"), i, cur);
+ return ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
+ }
+
+ if(arg->data)
+ *(arg->data) = *val;
+ else
+ arg->data = val;
+ arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
- ++arg;
+ if(!tmp)
+ ++i;
+ }
+ else if (arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED
+ && i + 1 >= argc)
+ {
+ /* if no value is present, report error */
+ printf(_("Argument %d '%s' requires a value\n"), i, cur);
+ return ETK_ARGUMENT_RETURN_REQUIRED_VALUE_NOT_FOUND;
}
- }
- }
+ else if(!(arg->flags & ETK_ARGUMENT_FLAG_VALUE_REQUIRED))
+ arg->flags |= ETK_ARGUMENT_FLAG_PRIV_SET;
+ }
+
+ if(tmp)
+ {
+ free(cur);
+ cur = argv[i];
+ }
+
+ ++arg;
+ }
+ }
+ }
/* check for required arguments */
i = 0;
arg = args;
while(arg->short_name != -1)
- {
- if(!(arg->flags & ETK_ARGUMENT_FLAG_PRIV_SET) &&
- arg->flags & ETK_ARGUMENT_FLAG_REQUIRED)
- {
- printf(_("Argument %d '-%c | --%s' is required\n"), i,
arg->short_name, arg->long_name);
- return ETK_ARGUMENT_RETURN_REQUIRED_NOT_FOUND;
- }
- ++i; ++arg;
- }
+ {
+ if(!(arg->flags & ETK_ARGUMENT_FLAG_PRIV_SET) &&
+ arg->flags & ETK_ARGUMENT_FLAG_REQUIRED)
+ {
+ printf(_("Argument %d '-%c | --%s' is required\n"), i,
arg->short_name, arg->long_name);
+ return ETK_ARGUMENT_RETURN_REQUIRED_NOT_FOUND;
+ }
+ ++i; ++arg;
+ }
/* call all the callbacks */
i = 0;
arg = args;
while(arg->short_name != -1)
- {
- if(arg->func && arg->flags & ETK_ARGUMENT_FLAG_PRIV_SET)
- arg->func(args, i);
- ++i; ++arg;
- }
+ {
+ if(arg->func && arg->flags & ETK_ARGUMENT_FLAG_PRIV_SET)
+ arg->func(args, i);
+ ++i; ++arg;
+ }
return ETK_ARGUMENT_RETURN_OK;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_dnd.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- etk_dnd.c 16 Feb 2006 01:40:16 -0000 1.10
+++ etk_dnd.c 2 Mar 2006 14:37:50 -0000 1.11
@@ -369,7 +369,7 @@
case ECORE_X_SELECTION_SECONDARY:
sel = ev->data;
- printf("secondary: %s %s\n", ev->target, sel->data);
+ //printf("secondary: %s %s\n", ev->target, sel->data);
break;
case ECORE_X_SELECTION_XDND:
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_notebook.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- etk_notebook.c 27 Feb 2006 22:00:16 -0000 1.9
+++ etk_notebook.c 2 Mar 2006 14:37:50 -0000 1.10
@@ -103,6 +103,28 @@
}
/**
+ * @brief Delete the specified page of the notebook
+ * @param notebook a notebook
+ * @param page_num the number of the page to delete to
+ */
+void etk_notebook_page_remove(Etk_Notebook *notebook, int page_num)
+{
+ Evas_List *l;
+ Etk_Notebook_Page *page;
+
+ if (!notebook || !(l = evas_list_nth_list(notebook->pages, page_num)))
+ return;
+
+ page = l->data;
+ etk_widget_parent_set(page->page_frame, NULL);
+ etk_object_destroy(ETK_OBJECT(page->page_frame));
+ etk_widget_parent_set(page->tab, NULL);
+ etk_object_destroy(ETK_OBJECT(page->tab));
+ free(page);
+ notebook->pages = evas_list_remove_list(notebook->pages, l);
+}
+
+/**
* @brief Sets the label of the tab of a page of the notebook
* @param notebook a notebook
* @param page_num the number of the page to set the tab label to
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs