[XForms] pathc to add client message callback

Jean-Marc Lasgouttes Jean-Marc.Lasgouttes at inria.fr
Fri May 28 11:10:05 EDT 2004


>>>>> "Jeff" == Jeff  <wd4nmq at comcast.net> writes:

Jeff> To subscribers of the xforms list To all,

Jeff> Ok, here is the patch for adding the an X client message
Jeff> handling callback.

Jeff, something that would be very nice is a ChangeLog entry
describing what you did to each file/function. 

Also, a demo program (I think you had one) would be great.

The patch lokks very good in general, but I have a few formatting nitpicks:

 	/* pump it thru current form */
-	fl_handle_form(form, FL_OTHER, 0, xev);
+        if(form->client_callback){
+	  if(!form->client_callback(form, xev))
+	    fl_handle_form(form, FL_OTHER, 0, xev);
+	}
+	else
+	  fl_handle_form(form, FL_OTHER, 0, xev);
     }
 }

Please respect the indentation conventions of the file: 4 characters
for each nesting level. Also, you should add a space after "if (".

+FL_CLIENT_CALLBACK
+fl_register_client_callback(FL_FORM *form, FL_CLIENT_CALLBACK clientCallback){
+
+  FL_CLIENT_CALLBACK old_rcb;
+
+  old_rcb =form->client_callback; 
+  form->client_callback = clientCallback;
+  return old_rcb;
+}

Add a space after "=" above. Respect indentation. Put the opening
brace of the function block on a line by itself.

+
+/**********************************/
+Window fl_get_winID(FL_FORM *form){
+  return form->window;
+}

Is this really needed since FL_FORM->window is public (and
documented?). Moreover, I do not think the name follows xforms
conventions. 

+FL_EXPORT FL_CLIENT_CALLBACK fl_register_client_callback(
+                FL_FORM *form,
+                FL_CLIENT_CALLBACK rcb
+                );

Indentation seems to be made of two tabs in this file.

+FL_EXPORT Window fl_get_winID(
+                FL_FORM *form
+                );
+

here too.

Don't feel put down by these remarks, I am just trying to keep the
code style coherent.

JMarc



More information about the Xforms mailing list