Enlightenment CVS committal
Author : leviathan
Project : e17
Module : libs/etk-perl
Dir : e17/libs/etk-perl
Modified Files:
Etk.xs EtkSignals.c Makefile.PL README TODO
Log Message:
- Complete tree model implementation (now columns can have many models)
- Add alpha to colorpicker
- Add documentation to Etk::Simple
===================================================================
RCS file: /cvs/e/e17/libs/etk-perl/Etk.xs,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- Etk.xs 21 Jan 2007 01:12:44 -0000 1.77
+++ Etk.xs 29 Jan 2007 13:55:44 -0000 1.78
@@ -222,7 +222,7 @@
sig = etk_signal_lookup(signal_name, obj->type);
if(!sig) printf("CANT GET SIG!\n");
marsh = etk_signal_marshaller_get(sig);
-
+
if(marsh == etk_marshaller_VOID__VOID)
etk_signal_connect_full(sig, obj, ETK_CALLBACK(callback_VOID__VOID),
cbd, swapped, after);
else if(marsh == etk_marshaller_VOID__INT)
@@ -239,6 +239,8 @@
etk_signal_connect_full(sig, obj,
ETK_CALLBACK(callback_BOOL__DOUBLE), cbd, swapped, after);
else if(marsh == etk_marshaller_BOOL__POINTER_POINTER)
etk_signal_connect_full(sig, obj,
ETK_CALLBACK(callback_BOOL__POINTER_POINTER), cbd, swapped, after);
+ else if(marsh == etk_marshaller_VOID__POINTER_POINTER)
+ etk_signal_connect_full(sig, obj,
ETK_CALLBACK(callback_VOID__POINTER_POINTER), cbd, swapped, after);
else
etk_signal_connect_full(sig, obj, ETK_CALLBACK(callback_VOID__VOID),
cbd, swapped, after);
@@ -817,6 +819,18 @@
ALIAS:
CurrentColorGet=1
+void
+etk_colorpicker_use_alpha_set(cp, use_alpha)
+ Etk_Colorpicker * cp
+ Etk_Bool use_alpha
+ ALIAS:
+ UseAlphaSet=1
+
+Etk_Bool
+etk_colorpicker_use_alpha_get(cp)
+ Etk_Colorpicker * cp
+ ALIAS:
+ UseAlphaGet=1
void
etk_colorpicker_current_color_set(cp, color)
@@ -3342,7 +3356,7 @@
ALIAS:
ValueGet=1
-void
+Etk_Bool
etk_range_value_set(range, value)
Etk_Range * range
double value
@@ -4730,6 +4744,96 @@
void
+model_fields_set(row, emit_signal, model, ...)
+ Etk_Tree_Row * row
+ Etk_Bool emit_signal
+ SV * model
+ ALIAS:
+ ModelFieldsSet=1
+ PREINIT:
+ Etk_Tree_Model * etkmodel;
+ SV ** mod;
+ CODE:
+ etkmodel = (Etk_Tree_Model *) SvObj(model, "Etk::Tree::Model");
+ mod = hv_fetch( (HV*)SvRV(model), "_model", 6, 0);
+ if (mod) {
+ int type = SvIV(*mod);
+ switch(type) {
+ case mINT:
+ etk_tree_row_model_fields_set(row, emit_signal, etkmodel,
SvIV(ST(3)), NULL);
+ break;
+ case mDOUBLE:
+ etk_tree_row_model_fields_set(row, emit_signal, etkmodel,
SvNV(ST(3)), NULL);
+ break;
+ case mCHECKBOX:
+ etk_tree_row_model_fields_set(row, emit_signal, etkmodel,
SvIV(ST(3)), NULL);
+ break;
+ case mIMAGE:
+ if (items == 4)
+ etk_tree_row_model_fields_set(row, emit_signal,
etkmodel,
+ SvPV_nolen(ST(3)), NULL, NULL);
+ else
+ etk_tree_row_model_fields_set(row, emit_signal,
etkmodel,
+ SvPV_nolen(ST(3)), SvPV_nolen(ST(4)), NULL);
+ break;
+ case mPROGRESSBAR:
+ break;
+ case mTEXT:
+ etk_tree_row_model_fields_set(row, emit_signal, etkmodel,
SvPV_nolen(ST(3)), NULL);
+ break;
+ }
+ }
+
+
+void
+model_fields_get(row, model)
+ Etk_Tree_Row * row
+ SV * model
+ ALIAS:
+ ModelFieldsGet=1
+ PREINIT:
+ Etk_Tree_Model * mod;
+ SV ** models;
+ int i;
+ Etk_Bool c;
+ double d;
+ char *c1, *c2, *c3;
+ PPCODE:
+ mod = (Etk_Tree_Model *) SvObj(model, "Etk::Tree::Model");
+ models = hv_fetch( (HV*)SvRV(model), "_model", 6, 0);
+ if (models) {
+ int type = SvIV(*models);
+ switch(type) {
+ case mINT:
+ etk_tree_row_model_fields_get(row, mod, &i, NULL);
+ XPUSHs(sv_2mortal(newSViv(i)));
+ break;
+ case mDOUBLE:
+ etk_tree_row_model_fields_get(row, mod, &d, NULL);
+ XPUSHs(sv_2mortal(newSVnv(d)));
+ break;
+ case mCHECKBOX:
+ etk_tree_row_model_fields_get(row, mod, &c, NULL);
+ XPUSHs(sv_2mortal(newSViv(c)));
+ break;
+ case mIMAGE:
+ etk_tree_row_model_fields_get(row, mod, &c1, &c2, NULL);
+ XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
+ if (c2) XPUSHs(sv_2mortal(newSVpv(c2, strlen(c2))));
+ break;
+ case mPROGRESSBAR:
+ //etk_tree_row_model_fields_get(row, mod, &d, &c1,
NULL);
+ //XPUSHs(sv_2mortal(newSVnv(d)));
+ //XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
+ break;
+ case mTEXT:
+ etk_tree_row_model_fields_get(row, mod, &c1, NULL);
+ XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
+ break;
+ }
+ }
+
+void
fields_set(row, emit_signal, col, ...)
Etk_Tree_Row * row
Etk_Bool emit_signal
@@ -4785,46 +4889,50 @@
FieldsGet=1
PREINIT:
Etk_Tree_Col * column;
+ SV ** models;
SV ** model;
int i;
Etk_Bool c;
double d;
char *c1, *c2, *c3;
PPCODE:
- // TODO: change this
-
column = (Etk_Tree_Col *) SvObj(col, "Etk::Tree::Col");
-
- model = hv_fetch( (HV*)SvRV(col), "_model", 6, 0);
- if (model) {
- int type = SvIV(*model);
- switch(type) {
- case mINT:
- etk_tree_row_fields_get(row, column, &i, NULL);
- XPUSHs(sv_2mortal(newSViv(i)));
- break;
- case mCHECKBOX:
- etk_tree_row_fields_get(row, column, &c, NULL);
- XPUSHs(sv_2mortal(newSViv(c)));
- break;
- case mDOUBLE:
- etk_tree_row_fields_get(row, column, &d, NULL);
- XPUSHs(sv_2mortal(newSVnv(d)));
- break;
- case mIMAGE:
- etk_tree_row_fields_get(row, column, &c1, NULL);
- XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
- break;
- case mPROGRESSBAR:
- etk_tree_row_fields_get(row, column, &d, &c1,
NULL);
- XPUSHs(sv_2mortal(newSVnv(d)));
- XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
- break;
- case mTEXT:
- etk_tree_row_fields_get(row, column, &c1, NULL);
- XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
- break;
- }
+ models = hv_fetch( (HV*)SvRV(col), "_models", 7, 0);
+ if (models) {
+ AV * mods = (AV *) SvRV(*models);
+ int total = (int)av_len(mods);
+ model = av_fetch(mods, 0, 0);
+ if (model) {
+ int type = SvIV(*model);
+ switch(type) {
+ case mINT:
+ etk_tree_row_fields_get(row, column, &i, NULL);
+ XPUSHs(sv_2mortal(newSViv(i)));
+ break;
+ case mDOUBLE:
+ etk_tree_row_fields_get(row, column, &d, NULL);
+ XPUSHs(sv_2mortal(newSVnv(d)));
+ break;
+ case mCHECKBOX:
+ etk_tree_row_fields_get(row, column, &c, NULL);
+ XPUSHs(sv_2mortal(newSViv(c)));
+ break;
+ case mIMAGE:
+ etk_tree_row_fields_get(row, column, &c1, &c2, NULL);
+ XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
+ if (c2) XPUSHs(sv_2mortal(newSVpv(c2, strlen(c2))));
+ break;
+ case mPROGRESSBAR:
+ //etk_tree_row_fields_get(row, column, &d, &c1, NULL);
+ //XPUSHs(sv_2mortal(newSVnv(d)));
+ //XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
+ break;
+ case mTEXT:
+ etk_tree_row_fields_get(row, column, &c1, NULL);
+ XPUSHs(sv_2mortal(newSVpv(c1, strlen(c1))));
+ break;
+ }
+ }
}
===================================================================
RCS file: /cvs/e/e17/libs/etk-perl/EtkSignals.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- EtkSignals.c 21 Jan 2007 01:12:44 -0000 1.6
+++ EtkSignals.c 29 Jan 2007 13:55:44 -0000 1.7
@@ -7,7 +7,7 @@
HV *event_hv;
SV *event_rv;
-
+
if(!strcmp(cbd->signal_name, "mouse_up"))
{
Etk_Event_Mouse_Up *event = value;
@@ -59,9 +59,9 @@
if(!strcmp(cbd->signal_name, "row_clicked"))
{
Etk_Tree_Row * row = val1;
- Etk_Event_Key_Up *key_event = val2;
+ Etk_Event_Mouse_Up *key_event = (Etk_Event_Mouse_Up *)val2;
*obj = newSVObj(row, getClass("Etk_Tree_Row"));
- *event = newSVEventKeyUp(key_event);
+ *event = newSVEventMouseUp(key_event);
}
}
===================================================================
RCS file: /cvs/e/e17/libs/etk-perl/Makefile.PL,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- Makefile.PL 1 Sep 2006 18:08:07 -0000 1.9
+++ Makefile.PL 29 Jan 2007 13:55:44 -0000 1.10
@@ -3,8 +3,10 @@
use Devel::PPPort;
# dependency check
+print "Checking for Etk...";
my $etklib = `etk-config --version`;
die "I can't run etk-config, make sure that etk is installed, and that
etk-config is in your path" unless $etklib;
+print "Ok\n";
Devel::PPPort::WriteFile();
===================================================================
RCS file: /cvs/e/e17/libs/etk-perl/README,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- README 6 Oct 2006 21:01:49 -0000 1.8
+++ README 29 Jan 2007 13:55:44 -0000 1.9
@@ -34,7 +34,7 @@
COPYRIGHT AND LICENCE
-Copyright (C) 2006 by Hisham Mardam Bey
+Copyright (C) 2007 by Chady Kassouf
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.7 or,
===================================================================
RCS file: /cvs/e/e17/libs/etk-perl/TODO,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- TODO 21 Jan 2007 01:12:44 -0000 1.23
+++ TODO 29 Jan 2007 13:55:44 -0000 1.24
@@ -1,6 +1,5 @@
TODO:
- - Fix Etk_Tree column models
- - callback system needs to convert event structs to perl equivalents
+ - complete callback system
- perldoc everything
- complete Tests
* Combobox
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs