aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGrégoire Jadi2013-06-11 23:05:18 +0200
committerGrégoire Jadi2013-06-11 23:05:18 +0200
commitd4244f65c1103f285f8e61826eb804a568d548ef (patch)
treeac0c5a6a38850ffb6a6e8ffeb9e11a70a7aa2c49 /src
parent64548c82e4d959bc4253cc3d2869eb8f76a4e989 (diff)
downloademacs-d4244f65c1103f285f8e61826eb804a568d548ef.tar.gz
emacs-d4244f65c1103f285f8e61826eb804a568d548ef.zip
* src/xwidget.c: Prefix all Lisp keywords on the C side by QC (standard
convention). This is done especially for Qtitle which is used here as a keyword but which is also declared in frame.c and used as a regular symbol.
Diffstat (limited to 'src')
-rw-r--r--src/xwidget.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/xwidget.c b/src/xwidget.c
index 69e2923d0f0..abbbec4735d 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -120,14 +120,14 @@ allocate_xwidget_view (void)
120#define XSETXWIDGET_VIEW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_XWIDGET_VIEW)) 120#define XSETXWIDGET_VIEW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_XWIDGET_VIEW))
121 121
122Lisp_Object Qxwidget; 122Lisp_Object Qxwidget;
123Lisp_Object Qcxwidget; 123Lisp_Object QCxwidget;
124Lisp_Object Qtitle; 124Lisp_Object QCtitle;
125Lisp_Object Qxwidget_set_keyboard_grab; 125Lisp_Object Qxwidget_set_keyboard_grab;
126Lisp_Object Qxwidget_embed_steal_window; 126Lisp_Object Qxwidget_embed_steal_window;
127Lisp_Object Qxwidget_info; 127Lisp_Object Qxwidget_info;
128Lisp_Object Qxwidget_resize; 128Lisp_Object Qxwidget_resize;
129Lisp_Object Qxwidget_send_keyboard_event; 129Lisp_Object Qxwidget_send_keyboard_event;
130Lisp_Object Qcxwgir_class; 130Lisp_Object QCxwgir_class;
131Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qsocket_osr, Qcairo, Qxwgir, 131Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qsocket_osr, Qcairo, Qxwgir,
132 Qwebkit_osr, QCplist; 132 Qwebkit_osr, QCplist;
133 133
@@ -227,7 +227,7 @@ TYPE is a symbol which can take one of the following values:
227 */ 227 */
228 if (EQ(xw->type, Qwebkit_osr)|| 228 if (EQ(xw->type, Qwebkit_osr)||
229 EQ(xw->type, Qsocket_osr)|| 229 EQ(xw->type, Qsocket_osr)||
230 (Fget(xw->type, Qcxwgir_class) != Qnil)) { 230 (Fget(xw->type, QCxwgir_class) != Qnil)) {
231 printf("init osr widget\n"); 231 printf("init osr widget\n");
232 block_input(); 232 block_input();
233 xw->widgetwindow_osr = GTK_CONTAINER (gtk_offscreen_window_new ()); 233 xw->widgetwindow_osr = GTK_CONTAINER (gtk_offscreen_window_new ());
@@ -237,9 +237,9 @@ TYPE is a symbol which can take one of the following values:
237 xw->widget_osr = webkit_web_view_new(); 237 xw->widget_osr = webkit_web_view_new();
238 if(EQ(xw->type, Qsocket_osr)) 238 if(EQ(xw->type, Qsocket_osr))
239 xw->widget_osr = gtk_socket_new(); 239 xw->widget_osr = gtk_socket_new();
240 if(Fget(xw->type, Qcxwgir_class) != Qnil) 240 if(Fget(xw->type, QCxwgir_class) != Qnil)
241 xw->widget_osr = xwgir_create(SDATA(Fcar(Fcdr(Fget(xw->type, Qcxwgir_class)))), 241 xw->widget_osr = xwgir_create(SDATA(Fcar(Fcdr(Fget(xw->type, QCxwgir_class)))),
242 SDATA(Fcar(Fget(xw->type, Qcxwgir_class)))); 242 SDATA(Fcar(Fget(xw->type, QCxwgir_class))));
243 243
244 gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); 244 gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height);
245 gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); 245 gtk_container_add (xw->widgetwindow_osr, xw->widget_osr);
@@ -764,7 +764,7 @@ xwgir_convert_lisp_to_gir_arg(GIArgument* giarg,
764void 764void
765refactor_attempt(){ 765refactor_attempt(){
766 //this methhod should be called from xwgir-xwidget-call-method and from xwgir xwidget construction 766 //this methhod should be called from xwgir-xwidget-call-method and from xwgir xwidget construction
767 char* class = SDATA(Fcar(Fcdr(Fget(xw->type, Qcxwgir_class)))); 767 char* class = SDATA(Fcar(Fcdr(Fget(xw->type, QCxwgir_class))));
768 768
769 GIObjectInfo* obj_info = g_irepository_find_by_name(girepository, namespace, class); 769 GIObjectInfo* obj_info = g_irepository_find_by_name(girepository, namespace, class);
770 GIFunctionInfo* f_info = g_object_info_find_method (obj_info, SDATA(method)); 770 GIFunctionInfo* f_info = g_object_info_find_method (obj_info, SDATA(method));
@@ -810,7 +810,7 @@ DEFUN ("xwgir-xwidget-call-method", Fxwgir_xwidget_call_method, Sxwgir_xwidget_
810 if(Qnil == xwidget) {printf("ERROR xwidget nil\n"); return Qnil;}; 810 if(Qnil == xwidget) {printf("ERROR xwidget nil\n"); return Qnil;};
811 xw = XXWIDGET(xwidget); 811 xw = XXWIDGET(xwidget);
812 if(NULL == xw) printf("ERROR xw is 0\n"); 812 if(NULL == xw) printf("ERROR xw is 0\n");
813 char* namespace = SDATA(Fcar(Fget(xw->type, Qcxwgir_class))); 813 char* namespace = SDATA(Fcar(Fget(xw->type, QCxwgir_class)));
814 //we need the concrete widget, which happens in 2 ways depending on OSR or not TODO 814 //we need the concrete widget, which happens in 2 ways depending on OSR or not TODO
815 GtkWidget* widget = NULL; 815 GtkWidget* widget = NULL;
816 if(NULL == xw->widget_osr) { 816 if(NULL == xw->widget_osr) {
@@ -825,7 +825,7 @@ DEFUN ("xwgir-xwidget-call-method", Fxwgir_xwidget_call_method, Sxwgir_xwidget_
825 /* char* class = G_OBJECT_TYPE_NAME(widget); //gives "GtkButton"(I want "Button") */ 825 /* char* class = G_OBJECT_TYPE_NAME(widget); //gives "GtkButton"(I want "Button") */
826 /* class += strlen(namespace); //TODO check for corresponding api method. but this seems to work. */ 826 /* class += strlen(namespace); //TODO check for corresponding api method. but this seems to work. */
827 827
828 char* class = SDATA(Fcar(Fcdr(Fget(xw->type, Qcxwgir_class)))); 828 char* class = SDATA(Fcar(Fcdr(Fget(xw->type, QCxwgir_class))));
829 829
830 GIObjectInfo* obj_info = g_irepository_find_by_name(girepository, namespace, class); 830 GIObjectInfo* obj_info = g_irepository_find_by_name(girepository, namespace, class);
831 GIFunctionInfo* f_info = g_object_info_find_method (obj_info, SDATA(method)); 831 GIFunctionInfo* f_info = g_object_info_find_method (obj_info, SDATA(method));
@@ -985,7 +985,7 @@ xwidget_init_view (struct xwidget *xww,
985 //gdk_cairo_create (gtk_widget_get_window (FRAME_GTK_WIDGET (s->f))); 985 //gdk_cairo_create (gtk_widget_get_window (FRAME_GTK_WIDGET (s->f)));
986 } else if (EQ(xww->type, Qwebkit_osr)|| 986 } else if (EQ(xww->type, Qwebkit_osr)||
987 EQ(xww->type, Qsocket_osr)|| 987 EQ(xww->type, Qsocket_osr)||
988 (Fget(xww->type, Qcxwgir_class) != Qnil))//xwgir widgets are OSR 988 (Fget(xww->type, QCxwgir_class) != Qnil))//xwgir widgets are OSR
989 { 989 {
990#ifdef HAVE_WEBKIT_OSR //TODO the ifdef isnt really relevant anymore, we always have osr 990#ifdef HAVE_WEBKIT_OSR //TODO the ifdef isnt really relevant anymore, we always have osr
991 printf("osr init:%s\n",SDATA(SYMBOL_NAME(xww->type))); 991 printf("osr init:%s\n",SDATA(SYMBOL_NAME(xww->type)));
@@ -1071,7 +1071,7 @@ xwidget_init_view (struct xwidget *xww,
1071 //xwgir debug 1071 //xwgir debug
1072 if (//EQ(xww->type, Qwebkit_osr)|| //TODO should be able to choose compile time which method to use with webkit 1072 if (//EQ(xww->type, Qwebkit_osr)|| //TODO should be able to choose compile time which method to use with webkit
1073 EQ(xww->type, Qsocket_osr)|| 1073 EQ(xww->type, Qsocket_osr)||
1074 (Fget(xww->type, Qcxwgir_class) != Qnil))//xwgir widgets are OSR 1074 (Fget(xww->type, QCxwgir_class) != Qnil))//xwgir widgets are OSR
1075 { 1075 {
1076 //xwidget_set_embedder_view(xww,xv); 1076 //xwidget_set_embedder_view(xww,xv);
1077 printf("gdk_offscreen_window_set_embedder %d %d\n", 1077 printf("gdk_offscreen_window_set_embedder %d %d\n",
@@ -1568,11 +1568,11 @@ syms_of_xwidget (void)
1568 defsubr (&Sxwidget_buffer); 1568 defsubr (&Sxwidget_buffer);
1569 defsubr (&Sset_xwidget_plist); 1569 defsubr (&Sset_xwidget_plist);
1570 1570
1571 DEFSYM (Qxwidget ,"xwidget"); 1571 DEFSYM (Qxwidget, "xwidget");
1572 1572
1573 DEFSYM (Qcxwidget ,":xwidget"); 1573 DEFSYM (QCxwidget, ":xwidget");
1574 DEFSYM (Qcxwgir_class ,":xwgir-class"); 1574 DEFSYM (QCxwgir_class, ":xwgir-class");
1575 DEFSYM (Qtitle ,":title"); 1575 DEFSYM (QCtitle, ":title");
1576 1576
1577 /* Do not forget to update the docstring of make-xwidget if you add 1577 /* Do not forget to update the docstring of make-xwidget if you add
1578 new types. */ 1578 new types. */
@@ -1703,12 +1703,12 @@ lookup_xwidget (Lisp_Object spec)
1703 Lisp_Object value; 1703 Lisp_Object value;
1704 struct xwidget *xw; 1704 struct xwidget *xw;
1705 1705
1706 value = xwidget_spec_value (spec, Qcxwidget, &found1); 1706 value = xwidget_spec_value (spec, QCxwidget, &found1);
1707 xw = XXWIDGET(value); 1707 xw = XXWIDGET(value);
1708 1708
1709 /* value = xwidget_spec_value (spec, QCtype, &found); */ 1709 /* value = xwidget_spec_value (spec, QCtype, &found); */
1710 /* xw->type = SYMBOLP (value) ? value : Qbutton; //default to button */ 1710 /* xw->type = SYMBOLP (value) ? value : Qbutton; //default to button */
1711 /* value = xwidget_spec_value (spec, Qtitle, &found2); */ 1711 /* value = xwidget_spec_value (spec, QCtitle, &found2); */
1712 /* xw->title = STRINGP (value) ? (char *) SDATA (value) : "?"; //funky cast FIXME TODO */ 1712 /* xw->title = STRINGP (value) ? (char *) SDATA (value) : "?"; //funky cast FIXME TODO */
1713 1713
1714 /* value = xwidget_spec_value (spec, QCheight, NULL); */ 1714 /* value = xwidget_spec_value (spec, QCheight, NULL); */