コード例 #1
0
ファイル: gtksignal.c プロジェクト: batman52/dingux-code
static inline gboolean
gtk_arg_set_from_value (GtkArg  *arg,
			GValue  *value,
			gboolean copy_string)
{
  switch (G_TYPE_FUNDAMENTAL (arg->type))
    {
    case G_TYPE_CHAR:		GTK_VALUE_CHAR (*arg) = g_value_get_char (value);	break;
    case G_TYPE_UCHAR:		GTK_VALUE_UCHAR (*arg) = g_value_get_uchar (value);	break;
    case G_TYPE_BOOLEAN:	GTK_VALUE_BOOL (*arg) = g_value_get_boolean (value);	break;
    case G_TYPE_INT:		GTK_VALUE_INT (*arg) = g_value_get_int (value);		break;
    case G_TYPE_UINT:		GTK_VALUE_UINT (*arg) = g_value_get_uint (value);	break;
    case G_TYPE_LONG:		GTK_VALUE_LONG (*arg) = g_value_get_long (value);	break;
    case G_TYPE_ULONG:		GTK_VALUE_ULONG (*arg) = g_value_get_ulong (value);	break;
    case G_TYPE_ENUM:		GTK_VALUE_ENUM (*arg) = g_value_get_enum (value);	break;
    case G_TYPE_FLAGS:		GTK_VALUE_FLAGS (*arg) = g_value_get_flags (value);	break;
    case G_TYPE_FLOAT:		GTK_VALUE_FLOAT (*arg) = g_value_get_float (value);	break;
    case G_TYPE_DOUBLE:		GTK_VALUE_DOUBLE (*arg) = g_value_get_double (value);	break;
    case G_TYPE_BOXED:		GTK_VALUE_BOXED (*arg) = g_value_get_boxed (value);	break;
    case G_TYPE_POINTER:	GTK_VALUE_POINTER (*arg) = g_value_get_pointer (value);	break;
    case G_TYPE_OBJECT:		GTK_VALUE_POINTER (*arg) = g_value_get_object (value);	break;
    case G_TYPE_STRING:		if (copy_string)
      GTK_VALUE_STRING (*arg) = g_value_dup_string (value);
    else
      GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value);
    break;
    default:
      return FALSE;
    }
  return TRUE;
}
コード例 #2
0
ファイル: gtkmarshal.c プロジェクト: dimkr/gtk
void
gtk_marshal_NONE__BOOL (GtkObject * object,
			GtkSignalFunc func, gpointer func_data, GtkArg * args)
{
  GtkSignal_NONE__BOOL rfunc;
  rfunc = (GtkSignal_NONE__BOOL) func;
  (*rfunc) (object, GTK_VALUE_BOOL (args[0]), func_data);
}
コード例 #3
0
ファイル: gtkfilebrowser.c プロジェクト: duke1102/psxdev
static void
gtk_file_browser_set_arg (GtkObject *object,
	GtkArg *arg,
	guint arg_id)
{
	GtkFileBrowser *file_browser;

	file_browser = GTK_FILE_BROWSER (object);
  
	switch (arg_id)
	{
		case ARG_USE_ICONS:
			gtk_file_browser_set_use_icons (file_browser, GTK_VALUE_BOOL (*arg));
			break;
		case ARG_PATH:
			gtk_file_browser_set_path (file_browser, GTK_VALUE_STRING (*arg));
			break;
		default:
			break;
	}
}
コード例 #4
0
ファイル: gtkfilebrowser.c プロジェクト: duke1102/psxdev
static void
gtk_file_browser_get_arg (GtkObject *object,
	GtkArg *arg,
	guint arg_id)
{
	GtkFileBrowser *file_browser;

	file_browser = GTK_FILE_BROWSER (object);
  
	switch (arg_id)
	{
		case ARG_USE_ICONS:
			GTK_VALUE_BOOL (*arg) = file_browser->use_icons;
			break;
		case ARG_PATH:
			GTK_VALUE_STRING (*arg) = file_browser->path;
			break;
		default:
			arg->type = GTK_TYPE_INVALID;
			break;
	}
}
コード例 #5
0
/*
** GUI Handler: Called when "custom" mapedit widget should be created
*/
GtkWidget *mapedit_create_new(gchar *widget_name, gchar *string1, 
			      gchar *string2, gint int1, gint int2)
{
    struct MCMap *mapeditmap;
    GtkWidget *mapwidget=NULL;
    GtkArg mapedarg[11], *args = mapedarg;

    errormsg(MAPDEBUG1,"mapedit_create_new: Entered");

    if (int1!=MPEDIT)
    {
	mapeditmap = g_malloc0(sizeof(struct MCMap));
	if (!mapeditmap)
	{
	    printf("Could not allocate memory for mapeditmap\n");
	    CloseAll();
	    exit(20);
	}
    }
#if DEBUGLEV > 2
    errormsg(MAPDEBUG3,"mapedit_create_new: widget_name=%s=%x, int1=%d, "
	     "mapeditmap=%x ",widget_name, widget_name, int1, mapeditmap);
#endif

    mapedarg[0].type = MAPEDIT_MapPieces;
    GTK_VALUE_POINTER(mapedarg[0]) = mMapPieces;
    mapedarg[1].type = MAPEDIT_PWidth;
    GTK_VALUE_UINT(mapedarg[1]) = 37;
    mapedarg[2].type = MAPEDIT_PLength;
    GTK_VALUE_UINT(mapedarg[2]) = 13;
    mapedarg[3].type = MAPEDIT_Default;
    GTK_VALUE_POINTER(mapedarg[3]) = &mDefault;
    mapedarg[4].type = MAPEDIT_MapWidth;
    GTK_VALUE_UINT(mapedarg[4]) = SELXSIZE;
    mapedarg[5].type = MAPEDIT_MapLength;
    GTK_VALUE_UINT(mapedarg[5]) = SELYSIZE;
    mapedarg[6].type = MAPEDIT_MapLayer;
    GTK_VALUE_UCHAR(mapedarg[6]) = 1;
    mapedarg[7].type = MAPEDIT_Map;
    GTK_VALUE_POINTER(mapedarg[7]) = mapeditmap;
    mapedarg[8].type = MAPEDIT_GetPieces;
    GTK_VALUE_BOOL(mapedarg[8]) = TRUE;
    mapedarg[9].type = MAPEDIT_Frame;
    GTK_VALUE_BOOL(mapedarg[9]) = TRUE;
    mapedarg[10].type = MAPEDIT_FrameSpace;
    GTK_VALUE_UCHAR(mapedarg[10]) = 4;

    errormsg(MAPDEBUG3,"mapedit_create_new: args=%x, args[0]=%x, args[1].type=%d",args,args[2].type,MAPEDIT_PWidth);

    switch(int1)
    {
        case MPGR1:
	    InitSelectGroup(mapeditmap,0);
	    TestMEdWindowObjs[WO_MPGRP1]=MapEditClassNew(args, 11);
	    mapwidget=TestMEdWindowObjs[WO_MPGRP1];
	    break;
        case MPGR2:
	    InitSelectGroup(mapeditmap,SELXSIZE*SELYSIZE);
	    TestMEdWindowObjs[WO_MPGRP2]=MapEditClassNew(args, 11);
	    mapwidget=TestMEdWindowObjs[WO_MPGRP2];
	    break;
        case MPGR3:
	    InitSelectGroup(mapeditmap,SELXSIZE*SELYSIZE*2);
	    TestMEdWindowObjs[WO_MPGRP3]=MapEditClassNew(args, 11);
	    mapwidget=TestMEdWindowObjs[WO_MPGRP3];
	    break;
        case MPEDIT:
	    mapedarg[4].type = MAPEDIT_MapWidth;
	    GTK_VALUE_UINT(mapedarg[4]) = 40;
	    mapedarg[5].type = MAPEDIT_MapLength;
	    GTK_VALUE_UINT(mapedarg[5]) = 80;
	    GTK_VALUE_UCHAR(mapedarg[6]) = 2; // 2 Layers!
	    TestMEdWindowObjs[WO_EDIT]=MapEditClassNew(args, 7);
	    mapwidget=TestMEdWindowObjs[WO_EDIT];
	    break;
    }
    errormsg(MAPDEBUG3,"mapedit_create_new: mapwidget=%x",mapwidget);

    errormsg(MAPDEBUG1,"mapedit_create_new: Finished succesfully");
    return mapwidget;
}